2016-05-06 10:56:20 +00:00
|
|
|
-- In this file we define functions that serves for bot_chat windows
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
|
|
-- create the game namespace without reseting if already created in an other file.
|
|
|
|
if (game==nil) then
|
2016-10-14 16:29:29 +00:00
|
|
|
game = {}
|
2016-05-06 10:56:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
|
|
-- called to construct guild flags background in the modal window
|
|
|
|
function game:bcCreateGuildInitFlags()
|
|
|
|
|
2016-10-14 16:29:29 +00:00
|
|
|
local ui = getUICaller()
|
2016-05-06 10:56:20 +00:00
|
|
|
|
|
|
|
for i = 0,14 do
|
2016-10-14 16:29:29 +00:00
|
|
|
local uiBack = getUI(getUIId(ui) .. ':back' .. i)
|
|
|
|
uiBack.image1.back = i+1
|
|
|
|
uiBack.image1.symbol = 0
|
|
|
|
uiBack.image1.color1 = runExpr('makeRGB(255,255,255)')
|
|
|
|
uiBack.image1.color2 = runExpr('makeRGB(0,0,0)')
|
2016-05-06 10:56:20 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------
|
|
|
|
-- called when UI:TEMP:MISSION:MISSION_TYPE changed
|
|
|
|
-- trap some parts should be deprecated ... try to clean it up
|
|
|
|
function game:bcMissionsUpdate()
|
|
|
|
|
2016-10-14 16:29:29 +00:00
|
|
|
local mt = getDbProp('UI:TEMP:MISSION:MISSION_TYPE')
|
2016-05-06 10:56:20 +00:00
|
|
|
|
|
|
|
-- init bot_chat_missions title
|
2016-10-14 16:29:29 +00:00
|
|
|
local title = 'uiBotChatMissions'
|
|
|
|
if (mt == 3) then title = 'uiBotChatZCCharges'
|
|
|
|
elseif (mt == 4) then title = 'uiBotChatBuilding'
|
|
|
|
elseif (mt == 5) then title = 'uiBotChatRMBuy'
|
|
|
|
elseif (mt == 6) then title = 'uiBotChatRMUpgrade'
|
2016-05-06 10:56:20 +00:00
|
|
|
end
|
2016-10-14 16:29:29 +00:00
|
|
|
local ui = getUI('ui:interface:bot_chat_missions')
|
|
|
|
ui.title = title
|
2016-05-06 10:56:20 +00:00
|
|
|
|
|
|
|
-- init desc
|
2016-10-14 16:29:29 +00:00
|
|
|
title = 'uiSelectMission'
|
|
|
|
if (mt == 3) then title = 'uiSelectZCCharge'
|
|
|
|
elseif (mt == 4) then title = 'uiSelectBuilding'
|
|
|
|
elseif (mt == 5) then title = 'uiSelectRMBuy'
|
|
|
|
elseif (mt == 6) then title = 'uiSelectRMUpgrade'
|
2016-05-06 10:56:20 +00:00
|
|
|
end
|
2016-10-14 16:29:29 +00:00
|
|
|
ui.header_opened.mission_title.hardtext = title
|
2016-05-06 10:56:20 +00:00
|
|
|
|
2016-10-14 16:29:29 +00:00
|
|
|
ui.header_opened.zc_duty.active = (mt == 3)
|
|
|
|
ui.header_opened.xp_guild.active = ((mt == 5) or (mt == 6))
|
2016-05-06 10:56:20 +00:00
|
|
|
|
|
|
|
-- init bot_chat_accept_mission title
|
2016-10-14 16:29:29 +00:00
|
|
|
title = 'uiAcceptMission'
|
|
|
|
if (mt == 3) then title = 'uiAcceptZCCharge'
|
|
|
|
elseif (mt == 4) then title = 'uiAcceptBuilding'
|
|
|
|
elseif (mt == 5) then title = 'uiAcceptRMBuy'
|
|
|
|
elseif (mt == 6) then title = 'uiAcceptRMUpgrade'
|
2016-05-06 10:56:20 +00:00
|
|
|
end
|
2016-10-14 16:29:29 +00:00
|
|
|
ui = getUI('ui:interface:bot_chat_accept_mission')
|
2016-05-06 10:56:20 +00:00
|
|
|
ui.title = title;
|
|
|
|
end
|