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