diff --git a/data/Source/Scripts/Views/GamePlayOptionsView.xdi b/data/Source/Scripts/Views/GamePlayOptionsView.xdi index 512e227..5bea46b 100644 --- a/data/Source/Scripts/Views/GamePlayOptionsView.xdi +++ b/data/Source/Scripts/Views/GamePlayOptionsView.xdi @@ -11,16 +11,24 @@ GamePlayOptionsView.__flipboardId = "OPTIONS_GAMEPLAY" function GamePlayOptionsView:new(parent) Container.new(self, parent, TableLayout({0}, {0}, 0, 0, 16, 16)) - local ct = Container(self, TableLayout({0, 100}, {0}, 0, 0, 16, 16)) - + local sl = Selector(self) + :setHorizontalAlign(Widget.ALIGN_CENTER) + + local ct = Container(sl, TableLayout({100,0}, {0}, 0, 0, 16, 0)) Static(ct, "BOOSTERS") + :setTextSize(70) + :setTextColor(Color4f(1, 1, 1, 1)) CheckBox(ct) + :setVerticalAlign(Widget.ALIGN_CENTER) + sl:add(ct) + local ct = Container(sl, TableLayout({100,0}, {0}, 0, 0, 16, 0)) Static(ct, "PICKUPS") + :setTextSize(70) + :setTextColor(Color4f(1, 1, 1, 1)) CheckBox(ct) - - PushButton(self, "RETURN") - :setOnClick(function() self._fnReturn() end) + :setVerticalAlign(Widget.ALIGN_CENTER) + sl:add(ct) self._fnReturn = function() end end @@ -29,6 +37,7 @@ function GamePlayOptionsView:setOnReturn(fn) self._fnReturn = fn return self end + ]]> diff --git a/data/Source/Scripts/Views/Widgets/Selector.xdi b/data/Source/Scripts/Views/Widgets/Selector.xdi index 44b84f3..51ac035 100644 --- a/data/Source/Scripts/Views/Widgets/Selector.xdi +++ b/data/Source/Scripts/Views/Widgets/Selector.xdi @@ -25,9 +25,13 @@ function Selector:place(x, y, width, height) end function Selector:add(item) - local s = Static(self, item) - :setTextSize(70) - table.insert(self._items, s) + if type(item) == "string" then + local s = Static(self, item) + :setTextSize(70) + table.insert(self._items, s) + else + table.insert(self._items, item) + end self:_layout() return self end @@ -70,12 +74,16 @@ function Selector:_layout() for idx, mc in ipairs(self._items) do local x < const > = (w - mc:getPreferredSize().width) / 2 - mc:place(x, y + 12, p.width, 80) - if idx == self._index + 1 then - mc:setTextColor(Color4f(1, 1, 1, 1)) - else - mc:setTextColor(Color4f(1, 1, 1, 0.75)) + mc:place(x, y + 12, w - x * 2, 80) + + if mc.setTextColor ~= nil then + if idx == self._index + 1 then + mc:setTextColor(Color4f(1, 1, 1, 1)) + else + mc:setTextColor(Color4f(1, 1, 1, 0.75)) + end end + y = y + 80 end @@ -111,6 +119,7 @@ function Selector:_onKeyUp(event) end end end + ]]> diff --git a/data/Source/UI/UI_Scaffolding.xdi b/data/Source/UI/UI_Scaffolding.xdi index a2677ca..76e4a33 100644 --- a/data/Source/UI/UI_Scaffolding.xdi +++ b/data/Source/UI/UI_Scaffolding.xdi @@ -22,7 +22,7 @@ function UI_Scaffolding:setup(frame) local fb = Flipboard(frame) - HudView(fb) + HudView(fb, 4) MainView(fb) :setHorizontalAlign(Widget.ALIGN_CENTER) @@ -49,13 +49,14 @@ function UI_Scaffolding:setup(frame) :setHorizontalAlign(Widget.ALIGN_CENTER) :setVerticalAlign(Widget.ALIGN_CENTER) - fb:showPage("MAIN") + fb:showPage("OPTIONS_GAMEPLAY") end function UI_Scaffolding:getResourceKits() return { "\{43489F5B-5785-1249-A7BA-CB5259C3F064}", "\{27DDC0FD-39DE-0946-BB1B-7D84A001C522}", "\{5ABEAE05-EB26-934F-932F-7F3C7C582383}" } end + ]]>