1 -- In this file we define functions that serves as an interface between the framework of the
2 -- editor (C++ code), and the ui. Ideally the C++ should never manipulate the ui directly.
3 -- It should rather call functions in this interface to do the job.
4 -- This allow for easy customisation, because users can replace any function with their
5 -- own lua code (possibly forwarding to the previous function).
6 -- This file works in close relation with the r2.xml file with contains the actual ui
16 -- The following table is intended to contain ui related classes & functions
17 -- For now the ui stuffs are being migrated into this table
18 -- TODO nico : move ui stuff here to 'depolute' the r2 table
31 r2
.FeatureTree
.buildFeatureTreeUI()
32 r2
:refreshWindowButtons()
33 --updateAllLocalisedElements()
35 for k
, form
in pairs(r2
.Forms
) do
37 for l
, prop
in pairs(form
.Prop
) do
38 form
.NameToProp
[prop
.Name
] = prop
41 -- make the admin window point on the main page (obsolete, replaced by Session Browser)
42 -- if browseRingWindowHomePage ~= nil then
43 -- browseRingWindowHomePage()
45 -- debugInfo("---> ERROR: what is browseRingWindowHomePage?")
48 local paletteWnd
= getUI("ui:interface:r2ed_palette")
49 local debugPanel
= paletteWnd
:find("debug_panel").button_enclosing
50 local extDbg
= (config
.R2EDExtendedDebug
== 1)
52 local chooseLocationWnd
= getUI("ui:interface:r2ed_acts")
53 local ringLevelDebug
= chooseLocationWnd
:find("ring_level")
56 debugPanel
.reset_ed
.active
= extDbg
57 debugPanel
.reset_ed_and_reload_ui
.active
= extDbg
58 debugPanel
.reload_core
.active
= extDbg
59 debugPanel
.inspect_r2
.active
= extDbg
60 debugPanel
.reset_display
.active
= extDbg
61 ringLevelDebug
.active
= extDbg
62 -- debugPanel.test.active = extDbg
63 -- debugPanel.create_scenario.active = extDbg
64 -- debugPanel.create_act.active = extDbg
65 -- debugPanel.connect_scenario.active = extDbg
66 -- debugPanel.reconnect_scenario.active = extDbg
67 -- debugPanel.list_adventures.active = extDbg
69 paletteWnd
:find("tab2").active
= true
70 paletteWnd
:find("tab2_bm").active
= true
71 paletteWnd
:find("tab4").active
= extDbg
72 paletteWnd
:find("tab4_bm").active
= extDbg
82 local headNode
= SNode()
83 local rootNode
= SNode()
84 headNode
:addChild(rootNode
)
85 rootNode
.Text
= "Root"
86 rootNode
.Opened
= true
87 rootNode
.Bitmap
= "ICO_Atys.tga"
88 local tree
= getUI(r2
.instanceTree
);
91 son
.Text
= "Node " .. tostring(i
)
92 rootNode
:addChild(son
)
94 tree
:setRootNode(headNode
)