File tree Expand file tree Collapse file tree 7 files changed +14
-94
lines changed
Expand file tree Collapse file tree 7 files changed +14
-94
lines changed Original file line number Diff line number Diff line change @@ -49,21 +49,9 @@ function ScenarioInfoView:init()
4949 })
5050 )
5151
52- local children = {
53- ScrollPanel :New {
54- x = 0 ,
55- y = 0 ,
56- bottom = 30 ,
57- right = 0 ,
58- borderColor = {0 ,0 ,0 ,0 },
59- horizontalScrollbar = false ,
60- children = { self .stackPanel },
61- },
62- }
63-
6452 SB .model .scenarioInfo :addListener (ScenarioInfoListenerWidget (self ))
6553
66- self :Finalize (children )
54+ self :Finalize ()
6755end
6856
6957function ScenarioInfoView :OnStartChange (name )
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ function GrassEditor:init()
3737 SB .model .terrainManager :generateShape (texture )
3838 end
3939 }))
40- self .btnAddGrass = TabbedPanelButton ({
40+ self .btnAddGrass = ActionButton ({
4141 x = 0 ,
4242 y = 0 ,
4343 tooltip = " Left Click to add grass, Right Click to remove it." ,
@@ -83,19 +83,9 @@ function GrassEditor:init()
8383 tooltip = " Rotation of the shape" ,
8484 }))
8585
86- local children = {
87- self .btnAddGrass ,
88- ScrollPanel :New {
89- x = 0 ,
90- y = 70 ,
91- bottom = 30 ,
92- right = 0 ,
93- borderColor = {0 ,0 ,0 ,0 },
94- horizontalScrollbar = false ,
95- children = { self .stackPanel },
96- },
97- }
98- self :Finalize (children )
86+ self :Finalize ({
87+ actionButtons = { self .btnAddGrass }
88+ })
9989end
10090
10191function GrassEditor :OnFieldChange (name , value )
Original file line number Diff line number Diff line change @@ -136,21 +136,9 @@ function LightingEditor:init()
136136
137137 self :UpdateLighting ()
138138
139- local children = {
140- ScrollPanel :New {
141- x = 0 ,
142- y = 0 ,
143- bottom = 30 ,
144- right = 0 ,
145- borderColor = {0 ,0 ,0 ,0 },
146- horizontalScrollbar = false ,
147- children = { self .stackPanel },
148- },
149- }
150-
151139 SB .commandManager :addListener (self )
152140
153- self :Finalize (children )
141+ self :Finalize ()
154142end
155143
156144function LightingEditor :UpdateLighting ()
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ function MetalEditor:init()
3737 SB .model .terrainManager :generateShape (texture )
3838 end
3939 }))
40- self .btnSetMetal = TabbedPanelButton ({
40+ self .btnSetMetal = ActionButton ({
4141 x = 0 ,
4242 y = 0 ,
4343 tooltip = " Left Click to set metal. Right click to remove it." ,
@@ -56,7 +56,7 @@ function MetalEditor:init()
5656 })
5757
5858 self :AddControl (" btn-show-metal" , {
59- Button : New {
59+ EditorButton {
6060 caption = " Show metal map" ,
6161 width = 200 ,
6262 height = 40 ,
@@ -93,19 +93,9 @@ function MetalEditor:init()
9393 tooltip = " Amount of metal" ,
9494 }))
9595
96- local children = {
97- self .btnSetMetal ,
98- ScrollPanel :New {
99- x = 0 ,
100- y = 70 ,
101- bottom = 30 ,
102- right = 0 ,
103- borderColor = {0 ,0 ,0 ,0 },
104- horizontalScrollbar = false ,
105- children = { self .stackPanel },
106- },
107- }
108- self :Finalize (children )
96+ self :Finalize ({
97+ actionButtons = { self .btnSetMetal }
98+ })
10999end
110100
111101function MetalEditor :IsValidState (state )
Original file line number Diff line number Diff line change @@ -78,21 +78,9 @@ function SkyEditor:init()
7878 }))
7979 self :UpdateAtmosphere ()
8080
81- local children = {
82- ScrollPanel :New {
83- x = 0 ,
84- y = 0 ,
85- bottom = 30 ,
86- right = 0 ,
87- borderColor = {0 ,0 ,0 ,0 },
88- horizontalScrollbar = false ,
89- children = { self .stackPanel },
90- },
91- }
92-
9381 SB .commandManager :addListener (self )
9482
95- self :Finalize (children )
83+ self :Finalize ()
9684end
9785
9886function SkyEditor :UpdateAtmosphere ()
Original file line number Diff line number Diff line change @@ -48,19 +48,7 @@ function TerrainSettingsEditor:init()
4848 self :_AddMapTextureControls ()
4949 -- self:_AddMapCompileControls()
5050
51- local children = {
52- ScrollPanel :New {
53- x = 0 ,
54- y = 0 ,
55- bottom = 30 ,
56- right = 0 ,
57- borderColor = {0 ,0 ,0 ,0 },
58- horizontalScrollbar = false ,
59- children = { self .stackPanel },
60- },
61- }
62-
63- self :Finalize (children )
51+ self :Finalize ()
6452end
6553
6654function TerrainSettingsEditor :_AddMapTextureControls ()
Original file line number Diff line number Diff line change @@ -269,21 +269,9 @@ function WaterEditor:init()
269269
270270 self :UpdateWaterRendering ()
271271
272- local children = {
273- ScrollPanel :New {
274- x = 0 ,
275- y = 0 ,
276- bottom = 30 ,
277- right = 0 ,
278- borderColor = {0 ,0 ,0 ,0 },
279- horizontalScrollbar = false ,
280- children = { self .stackPanel },
281- },
282- }
283-
284272 SB .commandManager :addListener (self )
285273
286- self :Finalize (children )
274+ self :Finalize ()
287275end
288276
289277function WaterEditor :UpdateWaterRendering ()
You can’t perform that action at this time.
0 commit comments