Sync UI xml with Forge data repo, rev ba4724f848d80775acdd7e3190f6e3eb8af47834
parent
7cba0c8794
commit
41c8499bd4
@ -0,0 +1,192 @@
|
||||
|
||||
-- global
|
||||
AppZone = {
|
||||
id = "ui:interface:appzone",
|
||||
homeuri = "?action=appzone_toolbar",
|
||||
launchuri = "?action=launch_app",
|
||||
addappuri = "?action=list_user_apps",
|
||||
mode = "h_bar",
|
||||
imagesize = 26
|
||||
}
|
||||
|
||||
-- use client.cfg value when available
|
||||
local uri = getClientCfg("AppZoneUrl")
|
||||
if uri == nil or uri == '' then
|
||||
uri = 'http://app.ryzom.com/'
|
||||
end
|
||||
|
||||
AppZone.homeuri = uri .. AppZone.homeuri
|
||||
AppZone.launchuri = uri .. AppZone.launchuri
|
||||
AppZone.addappuri = uri .. AppZone.addappuri
|
||||
|
||||
function AppZone:getRoot()
|
||||
return getUI(self.id)
|
||||
end
|
||||
|
||||
function AppZone:onButtonHome()
|
||||
local webig = getUI("ui:interface:webig")
|
||||
webig:find("html").url = self.addappuri
|
||||
webig.active = true
|
||||
end
|
||||
|
||||
function AppZone:calculateSize(count, spacer, mode)
|
||||
local w, h
|
||||
if mode == "h_bar" then
|
||||
-- icon=32, space=2+2
|
||||
w = count * self.imagesize + spacer * 15
|
||||
w = w + 55 + 10 + 20
|
||||
h = self.imagesize + 2
|
||||
elseif mode == "h_box" then
|
||||
w = count * self.imagesize
|
||||
w = w + 20
|
||||
h = self.imagesize + 2
|
||||
h = h * spacer
|
||||
h = h + 15
|
||||
elseif mode == "v_bar" then
|
||||
-- icon=32, space=2+2
|
||||
h = count * self.imagesize + spacer * 15
|
||||
h = h + 20 + 20 + 12
|
||||
w = self.imagesize + 2 + 18
|
||||
else
|
||||
h = count * self.imagesize
|
||||
h = h + 20 + 25
|
||||
w = self.imagesize + 2
|
||||
w = w * spacer
|
||||
w = w + 16
|
||||
end
|
||||
|
||||
local ui = getUI("ui:interface")
|
||||
if w > ui.w then
|
||||
w = ui.w
|
||||
end
|
||||
if h > ui.h then
|
||||
h = ui.h
|
||||
end
|
||||
|
||||
return w, h
|
||||
end
|
||||
|
||||
function AppZone:setElementCount(count,spacer,m)
|
||||
self.mode = m
|
||||
|
||||
local root = self:getRoot()
|
||||
local content = root:find("content")
|
||||
local html = root:find("html")
|
||||
|
||||
local button_toggle = root:find("toggle_mode")
|
||||
local button_reload = root:find("browse_reload")
|
||||
local button_home = root:find("browse_home")
|
||||
|
||||
local w, h = self:calculateSize(count, spacer, self.mode)
|
||||
root.h = h
|
||||
root.w = w
|
||||
content.w = w
|
||||
content.h = h
|
||||
|
||||
-- set position of buttons
|
||||
if self.mode == "h_bar" then
|
||||
-- button_toggle.posref = "BL BL"
|
||||
button_toggle.x = 2
|
||||
button_toggle.y = 0
|
||||
-- button_reload.posref = "TL BL"
|
||||
html.x = 15
|
||||
html.y = 0
|
||||
button_reload.x = -25
|
||||
button_reload.y = -25
|
||||
-- button_home.posref = "BR BR"
|
||||
button_home.x = 0
|
||||
button_home.y = -3 + 5
|
||||
elseif self.mode == "h_box" then
|
||||
-- button_toggle.posref = "TL TL"
|
||||
button_toggle.x = 2
|
||||
button_toggle.y = h - 15
|
||||
-- button_reload.posref = "TL BL"
|
||||
html.x = 0
|
||||
html.y = -20
|
||||
button_reload.x = -25
|
||||
button_reload.y = -4 - 20
|
||||
-- button_home.posref = "BR BR"
|
||||
button_home.x = 0
|
||||
button_home.y = -3 + h - 18
|
||||
elseif self.mode == "v_bar" then
|
||||
-- button_toggle.posref = "TL TL"
|
||||
button_toggle.x = 2
|
||||
button_toggle.y = h - 15
|
||||
-- button_reload.posref = "TL BL"
|
||||
html.x = 0
|
||||
html.y = -20
|
||||
button_reload.x = 0
|
||||
button_reload.y = -4
|
||||
-- button_home.posref = "BR BR"
|
||||
button_home.x = 4 - 7
|
||||
button_home.y = -3
|
||||
else
|
||||
-- button_toggle.posref = "TL TL"
|
||||
button_toggle.x = 2
|
||||
button_toggle.y = h - 15
|
||||
-- button_reload.posref = "TL BL"
|
||||
html.x = 0
|
||||
html.y = -20
|
||||
button_reload.x = -25
|
||||
button_reload.y = -4 - 20
|
||||
-- button_home.posref = "BR BR"
|
||||
button_home.x = 0 - w + 54 + 12
|
||||
button_home.y = -3
|
||||
end
|
||||
end
|
||||
|
||||
function AppZone:setMode(m)
|
||||
self.mode = m
|
||||
|
||||
self:reload()
|
||||
end
|
||||
|
||||
function AppZone:setActive(s)
|
||||
self:getRoot().active = s
|
||||
end
|
||||
|
||||
function AppZone:launchApp(appid, appwin, appurl)
|
||||
if not appwin then
|
||||
if string.match(appid, "^[0-9]+$") then
|
||||
appwin = "app" .. tostring(appid)
|
||||
else
|
||||
appwin = "webig"
|
||||
end
|
||||
end
|
||||
|
||||
if not appurl then
|
||||
appurl = self.launchuri .. "&appid=" .. tostring(appid)
|
||||
end
|
||||
|
||||
if WebBrowser then
|
||||
WebBrowser:openWindow(appwin, appurl)
|
||||
else
|
||||
-- fallback if WebBrowser not present
|
||||
local webig = getUI("ui:interface:webig")
|
||||
webig:find("html").url = appurl;
|
||||
webig.active = true
|
||||
end
|
||||
end
|
||||
|
||||
function AppZone:reload()
|
||||
local url = self.homeuri
|
||||
url = url .. "&mode=" .. tostring(self.mode)
|
||||
|
||||
local html = self:getRoot():find("html")
|
||||
html.url = url
|
||||
end
|
||||
|
||||
-- slash command: /appzone <cmd>
|
||||
function AppZone:handle(cmd)
|
||||
if cmd == 'show' then
|
||||
self:setActive(true)
|
||||
elseif cmd == 'hide' then
|
||||
self:setActive(false)
|
||||
elseif cmd == 'reload' then
|
||||
self:reload()
|
||||
elseif cmd == 'list' then
|
||||
self:onButtonHome()
|
||||
else
|
||||
self:launchApp(cmd)
|
||||
end
|
||||
end
|
@ -0,0 +1,260 @@
|
||||
<?xml version="1.0"?>
|
||||
<interface_config>
|
||||
<root id="interface"
|
||||
x="0"
|
||||
y="0"
|
||||
w="800"
|
||||
h="600"
|
||||
active="true" />
|
||||
|
||||
<!-- default: active, h_bar -->
|
||||
<variable entry="UI:VARIABLES:ISACTIVE:APPZONE"
|
||||
type="sint32"
|
||||
value="1" />
|
||||
<variable entry="UI:SAVE:APPZONE:MODE"
|
||||
type="sint32"
|
||||
value="1" />
|
||||
|
||||
<!-- load lua after variable are setup -->
|
||||
<lua file="appzone.lua" />
|
||||
<lua file="webbrowser.lua" />
|
||||
|
||||
<proc id="appzone_proc_active">
|
||||
<action handler="set"
|
||||
params="dblink=UI:VARIABLES:ISACTIVE:APPZONE|value=1" />
|
||||
<action handler="proc"
|
||||
params="appzone_proc_mode" />
|
||||
</proc>
|
||||
|
||||
<proc id="appzone_proc_deactive">
|
||||
<action handler="set"
|
||||
params="dblink=UI:VARIABLES:ISACTIVE:APPZONE|value=0" />
|
||||
</proc>
|
||||
|
||||
<proc id="appzone_proc_mode_set">
|
||||
<action handler="set"
|
||||
params="dblink=UI:SAVE:APPZONE:MODE|value=@0" />
|
||||
<action handler="proc"
|
||||
params="appzone_proc_mode" />
|
||||
</proc>
|
||||
|
||||
<proc id="appzone_proc_mode_inc">
|
||||
<action handler="set"
|
||||
params="dblink=UI:SAVE:APPZONE:MODE|value=add(@UI:SAVE:APPZONE:MODE,1)" />
|
||||
<action handler="proc"
|
||||
params="appzone_proc_mode" />
|
||||
</proc>
|
||||
|
||||
<proc id="appzone_proc_mode">
|
||||
<action handler="set"
|
||||
cond="le(@UI:SAVE:APPZONE:MODE,0)"
|
||||
params="dblink=UI:SAVE:APPZONE:MODE|value=1" />
|
||||
<action handler="set"
|
||||
cond="ge(@UI:SAVE:APPZONE:MODE,5)"
|
||||
params="dblink=UI:SAVE:APPZONE:MODE|value=1" />
|
||||
|
||||
<action handler="lua"
|
||||
cond="eq(@UI:SAVE:APPZONE:MODE,1)"
|
||||
params="AppZone:setMode('h_bar')" />
|
||||
<action handler="lua"
|
||||
cond="eq(@UI:SAVE:APPZONE:MODE,2)"
|
||||
params="AppZone:setMode('h_box')" />
|
||||
<action handler="lua"
|
||||
cond="eq(@UI:SAVE:APPZONE:MODE,3)"
|
||||
params="AppZone:setMode('v_bar')" />
|
||||
<action handler="lua"
|
||||
cond="eq(@UI:SAVE:APPZONE:MODE,4)"
|
||||
params="AppZone:setMode('v_box')" />
|
||||
</proc>
|
||||
|
||||
<group type="menu"
|
||||
id="appzone_menu"
|
||||
extends="base_menu_with_color">
|
||||
<action id="settings"
|
||||
name="uiBrowseHome"
|
||||
handler="lua"
|
||||
params="AppZone:onButtonHome()"
|
||||
icon="building_state2.tga" />
|
||||
<action id="reload"
|
||||
name="uiBrowseRefresh"
|
||||
handler="lua"
|
||||
params="AppZone:reload()"
|
||||
icon="curs_rotate.tga" />
|
||||
<action id="hide"
|
||||
name="uiHide"
|
||||
handler="lua"
|
||||
params="AppZone:setActive(false)"
|
||||
icon="r2_icon_stop_possess.tga" />
|
||||
<separator />
|
||||
</group>
|
||||
|
||||
<group id="appzone"
|
||||
type="container"
|
||||
x="0"
|
||||
y="0"
|
||||
w="200"
|
||||
h="26"
|
||||
posref="MM MM"
|
||||
min_w="26"
|
||||
min_h="26"
|
||||
max_w="1600"
|
||||
max_h="1600"
|
||||
pop_max_w="1600"
|
||||
pop_max_h="1600"
|
||||
title=""
|
||||
global_color="true"
|
||||
global_color_over="true"
|
||||
header_active="false"
|
||||
right_button="false"
|
||||
options="layer0_pad"
|
||||
movable="true"
|
||||
active="true"
|
||||
opened="true"
|
||||
openable="false"
|
||||
resizer="false"
|
||||
on_active="proc"
|
||||
on_active_params="appzone_proc_active"
|
||||
on_deactive="proc"
|
||||
on_deactive_params="appzone_proc_deactive"
|
||||
group_onclick_r="active_menu"
|
||||
group_params_r="menu=ui:interface:appzone_menu">
|
||||
<group id="header_closed"
|
||||
x="0"
|
||||
y="0"
|
||||
w="0"
|
||||
h="0"
|
||||
posref="TL TL" />
|
||||
<group id="header_opened"
|
||||
x="0"
|
||||
y="0"
|
||||
w="0"
|
||||
h="0"
|
||||
wmin="5"
|
||||
sizeref="w"
|
||||
posref="TL TL" />
|
||||
<group id="content"
|
||||
x="0"
|
||||
y="0"
|
||||
w="0"
|
||||
h="26"
|
||||
posref="TL TL">
|
||||
<ctrl type="button"
|
||||
style="text_button_header"
|
||||
button_type="toggle_button"
|
||||
id="toggle_mode"
|
||||
posref="BL BL"
|
||||
x="2"
|
||||
y="0"
|
||||
tx_normal="tb_mode.tga"
|
||||
tx_pushed="tb_mode.tga"
|
||||
tooltip="uiMk_mode"
|
||||
onclick_l="proc"
|
||||
params_l="appzone_proc_mode_inc" />
|
||||
<ctrl type="button"
|
||||
style="text_button_header"
|
||||
button_type="toggle_button"
|
||||
id="browse_home"
|
||||
posref="BR BR"
|
||||
x="0"
|
||||
y="-3"
|
||||
tx_normal="r2_palette_components.tga"
|
||||
tx_pushed="r2_palette_components.tga"
|
||||
tooltip="uittBrowseHome"
|
||||
onclick_l="lua"
|
||||
params_l="AppZone:onButtonHome()" />
|
||||
<ctrl type="button"
|
||||
style="text_button_header"
|
||||
button_type="toggle_button"
|
||||
id="browse_reload"
|
||||
posref="TL BL"
|
||||
posparent="browse_home"
|
||||
x="0"
|
||||
y="-4"
|
||||
tx_normal="r2ed_icon_rotate.tga"
|
||||
tx_pushed="r2ed_icon_rotate.tga"
|
||||
tooltip="uiBrowseRefresh"
|
||||
onclick_l="lua"
|
||||
params_l="AppZone:reload()" />
|
||||
<group id="html"
|
||||
type="webig_html"
|
||||
posref="TL TL"
|
||||
url=""
|
||||
title_prefix=""
|
||||
sizeref="wh"
|
||||
x="15"
|
||||
y="0"
|
||||
w="0"
|
||||
h="0"
|
||||
background_color="0 0 0 0"
|
||||
error_color="255 240 48 255"
|
||||
link_color="240 155 100 255"
|
||||
text_color="210 210 210 255"
|
||||
h1_color="255 255 255 255"
|
||||
h2_color="255 255 255 255"
|
||||
h3_color="255 255 255 255"
|
||||
h4_color="255 255 255 255"
|
||||
h5_color="255 255 255 255"
|
||||
h6_color="255 255 255 255"
|
||||
text_font_size="10"
|
||||
h1_font_size="16"
|
||||
h2_font_size="14"
|
||||
h3_font_size="13"
|
||||
h4_font_size="12"
|
||||
h5_font_size="11"
|
||||
h6_font_size="11"
|
||||
paragraph_begin_space="12"
|
||||
multi_line_space_factor="0.25"
|
||||
td_begin_space="0"
|
||||
li_begin_space="4"
|
||||
ul_begin_space="12"
|
||||
li_indent="-10"
|
||||
ul_indent="30"
|
||||
checkbox_bitmap_normal="patch_off.tga"
|
||||
checkbox_bitmap_pushed="patch_on.tga"
|
||||
checkbox_bitmap_over=""
|
||||
background_bitmap_view=""
|
||||
home=""
|
||||
browse_next_time="false"
|
||||
form_text_area_group="edit_box_widget_multiline">
|
||||
<group id="black"
|
||||
posref="BR BR"
|
||||
sizeref="hw"
|
||||
w="0"
|
||||
h="0"
|
||||
inherit_gc_alpha="true" />
|
||||
<view type="bitmap"
|
||||
id="black2"
|
||||
posparent="black"
|
||||
posref="MM MM"
|
||||
sizeref="wh"
|
||||
w="0"
|
||||
h="0"
|
||||
inherit_gc_alpha="true"
|
||||
scale="true"
|
||||
texture="blank.tga"
|
||||
global_color="false" />
|
||||
<group type="list"
|
||||
id="text_list"
|
||||
fontsize="9"
|
||||
posref="TL TL"
|
||||
posparent="black"
|
||||
x="0"
|
||||
y="0"
|
||||
space="0"
|
||||
sizeref="hw"
|
||||
w="-4"
|
||||
h="0"
|
||||
maxelements="2000" />
|
||||
<ctrl style="skin_scroll"
|
||||
id="scroll_bar" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<tree node="appzone" />
|
||||
|
||||
<command name="appzone"
|
||||
action="lua"
|
||||
params="AppZone:handle('$')" />
|
||||
|
||||
</interface_config>
|
@ -0,0 +1,202 @@
|
||||
--[[
|
||||
|
||||
base64 -- v1.5.1 public domain Lua base64 encoder/decoder
|
||||
no warranty implied; use at your own risk
|
||||
|
||||
Needs bit32.extract function. If not present it's implemented using BitOp
|
||||
or Lua 5.3 native bit operators. For Lua 5.1 fallbacks to pure Lua
|
||||
implementation inspired by Rici Lake's post:
|
||||
http://ricilake.blogspot.co.uk/2007/10/iterating-bits-in-lua.html
|
||||
|
||||
author: Ilya Kolbin (iskolbin@gmail.com)
|
||||
url: github.com/iskolbin/lbase64
|
||||
|
||||
COMPATIBILITY
|
||||
|
||||
Lua 5.1, 5.2, 5.3, LuaJIT
|
||||
|
||||
LICENSE
|
||||
|
||||
See end of file for license information.
|
||||
|
||||
--]]
|
||||
|
||||
|
||||
base64 = {}
|
||||
|
||||
local extract = _G.bit32 and _G.bit32.extract
|
||||
if not extract then
|
||||
if _G.bit then
|
||||
local shl, shr, band = _G.bit.lshift, _G.bit.rshift, _G.bit.band
|
||||
extract = function( v, from, width )
|
||||
return band( shr( v, from ), shl( 1, width ) - 1 )
|
||||
end
|
||||
elseif _G._VERSION >= "Lua 5.3" then
|
||||
extract = load[[return function( v, from, width )
|
||||
return ( v >> from ) & ((1 << width) - 1)
|
||||
end]]()
|
||||
else
|
||||
extract = function( v, from, width )
|
||||
local w = 0
|
||||
local flag = 2^from
|
||||
for i = 0, width-1 do
|
||||
local flag2 = flag + flag
|
||||
if v % flag2 >= flag then
|
||||
w = w + 2^i
|
||||
end
|
||||
flag = flag2
|
||||
end
|
||||
return w
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function base64.makeencoder( s62, s63, spad )
|
||||
local encoder = {}
|
||||
for b64code, char in pairs{[0]='A','B','C','D','E','F','G','H','I','J',
|
||||
'K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y',
|
||||
'Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n',
|
||||
'o','p','q','r','s','t','u','v','w','x','y','z','0','1','2',
|
||||
'3','4','5','6','7','8','9',s62 or '+',s63 or'/',spad or'='} do
|
||||
encoder[b64code] = char:byte()
|
||||
end
|
||||
return encoder
|
||||
end
|
||||
|
||||
function base64.makedecoder( s62, s63, spad )
|
||||
local decoder = {}
|
||||
for b64code, charcode in pairs( base64.makeencoder( s62, s63, spad )) do
|
||||
decoder[charcode] = b64code
|
||||
end
|
||||
return decoder
|
||||
end
|
||||
|
||||
local DEFAULT_ENCODER = base64.makeencoder()
|
||||
local DEFAULT_DECODER = base64.makedecoder()
|
||||
|
||||
local char, concat = string.char, table.concat
|
||||
|
||||
function base64.encode( str, encoder, usecaching )
|
||||
encoder = encoder or DEFAULT_ENCODER
|
||||
local t, k, n = {}, 1, #str
|
||||
local lastn = n % 3
|
||||
local cache = {}
|
||||
for i = 1, n-lastn, 3 do
|
||||
local a, b, c = str:byte( i, i+2 )
|
||||
local v = a*0x10000 + b*0x100 + c
|
||||
local s
|
||||
if usecaching then
|
||||
s = cache[v]
|
||||
if not s then
|
||||
s = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[extract(v,0,6)])
|
||||
cache[v] = s
|
||||
end
|
||||
else
|
||||
s = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[extract(v,0,6)])
|
||||
end
|
||||
t[k] = s
|
||||
k = k + 1
|
||||
end
|
||||
if lastn == 2 then
|
||||
local a, b = str:byte( n-1, n )
|
||||
local v = a*0x10000 + b*0x100
|
||||
t[k] = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[extract(v,6,6)], encoder[64])
|
||||
elseif lastn == 1 then
|
||||
local v = str:byte( n )*0x10000
|
||||
t[k] = char(encoder[extract(v,18,6)], encoder[extract(v,12,6)], encoder[64], encoder[64])
|
||||
end
|
||||
return concat( t )
|
||||
end
|
||||
|
||||
function base64.decode( b64, decoder, usecaching )
|
||||
decoder = decoder or DEFAULT_DECODER
|
||||
local pattern = '[^%w%+%/%=]'
|
||||
if decoder then
|
||||
local s62, s63
|
||||
for charcode, b64code in pairs( decoder ) do
|
||||
if b64code == 62 then s62 = charcode
|
||||
elseif b64code == 63 then s63 = charcode
|
||||
end
|
||||
end
|
||||
pattern = ('[^%%w%%%s%%%s%%=]'):format( char(s62), char(s63) )
|
||||
end
|
||||
b64 = b64:gsub( pattern, '' )
|
||||
local cache = usecaching and {}
|
||||
local t, k = {}, 1
|
||||
local n = #b64
|
||||
local padding = b64:sub(-2) == '==' and 2 or b64:sub(-1) == '=' and 1 or 0
|
||||
for i = 1, padding > 0 and n-4 or n, 4 do
|
||||
local a, b, c, d = b64:byte( i, i+3 )
|
||||
local s
|
||||
if usecaching then
|
||||
local v0 = a*0x1000000 + b*0x10000 + c*0x100 + d
|
||||
s = cache[v0]
|
||||
if not s then
|
||||
local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 + decoder[d]
|
||||
s = char( extract(v,16,8), extract(v,8,8), extract(v,0,8))
|
||||
cache[v0] = s
|
||||
end
|
||||
else
|
||||
local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 + decoder[d]
|
||||
s = char( extract(v,16,8), extract(v,8,8), extract(v,0,8))
|
||||
end
|
||||
t[k] = s
|
||||
k = k + 1
|
||||
end
|
||||
if padding == 1 then
|
||||
local a, b, c = b64:byte( n-3, n-1 )
|
||||
local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40
|
||||
t[k] = char( extract(v,16,8), extract(v,8,8))
|
||||
elseif padding == 2 then
|
||||
local a, b = b64:byte( n-3, n-2 )
|
||||
local v = decoder[a]*0x40000 + decoder[b]*0x1000
|
||||
t[k] = char( extract(v,16,8))
|
||||
end
|
||||
return concat( t )
|
||||
end
|
||||
|
||||
return base64
|
||||
|
||||
--[[
|
||||
------------------------------------------------------------------------------
|
||||
This software is available under 2 licenses -- choose whichever you prefer.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE A - MIT License
|
||||
Copyright (c) 2018 Ilya Kolbin
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
ALTERNATIVE B - Public Domain (www.unlicense.org)
|
||||
This is free and unencumbered software released into the public domain.
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
|
||||
software, either in source code form or as a compiled binary, for any purpose,
|
||||
commercial or non-commercial, and by any means.
|
||||
In jurisdictions that recognize copyright laws, the author or authors of this
|
||||
software dedicate any and all copyright interest in the software to the public
|
||||
domain. We make this dedication for the benefit of the public at large and to
|
||||
the detriment of our heirs and successors. We intend this dedication to be an
|
||||
overt act of relinquishment in perpetuity of all present and future rights to
|
||||
this software under copyright law.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
------------------------------------------------------------------------------
|
||||
--]]
|
||||
|
@ -0,0 +1,50 @@
|
||||
-- In this file we define functions that serves for compass window
|
||||
|
||||
if (game==nil) then
|
||||
game= {};
|
||||
end
|
||||
|
||||
|
||||
function game:areInSilan()
|
||||
polygons = {{8128,-10208}, {11368,-10208}, {11392,-12392}, {8096,-12368}}
|
||||
local x,y = getPlayerPos()
|
||||
for i = 1, 4 do
|
||||
local z = point_inside_poly(x, y, polygons)
|
||||
if z == true then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function game:updateCompass()
|
||||
if game.InGameDbInitialized == false then
|
||||
return
|
||||
end
|
||||
|
||||
local calendar_win = getUI("ui:interface:compass:calendar")
|
||||
local format_date = "%d %m %Y %H:%M"
|
||||
format_date = findReplaceAll(format_date, "%m", i18n.get("uiMonth"..getTimestampHuman("%m")):toUtf8())
|
||||
calendar_win.tooltip = getTimestampHuman(format_date)
|
||||
end
|
||||
|
||||
|
||||
function game:displayDynE()
|
||||
local win = getUI("ui:interface:app2453")
|
||||
if win ~= nil and win.active == true then
|
||||
win.active = false
|
||||
else
|
||||
AppZone:launchApp(2453)
|
||||
end
|
||||
end
|
||||
|
||||
function game:displayCalendar()
|
||||
local win = getUI("ui:interface:webig")
|
||||
if win ~= nil and win.active == true then
|
||||
win.active = false
|
||||
else
|
||||
win.active = true
|
||||
end
|
||||
end
|
||||
|
||||
setOnDraw(getUI("ui:interface:compass"), "game:updateCompass()")
|
@ -0,0 +1,128 @@
|
||||
-- misc
|
||||
--
|
||||
if misc == nil then
|
||||
misc = {}
|
||||
end
|
||||
|
||||
-- convert CRGBA to hexadecimal 6-digits
|
||||
function misc:toHexRGBA(rgba)
|
||||
return string.format("%.2x%.2x%.2x%.2x", rgba.R, rgba.G, rgba.B, rgba.A)
|
||||
end
|
||||
|
||||
-- convert hexadecimal to its short-hand version
|
||||
function misc:toHexShort(hex)
|
||||
local s = ''
|
||||
for i = 1, #str, 2 do s = s..string.sub(hex:lower(), i, i) end
|
||||
return s
|
||||
end
|
||||
|
||||
-- ready to use colored chat string
|
||||
function misc:encodeColorTag(hex, str)
|
||||
return "@{"..self:toHexShort(hex).."}"..str
|
||||
end
|
||||
|
||||
--
|
||||
-- inventories observer
|
||||
function misc:initInvObserver(
|
||||
inventory,
|
||||
func_add,
|
||||
func_del,
|
||||
func_change,
|
||||
item_filter
|
||||
)
|
||||
if self.invObserver == nil then
|
||||
self.invObserver = {
|
||||
maxSlots = 499, obs = {}
|
||||
}
|
||||
function self.invObserver:__remove(n)
|
||||
if #self.obs > 0 then
|
||||
self.obs[n] = nil
|
||||
end
|
||||
end
|
||||
function self.invObserver:__update(n)
|
||||
self.obs[n].cache = nil
|
||||
self:__observ(n)
|
||||
end
|
||||
function self.invObserver:__observ(n)
|
||||
local t = {}
|
||||
local n = n or 1
|
||||
if #self.obs <= 0 then
|
||||
return
|
||||
end
|
||||
for i = 0, self.maxSlots do
|
||||
local sheet = getDbProp(self.obs[n].inv..":"..i..":SHEET")
|
||||
if sheet > 0 then
|
||||
t[sheet] = getDbProp(self.obs[n].inv..":"..i..":QUANTITY")
|
||||
if self.obs[n].filter then
|
||||
local name = getSheetName(sheet)
|
||||
if not name:match(self.obs[n].filter) then
|
||||
t[sheet] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if not self.obs[n].cache then
|
||||
self.obs[n].cache = t
|
||||
t = {}
|
||||
return
|
||||
end
|
||||
local lenT = function(t)
|
||||
local i = 0
|
||||
for _ in pairs(t) do i = i + 1 end return i
|
||||
end
|
||||
local t_len, b_len = lenT(t), lenT(self.obs[n].cache)
|
||||
if t_len ~= b_len then
|
||||
if t_len > b_len then
|
||||
self.obs[n].onAdd(n)
|
||||
else
|
||||
self.obs[n].onDel(n)
|
||||
end
|
||||
self:__update(n)
|
||||
return
|
||||
end
|
||||
for k, v in pairs(self.obs[n].cache) do
|
||||
local found = false
|
||||
for k1, v1 in pairs(t) do
|
||||
if k == k1 then found = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if found then
|
||||
for k1, v1 in pairs(t) do
|
||||
if k == k1 then
|
||||
if v == v1 then break end
|
||||
self.obs[n].onChange(n)
|
||||
self:__update(n)
|
||||
end
|
||||
end
|
||||
else
|
||||
self:__update(n)
|
||||
end
|
||||
end
|
||||
end
|
||||
function self.invObserver:add(uiWindow, n)
|
||||
if uiWindow then
|
||||
setOnDraw(uiWindow, formatUI("misc.invObserver:__observ(#1)", n))
|
||||
end
|
||||
end
|
||||
function self.invObserver:remove(uiWindow, n)
|
||||
if uiWindow then
|
||||
setOnDraw(uiWindow, "")
|
||||
self:__remove(n)
|
||||
end
|
||||
end
|
||||
self.invObserver.__index = self.invObserver
|
||||
end
|
||||
if inventory then
|
||||
self.invObserver.obs[#self.invObserver.obs+1] =
|
||||
{
|
||||
inv = inventory,
|
||||
onAdd = func_add,
|
||||
onDel = func_del,
|
||||
onChange = func_change,
|
||||
filter = item_filter,
|
||||
cache = nil
|
||||
}
|
||||
end
|
||||
return setmetatable(misc, self.invObserver)
|
||||
end
|
@ -0,0 +1,242 @@
|
||||
RyzhomeBar = {
|
||||
id = "ui:interface:webig_ryzhome_toolbar",
|
||||
saveuri = "http://app.ryzom.com/app_ryzhome/index.php?action=toolbar_save",
|
||||
selectedPage = 1
|
||||
}
|
||||
|
||||
function RyzhomeBar:close()
|
||||
getUI("ui:interface:webig_ryzhome_toolbar").active=false
|
||||
self:saveConfig()
|
||||
|
||||
end
|
||||
|
||||
function RyzhomeBar:addItems()
|
||||
local url = "http://app.ryzom.com/app_arcc/index.php?action=player_ryzhome_LuaListItems&command=add"
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:moveItems()
|
||||
local url = "http://app.ryzom.com/app_arcc/index.php?action=player_ryzhome_LuaListItems&command=move"
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:removeItems()
|
||||
local url = "http://app.ryzom.com/app_arcc/index.php?action=player_ryzhome_LuaListItems&command=remove"
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:inviteFriend()
|
||||
local url = "http://app.ryzom.com/app_arcc/index.php?action=player_ryzhome_InviteFriend"
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:listFriends()
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(RyzhomeBar.listFriendsUrl)
|
||||
getUI("ui:interface:web_transactions:header_opened:browse_undo").active=false
|
||||
getUI("ui:interface:web_transactions:header_opened:browse_redo").active=false
|
||||
getUI("ui:interface:web_transactions:header_opened:browse_refresh").active=false
|
||||
getUI("ui:interface:web_transactions:header_opened:browse_home").active=false
|
||||
local wt = getUI("ui:interface:web_transactions")
|
||||
wt.w=316
|
||||
wt.h=420
|
||||
wt.pop_min_w=316
|
||||
wt.pop_max_w=316
|
||||
wt.pop_min_h=420
|
||||
wt.pop_max_h=420
|
||||
|
||||
local framewin = getUI("ui:interface:webig_ryzhome_list_item")
|
||||
if framewin ~= nil then
|
||||
framewin.active=false
|
||||
wt.x = framewin.x
|
||||
wt.y = framewin.y
|
||||
end
|
||||
|
||||
getUI("ui:interface:web_transactions").active=true
|
||||
|
||||
setOnDraw(getUI("ui:interface:web_transactions"), "RyzhomeBar:autocloseWebTransactions()")
|
||||
end
|
||||
|
||||
function RyzhomeBar:autocloseWebTransactions()
|
||||
local current_url = getUI("ui:interface:web_transactions:content:html").url
|
||||
if (current_url ~= RyzhomeBar.listFriendsUrl and current_url ~= inviteFriendsUrl) then
|
||||
local framewin = getUI("ui:interface:webig_ryzhome_list_item")
|
||||
framewin.x = getUI("ui:interface:web_transactions").x
|
||||
framewin.y = getUI("ui:interface:web_transactions").y
|
||||
getUI("ui:interface:web_transactions").active=false
|
||||
setOnDraw(getUI("ui:interface:web_transactions"), "")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function RyzhomeBar:serialize()
|
||||
local ui = getUI(self.id)
|
||||
local url = "&posx=" .. tostring(ui.x) .. "&posy=" .. tostring(ui.y)
|
||||
return url
|
||||
end
|
||||
|
||||
function RyzhomeBar:updateNbrItems(offset)
|
||||
RyzhomeBar.nbrItems = RyzhomeBar.nbrItems + offset
|
||||
if RyzhomeBar.nbrItems == 0 then
|
||||
getUI("ui:interface:webig_ryzhome_toolbar:content:new_items_quantity").hardtext=""
|
||||
else
|
||||
getUI("ui:interface:webig_ryzhome_toolbar:content:new_items_quantity").hardtext=tostring(RyzhomeBar.nbrItems)
|
||||
end
|
||||
end
|
||||
|
||||
function RyzhomeBar:saveConfig()
|
||||
local url = self.saveuri .. self:serialize()
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:movePage(offset)
|
||||
RyzhomeBar.selectedPage = RyzhomeBar.selectedPage + offset
|
||||
if RyzhomeBar.selectedPage <= 0 then
|
||||
RyzhomeBar.selectedPage = 1
|
||||
elseif RyzhomeBar.selectedPage > RyzhomeBar.nbrPages then
|
||||
RyzhomeBar.selectedPage = RyzhomeBar.nbrPages
|
||||
end
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened:page").hardtext=tostring(RyzhomeBar.selectedPage).." / "..tostring(RyzhomeBar.nbrPages)
|
||||
RyzhomeBar:setupItems()
|
||||
end
|
||||
|
||||
function RyzhomeBar:listItems()
|
||||
RyzhomeBar.recently_removed_item = false
|
||||
|
||||
local framewin = getUI("ui:interface:webig_ryzhome_list_item")
|
||||
--framewin.opened=true
|
||||
framewin.active=true
|
||||
if framewin.x == 0 and framewin.y == 0 then
|
||||
local ui = getUI("ui:interface")
|
||||
framewin.x = (ui.w - framewin.w) / 2
|
||||
framewin.y = (ui.h + framewin.h) / 2
|
||||
end
|
||||
|
||||
if RyzhomeBar.Items == nil then
|
||||
RyzhomeBar.Items = {}
|
||||
end
|
||||
end
|
||||
|
||||
function RyzhomeBar:useItem(id)
|
||||
id = tostring(RyzhomeBar.Items[RyzhomeBar.selectedPage][id][1])
|
||||
if RyzhomeBar.itemCommand == "add" then
|
||||
RyzhomeBar:addItem(id)
|
||||
elseif RyzhomeBar.itemCommand == "remove" then
|
||||
RyzhomeBar:removeItem(id)
|
||||
elseif RyzhomeBar.itemCommand == "move" then
|
||||
RyzhomeBar:moveItem(id)
|
||||
end
|
||||
end
|
||||
|
||||
function RyzhomeBar:addItem(id)
|
||||
local url = "http://app.ryzom.com/app_arcc/index.php?action=player_ryzhome_Place&command=add&id="..id
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:removeItem(id)
|
||||
RyzhomeBar.recently_removed_item = true
|
||||
RyzhomeBar:spawnItems()
|
||||
local v = RyzhomeBar.spawnedItems[id]
|
||||
runAH(nil,"add_shape", "shape=sp_mort.ps|x="..v[2].."|y="..v[3].."|z="..v[4].."|angle="..v[5].."|scale="..tostring(tonumber(v[6])*4)..v[7]..v[8]..v[9])
|
||||
local url = "http://app.ryzom.com/app_arcc/index.php?action=player_ryzhome_Remove&id="..id
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:moveItem(id)
|
||||
local url = "http://app.ryzom.com/app_arcc/index.php?action=player_ryzhome_Place&command=move&id="..id
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:highlightItem(id)
|
||||
if RyzhomeBar.itemCommand == "add" then
|
||||
return
|
||||
end
|
||||
if RyzhomeBar.recently_removed_item then
|
||||
RyzhomeBar.recently_removed_item = false
|
||||
else
|
||||
RyzhomeBar:spawnItems()
|
||||
local v = RyzhomeBar.spawnedItems[tostring(RyzhomeBar.Items[RyzhomeBar.selectedPage][id][1])]
|
||||
if v then
|
||||
runAH(nil, "add_shape", "shape=ma_acc_ascenseur.ps|x="..v[2].."|y="..v[3].."|z="..v[4].."|angle="..v[5].."|scale="..tostring(tonumber(v[6])*2)..v[7]..v[8]..v[9])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function RyzhomeBar:callFriendUrl(action, target)
|
||||
local url = "http://app.ryzom.com/app_arcc/index.php?action=player_ryzhome_"..action.."&target="..target
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(url)
|
||||
end
|
||||
|
||||
function RyzhomeBar:spawnItems()
|
||||
runAH(nil, "remove_shapes", "")
|
||||
for k,v in pairs(RyzhomeBar.spawnedItems) do
|
||||
runAH(nil, "add_shape", "shape="..v[1].."|x="..v[2].."|y="..v[3].."|z="..v[4].."|angle="..v[5].."|scale="..v[6]..v[7]..v[8]..v[9])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function RyzhomeBar:setupItems()
|
||||
for k = 1, 8 do
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened"):find(":but"..tostring(k)).active=false
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened"):find(":icon"..tostring(k)).active=false
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened"):find(":text"..tostring(k)).uc_hardtext=""
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened"):find(":info"..tostring(k)).uc_hardtext=""
|
||||
end
|
||||
for k,v in pairs(RyzhomeBar.Items[RyzhomeBar.selectedPage]) do
|
||||
if k ~= nil then
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened"):find(":icon"..tostring(k)).active=true
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened"):find(":but"..tostring(k)).active=true
|
||||
local text = ucstring()
|
||||
text:fromUtf8(v[3])
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened"):find(":text"..tostring(k)).uc_hardtext=text
|
||||
text:fromUtf8(v[4])
|
||||
getUI("ui:interface:webig_ryzhome_list_item:header_opened"):find(":info"..tostring(k)).uc_hardtext=text
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if RyzhomePlace == nil then
|
||||
RyzhomePlace = {
|
||||
saveuri = "",
|
||||
}
|
||||
end
|
||||
|
||||
function RyzhomePlace:move(x, y, z)
|
||||
pos_x=pos_x+x
|
||||
pos_y=pos_y+y
|
||||
pos_z=pos_z+z
|
||||
RyzhomePlace:update()
|
||||
end
|
||||
|
||||
function RyzhomePlace:rot(a)
|
||||
pos_a=pos_a+a
|
||||
RyzhomePlace:update()
|
||||
end
|
||||
|
||||
function RyzhomePlace:reset()
|
||||
--Ryzhome:addShapes()
|
||||
pos_x, pos_y, pos_z = getPlayerPos()
|
||||
pos_a = (3.14*getUI("ui:interface:compass:arrow3d:arrow").rotz)/18
|
||||
RyzhomePlace:addShape()
|
||||
RyzhomeBar:spawnItems()
|
||||
end
|
||||
|
||||
function RyzhomePlace:update()
|
||||
RyzhomePlace:addShapes()
|
||||
RyzhomePlace:addShape()
|
||||
RyzhomeBar:spawnItems()
|
||||
end
|
||||
|
||||
function RyzhomePlace:apply()
|
||||
getUI("ui:interface:web_transactions:content:html"):browse(RyzhomePlace.saveuri.."&pos_x="..pos_x.."&pos_y="..pos_y.."&pos_z="..pos_z.."&pos_a="..pos_a)
|
||||
end
|
||||
|
||||
function RyzhomePlace:close()
|
||||
--runAH(nil, "remove_shapes", "")
|
||||
getUI("ui:interface:webig_ryzhome_place_item").active=false
|
||||
end
|
||||
|
||||
function debug(text)
|
||||
local uc = ucstring()
|
||||
uc:fromUtf8(tostring(text))
|
||||
displaySystemInfo(ucstring(uc), "sys")
|
||||
end
|
@ -0,0 +1,445 @@
|
||||
<interface_config>
|
||||
<root id="interface" x="0" y="0" w="800" h="600" active="true" />
|
||||
|
||||
<lua file="ryzhome_toolbar.lua" />
|
||||
|
||||
<style style="button_over"
|
||||
type="button"
|
||||
id="button_over"
|
||||
button_type="push_button"
|
||||
posref="TR TR"
|
||||
x="0"
|
||||
y="0"
|
||||
h="39"
|
||||
w="44"
|
||||
scale="true"
|
||||
tx_over="W_button_32_over.tga"
|
||||
global_color_normal="false"
|
||||
global_color_pushed="false" />
|
||||
|
||||
<group type="container"
|
||||
id="webig_ryzhome_toolbar"
|
||||
x="0" y="0" w="200" h="56" posref="MM MM"
|
||||
max_w="1600" pop_max_w="1600"
|
||||
max_h="1600" pop_max_h="1600"
|
||||
min_w="26" pop_min_w="26"
|
||||
min_h="26" pop_min_h="26"
|
||||
title=""
|
||||
global_color="true"
|
||||
global_color_over="true"
|
||||
header_active="false"
|
||||
right_button="false"
|
||||
options="layer0_pad"
|
||||
movable="true"
|
||||
active="true"
|
||||
opened="true"
|
||||
openable="false"
|
||||
resizer="false">
|
||||
|
||||
<group id="header_closed" x="0" y="0" w="0" h="0" posref="TL TL"></group>
|
||||
<group id="header_opened" x="0" y="0" w="0" h="0" wmin="5" sizeref="w" posref="TL TL"></group>
|
||||
|
||||
<group id="content" x="0#" y="0#" w="200" h="56" posref="TL TL">
|
||||
|
||||
<view id="action_title"
|
||||
type="text"
|
||||
posref="TL TL"
|
||||
x="2"
|
||||
y="-2"
|
||||
color="255 255 255 255"
|
||||
fontsize="12"
|
||||
shadow="true"
|
||||
global_color="false"
|
||||
hardtext="Ryzhome" />
|
||||
|
||||
<ctrl id="close"
|
||||
type="button"
|
||||
style="button_close"
|
||||
button_type="push_button"
|
||||
posref="TR TR"
|
||||
x="1"
|
||||
y="1"
|
||||
tx_normal="w_win_close.tga"
|
||||
tx_pushed="w_win_close.tga"
|
||||
tooltip="uiNoteClose"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomeBar:close()"/>
|
||||
|
||||
<ctrl id="config"
|
||||
type="button"
|
||||
style="button_close"
|
||||
button_type="push_button"
|
||||
posref="TL TR"
|
||||
posparent="close"
|
||||
x="-2"
|
||||
y="-1"
|
||||
tx_normal="r2ed_permanent_pins.tga"
|
||||
tx_pushed="r2ed_permanent_pins.tga"
|
||||
tooltip="uiCreateUserLM"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomeBar:saveConfig()"/>
|
||||
|
||||
<ctrl id="add"
|
||||
type="button"
|
||||
style="button_over"
|
||||
button_type="toggle_button"
|
||||
posref="BL BL"
|
||||
x="3"
|
||||
y="0"
|
||||
tx_normal="ryzhome_add_item.png"
|
||||
tx_pushed="ryzhome_add_item.png"
|
||||
tx_over="W_button_32_over.tga"
|
||||
tooltip="uiPeopleAdd"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomeBar:addItems()"/>
|
||||
|
||||
<view id="new_items_quantity"
|
||||
type="text"
|
||||
posref="BL BL"
|
||||
posparent="add"
|
||||
x="-1"
|
||||
y="-1"
|
||||
color="255 200 0 255"
|
||||
global_color="false"
|
||||
fontsize="16"
|
||||
shadow="true"
|
||||
hardtext="" />
|
||||
|
||||
<ctrl id="move"
|
||||
type="button"
|
||||
style="button_over"
|
||||
button_type="toggle_button"
|
||||
posref="BR BL"
|
||||
posparent="add"
|
||||
x="3"
|
||||
y="0"
|
||||
tx_normal="ryzhome_move_item.png"
|
||||
tx_pushed="ryzhome_move_item.png"
|
||||
tx_over="W_button_32_over.tga"
|
||||
tooltip="uimMoveTo"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomeBar:moveItems()"/>
|
||||
|
||||
<ctrl id="remove"
|
||||
type="button"
|
||||
style="button_over"
|
||||
posref="BR BL"
|
||||
posparent="move"
|
||||
x="3"
|
||||
tx_normal="ryzhome_remove_item.png"
|
||||
tx_pushed="ryzhome_remove_item.png"
|
||||
tx_over="W_button_32_over.tga"
|
||||
tooltip="uimRemove"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomeBar:removeItems()"/>
|
||||
|
||||
<ctrl id="invite"
|
||||
type="button"
|
||||
style="button_over"
|
||||
posref="BR BL"
|
||||
posparent="remove"
|
||||
x="3"
|
||||
tx_normal="ryzhome_invite.png"
|
||||
tx_pushed="ryzhome_invite.png"
|
||||
tx_over="W_button_32_over.tga"
|
||||
tooltip="uiRAP_Invite"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomeBar:inviteFriend()"/>
|
||||
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<tree node="webig_ryzhome_toolbar"></tree>
|
||||
|
||||
|
||||
<style style="button_over"
|
||||
id="over"
|
||||
posref="TL TL"
|
||||
render_layer="-1"
|
||||
y="1" w="600" h="44" scale="true"
|
||||
button_type="push_button"
|
||||
tx_normal="blank.tga"
|
||||
tx_pushed="blank.tga"
|
||||
tx_over="blank.tga"
|
||||
color="255 255 255 0"
|
||||
col_over="255 255 255 64"
|
||||
col_pushed="255 255 255 128"
|
||||
global_color_over="false" />
|
||||
|
||||
<group id="webig_ryzhome_list_item"
|
||||
style="bot_chat_window"
|
||||
posref="MM MM"
|
||||
min_w="316"
|
||||
max_w="316"
|
||||
max_h="420"
|
||||
min_h="420"
|
||||
w="316"
|
||||
h="420"
|
||||
x="0"
|
||||
y="0"
|
||||
pop_max_h="700"
|
||||
active="false"
|
||||
title=""
|
||||
modal_parent="gestionsets">
|
||||
|
||||
<group id="header_opened"
|
||||
child_resize_hmargin="24"
|
||||
w="600"
|
||||
h="420"
|
||||
x="0"
|
||||
y="0"
|
||||
posref="TL TL">
|
||||
|
||||
<view id="action_title"
|
||||
type="text"
|
||||
posref="TL TL"
|
||||
x="2"
|
||||
y="-25"
|
||||
color="255 255 255 255"
|
||||
fontsize="12"
|
||||
shadow="true"
|
||||
hardtext="uiSelectMission" />
|
||||
|
||||
<ctrl id="page_next"
|
||||
type="button"
|
||||
posref="TR TR"
|
||||
x="-2"
|
||||
y="-20"
|
||||
tx_normal="W_arrow_right_0.tga"
|
||||
tx_pushed="W_arrow_right_0.tga"
|
||||
tooltip="uiKeyNEXT"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomeBar:movePage(1)" />
|
||||
|
||||
<view id="page"
|
||||
type="text"
|
||||
posref="TL TR"
|
||||
posparent="page_next"
|
||||
x="-2"
|
||||
y="0"
|
||||
color="255 255 255 255"
|
||||
fontsize="12"
|
||||
shadow="true"
|
||||
hardtext="1/1" />
|
||||
|
||||
<ctrl id="page_previous"
|
||||
type="button"
|
||||
posref="TL TR"
|
||||
posparent="page"
|
||||
x="-2"
|
||||
y="0"
|
||||
tx_normal="w_arrow_left_0.tga"
|
||||
tx_pushed="w_arrow_left_0.tga"
|
||||
tooltip="uiKeyPRIOR"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomeBar:movePage(-1)" />
|
||||
|
||||
<group id="scroll_text"
|
||||
sizeref="w"
|
||||
posref="TL TL"
|
||||
w="0"
|
||||
y="-40"
|
||||
child_resize_h="false"
|
||||
child_resize_hmargin="8">
|
||||
|
||||
<instance template="inner_thin_border_group" />
|
||||
|
||||
<group id="text_list"
|
||||
posref="TL TL"
|
||||
x="12"
|
||||
y="-4"
|
||||
sizeref="w"
|
||||
max_h="380"
|
||||
child_resize_h="true" >
|
||||
|
||||
<view type="bitmap" id="icon1" posref="TL TL" texture="r2ed_toolbar_freeze.tga" global_color="false" />
|
||||
<view type="text" id="text1" posref="TR TL" posparent="icon1" fontsize="10" x="5" y="-5" hardtext="" />
|
||||
<view type="text" id="info1" posref="BL TL" color="55 205 55 205" posparent="text1" fontsize="10" x="10" y="-5" hardtext="" />
|
||||
<ctrl type="button" id="but1" posparent="icon1" style="button_over" onover="lua" params_over="RyzhomeBar:highlightItem(1)" onclick_l="lua" params_l="RyzhomeBar:useItem(1)" />
|
||||
|
||||
<view type="bitmap" id="icon2" posparent="but1" posref="BL TL" y="-4" texture="r2ed_toolbar_freeze.tga" global_color="false" />
|
||||
<view type="text" id="text2" posref="TR TL" posparent="icon2" fontsize="10" x="5" y="-5" hardtext="" />
|
||||
<view type="text" id="info2" posref="BL TL" color="55 205 55 205" posparent="text2" fontsize="10" x="10" y="-5" hardtext="" />
|
||||
<ctrl type="button" id="but2" posparent="icon2" style="button_over" onover="lua" params_over="RyzhomeBar:highlightItem(2)" onclick_l="lua" params_l="RyzhomeBar:useItem(2)" />
|
||||
|
||||
<view type="bitmap" id="icon3" posparent="but2" posref="BL TL" y="-4" texture="r2ed_toolbar_freeze.tga" global_color="false" />
|
||||
<view type="text" id="text3" posref="TR TL" posparent="icon3" fontsize="10" x="5" y="-5" hardtext="" />
|
||||
<view type="text" id="info3" posref="BL TL" color="55 205 55 205" posparent="text3" fontsize="10" x="10" y="-5" hardtext="" />
|
||||
<ctrl type="button" id="but3" posparent="icon3" style="button_over" onover="lua" params_over="RyzhomeBar:highlightItem(3)" onclick_l="lua" params_l="RyzhomeBar:useItem(3)" />
|
||||
|
||||
<view type="bitmap" id="icon4" posparent="but3" posref="BL TL" y="-4" texture="r2ed_toolbar_freeze.tga" global_color="false" />
|
||||
<view type="text" id="text4" posref="TR TL" posparent="icon4" fontsize="10" x="5" y="-5" hardtext="" />
|
||||
<view type="text" id="info4" posref="BL TL" color="55 205 55 205" posparent="text4" fontsize="10" x="10" y="-5" hardtext="" />
|
||||
<ctrl type="button" id="but4" posparent="icon4" style="button_over" onover="lua" params_over="RyzhomeBar:highlightItem(4)" onclick_l="lua" params_l="RyzhomeBar:useItem(4)" />
|
||||
|
||||
<view type="bitmap" id="icon5" posparent="but4" posref="BL TL" y="-4" texture="r2ed_toolbar_freeze.tga" global_color="false" />
|
||||
<view type="text" id="text5" posref="TR TL" posparent="icon5" fontsize="10" x="5" y="-5" hardtext="" />
|
||||
<view type="text" id="info5" posref="BL TL" color="55 205 55 205" posparent="text5" fontsize="10" x="10" y="-5" hardtext="" />
|
||||
<ctrl type="button" id="but5" posparent="icon5" style="button_over" onover="lua" params_over="RyzhomeBar:highlightItem(5)" onclick_l="lua" params_l="RyzhomeBar:useItem(5)" />
|
||||
|
||||
<view type="bitmap" id="icon6" posparent="but5" posref="BL TL" y="-4" texture="r2ed_toolbar_freeze.tga" global_color="false" />
|
||||
<view type="text" id="text6" posref="TR TL" posparent="icon6" fontsize="10" x="5" y="-5" hardtext="" />
|
||||
<view type="text" id="info6" posref="BL TL" color="55 205 55 205" posparent="text6" fontsize="10" x="10" y="-5" hardtext="" />
|
||||
<ctrl type="button" id="but6" posparent="icon6" style="button_over" onover="lua" params_over="RyzhomeBar:highlightItem(6)" onclick_l="lua" params_l="RyzhomeBar:useItem(6)" />
|
||||
|
||||
<view type="bitmap" id="icon7" posparent="but6" posref="BL TL" y="-4" texture="r2ed_toolbar_freeze.tga" global_color="false" />
|
||||
<view type="text" id="text7" posref="TR TL" posparent="icon7" fontsize="10" x="5" y="-5" hardtext="" />
|
||||
<view type="text" id="info7" posref="BL TL" color="55 205 55 205" posparent="text7" fontsize="10" x="10" y="-5" hardtext="" />
|
||||
<ctrl type="button" id="but7" posparent="icon7" style="button_over" onover="lua" params_over="RyzhomeBar:highlightItem(7)" onclick_l="lua" params_l="RyzhomeBar:useItem(7)" />
|
||||
|
||||
<view type="bitmap" id="icon8" posparent="but7" posref="BL TL" y="-4" texture="r2ed_toolbar_freeze.tga" global_color="false" />
|
||||
<view type="text" id="text8" posref="TR TL" posparent="icon8" fontsize="10" x="5" y="-5" hardtext="" />
|
||||
<view type="text" id="info8" posref="BL TL" color="55 205 55 205" posparent="text8" fontsize="10" x="10" y="-5" hardtext="" />
|
||||
<ctrl type="button" id="but8" posparent="icon8" style="button_over" onover="lua" params_over="RyzhomeBar:highlightItem(8)" onclick_l="lua" params_l="RyzhomeBar:useItem(8)" />
|
||||
|
||||
|
||||
</group>
|
||||
|
||||
<ctrl style="skin_scroll"
|
||||
id="scroll_row"
|
||||
posref="TL TL"
|
||||
target_stepy="44"
|
||||
target="text_list" />
|
||||
|
||||
<group id="list"
|
||||
max_sizeref="h"
|
||||
max_sizeparent="parent"
|
||||
max_h="0"
|
||||
sizeref="w"
|
||||
posref="TL TL"
|
||||
x="8"
|
||||
y="0"
|
||||
w="-16" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<tree node="webig_ryzhome_list_item"></tree>
|
||||
|
||||
<template name="t_webig_ryzhome_button">
|
||||
<ctrl type="button"
|
||||
button_type="push_button"
|
||||
id="#id"
|
||||
posref="TL TL"
|
||||
x="#x"
|
||||
y="#y"
|
||||
tx_normal="#tx_normal"
|
||||
global_color="false"
|
||||
tooltip="#tooltip"
|
||||
onclick_l="lua"
|
||||
params_l="#params_l"/>
|
||||
<view type="bitmap"
|
||||
id="i_#id"
|
||||
posref="TL TL"
|
||||
x="#x"
|
||||
y="#y"
|
||||
rot="#rot"
|
||||
texture="#texture"
|
||||
global_color="false"/>
|
||||
</template>
|
||||
|
||||
<group type="container"
|
||||
id="webig_ryzhome_place_item"
|
||||
x="0" y="0" w="200" h="140" posref="TL TL"
|
||||
title=""
|
||||
global_color="true"
|
||||
global_color_over="true"
|
||||
header_active="false"
|
||||
right_button="false"
|
||||
options="layer0_pad"
|
||||
movable="true"
|
||||
active="true"
|
||||
opened="true"
|
||||
openable="false"
|
||||
resizer="false">
|
||||
|
||||
<group id="header_closed" x="0" y="0" w="0" h="0" posref="TL TL"></group>
|
||||
<group id="header_opened" x="0" y="0" w="0" h="0" wmin="5" sizeref="w" posref="TL TL"></group>
|
||||
|
||||
<group id="content" x="0" y="0" w="400" h="140" posref="TL TL">
|
||||
<view type="text"
|
||||
id="item"
|
||||
posref="TL TL"
|
||||
x="2"
|
||||
y="-4"
|
||||
color="255 255 255 255"
|
||||
shadow="true"
|
||||
global_color="false"
|
||||
fontsize="10"
|
||||
hardtext="" />
|
||||
|
||||
<ctrl style="text_button_16"
|
||||
id="quit"
|
||||
posref="TR TR"
|
||||
x="-2"
|
||||
y="-2"
|
||||
hardtext="uiClose"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomePlace:close()" />
|
||||
<!--
|
||||
<view type="bitmap" id="black" x="2" y="0" w="200" h="150" posref="ML ML" inherit_gc_alpha="true" scale="true" texture="blank.tga" color="0 0 0 240"/>
|
||||
<scene3d id="scene3d" x="2" y="0" w="200" h="150" posref="ML ML" curcam="cam" curcs="env" render_layer="-2" active="false"
|
||||
user_interaction="true" rotz_factor="0.017"
|
||||
roty_factor="0.005" roty_limit_min="-80" roty_limit_max="90"
|
||||
dist_factor="0.05" dist_limit_min="1" dist_limit_max="20.0"
|
||||
ambient="128 96 64" sun_ambient="0 0 0" sun_diffuse="255 255 196" sun_specular="0 0 0" sun_direction="-1.0 1.0 -1.0" >
|
||||
|
||||
|
||||
<camera id="cam" fov="80" pos="0.0 20.0 0" target="0.0 26.5 2" roll="0" />
|
||||
|
||||
<light id="back" pos="0.0 28.2 1.6" color="255 255 255" near="2.5" far="4.0" />
|
||||
<light id="lgt" pos="0.0 25.3 2.48" color="255 255 255" near="3.0" far="4.0" />
|
||||
|
||||
<shape id="shape" name="" pos="0.0 26.5 0.0" rot="0.0 0.0 0.0" />
|
||||
</scene3d>
|
||||
-->
|
||||
<group id="movers" x="0" y="-4" w="182" h="140" posref="MM MM">
|
||||
<instance template="t_webig_ryzhome_button" id="previous_x2" rot="2" x="2" y="-16" tooltip="ll" texture="mp3_button_next.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(-0.1, 0, 0)" />
|
||||
<instance template="t_webig_ryzhome_button" id="previous_x" rot="2" x="32" y="-16" tooltip="ll" texture="mp3_button_play.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(-0.01, 0, 0)" />
|
||||
<view type="text" id="x" posref="TL TL" x="76" y="-20" color="255 255 255 255" shadow="true" global_color="false" fontsize="10" hardtext="Axe X" />
|
||||
<instance template="t_webig_ryzhome_button" id="next_x" rot="0" x="130" y="-16" tooltip="ll" texture="mp3_button_play.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0.01, 0, 0)" />
|
||||
<instance template="t_webig_ryzhome_button" id="next_x2" rot="0" x="160" y="-16" tooltip="ll" texture="mp3_button_next.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0.1, 0, 0)" />
|
||||
|
||||
<instance template="t_webig_ryzhome_button" id="previous_y2" rot="2" x="2" y="-34" tooltip="ll" texture="mp3_button_next.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0, -0.1, 0)" />
|
||||
<instance template="t_webig_ryzhome_button" id="previous_y" rot="2" x="32" y="-34" tooltip="ll" texture="mp3_button_play.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0, -0.01, 0)" />
|
||||
<view type="text" id="y" posref="TL TL" x="76" y="-38" color="255 255 255 255" shadow="true" global_color="false" fontsize="10" hardtext="Axe Y" />
|
||||
<instance template="t_webig_ryzhome_button" id="next_y" rot="0" x="130" y="-34" tooltip="ll" texture="mp3_button_play.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0, 0.01, 0)" />
|
||||
<instance template="t_webig_ryzhome_button" id="next_y2" rot="0" x="160" y="-34" tooltip="ll" texture="mp3_button_next.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0, 0.1, 0)" />
|
||||
|
||||
<instance template="t_webig_ryzhome_button" id="previous_z2" rot="2" x="2" y="-52" tooltip="ll" texture="mp3_button_next.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0, 0, -0.1, 0)" />
|
||||
<instance template="t_webig_ryzhome_button" id="previous_z" rot="2" x="32" y="-52" tooltip="ll" texture="mp3_button_play.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0, 0, -0.01, 0)" />
|
||||
<view type="text" id="z" posref="TL TL" x="76" y="-58" color="255 255 255 255" shadow="true" global_color="false" fontsize="10" hardtext="Axe Z" />
|
||||
<instance template="t_webig_ryzhome_button" id="next_z" rot="0" x="130" y="-52" tooltip="ll" texture="mp3_button_play.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0, 0, 0.01, 0)" />
|
||||
<instance template="t_webig_ryzhome_button" id="next_z2" rot="0" x="160" y="-52" tooltip="ll" texture="mp3_button_next.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:move(0, 0, 0.1, 0)" />
|
||||
|
||||
<instance template="t_webig_ryzhome_button" id="previous_a2" rot="2" x="2" y="-70" tooltip="ll" texture="mp3_button_next.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:rot(-0.1)" />
|
||||
<instance template="t_webig_ryzhome_button" id="previous_a" rot="2" x="32" y="-70" tooltip="ll" texture="mp3_button_play.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:rot(-0.01)" />
|
||||
<view type="text" id="a" posref="TL TL" x="76" y="-76" color="255 255 255 255" shadow="true" global_color="false" fontsize="10" hardtext="Angle" />
|
||||
<instance template="t_webig_ryzhome_button" id="next_a" rot="0" x="130" y="-70" tooltip="ll" texture="mp3_button_play.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:rot(0.01)" />
|
||||
<instance template="t_webig_ryzhome_button" id="next_a2" rot="0" x="160" y="-70" tooltip="ll" texture="mp3_button_next.tga" tx_normal="mp3_button_play.tga" params_l="RyzhomePlace:rot(0.1)" />
|
||||
</group>
|
||||
|
||||
<ctrl style="text_button_16"
|
||||
id="validate"
|
||||
posref="BR BR"
|
||||
x="-2"
|
||||
y="2"
|
||||
hardtext="reset"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomePlace:apply()" />
|
||||
|
||||
<ctrl style="text_button_16"
|
||||
id="reset"
|
||||
posref="ML MR"
|
||||
posparent="validate"
|
||||
x="-2"
|
||||
y="0"
|
||||
hardtext="reset"
|
||||
onclick_l="lua"
|
||||
params_l="RyzhomePlace:reset()" />
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<tree node="webig_ryzhome_place_item"></tree>
|
||||
|
||||
</interface_config>
|
@ -0,0 +1,624 @@
|
||||
--- Parse interface of ark_scene_editor_edit_menu ---
|
||||
local script = [[<interface_config>
|
||||
<root id="interface" x="0" y="0" w="800" h="600" active="true"/>
|
||||
<group type="menu" id="ark_scene_editor_edit_menu" extends="base_menu" mouse_pos="true">
|
||||
</group>
|
||||
</interface_config>]]
|
||||
parseInterfaceFromString(script)
|
||||
|
||||
|
||||
if SceneEditor == nil then
|
||||
SceneEditor = {
|
||||
Shapes = {},
|
||||
Groups = {},
|
||||
LastEditedGroup = nil,
|
||||
HaveUpdate = nil
|
||||
|
||||
};
|
||||
end
|
||||
|
||||
|
||||
function debug(text)
|
||||
local message = ucstring()
|
||||
message:fromUtf8(tostring(text))
|
||||
displaySystemInfo(message, "SYS")
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:init(scene_id, form_url, translations, icons_url)
|
||||
self.sceneId = scene_id
|
||||
self.baseUrl = form_url
|
||||
self.iconsUrl = icons_url
|
||||
self.T = translations
|
||||
end
|
||||
|
||||
function SceneEditor:reset(no_get_html)
|
||||
self.Shapes = {}
|
||||
self.Groups = {}
|
||||
self.LastEditedGroup = nil
|
||||
self.HaveUpdate = nil
|
||||
runAH(nil, "remove_shapes", "")
|
||||
if no_get_html == true then
|
||||
self:get_html("Reseted")
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:show_menu()
|
||||
if (rightClick) then
|
||||
SceneEditor:launch_menu()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:launch_menu(id)
|
||||
-- SelectedInstanceId can be set by client application
|
||||
if id ~= nil then
|
||||
SelectedInstanceId = id
|
||||
end
|
||||
local menu = getUI("ui:interface:ark_scene_editor_edit_menu")
|
||||
menu:setMinW(185)
|
||||
menu:updateCoords()
|
||||
menu = menu:getRootMenu()
|
||||
menu:reset()
|
||||
menu:addLine(ucstring("-- SHAPE EDITION --"), "", "", "shape_header")
|
||||
menu:addLine(ucstring("Move"), "", "", "shape_move")
|
||||
menu:addSubMenu(1)
|
||||
local subMenu = menu:getSubMenu(1)
|
||||
subMenu:addIconLine(ucstring("Axe X"), "lua", "setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:move_x()')", "shape_move_x", "ark_move_x.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Y"), "lua", "setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:move_y()')", "shape_move_y", "ark_move_y.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Z"), "lua", "x, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:move_z()')", "shape_move_z", "ark_move_z.tga")
|
||||
subMenu:addIconLine(ucstring("Axes X & Y"), "lua", "setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:move_xy()')", "shape_move_xy", "ark_move_xy.tga")
|
||||
subMenu:addIconLine(ucstring("Axes X & Y Snap to ground"), "lua", "setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:move_xysnap()')", "shape_move_xy_snap", "ark_move_xysnap.tga")
|
||||
subMenu:addSeparator()
|
||||
subMenu:addIconLine(ucstring("Move to player"), "lua", "SceneEditor:move_player()", "shape_move_player", "ark_move_player.tga")
|
||||
|
||||
menu:addLine(ucstring("Rotate"), "", "", "shape_rotate")
|
||||
menu:addSubMenu(2)
|
||||
subMenu = menu:getSubMenu(2)
|
||||
subMenu:addIconLine(ucstring("Axe X"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:rotate(SelectedInstanceId, \"x\")')", "shape_rotate_x", "ark_rotate_x.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Y"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:rotate(SelectedInstanceId, \"y\")')", "shape_rotate_y", "ark_rotate_y.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Z"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:rotate(SelectedInstanceId, \"z\")')", "shape_rotate_z", "ark_rotate_z.tga")
|
||||
|
||||
menu:addLine(ucstring("Scale"), "", "", "shape_scale")
|
||||
menu:addSubMenu(3)
|
||||
subMenu = menu:getSubMenu(3)
|
||||
subMenu:addIconLine(ucstring("Axe X"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:scale(SelectedInstanceId, \"x\")')", "shape_scale_x", "ark_scale_x.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Y"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:scale(SelectedInstanceId, \"y\")')", "shape_scale_y", "ark_scale_y.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Z"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:scale(SelectedInstanceId, \"z\")')", "shape_scale_z", "ark_scale_z.tga")
|
||||
subMenu:addIconLine(ucstring("Axes X & Y & Z"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:scale(SelectedInstanceId, \"xyz\")')", "shape_scale_xyz", "ark_scale_xyz.tga")
|
||||
|
||||
menu:addLine(ucstring("-- COLLISION EDITION --"), "", "", "col_header")
|
||||
menu:addLine(ucstring("Move"), "", "", "col_move")
|
||||
menu:addSubMenu(5)
|
||||
subMenu = menu:getSubMenu(5)
|
||||
subMenu:addIconLine(ucstring("Axe X"), "lua", "setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:col_move_x()')", "col_move_x", "ark_move_x.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Y"), "lua", "setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:col_move_y()')", "col_move_y", "ark_move_y.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Z"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:col_move_z()')", "col_move_z", "ark_move_xy.tga")
|
||||
subMenu:addIconLine(ucstring("Axe X & Y"), "lua", "setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:col_move_xy()')", "col_move_xy", "ark_move_xy.tga")
|
||||
subMenu:addSeparator()
|
||||
subMenu:addIconLine(ucstring("Move to Shape"), "lua", "SceneEditor:col_move_to_shape()", "col_move_to_shape", "ark_move_player.tga")
|
||||
|
||||
menu:addIconLine(ucstring("Rotate"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:col_rotate(SelectedInstanceId, \"x\")')", "col_rotate_x", "ark_rotate_x.tga")
|
||||
|
||||
menu:addLine(ucstring("Scale"), "", "", "col_scale")
|
||||
menu:addSubMenu(7)
|
||||
subMenu = menu:getSubMenu(7)
|
||||
subMenu:addIconLine(ucstring("Axe X"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:col_scale(SelectedInstanceId, \"x\")')", "col_scale_x", "ark_scale_x.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Y"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:col_scale(SelectedInstanceId, \"y\")')", "col_scale_y", "ark_scale_y.tga")
|
||||
subMenu:addIconLine(ucstring("Axe Z"), "lua", "ARK_SHAPE_LATEST_X, ARK_SHAPE_LATEST_Y = getMousePos(); setOnDraw(getUI('ui:interface:ark_scene_editor'), 'SceneEditor:col_scale(SelectedInstanceId, \"z\")')", "col_scale_z", "ark_scale_z.tga")
|
||||
|
||||
launchContextMenuInGame("ui:interface:ark_scene_editor_edit_menu")
|
||||
end
|
||||
|
||||
|
||||
function arcc_tools_check_rclick()
|
||||
root = getUI("ui:interface")
|
||||
local rx, ry = getMousePos()
|
||||
i_id = getShapeIdAt(rx, ry)
|
||||
if i_id >= 0 then
|
||||
setOnDraw(getUI("ui:interface:ark_scene_editor"), "")
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:move(id, axe)
|
||||
local d, mx, my = getMouseDown()
|
||||
if d then
|
||||
setOnDraw(getUI("ui:interface:ark_scene_editor"), "")
|
||||
SceneEditor:set_modified(id)
|
||||
self:get_html("Moved")
|
||||
else
|
||||
local x,y,z = getGroundAtMouse()
|
||||
if axe == "x" then moveShape(id, tostring(x), "+0", "+0") end
|
||||
if axe == "y" then moveShape(id, "+0", tostring(y), "+0") end
|
||||
if axe == "z" then
|
||||
mx, my = getMousePos()
|
||||
moveShape(id, "+0", "+0", "+"..tostring((my-ARK_SHAPE_LATEST_Y)/100))
|
||||
ARK_SHAPE_LATEST_Y = my
|
||||
end
|
||||
if axe == "xysnap" then moveShape(id, tostring(x), tostring(y), tostring(z)) end
|
||||
if axe == "xy" then moveShape(id, tostring(x), tostring(y), "+0") end
|
||||
if axe == "player" then
|
||||
x, y, z = getPlayerPos()
|
||||
moveShape(id, tostring(x), tostring(y), tostring(z))
|
||||
SceneEditor:set_modified(id)
|
||||
self:get_html("Moved to player")
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:rotate(id, axe)
|
||||
local d, mx, my = getMouseDown()
|
||||
if d then
|
||||
setOnDraw(getUI("ui:interface:ark_scene_editor"), "")
|
||||
SceneEditor:set_modified(id)
|
||||
self:get_html("Rotate")
|
||||
else
|
||||
mx, my = getMousePos()
|
||||
if axe == "x" then rotateShape(id, "+"..tostring((my-ARK_SHAPE_LATEST_Y)/100), "+0", "+0") end
|
||||
if axe == "y" then rotateShape(id, "+0", "+"..tostring((my-ARK_SHAPE_LATEST_Y)/100), "+0") end
|
||||
if axe == "z" then rotateShape(id, "+0", "+0", "+"..tostring((mx-ARK_SHAPE_LATEST_X)/100)) end
|
||||
ARK_SHAPE_LATEST_X = mx
|
||||
ARK_SHAPE_LATEST_Y = my
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:scale(id, axe)
|
||||
local d, mx, my = getMouseDown()
|
||||
if d then
|
||||
setOnDraw(getUI("ui:interface:ark_scene_editor"), "")
|
||||
SceneEditor:set_modified(id)
|
||||
self:get_html("Rotate")
|
||||
else
|
||||
mx, my = getMousePos()
|
||||
local setup = {}
|
||||
if axe == "xyz" then
|
||||
setup["scale x"]="+"..tostring((mx-ARK_SHAPE_LATEST_X)/100)
|
||||
setup["scale y"]="+"..tostring((mx-ARK_SHAPE_LATEST_X)/100)
|
||||
setup["scale z"]="+"..tostring((mx-ARK_SHAPE_LATEST_X)/100)
|
||||
end
|
||||
if axe == "x" then setup["scale x"]="+"..tostring((mx-ARK_SHAPE_LATEST_X)/100) end
|
||||
if axe == "y" then setup["scale y"]="+"..tostring((mx-ARK_SHAPE_LATEST_X)/100) end
|
||||
if axe == "z" then setup["scale z"]="+"..tostring((my-ARK_SHAPE_LATEST_Y)/100) end
|
||||
setupShape(id, setup)
|
||||
ARK_SHAPE_LATEST_X = mx
|
||||
ARK_SHAPE_LATEST_Y = my
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:move_x()
|
||||
self:move(SelectedInstanceId, "x")
|
||||
end
|
||||
|
||||
function SceneEditor:move_y()
|
||||
self:move(SelectedInstanceId, "y")
|
||||
end
|
||||
|
||||
function SceneEditor:move_xy()
|
||||
self:move(SelectedInstanceId, "xy")
|
||||
end
|
||||
|
||||
function SceneEditor:move_xysnap()
|
||||
self:move(SelectedInstanceId, "xysnap")
|
||||
end
|
||||
|
||||
function SceneEditor:move_z()
|
||||
self:move(SelectedInstanceId, "z")
|
||||
end
|
||||
|
||||
function SceneEditor:move_player()
|
||||
self:move(SelectedInstanceId, "player")
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:col_move(id, axe)
|
||||
local d, mx, my = getMouseDown()
|
||||
|
||||
if d then
|
||||
setOnDraw(getUI("ui:interface:ark_scene_editor"), "")
|
||||
self:set_modified(id)
|
||||
self:get_html("Updated")
|
||||
else
|
||||
local x,y,z = getGroundAtMouse()
|
||||
local setup = {}
|
||||
if axe == "x" then setup["col pos x"]=tostring(x) end
|
||||
if axe == "y" then setup["col pos y"]=tostring(y) end
|
||||
if axe == "z" then
|
||||
mx, my = getMousePos()
|
||||
setup["col pos z"]="+"..tostring((my-ARK_SHAPE_LATEST_Y)/100)
|
||||
ARK_SHAPE_LATEST_X = mx
|
||||
ARK_SHAPE_LATEST_Y = my
|
||||
end
|
||||
if axe == "xy" then setup["col pos x"]=tostring(x); setup["col pos y"]=tostring(y) end
|
||||
if axe == "shape" then
|
||||
x, y, z = getShapePos(id)
|
||||
setup["col pos x"]=tostring(x)
|
||||
setup["col pos y"]=tostring(y)
|
||||
self:set_modified(id)
|
||||
setupShape(id, setup)
|
||||
self:get_html("Updated")
|
||||
else
|
||||
setupShape(id, setup)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:col_rotate(id, axe)
|
||||
local d, mx, my = getMouseDown()
|
||||
if d then
|
||||
setOnDraw(getUI("ui:interface:ark_scene_editor"), "")
|
||||
SceneEditor:set_modified(id)
|
||||
self:get_html("Rotate")
|
||||
else
|
||||
mx, my = getMousePos()
|
||||
local setup = {}
|
||||
setup["col orientation"]="+"..tostring((mx-ARK_SHAPE_LATEST_X)/100)
|
||||
setupShape(id, setup)
|
||||
ARK_SHAPE_LATEST_X = mx
|
||||
ARK_SHAPE_LATEST_Y = my
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function SceneEditor:col_scale(id, axe)
|
||||
local d, mx, my = getMouseDown()
|
||||
if d then
|
||||
setOnDraw(getUI("ui:interface:ark_scene_editor"), "")
|
||||
SceneEditor:set_modified(id)
|
||||
self:get_html("Rotate")
|
||||
else
|
||||
mx, my = getMousePos()
|
||||
local setup = {}
|
||||
if axe == "x" then setup["col size x"]="+"..tostring((mx-ARK_SHAPE_LATEST_X)/100) end
|
||||
if axe == "y" then setup["col size y"]="+"..tostring((mx-ARK_SHAPE_LATEST_X)/100) end
|
||||
if axe == "z" then setup["col size z"]="+"..tostring((my-ARK_SHAPE_LATEST_Y)/100) end
|
||||
setupShape(id, setup)
|
||||
ARK_SHAPE_LATEST_X = mx
|
||||
ARK_SHAPE_LATEST_Y = my
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:set_modified(id)
|
||||
self.Groups[self.Shapes[id].group].props.modified=true
|
||||
self.Shapes[id].modified = "modified"
|
||||
self.HaveUpdate = true
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:col_move_x()
|
||||
self:col_move(SelectedInstanceId, "x")
|
||||
end
|
||||
|
||||
function SceneEditor:col_move_y()
|
||||
self:col_move(SelectedInstanceId, "y")
|
||||
end
|
||||
function SceneEditor:col_move_z()
|
||||
self:col_move(SelectedInstanceId, "z")
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:col_move_xy()
|
||||
self:col_move(SelectedInstanceId, "xy")
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:col_move_to_shape()
|
||||
self:col_move(SelectedInstanceId, "shape")
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:setup_shape(shape_id, setup)
|
||||
final_setup = self.Shapes[new_shape.id].setup
|
||||
if final_setup == nil then
|
||||
final_setup = {}
|
||||
end
|
||||
for k,v in pairs(setup) do
|
||||
final_setup[k] = v
|
||||
end
|
||||
self.Shapes[new_shape.id].setup = final_setup
|
||||
setupShape(shape_id, setup)
|
||||
end
|
||||
|
||||
function SceneEditor:add(shape)
|
||||
if self.LastEditedGroup == nil then
|
||||
self:get_html('<font color="#aa00000">'..self.T["no_selected_group"]..'</font>', '000000')
|
||||
end
|
||||
local new_shape = {}
|
||||
new_shape.file = shape
|
||||
new_shape.group = self.LastEditedGroup
|
||||
self.Groups[new_shape.group].props.modified=true
|
||||
new_shape.db_id = self.Groups[new_shape.group].props.count + 1
|
||||
new_shape.modified = "added"
|
||||
new_shape_id = addShape(shape, 0, 0, 0, "user", 1, true, "", "SceneEditor:show_menu()")
|
||||
table.insert(self.Groups[new_shape.group], new_shape_id)
|
||||
self.Groups[new_shape.group].props.count = self.Groups[new_shape.group].props.count + 1
|
||||
self.Shapes[new_shape_id] = new_shape
|
||||
self:get_html("Added")
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:removeShape(shape_id)
|
||||
deleteShape(shape_id)
|
||||
local group = self.Shapes[shape_id].group
|
||||
for k,g_shape_id in pairs(self.Groups[group]) do
|
||||
if shape_id == g_shape_id then
|
||||
self.Groups[group][k] = nil
|
||||
end
|
||||
end
|
||||
self:set_modified(shape_id)
|
||||
self.Shapes[shape_id] = nil
|
||||
self:get_html("Removed")
|
||||
end
|
||||
|
||||
function SceneEditor:addGroup(name, count, show, edit)
|
||||
if name == nil then
|
||||
return
|
||||
end
|
||||
if self.Groups[name] == nil then
|
||||
self.Groups[name] = {}
|
||||
self.Groups[name].props = {}
|
||||
self.Groups[name].props.count = count
|
||||
self.Groups[name].props.show = show
|
||||
self.Groups[name].props.edit = edit
|
||||
self.Groups[name].props.modified = false
|
||||
else
|
||||
self.Groups[name].props.show = show
|
||||
self.Groups[name].props.edit = edit
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:editGroup(group)
|
||||
if self.LastEditedGroup then
|
||||
self:removeGroup(self.LastEditedGroup, true)
|
||||
self:addGroup(self.LastEditedGroup, 0, true, false)
|
||||
end
|
||||
self:removeGroup(group, true);
|
||||
self:addGroup(group, 0, true, true)
|
||||
self.LastEditedGroup = group
|
||||
end
|
||||
|
||||
function SceneEditor:addFromDb(group, db_id, json_shape, edit)
|
||||
shape = Json.decode(json_shape)
|
||||
shape.db_id = db_id
|
||||
|
||||
shape.group = group
|
||||
shape.modified = ""
|
||||
if edit then
|
||||
shape_id = addShape(shape.file, shape.pos[1], shape.pos[2], shape.pos[3], "user", 1, true, "", "SceneEditor:show_menu()")
|
||||
else
|
||||
shape_id = addShape(shape.file, shape.pos[1], shape.pos[2], shape.pos[3], "user", 1, true, "", "")
|
||||
end
|
||||
rotateShape(shape_id, tostring(shape.rot[1]), tostring(shape.rot[2]), tostring(shape.rot[3]))
|
||||
setupShape(shape_id, shape.setup)
|
||||
self.Shapes[shape_id] = shape
|
||||
table.insert(self.Groups[group], shape_id)
|
||||
if db_id > self.Groups[group].props.count then
|
||||
self.Groups[group].props.count = db_id
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:spawnShape(shape, x, y, z, rotx, roty, rotz, setup)
|
||||
local id = addShape(shape, x, y, z, "user", 1, true, "", "", false, false, "", "", true)
|
||||
rotateShape(id, tostring(rotx), tostring(roty), tostring(rotz))
|
||||
setupShape(id, Json.decode(setup))
|
||||
end
|
||||
|
||||
function SceneEditor:removeGroup(group, no_get_html)
|
||||
if self.Groups[group] == nil then
|
||||
return
|
||||
end
|
||||
|
||||
for k,shape_id in pairs(self.Groups[group]) do
|
||||
if k ~= "props" then
|
||||
self.Shapes[shape_id] = nil
|
||||
deleteShape(shape_id)
|
||||
end
|
||||
end
|
||||
|
||||
self.Groups[group] = nil
|
||||
if self.LastEditedGroup == group then
|
||||
self.LastEditedGroup = nil
|
||||
local ui = getUI("ui:interface:ark_list_of_shapes")
|
||||
if ui then
|
||||
ui.active=false
|
||||
end
|
||||
end
|
||||
if no_get_html == nil then
|
||||
self:get_html("Group Removed")
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:enc64(data)
|
||||
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
||||
return ((data:gsub('.', function(x)
|
||||
local r,b='',x:byte()
|
||||
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
|
||||
return r;
|
||||
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
|
||||
if (#x < 6) then return '' end
|
||||
local c=0
|
||||
for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
|
||||
return b:sub(c+1,c+1)
|
||||
end)..({ '', '==', '=' })[#data%3+1])
|
||||
end
|
||||
|
||||
function SceneEditor:get_vector(x, y, z)
|
||||
local vector = {}
|
||||
table.insert(vector, x)
|
||||
table.insert(vector, y)
|
||||
table.insert(vector, z)
|
||||
|
||||
return vector
|
||||
end
|
||||
|
||||
function SceneEditor:get_random_color()
|
||||
local r = math.random(44, 66);
|
||||
local g = math.random(44, 66);
|
||||
local b = math.random(44, 66);
|
||||
return '#'..tostring(r)..tostring(g)..tostring(b)
|
||||
|
||||
end
|
||||
|
||||
function pairsByKeys(t, f)
|
||||
local a = {}
|
||||
for n in pairs(t) do table.insert(a, n) end
|
||||
table.sort(a, f)
|
||||
local i = 0 -- iterator variable
|
||||
local iter = function () -- iterator function
|
||||
i = i + 1
|
||||
if a[i] == nil then
|
||||
return nil
|
||||
else
|
||||
return a[i], t[a[i]]
|
||||
end
|
||||
end
|
||||
return iter
|
||||
end
|
||||
|
||||
function SceneEditor:show_shape_list()
|
||||
local ui = getUI("ui:interface:ark_list_of_shapes")
|
||||
local need_setup = ui == nil
|
||||
if need_setup then
|
||||
WebBrowser:openWindow("ark_list_of_shapes", self.baseUrl..'_ListShapes')
|
||||
ui = getUI("ui:interface:ark_list_of_shapes")
|
||||
ui.pop_min_w = 400
|
||||
ui.w = 400
|
||||
getUI("ui:interface:ark_list_of_shapes:browser:header_opened:browse_redo").active=false
|
||||
getUI("ui:interface:ark_list_of_shapes:browser:header_opened:browse_undo").active=false
|
||||
getUI("ui:interface:ark_list_of_shapes:browser:header_opened:browse_refresh").active=false
|
||||
getUI("ui:interface:ark_list_of_shapes:browser:header_opened:browse_home").active=false
|
||||
else
|
||||
ui.active = true
|
||||
end
|
||||
end
|
||||
|
||||
function SceneEditor:getShapesByGroups()
|
||||
local groups = {}
|
||||
for shape_id, shape in pairs(self.Shapes) do
|
||||
if shape.group == nil then
|
||||
shape.group = ""
|
||||
end
|
||||
|
||||
if groups[shape.group] == nil then
|
||||
groups[shape.group] = {}
|
||||
end
|
||||
table.insert(groups[shape.group], shape_id)
|
||||
end
|
||||
return groups
|
||||
end
|
||||
|
||||
|
||||
function SceneEditor:get_html_section(message, color)
|
||||
return '<table width="100%" cellspacing="0" cellpadding="0"><tr bgcolor="'..color..'"><td align="center" valign="middle"><font color="#FFFFFF" size="12">'..message..'</font></td></tr></table>'
|
||||
end
|
||||
|
||||
function SceneEditor:get_html(message, message_bg)
|
||||
debug("get_html :"..message)
|
||||
local new_group = ' <a class="ryzom-ui-button" href="'..self.baseUrl..'_AddGroup&add_new_group=1&scene_id='..self.sceneId..'"><img src="'..self.iconsUrl..'/32/chart_organisation_add.png" alt="'..self.T["add_new_group"]..'" /></a>'
|
||||
local show_hide_cols = ' <a class="ryzom-ui-button" href="ah:ark_pacs_borders"><img src="'..self.iconsUrl..'/32/show_hide_cols.png" alt="'..self.T["show_hide_cols"]..'" /></a>'
|
||||
local reset_scene = '</td><td align="center" bgcolor="#502020" width="40px"><a class="ryzom-ui-button" href="'..self.baseUrl..'_SaveShapes&reset_scene=1&scene_id='..self.sceneId..'"><img src="'..self.iconsUrl..'/32/bin.png" alt="'..self.T["reset_scene"]..'" /></a>'
|
||||
|
||||
local html = '<header><title>'..self.T["sceno_editor"]..'</title></header>'..self:get_html_section(message..'</td><td bgcolor="#202020" align="center" height="40px" width="140px" valign="middle">'..new_group..show_hide_cols..reset_scene, (message_bg or SceneEditor:get_random_color()))
|
||||
|
||||
html = html .. '<form action="'..self.baseUrl..'_SaveShapes" method="POST"><input type="hidden" name="group" value="'..(self.LastEditedGroup or "")..'" /><input type="hidden" name="scene_id" value="'..self.sceneId..'" />\
|
||||
<table width="100%" cellspacing="0" cellpadding="0">'
|
||||
|
||||
local groups = self:getShapesByGroups()
|
||||
|
||||
for group, shapes in pairsByKeys(self.Groups) do
|
||||
debug("Group : "..group)
|
||||
local groupname = group
|
||||
html = html .. '<tr bgcolor="#444444"><td height="20px"><table width="100%"><tr><td> '..groupname..' ('..(self.Groups[group].props.count or '0')..') </td><td align="right"><input type="hidden" name="shape[]", value="#"/>'
|
||||
|
||||
|
||||
if self.Groups[group].props.show then
|
||||
debug("Group : show")
|
||||
if self.Groups[group].props.edit then
|
||||
html = html .. '<a href="ah:lua:SceneEditor:show_shape_list()"><img src="'..self.iconsUrl..'/16/box_add.png" alt="'..self.T["add_shape"]..'"/></a></td><td align="right">'
|
||||
if self.HaveUpdate then
|
||||
html = html .. '<a class="ryzom-ui-button" href="'..self.baseUrl..'_SaveShapes&hide_group='..group..'&edit_group='..group..'">'..self.T["cancel"]..'</a>'
|
||||
else
|
||||
html = html .. '<a class="ryzom-ui-button" href="'..self.baseUrl..'_SaveShapes&hide_group='..group..'">'..self.T["hide"]..'</a>'
|
||||
end
|
||||
else
|
||||
html = html .. '<a class="ryzom-ui-button" href="'..self.baseUrl..'_SaveShapes&hide_group='..group..'">'..self.T["hide"]..'</a>'
|
||||
end
|
||||
else
|
||||
html = html .. '<a class="ryzom-ui-button" href="'..self.baseUrl..'_SaveShapes&show_group='..group..'">'..self.T["show"]..'</a>'
|
||||
end
|
||||
|
||||
local shapes_html = ""
|
||||
local shapes_html_dict = {}
|
||||
local show = self.Groups[group].props.show
|
||||
if self.Groups[group].props.edit then
|
||||
shapes_id = groups[group]
|
||||
if shapes_id then
|
||||
for k,shape_id in pairs(shapes_id) do
|
||||
shape = {}
|
||||
if self.Shapes[shape_id] then
|
||||
shape["db_id"] = self.Shapes[shape_id].db_id
|
||||
shape["file"] = self.Shapes[shape_id].file
|
||||
shape["pos"] = self:get_vector(getShapePos(shape_id))
|
||||
scale_x, scale_y, scale_z = getShapeScale(shape_id)
|
||||
shape["rot"] = self:get_vector(getShapeRot(shape_id))
|
||||
colpos_x, colpos_y, colpos_z = getShapeColPos(shape_id)
|
||||
colscale_x, colscale_y, colscale_z = getShapeColScale(shape_id)
|
||||
colorient = getShapeColOrient(shape_id)
|
||||
shape["setup"] = {}
|
||||
shape["setup"]["scale x"] = scale_x
|
||||
shape["setup"]["scale y"] = scale_y
|
||||
shape["setup"]["scale z"] = scale_z
|
||||
shape["setup"]["col pos x"] = shape["pos"][1]+colpos_x
|
||||
shape["setup"]["col pos y"] = shape["pos"][2]+colpos_y
|
||||
shape["setup"]["col size x"] = colscale_x
|
||||
shape["setup"]["col size y"] = colscale_y
|
||||
shape["setup"]["col size z"] = colscale_z
|
||||
shape["setup"]["col orientation"] = colorient
|
||||
local color = "202020"
|
||||
if k % 2 == 0 then
|
||||
color = "101010"
|
||||
end
|
||||
local text_color = "ef9b64"
|
||||
if self.Shapes[shape_id].modified == "modified" then
|
||||
text_color = "aa5555"
|
||||
else
|
||||
if self.Shapes[shape_id].modified == "added" then
|
||||
text_color = "55aa55"
|
||||
end
|
||||
end
|
||||
table.insert(shapes_html_dict, {id=shape.db_id, html="<tr bgcolor='#"..color.."'><td height='20px'> <input type='hidden' name='shape[]', value='"..SceneEditor:enc64((shape.db_id or '')..":"..Json.encode(shape)).."' />"..'#'..(shape.db_id or '0').." <a href='ah:lua:SceneEditor:launch_menu("..tostring(shape_id)..")'><font color='#"..text_color.."'>"..shape.file.."</font></a></td>\
|
||||
<td width='30px'><a href='ah:lua:SceneEditor:editShapeProperties("..tostring(shape_id)..")'><img src='"..self.iconsUrl.."/16/layout_edit.png' /></a></td>\
|
||||
<td width='3px'><a href='ah:lua:SceneEditor:removeShape("..tostring(shape_id)..")'><img src='"..self.iconsUrl.."/16/cross.png' /></a></td>\
|
||||
</tr>"})
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(shapes_html_dict, function (a, b) return a.id < b.id end)
|
||||
for k,shape in ipairs(shapes_html_dict) do
|
||||
shapes_html = shape.html .. shapes_html
|
||||
end
|
||||
end
|
||||
else
|
||||
if self.HaveUpdate == nil then
|
||||
html = html .. ' <a class="ryzom-ui-button" href="'..self.baseUrl..'_SaveShapes&edit_group='..group..'">'..self.T["edit"]..'</a>'
|
||||
html = html .. '</td><td align="right"><a class="ryzom-ui-button" href="'..self.baseUrl..'_SaveShapes&reset_scene=1&del_group='..group..'">'..self.T["remove"]..'</a>'
|
||||
end
|
||||
end
|
||||
|
||||
if self.Groups[group].props.modified then
|
||||
html = html .. ' <input type="submit" value="'..self.T["save"]..'" />'
|
||||
end
|
||||
html = html .. '</td></tr></table></td><td></td></tr>'..shapes_html
|
||||
|
||||
end
|
||||
|
||||
html = html .. '</table></form>'
|
||||
ui = getUI("ui:interface:ark_scene_editor:browser:content:html", false)
|
||||
if ui then
|
||||
ui:renderHtml(html)
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,170 @@
|
||||
<interface_config>
|
||||
<root id="interface" x="0" y="0" w="800" h="600" active="true" />
|
||||
|
||||
<variable entry="UI:SAVE:TELEPORT:DO_PACT" type="sint32" value="0" />
|
||||
<variable entry="UI:SAVE:TELEPORT:BANNER" type="sint32" value="1" />
|
||||
<variable entry="UI:SAVE:TELEPORT:CLOSE_AFTER_TP" type="sint32" value="1" />
|
||||
<variable entry="UI:SAVE:TELEPORT:ISDETACHED" type="sint32" value="1" />
|
||||
<variable entry="UI:SAVE:ISACTIVE:ARTEFACT" type="sint32" value="0" />
|
||||
|
||||
<!-- artefact v1 -->
|
||||
<lua file="tp_interface.lua" />
|
||||
<lua file="misc.lua" />
|
||||
|
||||
<proc id="artefact_proc_active">
|
||||
<action handler="set" params="dblink=UI:SAVE:ISACTIVE:ARTEFACT|value=1" />
|
||||
<action handler="lua" params="artefact:onActive()" />
|
||||
</proc>
|
||||
<proc id="artefact_proc_deactive">
|
||||
<action handler="set" params="dblink=UI:SAVE:ISACTIVE:ARTEFACT|value=0" />
|
||||
<action handler="lua" params="artefact:onDeactive()" />
|
||||
</proc>
|
||||
<proc id="artefact_win_attach">
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:iil:active|value=0" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:ryzhome:active|value=0" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:webitems:active|value=0" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:artefact_content:active|value=1" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:artefact_bottom:active|value=1" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:artefact_tab:active|value=1" />
|
||||
<action handler="set" params="dblink=UI:SAVE:TELEPORT:ISDETACHED|value=0" />
|
||||
<action handler="lua" params="artefact:attachWindow()" />
|
||||
</proc>
|
||||
<proc id="artefact_win_detach">
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:iil:active|value=1" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:ryzhome:active|value=0" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:webitems:active|value=0" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:artefact_content:active|value=0" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:artefact_bottom:active|value=0" />
|
||||
<action handler="set" params="target_property=ui:interface:inventory:content:bag:artefact_tab:active|value=0" />
|
||||
<action handler="set" params="dblink=UI:SAVE:TELEPORT:ISDETACHED|value=1" />
|
||||
<action handler="lua" params="artefact:detachWindow()" />
|
||||
</proc>
|
||||
|
||||
<group type="menu" id="base_menu_artefact" extends="base_menu_with_color">
|
||||
<action id="toggle_banner_hide" name="uimIhideBanner" handler="lua" params="artefact:onSelect(1)" icon="r2_icon_stop_possess.tga"/>
|
||||
<action id="toggle_banner_show" name="uimIshowBanner" handler="lua" params="artefact:onSelect(1)" icon="r2_icon_possess.tga"/>
|
||||
<action id="window_on_tp_close" name="uimIcloseOnTp" handler="lua" params="artefact:onSelect(2)" icon="r2_icon_acts_pushed.tga"/>
|
||||
<action id="window_on_tp_open" name="uimIopenOnTp" handler="lua" params="artefact:onSelect(2)" icon="r2_icon_acts.tga"/>
|
||||
<action id="window_refresh" name="uimIrefresh" handler="lua" params="artefact:onSelect(3)" icon="r2ed_tool_rotate.tga"/>
|
||||
<action id="window_compact" name="uimIcompact" handler="lua" params="artefact:onSelect(4)" icon="r2_icon_light_off_small.tga"/>
|
||||
<separator />
|
||||
</group>
|
||||
|
||||
<group id="artefact" type="container"
|
||||
w="526" h="479"
|
||||
x="0" y="0"
|
||||
pop_max_w="603"
|
||||
pop_max_h="479"
|
||||
pop_min_w="200"
|
||||
pop_min_h="234"
|
||||
header_color="UI:SAVE:WIN:COLORS:COM"
|
||||
posref="TL TL"
|
||||
global_color="true"
|
||||
global_color_over="true"
|
||||
right_button="true"
|
||||
savable="true"
|
||||
movable="true"
|
||||
lockable="true"
|
||||
active="false"
|
||||
openable="false"
|
||||
opened="false"
|
||||
resizer="true"
|
||||
header_active="false"
|
||||
on_active="proc"
|
||||
on_active_params="artefact_proc_active"
|
||||
on_deactive="proc"
|
||||
on_deactive_params="artefact_proc_deactive"
|
||||
on_close_button="lua"
|
||||
on_close_button_params="artefact:onClose()"
|
||||
on_resize="lua"
|
||||
on_resize_params="artefact:onResize()">
|
||||
<group id="header_opened"
|
||||
h="16"
|
||||
w="480"
|
||||
posref="TL TL"
|
||||
on_active="lua"
|
||||
on_active_params="artefact:onClickHeader(1)"
|
||||
group_onclick_r="lua"
|
||||
group_params_r="artefact:onMenu('ui:interface:base_menu_artefact')">
|
||||
<ctrl id="header_attach"
|
||||
type="button"
|
||||
button_type="push_button"
|
||||
posref="MR MR"
|
||||
y="0"
|
||||
x="-16"
|
||||
tx_normal="w_win_popin.tga"
|
||||
tx_pushed="w_win_popin.tga"
|
||||
tx_over="W_button_16_over.tga"
|
||||
onclick_l="lua"
|
||||
params_l="artefact:onSelect(5)" />
|
||||
<ctrl id="header_minimize"
|
||||
type="button"
|
||||
button_type="push_button"
|
||||
posref="ML ML"
|
||||
y="5"
|
||||
x="0"
|
||||
tx_normal="ark_move_z.tga"
|
||||
tx_pushed="ark_move_z.tga"
|
||||
tx_over="ark_move_z.tga"
|
||||
onclick_l="lua"
|
||||
params_l="artefact:onClickHeader(0)" />
|
||||
<group id="faketab"
|
||||
type="tab"
|
||||
child_resize_w="true"
|
||||
h="0"
|
||||
posref="TL TL"
|
||||
x="0"
|
||||
y="0">
|
||||
<ctrl style="tab_button_new"
|
||||
id="tab0"
|
||||
x="0"
|
||||
posref="TL TL"
|
||||
group="content:html"
|
||||
hardtext=""
|
||||
tooltip=""
|
||||
onclick_r=""
|
||||
params_r=""
|
||||
onclick_l=""
|
||||
params_l="" />
|
||||
</group>
|
||||
</group>
|
||||
<group id="content" x="0" y="0" w="0" h="0" posref="TL TL">
|
||||
<instance template="webig_html" />
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<tree node="artefact" />
|
||||
|
||||
<template name="webig_inv_item_artefact" ql0="" ql1="" ql2="" q0="" q1="" q2="" q3="" q4="" q5="" q6="" q7="" o0="" o1="" o2="" o3="" o4="" o5="" o6="" o7="" render_layer1="1" render_layer2="2" render_layer3="3" render_layer4="4" w="43" keep="true" img1="token_basic.tga" img2="" img3="" tooltip="" quality="" quantity="" overlay="" text="" text2="" color="255 255 255 255" gc1="true" gc2="true" color2="255 255 255 255" slotbg="w_slot_item.tga" slotbg_gc="true" bg="blank2.tga" tx_normal="blank.tga" tx_pushed="blank.tga" tx_over="blank.tga" ctrl_color="0 0 0 0" col_over="255 255 255 50" col_pushed="255 255 255 0" params_over="" params_l="" params_r="" x="0" y="0">
|
||||
<group id="#id" posref="MM MM" w="#w" h="43" x="#x" y="#y" sizeref="" render_layer="#render_layer1">
|
||||
<view type="bitmap" id="back" posref="ML ML" x="0" y="0" h="42" w="42" scale="true" render_layer="#render_layer1" texture="#slotbg" color="255 255 255 255" global_color="#slotbg_gc" />
|
||||
<view type="bitmap" id="bg" posparent="back" posref="MM MM" x="0" y="0" w="40" h="40" render_layer="#render_layer2" scale="false" texture="#bg" global_color="false" />
|
||||
<view type="bitmap" id="img1" posparent="back" posref="MM MM" x="0" y="0" w="40" h="40" scale="false" render_layer="#render_layer3" texture="#img1" global_color="false" />
|
||||
<view type="bitmap" id="img2" posparent="back" posref="MM MM" render_layer="#render_layer3" x="0" y="0" texture="#img2" global_color="false" />
|
||||
<view type="bitmap" id="img3" posparent="back" posref="MM MM" render_layer="#render_layer4" x="0" y="0" texture="#img3" global_color="false" />
|
||||
|
||||
<instance id="over" template="typo_ryzom_artefact" posref="TL TL" render_layer="6" x="1" y="-2" t0="#o0" t1="#o1" t2="#o2" t3="#o3" t4="#o4" t5="#o5" t6="#o6" t7="#o7" />
|
||||
<instance id="quantity" template="typo_ryzom_artefact" posref="BL BL" typo="numbers" render_layer="4" posparent="" x="2" y="2" t0="#q0" t1="#q1" t2="#q2" t3="#q3" t4="#q4" t5="#q5" t6="#q6" t7="#q7" />
|
||||
<instance id="quality" template="typo_ryzom_artefact" posref="BL BL" typo="numbers" render_layer="4" posparent="back" x="24" y="1" t0="#ql0" t1="#ql1" t2="#ql2" gc="true"/>
|
||||
|
||||
<view type="text" id="text1" multi_line="true" posref="TR TL" posparent="back" x="3" y="1" fontsize="8" hardtext_format="#text" color="#color1" shadow="true" global_color="#gc1" />
|
||||
<view type="text" id="text2" multi_line="true" posref="BL TL" posparent="text1" x="0" y="-2" fontsize="8" hardtext_format="#text2" color="#color2" shadow="true" global_color="#gc2" />
|
||||
<ctrl type="button" id="tooltip" posparent="back" scale="true" posref="MM MM" x="0" y="0" h="40" w="40" tooltip="#tooltip" instant_help="false" tooltip_posref="TR BL" />
|
||||
<ctrl type="button" id="ctrl" button_type="push_button" global_color_normal="false" posref="MM MM" posparent="back" x="0" y="0" tx_normal="#tx_normal" tx_pushed="#tx_pushed" tx_over="#tx_over" scale="true" w="0" sizeref="w" h="42" color="#ctrl_color" col_over="#col_over" col_pushed="#col_pushed" render_layer="#render_layer2" onover="lua" params_over="#params_over" onclick_l="lua" params_l="#params_l" onclick_r="lua" params_r="#params_r" />
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<template name="typo_ryzom_artefact" keep="true" typo="typo" posref="TL TL" posparent="" x="0" y="0" render_layer="3" t0="" t1="" t2="" t3="" t4="" t5="" t6="" t7="" gc="false" >
|
||||
<group id="#id" posref="#posref" posparent="#posparent" x="#x" y="#y" render_layer="#render_layer">
|
||||
<view type="bitmap" id="t0" posref="#posref" render_layer="#render_layer" texture="#typo_#t0.tga" global_color="#gc"/>
|
||||
<view type="bitmap" id="t1" posref="BR BL" posparent="t0" x="0" render_layer="#render_layer" texture="#typo_#t1.tga" global_color="#gc"/>
|
||||
<view type="bitmap" id="t2" posref="MR ML" posparent="t1" x="0" render_layer="#render_layer" texture="#typo_#t2.tga" global_color="#gc"/>
|
||||
<view type="bitmap" id="t3" posref="MR ML" posparent="t2" x="0" render_layer="#render_layer" texture="#typo_#t3.tga" global_color="#gc"/>
|
||||
<view type="bitmap" id="t4" posref="MR ML" posparent="t3" x="0" render_layer="#render_layer" texture="#typo_#t4.tga" global_color="#gc"/>
|
||||
<view type="bitmap" id="t5" posref="MR ML" posparent="t4" x="0" render_layer="#render_layer" texture="#typo_#t5.tga" global_color="#gc"/>
|
||||
<view type="bitmap" id="t6" posref="MR ML" posparent="t5" x="0" render_layer="#render_layer" texture="#typo_#t6.tga" global_color="#gc"/>
|
||||
<view type="bitmap" id="t7" posref="MR ML" posparent="t6" x="0" render_layer="#render_layer" texture="#typo_#t7.tga" global_color="#gc"/>
|
||||
</group>
|
||||
</template>
|
||||
|
||||
</interface_config>
|
@ -0,0 +1,226 @@
|
||||
|
||||
-- create the webig namespace without reseting if already created in an other file.
|
||||
if (webig==nil) then
|
||||
webig= {}
|
||||
end
|
||||
|
||||
if (webig.sheetLists==nil) then
|
||||
webig.sheetLists = {}
|
||||
end
|
||||
|
||||
function getUCtf8(text)
|
||||
local uctext = ucstring()
|
||||
if type(text) == "string" then
|
||||
uctext:fromUtf8(text)
|
||||
return uctext
|
||||
end
|
||||
return text
|
||||
end
|
||||
|
||||
function game:openUrlOnWebig(url, noblink, close_if_open)
|
||||
local winframe = getUI("ui:interface:open_url_window")
|
||||
if close_if_open and winframe ~= nil and winframe.active == true then
|
||||
winframe.active = false
|
||||
else
|
||||
WebBrowser:openWindow("open_url_window", url)
|
||||
winframe = getUI("ui:interface:open_url_window")
|
||||
winframe.opened=true
|
||||
winframe.active=true
|
||||
winframe.w = 830
|
||||
winframe.h = 600
|
||||
setTopWindow(winframe)
|
||||
if noblink == nil then
|
||||
winframe:blink(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
function webig:addSheet(dst, sheet, quality, quantity, worned, user_color, rm_class_type, rm_faber_stat_type)
|
||||
if quality == nil then quality=0 end
|
||||
if quantity == nil then quantity=0 end
|
||||
if worned == nil then worned=0 end
|
||||
if user_color == nil then user_color=0 end
|
||||
if rm_class_type == nil then rm_class_type=0 end
|
||||
if rm_faber_stat_type == nil then rm_faber_stat_type=0 end
|
||||
addDbProp(dst..":SHEET", sheet)
|
||||
addDbProp(dst..":WORNED", worned)
|
||||
addDbProp(dst..":QUALITY", quality)
|
||||
addDbProp(dst..":QUANTITY", quantity)
|
||||
addDbProp(dst..":USER_COLOR", user_color)
|
||||
addDbProp(dst..":RM_CLASS_TYPE", rm_class_type)
|
||||
addDbProp(dst..":RM_FABER_STAT_TYPE", rm_faber_stat_type)
|
||||
end
|
||||
|
||||
function webig:cleanSheets(db)
|
||||
delDbProp(db)
|
||||
end
|
||||
|
||||
function webig:addSheetList(name, ctrl, db, size)
|
||||
webig.sheetLists[name] = {}
|
||||
webig.sheetLists[name].ctrl = ctrl
|
||||
webig.sheetLists[name].db = db
|
||||
webig.sheetLists[name].selection = ""
|
||||
webig.sheetLists[name].size = size
|
||||
end
|
||||
|
||||
function webig:copyItems(src, dst)
|
||||
addDbProp(dst..":SHEET", getDbProp(src..":SHEET"))
|
||||
addDbProp(dst..":WORNED", getDbProp(src..":WORNED"))
|
||||
addDbProp(dst..":QUALITY", getDbProp(src..":QUALITY"))
|
||||
addDbProp(dst..":QUANTITY", getDbProp(src..":QUANTITY"))
|
||||
addDbProp(dst..":USER_COLOR", getDbProp(src..":USER_COLOR"))
|
||||
addDbProp(dst..":RM_CLASS_TYPE", getDbProp(src..":RM_CLASS_TYPE"))
|
||||
addDbProp(dst..":RM_FABER_STAT_TYPE", getDbProp(src..":RM_FABER_STAT_TYPE"))
|
||||
end
|
||||
|
||||
function webig:swapItems(src, dst)
|
||||
local sheet = getDbProp(dst..":SHEET")
|
||||
local worned = getDbProp(dst..":WORNED")
|
||||
local quality = getDbProp(dst..":QUALITY")
|
||||
local quantity = getDbProp(dst..":QUANTITY")
|
||||
local user_color = getDbProp(dst..":USER_COLOR")
|
||||
local rm_class_type = getDbProp(dst..":RM_CLASS_TYPE")
|
||||
local rm_faber_stat_type = getDbProp(dst..":RM_FABER_STAT_TYPE")
|
||||
|
||||
addDbProp(dst..":SHEET", getDbProp(src..":SHEET"))
|
||||
addDbProp(dst..":WORNED", getDbProp(src..":WORNED"))
|
||||
addDbProp(dst..":QUALITY", getDbProp(src..":QUALITY"))
|
||||
addDbProp(dst..":QUANTITY", getDbProp(src..":QUANTITY"))
|
||||
addDbProp(dst..":USER_COLOR", getDbProp(src..":USER_COLOR"))
|
||||
addDbProp(dst..":RM_CLASS_TYPE", getDbProp(src..":RM_CLASS_TYPE"))
|
||||
addDbProp(dst..":RM_FABER_STAT_TYPE", getDbProp(src..":RM_FABER_STAT_TYPE"))
|
||||
|
||||
addDbProp(src..":SHEET", sheet)
|
||||
addDbProp(src..":WORNED", worned)
|
||||
addDbProp(src..":QUALITY", quality)
|
||||
addDbProp(src..":QUANTITY", quantity)
|
||||
addDbProp(src..":USER_COLOR", user_color)
|
||||
addDbProp(src..":RM_CLASS_TYPE", rm_class_type)
|
||||
addDbProp(src..":RM_FABER_STAT_TYPE", rm_faber_stat_type)
|
||||
end
|
||||
|
||||
function webig:deleteItem(src)
|
||||
addDbProp(src..":SHEET", 0)
|
||||
addDbProp(src..":WORNED", 0)
|
||||
addDbProp(src..":QUALITY", 0)
|
||||
addDbProp(src..":QUANTITY", 0)
|
||||
addDbProp(src..":USER_COLOR", 0)
|
||||
addDbProp(src..":RM_CLASS_TYPE", 0)
|
||||
addDbProp(src..":RM_FABER_STAT_TYPE", 0)
|
||||
end
|
||||
|
||||
function webig:paramDbSheetSlot(sheet_list, ctrl)
|
||||
local ctrlSheet = webig.sheetLists[sheet_list].ctrl:find("list:"..ctrl)
|
||||
if ctrlSheet ~= nil then
|
||||
ctrlSheet.left_click="lua"
|
||||
ctrlSheet.left_click_params="webig:addOrRemoveDbSheet(\'"..sheet_list.."\', \'"..ctrl.."\')"
|
||||
ctrlSheet.dragable=true
|
||||
ctrlSheet.can_drop=true
|
||||
ctrlSheet.on_drop="lua"
|
||||
ctrlSheet.on_drop_params="webig:dropDbSheet(\'"..sheet_list.."\', \'"..ctrl.."\', \'%src\')"
|
||||
ctrlSheet.on_can_drop="lua"
|
||||
ctrlSheet.on_can_drop_params="webig:canDropDbSheet(\'"..sheet_list.."\', \'"..ctrl.."\', \'%src\')"
|
||||
end
|
||||
end
|
||||
|
||||
function webig:paramDbSheetSelect(sheet_list, ctrl, lua_function)
|
||||
local ctrlSheet = webig.sheetLists[sheet_list].ctrl:find("list:"..ctrl)
|
||||
if ctrlSheet ~= nil then
|
||||
ctrlSheet.left_click="lua"
|
||||
ctrlSheet.left_click_params=lua_function.."(\'"..sheet_list.."\', \'"..ctrl.."\')"
|
||||
ctrlSheet.dragable=false
|
||||
ctrlSheet.can_drop=false
|
||||
end
|
||||
end
|
||||
|
||||
function webig:canDropDbSheet(sheet_list, ctrl, src)
|
||||
webig.sheetLists[sheet_list].ctrl:find("list:"..ctrl).can_drop=true
|
||||
end
|
||||
|
||||
function webig:dropDbSheet(sheet_list, ctrl, src)
|
||||
local db = webig.sheetLists[sheet_list].db
|
||||
local sl_id = webig.sheetLists[sheet_list].ctrl.id
|
||||
if (string.sub(src, 1, string.len(sl_id)) == sl_id) then -- copy from same list sheet
|
||||
local pos=nil
|
||||
for i=1, string.len(src) do
|
||||
if string.sub(src, i, i) == ":" then
|
||||
pos = i+1
|
||||
end
|
||||
end
|
||||
id = string.sub(src, pos, string.len(src))
|
||||
webig:swapItems(db..":"..id, db..":"..ctrl)
|
||||
else
|
||||
slot = getUI(src)
|
||||
if slot ~= nil then
|
||||
id = findReplaceAll(src, slot.parent.id..":", "")
|
||||
webig:copyItems("LOCAL:INVENTORY:BAG:"..id, db..":"..ctrl)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function webig:addOrRemoveDbSheet(sheet_list, ctrl)
|
||||
local db = webig.sheetLists[sheet_list].db
|
||||
if getDbProp(db..":"..ctrl..":SHEET") == 0 then -- Add item
|
||||
webig:AddDbSheet(sheet_list, ctrl)
|
||||
else
|
||||
webig:removeDbSheetQuantity(sheet_list, ctrl)
|
||||
end
|
||||
end
|
||||
|
||||
function webig:AddDbSheet(sheet_list, ctrl)
|
||||
runAH(nil, "enter_modal", "group=ui:interface:webig_html_modal")
|
||||
local whm = getUI("ui:interface:webig_html_modal")
|
||||
whm.child_resize_h=false
|
||||
whm.h = 44*webig.sheetLists[sheet_list].size
|
||||
whm.w = 224
|
||||
whm = getUI("ui:interface:webig_html_modal:html")
|
||||
if whm ~= nil then
|
||||
whm:refresh() -- url need be setted before
|
||||
end
|
||||
webig.sheetLists[sheet_list].selection = ctrl
|
||||
end
|
||||
|
||||
function webig:removeDbSheetQuantity(sheet_list, ctrl)
|
||||
local db = webig.sheetLists[sheet_list].db
|
||||
webig:copyItems(db..":"..ctrl, "UI:DROP_DESTROY_ITEM:ITEM")
|
||||
runAH(nil, "set_keyboard_focus", "select_all=true|target=ui:interface:webig_drop_destroy_item_quantity_modal:edit:eb")
|
||||
getUI("ui:interface:webig_drop_destroy_item_quantity_modal:ok_cancel:ok").onclick_l="lua"
|
||||
getUI("ui:interface:webig_drop_destroy_item_quantity_modal:ok_cancel:ok").params_l="webig:doRemoveDbSheetQuantity(\'"..sheet_list.."\', \'"..ctrl.."\')"
|
||||
getUI("ui:interface:webig_drop_destroy_item_quantity_modal:edit:eb").on_enter="lua"
|
||||
getUI("ui:interface:webig_drop_destroy_item_quantity_modal:edit:eb").on_enter_params="webig:doRemoveDbSheetQuantity(\'"..sheet_list.."\', \'"..ctrl.."\')"
|
||||
runAH(nil, "enter_modal", "group=ui:interface:webig_drop_destroy_item_quantity_modal")
|
||||
setDbProp("UI:DROP_DESTROY_ITEM:ITEM:QUANTITY", getDbProp(db..":"..ctrl..":QUANTITY"))
|
||||
getUI("ui:interface:webig_drop_destroy_item_quantity_modal:edit:eb").input_string=tostring(getDbProp(db..":"..ctrl..":QUANTITY"))
|
||||
end
|
||||
|
||||
function webig:doRemoveDbSheetQuantity(sheet_list, ctrl)
|
||||
local db = webig.sheetLists[sheet_list].db
|
||||
runAH(nil, "leave_modal", "group=ui:interface:webig_drop_destroy_item_quantity_modal")
|
||||
local new_quantity = tonumber(getUI("ui:interface:webig_drop_destroy_item_quantity_modal:edit:eb").input_string)
|
||||
local current_quantity = getDbProp(db..":"..ctrl..":QUANTITY")
|
||||
if new_quantity >= current_quantity then
|
||||
webig:deleteItem(db..":"..ctrl)
|
||||
else
|
||||
addDbProp(db..":"..ctrl..":QUANTITY", new_quantity)
|
||||
end
|
||||
end
|
||||
|
||||
function getUICallerRoot()
|
||||
return getUI(getUICaller().id:match("(ui:interface:[^:]*):?"))
|
||||
end
|
||||
|
||||
function webig:openUrl(url)
|
||||
getUI("ui:interface:web_transactions"):find("html"):browse(url)
|
||||
end
|
||||
|
||||
--assert(nil, "RELOADABLE SCRIPT")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,249 @@
|
||||
<!-- ****************************************** -->
|
||||
<!-- * WEBIG WIDGETS * -->
|
||||
<!-- ****************************************** -->
|
||||
<interface_config>
|
||||
<root id="interface" x="0" y="0" w="800" h="600" active="true" />
|
||||
<lua file="webig.lua" />
|
||||
<lua file="json.lua" />
|
||||
<lua file="base64.lua" />
|
||||
<lua file="sceneedit.lua" />
|
||||
<lua file="ark.lua" />
|
||||
|
||||
<!-- //////////// STYLE : webigchat_desc /////////// -->
|
||||
<style style="webigchat_desc" type="text" fontsize="12" justification="dont_clip_word" color="0 0 0 255" global_color="false" multi_line="true" multi_line_space="0" line_maxw="320" multi_line_maxw_only="true" />
|
||||
<!-- //////////// STYLE : webigchat_option /////////// -->
|
||||
<style style="webigchat_option" type="text" format_taged="true" fontsize="10" justification="dont_clip_word" color="0 0 64 255" underlined="true" global_color="false" multi_line="true" multi_line_space="0" line_maxw="320" multi_line_maxw_only="true" />
|
||||
<!-- //////////// STYLE : webigchat_option_but /////////// -->
|
||||
<style style="webigchat_option_but" type="button_link" posref="TL TL" x="0" y="0" sizeref="wh" w="0" h="0" onclick_l="proc" params_l="proc_browse_faq" />
|
||||
|
||||
<!-- //////////// TEMPLATE : webig_3dbulle_L /////////// -->
|
||||
<template name="webig_3dbulle_L" id="" keep="true">
|
||||
<group id="#id" type="in_scene_bubble" header_active="false" options="no_bordure" openable="false" savable="false" resizer="true" movable="false" right_button="false" opened="true" child_resize_w="true" w="0" max_w="512" min_w="48" child_resize_h="true" in_scene_offset_x="-95" win_priority="%win_priority_world_space" posref="BL BR" use_cursor="true">
|
||||
<group id="header_opened" x="0" y="0" child_resize_w="true" w="0" child_resize_h="true" h="0" max_w="512" min_w="48" max_h="256" min_h="48" posref="TL TL">
|
||||
<group id="window" x="0" y="0" child_resize_w="true" child_resize_wmargin="10" child_resize_h="true" child_resize_hmargin="10" posref="TL TL">
|
||||
<group id="back" x="0" y="0" w="0" h="0" sizeref="wh" posref="TL TL">
|
||||
<view type="bitmap" id="win_M" posref="MM MM" scale="true" sizeref="wh" w="-10" h="-10" texture="Bulle_M.tga" global_color="false" />
|
||||
<view type="bitmap" id="win_T" posparent="win_M" posref="TL BL" scale="true" sizeref="w" w="0" h="5" texture="Bulle_T.tga" global_color="false" />
|
||||
<view type="bitmap" id="win_B" posparent="win_M" posref="BL TL" scale="true" sizeref="w" w="0" h="5" texture="Bulle_B.tga" global_color="false" />
|
||||
<view type="bitmap" id="win_L" posparent="win_M" posref="TL TR" scale="true" sizeref="h" w="5" h="0" texture="Bulle_L.tga" global_color="false" />
|
||||
<view type="bitmap" id="win_R" posparent="win_M" posref="TR TL" scale="true" sizeref="h" w="5" h="0" texture="Bulle_R.tga" global_color="false" />
|
||||
<view type="bitmap" id="win_TL" posref="TL TL" texture="Bulle_TL.tga" global_color="false" />
|
||||
<view type="bitmap" id="win_TR" posref="TR TR" texture="Bulle_TR.tga" global_color="false" />
|
||||
<view type="bitmap" id="win_BL" posref="BL BL" texture="Bulle_BL.tga" global_color="false" />
|
||||
<view type="bitmap" id="win_BR" posref="BR BR" texture="Bulle_BR.tga" global_color="false" />
|
||||
</group>
|
||||
<view style="webigchat_desc" id="text" posref="TL TL" x="5" y="-24" />
|
||||
<ctrl type="button" button_type="push_button" tx_normal="Bulle_next.tga" tx_pushed="Bulle_next.tga" tx_over="Bulle_next.tga" color="255 255 255 255" col_over="255 255 255 0" col_pushed="255 255 255 255" global_color_normal="false" global_color_over="false" global_color_pushed="false" tooltip="uiNext" id="but_next" posref="TR TR" x="-5" y="-5" onclick_l="bubble_next" active="false" />
|
||||
<ctrl type="button" button_type="push_button" tx_normal="Bulle_quit.tga" tx_pushed="Bulle_quit.tga" tx_over="Bulle_quit.tga" color="255 255 255 255" col_over="255 255 255 0" col_pushed="255 255 255 255" global_color_normal="false" global_color_over="false" global_color_pushed="false" tooltip="uiSkip" id="but_skip" posref="TL TR" posparent="but_next" x="-4" y="0" onclick_l="bubble_skip" active="false" />
|
||||
<!-- Yoyo: Fake to have minimum bubble size -->
|
||||
<group id="min_w" posparent="text" posref="TL TL" x="0" y="0" w="48" h="14" />
|
||||
<view style="webigchat_option" id="opt0" posparent="text" posref="BL TL" x="16" y="-4" />
|
||||
<view style="webigchat_option" id="opt1" posparent="opt0" posref="BL TL" x="0" y="-4" />
|
||||
<view style="webigchat_option" id="opt2" posparent="opt1" posref="BL TL" x="0" y="-5" />
|
||||
<view style="webigchat_option" id="opt3" posparent="opt2" posref="BL TL" x="0" y="-5" />
|
||||
<view style="webigchat_option" id="opt4" posparent="opt3" posref="BL TL" x="0" y="-5" />
|
||||
<view style="webigchat_option" id="opt5" posparent="opt4" posref="BL TL" x="0" y="-5" />
|
||||
<view style="webigchat_option" id="opt6" posparent="opt5" posref="BL TL" x="0" y="-5" />
|
||||
<view style="webigchat_option" id="opt7" posparent="opt6" posref="BL TL" x="0" y="-5" />
|
||||
<ctrl style="webigchat_option_but" id="optb0" posparent="opt0" params_l="0" />
|
||||
<ctrl style="webigchat_option_but" id="optb1" posparent="opt1" params_l="1" />
|
||||
<ctrl style="webigchat_option_but" id="optb2" posparent="opt2" params_l="2" />
|
||||
<ctrl style="webigchat_option_but" id="optb3" posparent="opt3" params_l="3" />
|
||||
<ctrl style="webigchat_option_but" id="optb4" posparent="opt4" params_l="4" />
|
||||
<ctrl style="webigchat_option_but" id="optb5" posparent="opt5" params_l="5" />
|
||||
<ctrl style="webigchat_option_but" id="optb6" posparent="opt6" params_l="6" />
|
||||
<ctrl style="webigchat_option_but" id="optb7" posparent="opt7" params_l="7" />
|
||||
</group>
|
||||
<view type="bitmap" id="win_talk" posref="BR TR" x="-24" y="2" posparent="window" texture="Bulle_Say_L.tga" global_color="false" />
|
||||
</group>
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<!-- //////////// TEMPLATE : webig_modal /////////// -->
|
||||
<group type="modal" id="webig_html_modal" w="360" posref="TL TL" child_resize_hmargin="8" child_resize_h="true" x="0" y="0" active="false" options="skin_modal" escapable="true" global_color="true">
|
||||
<group id="html" type="html" posref="MM MM" url="" title_prefix="uiQuickhelpTitle" sizeref="wh" x="0" y="0" w="0" h="0" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="patch_off.tga" checkbox_bitmap_pushed="patch_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
|
||||
<group id="black" posref="BR BR" sizeref="hw" w="-16" h="-12" inherit_gc_alpha="true"/>
|
||||
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" global_color="false"/>
|
||||
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="2" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000"/>
|
||||
<ctrl style="skin_scroll" id="scroll_bar" />
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<!-- //////////// MODAL : webig_exchange_choose_in_bag /////////// -->
|
||||
<group type="modal" id="webig_exchange_choose_in_bag" w="360" child_resize_hmargin="8" child_resize_h="true" x="0" y="0" active="false" options="skin_modal" escapable="true" global_color="true">
|
||||
<view type="text" id="title" posref="TL TL" x="6" y="-8" color="255 255 255 255" global_color="false" fontsize="10" shadow="true" hardtext="uiBCTitleMPItemType"/>
|
||||
<group type="list_sheet" id="list" nature="item" posref="TL TL" x="4" y="-20" value="UI:VARIABLES:BOTCHAT:FILTER_ITEM_TYPE_SELECTED" force_item_background_generic="true" wspace="2" hspace="2" array="false" w="350" lmargin="0" rmargin="0" tmargin="2" bmargin="2" child_resize_h="true" onclick_l="confirm_change_botchat_buy_filter_item_type" on_tooltip="botchat_tt_item_type" use_quantity="false" use_quality="false" display_empty_slot="true"/>
|
||||
<view type="text" id="no_filter" posparent="ctrl" posref="TL MM" x="24" y="-46" fontsize="12" shadow="true" case_mode="%case_upper" global_color="false" hardtext="uiBCNoItemTypeFilter"/>
|
||||
</group>
|
||||
|
||||
<!-- //////////// MODAL : webig_drop_destroy_item_quantity_modal /////////// -->
|
||||
<group type="modal" id="webig_drop_destroy_item_quantity_modal" exit_click_out="true" posref="TL TL" w="180" h="80" x="-8" y="8" options="skin_modal">
|
||||
<ctrl type="sheet" id="sheet" value="UI:DROP_DESTROY_ITEM:ITEM" posparent="parent" posref="MM MM" x="-26" y="0"/>
|
||||
<view type="text" id="x" posparent="sheet" posref="MR MM" x="8" y="0" color="255 255 255 255" fontsize="12" shadow="true" hardtext="X"/>
|
||||
<instance template="edit_box_widget" entry_type="positive_integer" id="edit" text_ref="TR TR" text_y="-1" fontsize="12" posparent="sheet" posref="MR ML" x="16" text_x="-2" w="32" prompt="" enter_loose_focus="false" multi_line="false" max_num_chars="3" onchange="editbox_number" onchange_params="value=UI:DROP_DESTROY_ITEM:ITEM:QUANTITY|update_text=false" onenter="proc" params="webig_drop_destroy_item_quantity_modal_ok" max_historic="0"/>
|
||||
<instance template="button_ok_cancel" posref="BR BR" x="-4" y="4" onclick_ok="" onclick_ok_param="" onclick_cancel="leave_modal" onclick_cancel_param=""/>
|
||||
<link expr="eq(@UI:DROP_DESTROY_ITEM:DROP_MODE,1)" target="drop_text:active"/>
|
||||
<link expr="ne(@UI:DROP_DESTROY_ITEM:DROP_MODE,1)" target="destroy_text:active"/>
|
||||
</group>
|
||||
|
||||
<!-- //////////// TEMPLATE : webig_list_sheet /////////// -->
|
||||
<template name="webig_list_sheet" keep="true" db="" w="200" y="-10" x="10">
|
||||
<group id="list_group" w="#w" y="#y" x="#x" posref="TL TL" child_resize_h="true" >
|
||||
<group type="list_sheet" nature="item" id="list" posref="TL TL" x="0" y="0" child_resize_h="true" wspace="8" hspace="8" value="#db" array="true" auto_grayed="true" onclick_r="open_item_help" tooltip="uittSelectMp" />
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<!-- //////////// TEMPLATE : webig_frame_borderless /////////// -->
|
||||
<template name="webig_frame_borderless" keep="true" w="200" h="200" x="0" y="0" movable="true">
|
||||
<group title="" id="content" type="container" posref="MM MM" movable="#movable" pop_max_h="#h" pop_min_h="#h" pop_min_w="#w" pop_max_w="#w" opened="false" openable="false" options="compass" header_active="true" right_button="false">
|
||||
<group id="html" type="html" posref="TL TL" url="" title_prefix="uiQuickhelpTitle" sizeref="wh" x="0" y="0" w="0" h="0" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="patch_off.tga" checkbox_bitmap_pushed="patch_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
|
||||
<group id="black" posref="BR BR" sizeref="hw" inherit_gc_alpha="true"/>
|
||||
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" global_color="false"/>
|
||||
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="2" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000"/>
|
||||
<ctrl style="skin_scroll" id="scroll_bar" />
|
||||
</group>
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<!-- //////////// TEMPLATE : webig_frame_skin_modal /////////// -->
|
||||
<template name="webig_frame_skin_modal" keep="true" w="200" h="200" x="0" y="0">
|
||||
<group id="group" type="container" active="true" w="#w" h="#h" x="#x" y="#y" posref="MM MM" options="skin_modal" opened="true" openable="true" movable="true" header_color="UI:SAVE:WIN:COLORS:COM">
|
||||
<group id="header_closed" x="0" y="0" w="#w" h="16" posref="TL TL"></group>
|
||||
<group id="header_opened" x="0" y="0" w="#w" h="16" posref="TL TL"></group>
|
||||
<group id="content" x="0" y="0" w="0" h="0" posref="TL TL ">
|
||||
<group id="html" type="html" posref="MM MM" url="" title_prefix="uiQuickhelpTitle" sizeref="wh" x="0" y="0" w="0" h="0" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="patch_off.tga" checkbox_bitmap_pushed="patch_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline" >
|
||||
<group id="black" posref="BR BR" sizeref="hw" w="-16" h="-12" inherit_gc_alpha="true"/>
|
||||
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" global_color="false"/>
|
||||
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="2" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000"/>
|
||||
<ctrl style="skin_scroll" id="scroll_bar" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<template name="money_tmpl" keep="true" posparent="parent" x="0" y="0" w="110" h="32" posref="TL TL" id="" value="?" icon="money_32.tga" tooltip="uittPlayerMoney">
|
||||
<group id="#id" posparent="#posparent" posref="#posref" w="#w" h="#h" x="#x" y="#y">
|
||||
<view type="bitmap" id="icone" posref="ML ML" texture="#icon" scale="true" w="32" global_color="false" />
|
||||
<instance template="box_widget" id="box1" posref="ML ML" sizeref="w" w="-18" h="16" x="18" />
|
||||
<view type="text_number" id="val1" posparent="box1" posref="MR MR" x="-3" y="0" color="135 243 28 255" shadow="true" fontsize="10" value="#value" global_color="false" positive="true" format="true" />
|
||||
<ctrl type="tooltip" id="tt" posparent="box1" posref="TL TL" sizeref="wh" w="0" h="0" tooltip="#tooltip" />
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<!-- //////////// TEMPLATE : webig_bot_chat_buy /////////// -->
|
||||
<template name="webig_bot_chat_buy" keep="true" title="uiBuy" tooltip="Dappers" icon_points="money_seve.tga" buyto_text="uiBuyFrom" buyto_name="?">
|
||||
<group id="#id" type="container" openable="false" opened="true" movable="true" resizer="false" savable="false" header_color="UI:SAVE:WIN:COLORS:BOT" global_color="false" escapable="true" posref="BL TL" min_w="450" max_w="450" w="450" x="352" y="200" pop_max_h="700" max_h="2000" active="true" title="#title">
|
||||
<group id="header_opened" child_resize_h="true" w="600" x="0" y="0" posref="TL TL">
|
||||
<instance template="bc_border_text" id="intro" />
|
||||
<group id="trade_content" sizeref="w" w="0" child_resize_h="true" child_resize_hmargin="30" posref="BL TL" posparent="intro" y="0">
|
||||
<view type="text" id="buy_title" multi_line="1" posparent="buy_back" posref="TL BL" x="0" y="35" color="255 255 255 255" fontsize="12" shadow="true" hardtext="#buyto_text" />
|
||||
<view type="text" id="vendor_name" multi_line="1" posparent="buy_back" posref="TL BL" x="10" y="18" color="255 255 255 255" global_color="false" fontsize="12" shadow="true" hardtext="#buyto_name" />
|
||||
<view type="text" id="buy_info" multi_line="1" posparent="buy_back" posref="TL BL" x="10" y="2" color="255 255 255 255" global_color="false" fontsize="12" shadow="true" hardtext="" />
|
||||
<instance template="box_widget" id="buy_back" posref="TR TR" w="430" h="420" x="0" y="-48" />
|
||||
<!-- BUY -->
|
||||
<group id="buy" type="html" posparent="buy_back" posref="MM MM" sizeref="wh" w="0" h="0" url="" title_prefix="uiQuickhelpTitle" x="5" y="0" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="patch_off.tga" checkbox_bitmap_pushed="patch_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline">
|
||||
<group id="black" posref="TL TL" sizeref="hw" inherit_gc_alpha="true" />
|
||||
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" global_color="false" />
|
||||
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="10" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000" />
|
||||
<ctrl style="skin_scroll" id="scroll_bar" />
|
||||
</group>
|
||||
<instance template="money_tmpl" id="points" posref="BR TR" x="0" y="-8" w="150" icon="#icon_points" posparent="buy_back" tooltip="#tooltip" value="UI:TEMP:ARK_SHOP_MONEY" />
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<!-- //////////// TEMPLATE : webig_bot_chat_buy_item /////////// -->
|
||||
<template name="webig_bot_chat_buy_item" id="" money_tooltip="uiDappers" money_icon="money_seve.tga" onclick="" infosclick="" infos_text="uiTS_Items" ok_text="uiBuy" tooltip_ok="" keep="true" x="0" y="0">
|
||||
<group id="#id" type="container" posref="TL TL" min_w="240" w="408" x="#x" y="#y" pop_min_h="320" pop_max_h="420" min_h="320" max_h="420" active="true" openable="false" opened="true" movable="true" resizer="false" savable="false" title="uiBotChatMissions" escapable="true" header_color="UI:SAVE:WIN:COLORS:BOT" global_color="false">
|
||||
<group id="header_opened" h="400" w="600" x="0" y="0" posref="TL TL">
|
||||
<group id="top" posref="TL TL" sizeref="wh" x="2" y="-2">
|
||||
<group id="buy_sell_slot" type="html" posref="TL TL" w="48" h="48" url="" x="2" y="-20" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="patch_off.tga" checkbox_bitmap_pushed="patch_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline">
|
||||
<group id="black" posref="TL TL" sizeref="hw" inherit_gc_alpha="true" />
|
||||
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" global_color="false" />
|
||||
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="2" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000" />
|
||||
<ctrl style="skin_scroll" id="scroll_bar" />
|
||||
</group>
|
||||
|
||||
<group id="standard_price" posparent="buy_sell_slot" posref="TR TL" x="0" y="-2" w="335" h="50">
|
||||
<instance template="money_tmpl" id="item_price" tooltip="#money_tooltip" icon="#money_icon" posref="ML ML" x="0" w="130" h="32" value="UI:TEMP:ARK_MONEY_PRICE" />
|
||||
<instance template="edit_box_widget" id="edit" posref="MM MM" x="0" text_x="0" text_ref="BR BR" w="36" backup_father_container_pos="true" prompt="" value="1" enter_loose_focus="true" multi_line="false" max_num_chars="4" onenter="lua" params="arkNpcShop:CheckMoney()" onchange="lua" onchange_params="arkNpcShop:CheckMoney()" enter_recover_focus="true" reset_focus_on_hide="true" max_historic="0" entry_type="positive_integer" />
|
||||
<instance template="money_tmpl" id="item_total_price" tooltip="#money_tooltip" icon="#money_icon" posref="MR MR" x="0" w="130" h="32" value="UI:TEMP:ARK_MONEY_TOTAL" />
|
||||
<view type="text" id="cross" posref="ML MR" posparent="edit" color="255 255 255 255" fontsize="10" x="-4" y="0" shadow="true" hardtext="X" />
|
||||
<view type="text" id="equal" posref="MR ML" posparent="edit" color="255 255 255 255" x="2" y="0" fontsize="16" shadow="true" hardtext="=" />
|
||||
<view type="text" id="unit_price_header" posparent="item_price" posref="TR BR" color="255 255 255 255" fontsize="10" x="0" y="-5" shadow="true" hardtext="uiUnitValue" />
|
||||
<view type="text" id="quantity_header" posref="TM TM" color="255 255 255 255" fontsize="10" x="0" y="0" shadow="true" hardtext="uiQtty" />
|
||||
<view type="text" id="total_price_header" posparent="item_total_price" posref="TR BR" color="255 255 255 255" fontsize="10" x="0" y="-5" shadow="true" hardtext="uiImmediatePrice" />
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group id="scroll_text" posref="TL TL" h="200" y="-20" sizeref="w" w="0">
|
||||
<instance template="inner_thin_border_group" />
|
||||
<group id="infos" type="html" posref="MM MM" sizeref="hw" w="0" h="0" url="" title_prefix="uiQuickhelpTitle" x="0" y="0" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color_global_color="true" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="12" h1_font_size="16" h2_font_size="14" h3_font_size="13" h4_font_size="12" h5_font_size="11" h6_font_size="11" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="patch_off.tga" checkbox_bitmap_pushed="patch_on.tga" checkbox_bitmap_over="" background_bitmap_view="" home="" browse_next_time="false" timeout="0" form_text_area_group="edit_box_widget_multiline">
|
||||
<group id="black" posref="TL TL" sizeref="hw" inherit_gc_alpha="true" />
|
||||
<view type="bitmap" id="black2" posparent="black" posref="MM MM" sizeref="wh" w="-2" h="-2" inherit_gc_alpha="true" scale="true" texture="blank.tga" />
|
||||
<group type="list" id="text_list" fontsize="9" posref="TL TL" posparent="black" x="2" y="-2" space="0" sizeref="hw" w="-4" h="-4" maxelements="2000" />
|
||||
<ctrl style="skin_scroll" id="scroll_bar" />
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<group id="item_preview" active="false" posref="TL TL" sizeref="w" w="200" h="320" x="0" y="-70">
|
||||
<scene3d id="scene_item_preview" sizeref="wh" w="-2" h="-2" posref="TL TL" x="1" curcam="cam_item_preview" user_interaction="true" ambient="128 96 64" sun_ambient="70 70 70" sun_diffuse="255 255 196" sun_specular="0 0 0" sun_direction="-1.0 1.0 -1.0" rotz_factor="0.017" roty_factor="0.005" dist_factor="0.2" camz="10" dist_limit_min="20.0" dist_limit_max="80.0">
|
||||
<character3d id="char" dblink="UI:TEMP:CHAR3D" pos="0.0 0.0 -1.7" rot="0.0 0.0 -60.0" />
|
||||
<camera id="cam_item_preview" fov="5" pos="0.0 -50.0 0.0" target="0.0 0.0 -0.85" roll="0" />
|
||||
<light id="back" pos="0.0 28.2 1.6" color="96 64 32" near="1.0" far="4.0" />
|
||||
<light id="lgt" pos="0.0 25.3 2.48" color="255 255 255" near="1.0" far="4.0" />
|
||||
</scene3d>
|
||||
</group>
|
||||
|
||||
<ctrl style="button_ok" id="ok" x="-7" y="-7" posparent="scroll_text" posref="BR TR" text_y="0" onclick_l="lua" params_l="#onclick" hardtext="#ok_text" tooltip="#tooltip_ok" />
|
||||
<ctrl style="button_ok" id="desc" x="-5" y="0" posparent="ok" posref="BL BR" text_y="0" onclick_l="lua" params_l="#infosclick" hardtext="#infos_text" tooltip="#infos_text" />
|
||||
</group>
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<!-- //////////// TEMPLATE : webig_inv_item /////////// -->
|
||||
<template name="webig_inv_item" render_layer1="1" render_layer2="2" render_layer3="3" w="45" keep="true" img1="token_basic.tga" img2="" img3="" tooltip="" quality="" quantity="" overlay="" text="" text2="" color="255 255 255 255" gc1="true" gc2="true" color2="255 255 255 255" bg="w_slot_item.tga" params_l="" params_r="" x="0" y="0">
|
||||
<group id="#id" posref="MM MM" w="#w" h="45" x="#x" y="#y" sizeref="" render_layer="#render_layer1">
|
||||
<view type="bitmap" id="back" posref="ML ML" x="0" y="0" render_layer="#render_layer1" texture="#bg" global_color="false" />
|
||||
<view type="bitmap" id="img1" posref="ML ML" x="0" y="0" render_layer="#render_layer2" texture="#img1" global_color="false" />
|
||||
<view type="bitmap" id="img2" posref="ML ML" render_layer="#render_layer2" x="0" y="0" texture="#img2" global_color="false" />
|
||||
<view type="bitmap" id="img3" posref="ML ML" render_layer="#render_layer2" x="0" y="0" texture="#img3" global_color="false" />
|
||||
<view type="text" id="overlay" posref="TL TL" posparent="img1" render_layer="#render_layer2" x="0" y="0" hardtext="#overlay" fontsize="8" color="255 255 255 255" shadow="true" global_color="false" />
|
||||
<view type="text" id="quantity" posref="BL BL" posparent="img1" render_layer="#render_layer3" x="0" y="0" hardtext="#quantity" fontsize="8" color="255 255 255 255" shadow="true" global_color="false" />
|
||||
<view type="text" id="quality" posref="BR BR" posparent="img1" render_layer="#render_layer3" x="-1" y="0" hardtext="#quality" fontsize="8" color="255 255 255 255" shadow="true" global_color="true" />
|
||||
<view type="text" id="text1" posref="TR TL" posparent="img1" x="3" y="1" fontsize="8" hardtext="#text" color="#color1" shadow="true" global_color="#gc1" />
|
||||
<view type="text" id="text2" posref="BL TL" posparent="text1" x="0" y="2" fontsize="8" hardtext="#text2" color="#color2" shadow="true" global_color="#gc2" />
|
||||
<ctrl type="button" id="ctrl" button_type="push_button" global_color_normal="false" posref="ML ML" x="1" y="0" tx_normal="blank.tga" tx_pushed="blank.tga" tx_over="blank.tga" scale="true" w="40" h="40" tooltip="#tooltip" color="0 0 0 0" col_over="255 255 255 0" col_pushed="255 255 255 0" render_layer="#render_layer1" onclick_l="lua" params_l="#params_l" onclick_r="lua" params_r="#params_r" />
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<template name="html_push_button" id="" texture="" posparent="parent" posref="TL TL" onclick="" onclick_param="" x="0" y="0" keep="true">
|
||||
<group id="#id" posparent="#posparent" posref="#posref" child_resize_w="true" child_resize_h="true" x="#x" y="#y">
|
||||
<ctrl type="button" id="b" button_type="push_button" pushed="false" tx_normal="#texture" tx_pushed="#texture" tx_over="#texture" color="255 255 255 255" col_pushed="255 255 255 255" col_over="255 255 255 0" onclick_l="#onclick" params_l="#onclick_param" />
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<template name="lesson_template" bg="storyline_lesson_bg" script="0" parent="0" open_script="false" check_color="255 255 255 200" over="80" pushed="90" waiting="true" started="false" finished="false" event="" lesson="">
|
||||
<group id="#id" posref="MM MM" w="510" h="70">
|
||||
<view type="bitmap" id="back" posref="ML ML" texture="#bg.tga" global_color="false" />
|
||||
<group id="html" type="webig_html" posref="TL TL" global_color="false" title_prefix="" sizeref="wh" x="30" y="0" w="510" h="70" background_color="0 0 0 0" error_color="255 240 48 255" link_color="240 155 100 255" text_color="210 210 210 255" h1_color="255 255 255 255" h2_color="255 255 255 255" h3_color="255 255 255 255" h4_color="255 255 255 255" h5_color="255 255 255 255" h6_color="255 255 255 255" text_font_size="10" h1_font_size="20" h2_font_size="18" h3_font_size="16" h4_font_size="14" h5_font_size="12" h6_font_size="12" paragraph_begin_space="12" multi_line_space_factor="0.25" td_begin_space="0" li_begin_space="4" ul_begin_space="12" li_indent="-10" ul_indent="30" checkbox_bitmap_normal="w_slot_on.tga" checkbox_bitmap_pushed="w_opacity_on.tga" checkbox_bitmap_over="" background_bitmap_view="background_bitmap" browse_next_time="false" form_text_area_group="edit_box_widget_multiline">
|
||||
<group id="text_list" type="list" fontsize="9" posref="TL TL" x="0" y="-10" space="0" w="510" h="70" maxelements="2000" />
|
||||
<ctrl id="scroll_bar" style="skin_scroll" />
|
||||
</group>
|
||||
<view type="bitmap" id="check" active="#waiting" x="6" posref="ML ML" texture="w_slot_brick.tga" color="255 255 255 255" global_color="false" />
|
||||
<view type="bitmap" id="started" active="#started" x="6" posref="ML ML" texture="w_slot_on.tga" color="#check_color" global_color="false" h="26" w="26" scale="true"/>
|
||||
<view type="bitmap" id="finished" active="#finished" x="0" posref="ML ML" texture="ico_task_done.tga" color="255 255 255 255" global_color="false" />
|
||||
<ctrl type="button" id="lesson" button_type="push_button" global_color_normal="false" global_color_over="false" global_color_pushed="false" posref="MM MM" x="0" y="0" w="510" h="60" tx_normal="blank.tga" tx_pushed="storyline_lesson_bg_white.tga" tx_over="storyline_lesson_bg_white.tga" scale="true" color="255 255 255 0" col_over="255 255 255 #over" col_pushed="255 255 255 #pushed" onclick_l="lua" params_l="openLesson(#event, #lesson)" />
|
||||
<ctrl type="button" id="open_script" active="#open_script" button_type="push_button" posref="BL BL" x="78" y="9" tx_normal="mp3_button_list.tga" tx_pushed="mp3_button_list.tga" tx_over="mp3_button_over.tga" onclick_l="lua" params_l="openStorylineStepDetails(#script, #parent)" tooltip="" />
|
||||
</group>
|
||||
</template>
|
||||
|
||||
<template name="webig_button" w="100" h="20" x="0" y="0" text="OK" fontsize="12" shadow="true" color_text="255 255 255 255" normal="blank.tga" pushed="blank.tga" over="blank.tga" color="255 255 255 0" color_over="255 255 255 55" color_pushed="255 255 255 100" params_l="">
|
||||
<group id="#id" posref="MM MM" w="#w" h="#h" x="#x" y="#y">
|
||||
<ctrl type="button" id="but" button_type="push_button" global_color_normal="false" global_color_over="false" global_color_pushed="false" posref="MM MM" x="0" y="0" w="#w" h="#h" tx_normal="#normal" tx_pushed="#pushed" tx_over="#over" scale="true" color="#color" col_over="#color_over" col_pushed="#color_pushed" onclick_l="lua" params_l="#params_l" />
|
||||
<view type="text" id="text" color="#color_text" global_color="false" fontsize="#fontsize" shadow="#shadow" posref="MM MM" hardtext="#text" />
|
||||
</group>
|
||||
</template>
|
||||
|
||||
</interface_config>
|
Loading…
Reference in New Issue