Update lua versions
[ryzomcore.git] / ryzom / client / data / gamedev / interfaces_v3 / help.lua
blob9d3d437531649f61c52a2be8c97a8bb6fc410267
1 -- In this file we define functions that serves for help windows
3 ------------------------------------------------------------------------------------------------------------
4 -- create the game namespace without reseting if already created in an other file.
5 if (help==nil) then
6 help = {}
7 end
9 ------------------------------------------------------------------------------------------------------------
11 function help:closeCSBrowserHeader()
12 local ui = getUI('ui:interface:cs_browser')
14 -- save size
15 ui_cs_browser_h = ui.h
16 ui_cs_browser_w = ui.w
18 -- reduce window size
19 ui.pop_min_h = 32
20 ui.h = 0
21 ui.w = 216
22 end
24 ------------------------------------------------------------------------------------------------------------
26 function help:openCSBrowserHeader()
27 local ui = getUI('ui:interface:cs_browser')
28 ui.pop_min_h = 96
30 -- set size from saved values
31 if (ui_cs_browser_h ~= nil) then
32 ui.h = ui_cs_browser_h
33 end
35 if (ui_cs_browser_w ~= nil) then
36 ui.w = ui_cs_browser_w
37 end
38 end
40 function help:skipTutorial()
41 WebQueue:push("https://app.ryzom.com/app_arcc/outgame_rpbg.php?action=skip")
42 setDbProp("UI:SAVE:SKIP_WELCOME", 1)
43 setDbProp("UI:SAVE:TUTORIAL_ACTIVE_SETS", 1)
44 setDbProp("UI:SAVE:TUTORIAL_ACTIVE_INFO_PLAYER_JOURNAL", 1)
45 setDbProp("UI:SAVE:TUTORIAL_ACTIVE_PLAYER", 1)
46 setDbProp("UI:SAVE:TUTORIAL_ACTIVE_COMPASS", 1)
47 setDbProp("UI:SAVE:TUTORIAL_ACTIVE_TARGET", 1)
48 setDbProp("UI:SAVE:TUTORIAL_ACTIVE_MAIN_CHAT", 1)
49 setDbProp("UI:SAVE:TUTORIAL_ACTIVE_INVENTORY", 1)
50 setDbProp("UI:SAVE:TUTORIAL_ACTIVE_ENCYCLOPEDIA", 1)
51 setDbProp("UI:SAVE:ISENABLED:AROUND_ME", 1)
52 setDbProp("UI:SAVE:ISENABLED:REGION_CHAT", 1)
53 setDbProp("UI:SAVE:ISENABLED:DYNAMIC_CHAT0", 1)
54 if getDbProp("UI:SAVE:SKIP_TUTORIAL") == 1 then
55 return
56 end
57 setDbProp("UI:SAVE:SKIP_TUTORIAL", 1)
58 runAH(nil, "milko_menu_do_reset_interface", "")
59 removeOnDbChange(getUI("ui:interface:milko_pad"), "@UI:VARIABLES:CURRENT_SERVER_TICK")
60 end
62 function help:displayWelcome()
63 -- Hide not ready windows
64 if not game:areInSilan() then
65 return
66 end
68 if getDbProp("UI:SAVE:SKIP_TUTORIAL") == 1 then
69 return
70 end
72 game:keepExpandCapWeb(true)
74 if getDbProp("UI:SAVE:TUTORIAL_ACTIVE_MAIN_CHAT") == 0 then
75 setDbProp("UI:SAVE:ISENABLED:AROUND_ME", 0)
76 setDbProp("UI:SAVE:ISENABLED:REGION_CHAT", 0)
77 setDbProp("UI:SAVE:ISENABLED:DYNAMIC_CHAT0", 0)
78 end
80 if getDbProp("UI:SAVE:TUTORIAL_ACTIVE_SETS") == 0 then
81 getUI("ui:interface:gestionsets").active=false
82 end
84 if getDbProp("UI:SAVE:TUTORIAL_ACTIVE_INFO_PLAYER_JOURNAL") == 0 then
85 getUI("ui:interface:info_player_journal").active=false
86 end
88 if getDbProp("UI:SAVE:TUTORIAL_ACTIVE_PLAYER") == 0 then
89 getUI("ui:interface:player").active=false
90 end
92 if getDbProp("UI:SAVE:TUTORIAL_ACTIVE_TARGET") == 0 then
93 getUI("ui:interface:target").active=false
94 end
97 getUI("ui:interface:milko_pad:content:mode_button").active=false
98 setDbProp("UI:SAVE:MK_MODE", 5)
99 game:activeMilkoKey(1, false)
100 game:activeMilkoKey(2, false)
101 game:activeMilkoKey(3, false)
102 game:activeMilkoKey(4, getDbProp("UI:SAVE:TUTORIAL_ACTIVE_INVENTORY") == 1) -- bag
103 game:activeMilkoKey(5, getDbProp("UI:SAVE:TUTORIAL_ACTIVE_ENCYCLOPEDIA") == 1) -- ency
104 game:activeMilkoKey(6, true) -- mission
105 game:activeMilkoKey(7, true) -- help
106 game:activeMilkoKey(8, true) -- system
107 game:activeMilkoKey(9, true) -- quit
108 game:resizeMilkoPad()
109 getUI("ui:interface:milko_pad").y = 5
112 function help:initWelcome()
113 if getDbProp("UI:SAVE:SKIP_TUTORIAL") == 1 then return end
115 local root = getUI("ui:interface")
116 local wins = {"compass", "player", "target", "welcome_info", "encyclopedia", "milko_pad:content:mode_button"}
118 for _, win in ipairs(wins) do
119 local ui = getUI("ui:interface:"..win, false)
120 if ui and ui.active and getDbProp("UI:SAVE:TUTORIAL_ACTIVE_"..win:upper()) == 0 then
121 ui.active = false
122 if win == "milko_pad:content:mode_button" then
123 game:resizeMilkoPad()
127 addOnDbChange(getUI("ui:interface:milko_pad"), "@UI:VARIABLES:CURRENT_SERVER_TICK", "help:checkCapActive()")
130 function help:checkCapActive()
131 local cap = getUI("ui:interface:cap")
132 if cap.active == false then
133 cap.active = true
137 function help:continueLesson(id, url)
138 getUI("ui:interface:ArkLessonWin"..id).active = true
139 webig:checkUrl(url)
144 -- VERSION --
145 RYZOM_HELP_VERSION = 10469