khanat-opennel-code/code/ryzom/client/data/gamedev/interfaces_v3/taskbar.lua

40 lines
1 KiB
Lua
Raw Normal View History

------------------------------------------------------------------------------------------------------------
-- create the game namespace without reseting if already created in an other file.
if (game==nil) then
2016-04-12 14:53:28 +00:00
game = {}
end
------------------------------------------------------------------------------------------------------------
--
function game:getMilkoTooltipWithKey(prop, tooltip, tooltip_pushed, name, param)
2016-04-12 14:53:28 +00:00
local tt
-- Check if button is toggled and choose the good tooltip
if (prop ~= '' and tooltip_pushed ~= '') then
2016-04-12 14:53:28 +00:00
local db = getDbProp(prop)
if (db == 1) then
2016-04-12 14:53:28 +00:00
tt = tooltip_pushed
else
2016-04-12 14:53:28 +00:00
tt = tooltip
end
else
tt = tooltip;
end
-- Get key shortcut
2016-04-12 14:53:28 +00:00
local text = i18n.get(tt)
local key = runExpr('getKey(\'' .. name .. '\',\'' .. param .. '\',1)')
if (key ~= nil and key ~= '') then
2016-04-12 14:53:28 +00:00
key = ' @{2F2F}(' .. key .. ')'
text = concatUCString(text, key)
end
2016-04-12 14:53:28 +00:00
setContextHelpText(text)
end
function game:taskbarDisableTooltip(ui)
2016-04-12 14:53:28 +00:00
local uiGroup = getUI(ui)
disableContextHelpForControl(uiGroup)
end