diff --git a/data/ryz/ryz_ring/r2_core_user_component_manager.lua b/data/ryz/ryz_ring/r2_core_user_component_manager.lua
index 6769d503..4aa44548 100644
--- a/data/ryz/ryz_ring/r2_core_user_component_manager.lua
+++ b/data/ryz/ryz_ring/r2_core_user_component_manager.lua
@@ -1116,7 +1116,7 @@ function userComponentManager:export(list, refX, refY, refZ)
messageBox(i18n.get("uiR2EDInvalidName"))
return
end
- if string.find(form.ComponentFileName, '\.lua', -4) == nil then
+ if string.find(form.ComponentFileName, '.lua', -4) == nil then
form.ComponentFileName = form.ComponentFileName .. ".lua"
end
local refPosition = form.RefPosition
diff --git a/data/ryz/ryz_ring/r2_debug.lua b/data/ryz/ryz_ring/r2_debug.lua
index 6a63b547..78501dca 100644
--- a/data/ryz/ryz_ring/r2_debug.lua
+++ b/data/ryz/ryz_ring/r2_debug.lua
@@ -140,7 +140,8 @@ end
function assert(cond)
if not cond then
- rawDebugInfo(colorTag(255, 0, 255) .. "ASSERTION FAILED !! ")
+ -- rawDebugInfo(colorTag(255, 0, 255) .. "ASSERTION FAILED !! ")
+ rawDebugInfo("@{FOFF}ASSERTION FAILED !! ")
dumpCallStack(2);
error("")
end
diff --git a/data/ryz/ryz_ring/r2_features_default.lua b/data/ryz/ryz_ring/r2_features_default.lua
index d64113c9..70d12938 100644
--- a/data/ryz/ryz_ring/r2_features_default.lua
+++ b/data/ryz/ryz_ring/r2_features_default.lua
@@ -371,7 +371,7 @@ local registerFeature = function ()
--------------------
convertToWidgetValue =
function(value)
- local result = math.mod(math.floor(180 * value / math.pi), 360)
+ local result = math.fmod(math.floor(180 * value / math.pi), 360)
if result < 0 then result = 360 + result end
return result
end,
diff --git a/data/ryz/ryz_ring/r2_features_easter_egg.lua b/data/ryz/ryz_ring/r2_features_easter_egg.lua
index 3756d0ab..76b185f8 100644
--- a/data/ryz/ryz_ring/r2_features_easter_egg.lua
+++ b/data/ryz/ryz_ring/r2_features_easter_egg.lua
@@ -78,7 +78,7 @@ feature.Components.EasterEgg =
function(value)
local angle = value
if angle == nil then angle = 0 end
- local result = math.mod(math.floor(180 * angle / math.pi), 360)
+ local result = math.fmod(math.floor(180 * angle / math.pi), 360)
if result < 0 then result = 360 + result end
return result
end,
diff --git a/data/ryz/ryz_ring/r2_logic.lua b/data/ryz/ryz_ring/r2_logic.lua
index 1ee35d56..d50a15fa 100644
--- a/data/ryz/ryz_ring/r2_logic.lua
+++ b/data/ryz/ryz_ring/r2_logic.lua
@@ -1679,7 +1679,7 @@ Logic.translateChatSequences = function (context, hlComponent, behavior, rtNpcGr
event.Name = "activity_sequence_changed"
table.insert(context.RtAct.Events, event)
- local rtInitChatStep = r2.Translator.createAction("code", "oldChatStepVar = -1;\n" .. Logic.chatStepVar .." = 0;\n()setTimer(1, " ..Logic.chatTimerId .. ")\;\n")
+ local rtInitChatStep = r2.Translator.createAction("code", "oldChatStepVar = -1;\n" .. Logic.chatStepVar .." = 0;\n()setTimer(1, " ..Logic.chatTimerId .. ");\n")
rtInitChatStep.Name = "init_chat_step"
table.insert(context.RtAct.Actions, rtInitChatStep)
table.insert(event.ActionsId, rtInitChatStep.Id)
diff --git a/data/ryz/ryz_ring/r2_logic_entities.xml b/data/ryz/ryz_ring/r2_logic_entities.xml
index 218d281b..b126c6f0 100644
--- a/data/ryz/ryz_ring/r2_logic_entities.xml
+++ b/data/ryz/ryz_ring/r2_logic_entities.xml
@@ -318,7 +318,7 @@
on_change_params="r2.events:initFilterMenu()" color_text="255 255 0 255" />
+ text_y="0" onclick_l="lua" params_l="r2.events:newActionUI()" hardtext="uiR2EDAddAction" fontsize="10" text_color_normal="255 255 255 170" />
@@ -488,7 +488,7 @@
+ text_y="0" onclick_l="lua" params_l="r2.events:newConditionUI()" hardtext="uiR2EDAddCondition" fontsize="10" text_color_normal="255 255 255 170" />
@@ -500,7 +500,7 @@
color="#col_pushed" col_over="#col_pushed" col_pushed="#col_pushed"/>
+ text_y="0" onclick_l="lua" params_l="r2.events:advancedEditor('true')" hardtext="Advanced..." fontsize="12" text_color_normal="255 255 255 150" />
diff --git a/data/ryz/ryz_ring/r2_misc.lua b/data/ryz/ryz_ring/r2_misc.lua
index ee9e2885..d85744bd 100644
--- a/data/ryz/ryz_ring/r2_misc.lua
+++ b/data/ryz/ryz_ring/r2_misc.lua
@@ -28,6 +28,19 @@ function forEach(table, fn)
end
end
+
+------------------------------------------------------------------------------------------------------------
+-- whatever
+table.setn = function(table, n)
+ assert(table)
+ local mt = getmetatable(table)
+ if mt ~= nil then
+ if mt.__next ~= nil then
+ table.Size = n
+ end
+ end
+end
+
------------------------------------------------------------------------------------------------------------
-- extension to table library : remove all content of a table without deleting the table object
function table.clear(tbl)
@@ -175,6 +188,17 @@ function strify(str)
return [["]] .. tostring(str) .. [["]]
end
+-------------------------------------------------------------------------------------------------
+-- enclose a string by double quotes
+function strifyXml(str)
+ local strxml = string.gsub(tostring(str), ">", ">")
+ strxml = string.gsub(strxml, "<", "<")
+ strxml = string.gsub(strxml, "&", "&")
+ strxml = string.gsub(strxml, "'", "'")
+ strxml = string.gsub(strxml, '"', """)
+ return [["]] .. strxml .. [["]]
+end
+
------------------------------------------------------------------------------------------------------------
-- snap a position to ground, returning the z snapped coordinate
function r2:snapZToGround(x, y)
@@ -251,26 +275,37 @@ end
-assert(table.getn ~= nil) -- default lib should have been opened
+-- assert(table.getn ~= nil) -- default lib should have been opened
+
+--if oldTableGetnFunction == nil then
+-- oldTableGetnFunction = table.getn
+--end
+--
+--table.getn = function(table)
+-- assert(table)
+-- local mt = getmetatable(table)
+-- if mt ~= nil then
+-- if mt.__next ~= nil then
+-- return table.Size
+-- end
+-- end
+-- return oldTableGetnFunction(table)
+--end
-if oldTableGetnFunction == nil then
- oldTableGetnFunction = table.getn
-end
table.getn = function(table)
assert(table)
local mt = getmetatable(table)
if mt ~= nil then
if mt.__next ~= nil then
- return table.Size
+ return table.Size
end
end
- return oldTableGetnFunction(table)
+ return #table
end
-
-- redefine the hardcoded 'pairs' function to use the redefined 'next'
-- hardcoded version uses the C version of next, not the lua one if it has been redefined
diff --git a/data/ryz/ryz_ring/r2_translator.lua b/data/ryz/ryz_ring/r2_translator.lua
index 600928d9..e1c4701b 100644
--- a/data/ryz/ryz_ring/r2_translator.lua
+++ b/data/ryz/ryz_ring/r2_translator.lua
@@ -541,7 +541,7 @@ Translator.translateEventHandlers = function(context, hlNpc, eventHandlers, rtNp
while k do
local caller = nil
if devMode then
- caller = function (...) arg[1](arg[2], arg[3], arg[4], arg[5]) return true end
+ caller = function (...) local arg = {...} arg[1](arg[2], arg[3], arg[4], arg[5]) return true end
else
caller = pcall
@@ -898,6 +898,7 @@ end
-- Returns a RtNpcEventHandlerAction if the action is allowed
--first parameter: action type
Translator.createAction = function(...)
+ local arg = {...}
local debug=config.R2EDExtendedDebug
local function header(toto)
@@ -2774,6 +2775,7 @@ end
--third param : GroupsByName
--then, parameters
Translator.createEvent = function(...)
+ local arg = {...}
local event = r2.newComponent("RtNpcEventHandler")
local eventType = arg[1]
event.Event = eventType
diff --git a/data/ryz/ryz_ring/r2_triggers.xml b/data/ryz/ryz_ring/r2_triggers.xml
index fce09b73..8647e779 100644
--- a/data/ryz/ryz_ring/r2_triggers.xml
+++ b/data/ryz/ryz_ring/r2_triggers.xml
@@ -196,7 +196,7 @@
+ text_y="0" onclick_l="lua" params_l="#new_elt" hardtext="#new_elt_text" />
@@ -333,7 +333,7 @@
seq_color="" over_seq_color="" repeat_seq="" right_seq="" left_seq="" on_change="" >
+ text_y="0" onclick_l="lua" params_l="#new_seq" hardtext="#new_seq_text" />
@@ -2131,7 +2131,7 @@ text_y="-2"
+ text_y="0" onclick_l="" params_l="" hardtext="uiR2EdCreateNew" tooltip="" />
-->
@@ -2209,11 +2209,11 @@ text_y="-2"
+ text_y="0" onclick_l="lua" params_l="r2:randomEquipment()" hardtext="uiR2EdRandomEquipment" />
+ text_y="0" onclick_l="lua" params_l="r2:randomColor()" hardtext="uiR2EdRandomColor" />
+ text_y="0" hardtext="uiR2EdManageSets" onclick_l="proc" params_l="add_equipment_active" />
@@ -2230,7 +2230,7 @@ text_y="-2"
@@ -2509,7 +2509,7 @@ text_y="-2"
+ text_y="0" onclick_l="lua" params_l="r2:preview()" hardtext="uiR2EdPreview" />
@@ -2628,7 +2628,7 @@ text_y="-2"
+ text_y="0" onclick_l="" params_l="" hardtext="uiR2EdAddList" tooltip="" />
@@ -2638,15 +2638,15 @@ text_y="-2"
+ text_y="0" onclick_l="leave_modal" params_l="" hardtext=" OK " tooltip="" />
+ text_y="0" onclick_l="leave_modal" params_l="" hardtext=" CANCEL " tooltip="" />
+ text_y="0" onclick_l="leave_modal" params_l="" hardtext=" UPDATE " tooltip="" />
@@ -2680,11 +2680,11 @@ text_y="-2"
+ text_y="0" onclick_l="lua" params_l="#add_params" hardtext="uiR2EdAdd" />
+ text_y="0" onclick_l="lua" params_l="#random_params" hardtext="uiR2EdRandomSet" />
+ text_y="0" onclick_l="lua" params_l="#update_params" hardtext="uiR2EdUpdate" />
+ text_y="0" onclick_l="lua" params_l="#remove_params" hardtext="uiR2EdRemove" tooltip="" />
@@ -3072,7 +3072,7 @@ text_y="-2"
/>
-
diff --git a/data/ryz/ryz_ring/r2ed_acts.xml b/data/ryz/ryz_ring/r2ed_acts.xml
index 4c89edc2..bacc3a88 100644
--- a/data/ryz/ryz_ring/r2ed_acts.xml
+++ b/data/ryz/ryz_ring/r2ed_acts.xml
@@ -12,7 +12,7 @@
child_resize_h="true" child_resize_hmargin="0" >
+ text_y="0" onclick_l="lua" params_l="r2:showFilteredScenarios()" hardtext="OK" fontsize="10" />
diff --git a/data/ryz/ryz_zzz_bazaar/appzone.lua b/data/ryz/ryz_zzz_bazaar/appzone.lua
new file mode 100644
index 00000000..1332eb3d
--- /dev/null
+++ b/data/ryz/ryz_zzz_bazaar/appzone.lua
@@ -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
+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
diff --git a/data/ryz/ryz_zzz_bazaar/appzone.xml b/data/ryz/ryz_zzz_bazaar/appzone.xml
new file mode 100644
index 00000000..51bc0417
--- /dev/null
+++ b/data/ryz/ryz_zzz_bazaar/appzone.xml
@@ -0,0 +1,257 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/ryz/ryz_zzz_bazaar/compass.xml b/data/ryz/ryz_zzz_bazaar/compass.xml
index c2bd7a40..a88f49f4 100644
--- a/data/ryz/ryz_zzz_bazaar/compass.xml
+++ b/data/ryz/ryz_zzz_bazaar/compass.xml
@@ -8,7 +8,7 @@
-
@@ -25,23 +25,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+ params="volume=@UI:SAVE:MP3_VOLUME" />
+ onclick_l="enter_modal"
+ params_l="group=ui:interface:playlist"
+ tooltip="uiMP3Playlist" />
@@ -645,7 +679,7 @@
id="dist"
posref="BM BM"
x="0"
- y="0"
+ y="2"
hardtext="uiRadarZoom0"
shadow="true"
color="255 255 255 255"
@@ -694,7 +728,7 @@
id="range"
posref="BM MM"
x="0"
- y="16"
+ y="20"
hardtext="uiRadarZoom0"
shadow="true"
color="255 255 255 255"
@@ -748,8 +782,8 @@
posref="BM BM"
x="0"
y="26"
- w="44"
- h="18" />
+ w="46"
+ h="25" />
diff --git a/data/ryz/ryz_zzz_bazaar/help.lua b/data/ryz/ryz_zzz_bazaar/help.lua
index 07a7fcd2..d6c6da72 100644
--- a/data/ryz/ryz_zzz_bazaar/help.lua
+++ b/data/ryz/ryz_zzz_bazaar/help.lua
@@ -3,36 +3,36 @@
------------------------------------------------------------------------------------------------------------
-- create the game namespace without reseting if already created in an other file.
if (help==nil) then
- help= {};
+ help = {}
end
------------------------------------------------------------------------------------------------------------
--
function help:closeCSBrowserHeader()
- local ui = getUI('ui:interface:cs_browser');
+ local ui = getUI('ui:interface:cs_browser')
-- save size
- ui_cs_browser_h = ui.h;
- ui_cs_browser_w = ui.w;
+ ui_cs_browser_h = ui.h
+ ui_cs_browser_w = ui.w
-- reduce window size
- ui.pop_min_h = 32;
- ui.h = 0;
- ui.w = 216;
+ ui.pop_min_h = 32
+ ui.h = 0
+ ui.w = 216
end
------------------------------------------------------------------------------------------------------------
--
function help:openCSBrowserHeader()
- local ui = getUI('ui:interface:cs_browser');
- ui.pop_min_h = 96;
+ local ui = getUI('ui:interface:cs_browser')
+ ui.pop_min_h = 96
-- set size from saved values
if (ui_cs_browser_h ~= nil) then
- ui.h = ui_cs_browser_h;
+ ui.h = ui_cs_browser_h
end
if (ui_cs_browser_w ~= nil) then
- ui.w = ui_cs_browser_w;
+ ui.w = ui_cs_browser_w
end
end
\ No newline at end of file
diff --git a/data/ryz/ryz_zzz_bazaar/interaction.lua b/data/ryz/ryz_zzz_bazaar/interaction.lua
index d36486e9..489484ee 100644
--- a/data/ryz/ryz_zzz_bazaar/interaction.lua
+++ b/data/ryz/ryz_zzz_bazaar/interaction.lua
@@ -10,7 +10,7 @@ end
------------------------------------------------------------------------------------------------------------
-- called when server send an invitaion we receive a text id containing the string to display (invitor name)
function game:onTeamInvation(textID)
-
+
local ui = getUI('ui:interface:join_team_proposal');
ui.content.inside.invitor_name.textid = textID;
ui.active = true;
@@ -20,7 +20,7 @@ function game:onTeamInvation(textID)
end
------------------------------------------------------------------------------------------------------------
---
+--
function game:teamInvitationAccept()
local ui = getUI('ui:interface:join_team_proposal');
@@ -29,7 +29,7 @@ function game:teamInvitationAccept()
end
------------------------------------------------------------------------------------------------------------
---
+--
function game:teamInvitationRefuse()
local ui = getUI('ui:interface:join_team_proposal');
@@ -38,7 +38,7 @@ function game:teamInvitationRefuse()
end
------------------------------------------------------------------------------------------------------------
---
+--
function game:switchChatTab(dbEntry)
local db= 'UI:SAVE:ISENABLED:' .. dbEntry;
local val= getDbProp(db);
@@ -51,13 +51,13 @@ function game:switchChatTab(dbEntry)
end
------------------------------------------------------------------------------------------------------------
---
+--
function game:updateEmoteMenu(prop, tooltip, tooltip_pushed, name, param)
for i=0,9 do
-- Get key shortcut
local text = i18n.get('uiTalkMemMsg0' .. i);
local key = runExpr( "getKey('talk_message','0" .. i .. "',1)" );
-
+
if (key ~= nil and key ~= '') then
key = ' @{T25}@{2F2F}(' .. key .. ')';
text = concatUCString(text, key);
@@ -67,11 +67,11 @@ function game:updateEmoteMenu(prop, tooltip, tooltip_pushed, name, param)
local uiQC= getUI("ui:interface:user_chat_emote_menu:quick_chat:" .. "qc" .. i);
uiQC.uc_hardtext_format= text;
end
-
+
end
------------------------------------------------------------------------------------------------------------
---
+--
if (ui_free_chat_h == nil) then
ui_free_chat_h = {}
end
@@ -81,14 +81,14 @@ if (ui_free_chat_w == nil) then
end
------------------------------------------------------------------------------------------------------------
---
+--
function game:closeTellHeader(uiID)
local ui = getUI('ui:interface:' .. uiID);
-
+
-- save size
ui_free_chat_h[uiID] = ui.h;
ui_free_chat_w[uiID] = ui.w;
-
+
-- reduce window size
ui.pop_min_h = 32;
ui.h = 0;
@@ -96,7 +96,7 @@ function game:closeTellHeader(uiID)
end
------------------------------------------------------------------------------------------------------------
---
+--
function game:openTellHeader(uiID)
local ui = getUI('ui:interface:' .. uiID);
ui.pop_min_h = 96;
@@ -105,7 +105,7 @@ function game:openTellHeader(uiID)
if (ui_free_chat_h[uiID] ~= nil) then
ui.h = ui_free_chat_h[uiID];
end
-
+
if (ui_free_chat_w[uiID] ~= nil) then
ui.w = ui_free_chat_w[uiID];
end
@@ -127,12 +127,12 @@ local function levelToForceRegion(level)
return 6
else
return math.floor(level / 50) + 2
- end
-end
+ end
+end
local function levelToLevelForce(level)
- return math.floor(math.fmod(level, 50) * 5 / 50) + 1
-end
+ return math.floor(math.fmod(level, 50) * 5 / 50) + 1
+end
@@ -186,7 +186,7 @@ end
local function twIsTargetPlayer()
if config.Local == 1 then
return twTargetPlayer
- else
+ else
return isTargetPlayer()
end
end
@@ -195,7 +195,7 @@ end
local function twIsPlayerInPVPMode()
if config.Local == 1 then
return twPlayerInPVPMode
- else
+ else
return isPlayerInPVPMode()
end
end
@@ -204,7 +204,7 @@ end
local function twIsTargetInPVPMode()
if config.Local == 1 then
return twTargetInPVPMode
- else
+ else
return isTargetInPVPMode()
end
end
@@ -219,17 +219,16 @@ end
function game:updateTargetConsiderUI()
--debugInfo("Updating consider widget")
-
- local targetWindow = getUI("ui:interface:target")
- --
+ local targetWindow = getUI("ui:interface:target")
+ --
local wgTargetSlotForce = targetWindow:find("slot_force")
local wgTargetLevel = targetWindow:find("target_level")
local wgImpossible = targetWindow:find("impossible")
local wgSlotRing = targetWindow:find("slot_ring")
local wgToolTip = targetWindow:find("target_tooltip")
- local wgPvPTag = targetWindow:find("pvp_tags")
- local wgHeader = targetWindow:find("header_opened")
-
+ local wgPvPTag = targetWindow:find("pvp_tags")
+ local wgHeader = targetWindow:find("header_opened")
+
wgTargetSlotForce.active = true
wgImpossible.active = true
@@ -238,7 +237,7 @@ function game:updateTargetConsiderUI()
wgTargetSlotForce.active = false
wgTargetLevel.active = false
wgImpossible.active = false
- wgSlotRing.active = false
+ wgSlotRing.active = false
if (isTargetUser() and twIsPlayerInPVPMode()) then
wgToolTip.tooltip = ""
wgPvPTag.active = true
@@ -289,14 +288,14 @@ function game:updateTargetConsiderUI()
local impossible = (twGetTargetLevel() - twGetPlayerLevel() > maxDiffLevel)
wgSlotRing.active = false
-
+
if impossible then
-- targeted object is too hard too beat, display a skull
wgTargetLevel.active = false
wgImpossible.y = -5
wgImpossible.color = "255 50 50 255"
else
- -- player can see the level of the targeted creature
+ -- player can see the level of the targeted creature
wgTargetLevel.active = true
wgImpossible.y = 6
wgTargetLevel.hardtext = tostring(twGetTargetLevel())
@@ -310,7 +309,7 @@ function game:updateTargetConsiderUI()
wgImpossible.texture = getDefine("force_level_" .. tostring(levelForce))
wgImpossible.active = true
- if levelForce < 6 then
+ if levelForce < 6 then
wgToolTip.tooltip = i18n.get("uittConsiderTargetLevel")
elseif levelForce == 6 then
-- Named creature
@@ -343,7 +342,6 @@ function game:updateTargetConsiderUI()
if impossible then
wgToolTip.tooltip = concatUCString(wgToolTip.tooltip, ucstring("\n"), i18n.get("uittConsiderUnknownLevel"))
end
-
end
----------------------
@@ -506,18 +504,18 @@ function twGroup(groupSize)
else
setDbProp("SERVER:GROUP:" .. tostring(gm) .. ":PRESENT", 0)
end
- end
+ end
end
------------------------------------------------------------------------------------------------------------
---
+--
function game:closeWebIGBrowserHeader()
local ui = getUI('ui:interface:webig');
-
+
-- save size
ui_webig_browser_h = ui.h;
ui_webig_browser_w = ui.w;
-
+
-- reduce window size
ui.pop_min_h = 32;
ui.h = 0;
@@ -525,7 +523,7 @@ function game:closeWebIGBrowserHeader()
end
------------------------------------------------------------------------------------------------------------
---
+--
function game:openWebIGBrowserHeader()
local ui = getUI('ui:interface:webig');
ui.pop_min_h = 96;
@@ -534,7 +532,7 @@ function game:openWebIGBrowserHeader()
if (ui_webig_browser_h ~= nil) then
ui.h = ui_webig_browser_h;
end
-
+
if (ui_webig_browser_w ~= nil) then
ui.w = ui_webig_browser_w;
end
diff --git a/data/ryz/ryz_zzz_bazaar/inventory.xml b/data/ryz/ryz_zzz_bazaar/inventory.xml
index 83a8dc08..e9ff0719 100644
--- a/data/ryz/ryz_zzz_bazaar/inventory.xml
+++ b/data/ryz/ryz_zzz_bazaar/inventory.xml
@@ -27,6 +27,15 @@
+
+
+
+
+
+
+
+
+
@@ -44,6 +53,83 @@
onclick_l="proc"
params_l="inv_left_click_on_slot"
auto_grayed="false" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1501,9 +1866,66 @@
tooltip="uittHandSet"
tooltip_parent="win" />
+
+
+
+
+
+
+
diff --git a/data/ryz/ryz_zzz_bazaar/login_config.xml b/data/ryz/ryz_zzz_bazaar/login_config.xml
index e4b2e77e..47b3c627 100644
--- a/data/ryz/ryz_zzz_bazaar/login_config.xml
+++ b/data/ryz/ryz_zzz_bazaar/login_config.xml
@@ -838,6 +838,8 @@ This MUST follow the Enum MISSION_DESC::TIconId
value="basic.ttf" /> -->
+
-->
+
-->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/ryz/ryz_zzz_bazaar/r2_triggers.xml b/data/ryz/ryz_zzz_bazaar/r2_triggers.xml
new file mode 100644
index 00000000..8647e779
--- /dev/null
+++ b/data/ryz/ryz_zzz_bazaar/r2_triggers.xml
@@ -0,0 +1,780 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/ryz/ryz_zzz_bazaar/taskbar.lua b/data/ryz/ryz_zzz_bazaar/taskbar.lua
index 7ac4c68d..9dc6035f 100644
--- a/data/ryz/ryz_zzz_bazaar/taskbar.lua
+++ b/data/ryz/ryz_zzz_bazaar/taskbar.lua
@@ -2,39 +2,39 @@
------------------------------------------------------------------------------------------------------------
-- create the game namespace without reseting if already created in an other file.
if (game==nil) then
- game= {};
+ game = {}
end
------------------------------------------------------------------------------------------------------------
--
function game:getMilkoTooltipWithKey(prop, tooltip, tooltip_pushed, name, param)
- local tt;
+ local tt
-- Check if button is toggled and choose the good tooltip
if (prop ~= '' and tooltip_pushed ~= '') then
- local db = getDbProp(prop);
+ local db = getDbProp(prop)
if (db == 1) then
- tt = tooltip_pushed;
+ tt = tooltip_pushed
else
- tt = tooltip;
+ tt = tooltip
end
else
tt = tooltip;
end
-- Get key shortcut
- local text = i18n.get(tt);
- local key = runExpr('getKey(\'' .. name .. '\',\'' .. param .. '\',1)');
+ local text = i18n.get(tt)
+ local key = runExpr('getKey(\'' .. name .. '\',\'' .. param .. '\',1)')
if (key ~= nil and key ~= '') then
- key = ' @{2F2F}(' .. key .. ')';
- text = concatUCString(text, key);
+ key = ' @{2F2F}(' .. key .. ')'
+ text = concatUCString(text, key)
end
- setContextHelpText(text);
+ setContextHelpText(text)
end
function game:taskbarDisableTooltip(ui)
- local uiGroup = getUI(ui);
- disableContextHelpForControl(uiGroup);
+ local uiGroup = getUI(ui)
+ disableContextHelpForControl(uiGroup)
end
\ No newline at end of file
diff --git a/data/ryz/ryz_zzz_bazaar/taskbar.xml b/data/ryz/ryz_zzz_bazaar/taskbar.xml
index 0c42103f..e497f25e 100644
--- a/data/ryz/ryz_zzz_bazaar/taskbar.xml
+++ b/data/ryz/ryz_zzz_bazaar/taskbar.xml
@@ -1091,7 +1091,10 @@
-
+
+
+
diff --git a/data/ryz/ryz_zzz_bazaar/webig.lua b/data/ryz/ryz_zzz_bazaar/webig.lua
index 9b88c02f..10c489ca 100644
--- a/data/ryz/ryz_zzz_bazaar/webig.lua
+++ b/data/ryz/ryz_zzz_bazaar/webig.lua
@@ -176,11 +176,11 @@ function webig:doRemoveDbSheetQuantity(sheet_list, ctrl)
if new_quantity >= current_quantity then
webig:deleteItem(db..":"..ctrl)
else
- addDbProp(db..":"..ctrl..":QUANTITY", current_quantity-new_quantity)
+ addDbProp(db..":"..ctrl..":QUANTITY", new_quantity)
end
end
---assert(nil, "RELOADABLE SCRIPT");
+--assert(nil, "RELOADABLE SCRIPT")