1 -- management of visible editor windows
7 -------------------------------------------------------------------------------------
8 -- refresh the button that allow to toggle a window on / off
9 function r2
:refreshWindowButtons()
10 -- debugInfo("refreshWindowButtons")
14 -------------------------------------------------------------------------------------
15 function r2
:switchWindow(name
)
16 local wnd
= getUI(name
)
17 wnd
.active
= not wnd
.active
20 -------------------------------------------------------------------------------------
21 -- misc windows activation deactivation
22 function r2
:switchPaletteWindow()
23 self
:switchWindow("ui:interface:r2ed_palette")
26 function r2
:switchScenarioWindow()
27 self
:switchWindow("ui:interface:r2ed_scenario")
30 function r2
:switchDebugWindow()
31 self
:switchWindow("ui:interface:debug_info")
34 function r2
:switchChatWindow()
35 self
:switchWindow("ui:interface:main_chat")
38 function r2
:switchWebAdminWindow()
39 self
:switchWindow("ui:interface:r2ed_ring_window")
42 function r2
:switchMailBoxWindow()
43 self
:switchWindow("ui:interface:mailbox")
46 function r2
:switchGuildForumWindow()
47 self
:switchWindow("ui:interface:guild_forum")
50 function r2
:switchMapWindow()
51 self
:switchWindow("ui:interface:map")
54 function r2
:switchPlayerAdminWindow()
55 self
:switchWindow("ui:interface:ring_chars_tracking")
58 function r2
:switchCustomBBoxWindow()
59 self
:switchWindow("ui:interface:r2ed_bbox_edit")
60 if r2
.CustomBBox
.FirstDisplay
== true then
61 if r2
.CustomBBox
:getWindow().active
then
62 r2
.CustomBBox
:getWindow():center()
64 r2
.CustomBBox
.FirstDisplay
= false
66 if r2
.CustomBBox
:getWindow().active
then
67 runCommand("showR2EntityBoxes")
69 runCommand("hideR2EntityBoxes")
74 function r2
:isPropertyWindowVisible()
75 if r2
.PropertyWindowVisible
== true then
76 if r2
.CurrentPropertyWindow
~= nil then
83 function r2
:switchPropertiesWindow()
84 if r2
:isPropertyWindowVisible() then
85 if r2
.CurrentPropertyWindow
~= nil then
86 r2
.CurrentPropertyWindow
.active
= false
88 r2
.PropertyWindowVisible
= false
90 r2
:showProperties(r2
:getSelectedInstance())
98 r2
.PropertyWindowVisible
= false -- not stored in window because there are several "properties" windows (one per class)
99 r2
.CurrentPropertyWindow
= nil -- current property window being displayed
102 -----------------------------------------
103 -- INIT OF WINDOW POSITIONS AT STARTUP --
104 -----------------------------------------
107 -- init default pos for a property window
108 function r2
:initDefaultPropertyWindowPosition(wnd
)
112 scrW
, scrH
= getWindowSize()