Fix checkRpItemsPosition
[ryzomcore.git] / ryzom / client / data / gamedev / interfaces_v3 / taskbar.lua
blob4d70cf8462bc0ba69992a98ea65a74695c4ad456
2 ------------------------------------------------------------------------------------------------------------
3 -- create the game namespace without reseting if already created in an other file.
4 if (game==nil) then
5 game = {}
6 end
8 ------------------------------------------------------------------------------------------------------------
9 --
10 function game:getMilkoTooltipWithKey(prop, tooltip, tooltip_pushed, name, param)
11 local tt
13 -- Check if button is toggled and choose the good tooltip
14 if (prop ~= '' and tooltip_pushed ~= '') then
15 local db = getDbProp(prop)
16 if (db == 1) then
17 tt = tooltip_pushed
18 else
19 tt = tooltip
20 end
21 else
22 tt = tooltip;
23 end
25 -- Get key shortcut
26 local text = i18n.get(tt)
27 local key = runExpr('getKey(\'' .. name .. '\',\'' .. param .. '\',1)')
29 if (key ~= nil and key ~= '') then
30 key = ' @{2F2F}(' .. key .. ')'
31 text = concatUCString(text, key)
32 end
34 setContextHelpText(text)
35 end
37 function game:taskbarDisableTooltip(ui)
38 local uiGroup = getUI(ui)
39 disableContextHelpForControl(uiGroup)
40 end
42 function game:activeMilkoKey(key, status)
43 local ui = getUI("ui:interface:milko_pad:content:mode5:window"..tostring(key))
44 if ui then
45 ui.active = status
46 end
47 end
49 function game:resizeMilkoPad()
50 if getDbProp("UI:SAVE:SKIP_TUTORIAL") == 1 then
51 removeOnDbChange(getUI("ui:interface"), "@UI:SAVE:MK_MODE")
52 game:activeMilkoKey(1, true)
53 game:activeMilkoKey(2, true)
54 game:activeMilkoKey(3, true)
55 game:activeMilkoKey(4, true)
56 game:activeMilkoKey(5, true)
57 game:activeMilkoKey(6, true)
58 game:activeMilkoKey(7, true)
59 game:activeMilkoKey(8, true)
60 game:activeMilkoKey(9, true)
61 getUI("ui:interface:milko_pad:content:mode_button").active = true
62 setDbProp("UI:SAVE:MK_MODE", 1)
63 setDbProp("UI:SAVE:MK_MODE", 5)
64 getUI("ui:interface:milko_pad:content:mode5").x = 16
65 return
66 end
68 local mk_mode = getDbProp("UI:SAVE:MK_MODE")
69 if mk_mode == 5 then
70 local ui = getUI("ui:interface:milko_pad:content:mode_button")
71 local offset = 40
72 if ui and ui.active then
73 offset = 72
74 getUI("ui:interface:milko_pad:content:mode5").x = 16
75 else
76 getUI("ui:interface:milko_pad:content:mode5").x = 0
77 end
78 local total = -1
79 for i=1,9 do
80 ui = getUI("ui:interface:milko_pad:content:mode5:window"..tostring(i))
81 if ui and ui.active then
82 total = total + 1
83 end
84 end
85 ui = getUI("ui:interface:milko_pad")
86 local last_w = ui.w
87 ui.w = offset + (24*total)
88 ui.x = ui.x + last_w - ui.w
89 end
90 end
92 function game:updateMilkoKey(key, status)
93 game:activeMilkoKey(key, status)
94 game:resizeMilkoPad()
95 end
98 -- VERSION --
99 RYZOM_TASKBAR_VERSION = 324