#include "display_options_logic.lua" #include "ui/ui_extensions.lua" #include "common_components.lua" ChosenDisplay.listView = { } ChosenDisplay.listView.listItems = {} ChosenDisplay.listView.backGround = { w = 12.0, h = 473.0, draw = function(self) UiPush() UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#525252_o1.00_cr4.png", self.w, self.h, 4, 4) UiPop() end, } ChosenDisplay.listView.thumb = { w = 8.0, h = 127.0, draw = function(self) UiPush() UiTranslate(2.0, 10.0) UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#ffffff_o1.00_cr3.png", self.w, self.h, 3, 3) UiPop() end, } ChosenDisplay.listView.scrollBar = UiCreateScrollBar(ChosenDisplay.listView.thumb, ChosenDisplay.listView.backGround) ChosenDisplay.listView = { } ChosenDisplay.listView.listItems = {} ChosenDisplay.listView.backGround = { w = 12.0, h = 473.0, draw = function() UiPush() UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#525252_o1.00_cr4.png", 12.0, 473.0, 4, 4) UiPop() end, } ChosenDisplay.listView.thumb = { w = 8.0, h = 127.0, draw = function() UiPush() UiTranslate(2.0, 10.0) UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#ffffff_o1.00_cr3.png", 8.0, 127.0, 3, 3) UiPop() end, } ChosenDisplay.listView.scrollBar = UiCreateScrollBar(ChosenDisplay.listView.thumb, ChosenDisplay.listView.backGround) function drawComponent_fI458_6533_388_987_item_353_844(p0, p1) local fI458_6533_388_987_item_navId = UiNavGroupBegin() UiNavGroupSize(232.0, 42.0) local fI458_6533_388_987_item_isFocued = UiReceivesInput() and (UiIsMouseInRect(232.0, 42.0) or UiIsComponentInFocus(fI458_6533_388_987_item_navId)) if fI458_6533_388_987_item_isFocued then -- draw frame FI458_6533_388_987_item UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() local navId = UiNavComponent(232.0, 42.0) local isFocused = UiIsMouseInRect(232.0, 42.0) or UiIsComponentInFocus(navId) local isClicked = isFocused and (InputPressed("menu_accept") or InputPressed("lmb")) UiIgnoreNavigation() if isClicked then p0 = not p0 end if p0 then -- draw frame FI458_6533_388_987_359_1089_Checked UiPush() UiPush() UiColor(1, 1, 1, 1) UiTranslate(199.0, 10.0) UiImage("common/dropdown_item_selected.png") UiPop() UiPush() UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#ffffff_o0.15_cr8.png", 232.0, 42.0, 9, 9) UiPop() UiPush() UiTranslate(10.947021484375, 11.244994354248036) UiColor(1.0, 1.0, 0.49803921580314636, 1) UiFont("regular.ttf", 27) UiText(p1) UiPop() UiPop() else -- draw frame FI458_6533_388_987_359_1185_Unchecked UiPush() UiPush() UiColor(1, 1, 1, 1) UiTranslate(199.0, 10.0) UiImage("common/dropdown_item.png") UiPop() UiPush() UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#ffffff_o0.15_cr8.png", 232.0, 42.0, 9, 9) UiPop() UiPush() UiTranslate(10.947021484375, 11.244994354248036) UiColor(1.0, 1.0, 0.49803921580314636, 1) UiFont("regular.ttf", 27) UiText(p1) UiPop() UiPop() end UiPop() UiPop() else -- draw frame FI458_6533_388_987_item UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() local navId = UiNavComponent(232.0, 42.0) local isFocused = UiIsMouseInRect(232.0, 42.0) or UiIsComponentInFocus(navId) local isClicked = isFocused and (InputPressed("menu_accept") or InputPressed("lmb")) UiIgnoreNavigation() if isClicked then p0 = not p0 end if p0 then -- draw frame FI458_6533_388_987_359_1036_Checked UiPush() UiTranslate(9.0, 8.0) UiPush() UiColor(1, 1, 1, 1) UiTranslate(190.0, 2.0) UiImage("common/dropdown_item_selected.png") UiPop() UiPush() UiTranslate(1.947021484375, 3.2449943542480355) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p1) UiPop() UiPop() else -- draw frame FI458_6533_388_987_359_1041_Unchecked UiPush() UiTranslate(9.0, 8.0) UiPush() UiColor(1, 1, 1, 1) UiTranslate(190.0, 2.0) UiImage("common/dropdown_item.png") UiPop() UiPush() UiTranslate(1.947021484375, 3.2449943542480355) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p1) UiPop() UiPop() end UiPop() UiPop() end UiNavGroupEnd() end function drawComponent_f458_6533_Settings_layout_218_273(p0, p1) local f458_6533_Settings_layout_navId = UiNavGroupBegin() UiNavGroupSize(1008.0, 50.0) local f458_6533_Settings_layout_isFocued = UiReceivesInput() and (UiIsMouseInRect(1008.0, 50.0) or UiIsComponentInFocus(f458_6533_Settings_layout_navId)) if f458_6533_Settings_layout_isFocued or p1.isOpened then -- draw frame F458_6533_Settings_layout UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#d9d9d9_o1.00_cr8.png", 1008.0, 50.0, 9, 9) UiPop() UiPush() UiTranslate(11.947006225585938, 15.12399215698241) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p0) UiPop() -- draw frame FI458_6533_388_1316_UiSettingSwitch UiPush() UiTranslate(660.0, 10.0) local ddMainView = { w = 341.0, h = 27.0, drawOpened = function(self, p0) -- draw frame FI458_6533_388_1406_Opened UiPush() UiTranslate(235.0, 0.0) UiPush() UiColor(1, 1, 1, 1) UiTranslate(82.258544921875, 10.486602783203125) UiImageBox("common/img_I218_284_388_1408.png", 18, 12, 0, 0) UiPop() UiPush() UiAlign("top right") UiTranslate(72.5999755859375, 3.123999786376956) UiColor(1.0, 1.0, 0.49803921580314636, 1) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiNavComponent(101.0, 27.0) UiPop() end, drawClosed = function(self, p0) -- draw frame FI458_6533_388_1399_Closed UiPush() UiTranslate(235.0, 0.0) UiPush() UiColor(1, 1, 1, 1) UiTranslate(82.258544921875, 10.0) UiImageBox("common/img_I218_284_388_1401.png", 18, 12, 0, 0) UiPop() UiPush() UiAlign("top right") UiTranslate(72.5999755859375, 3.123999786376956) UiColor(1.0, 1.0, 0.49803921580314636, 1) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiNavComponent(101.0, 27.0) UiPop() end, } local ddListView = { w = 253.0, h = #p1.values * 42 + 25, list = ChosenDisplay.listView, offsetX = 95.0, offsetY = 50.0, draw = function() -- draw frame FI458_6533_388_1413_List UiPush() UiPush() UiTranslate(0.0, 1.0) UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#3a3a3a_o1.00_cr8.png", 252.0, #p1.values * 42 + 25, 8, 8) UiPop() UiPush() UiTranslate(10.0, 12.0) UiList(232.0, 455.0, ChosenDisplay.listView.listItems, ChosenDisplay.listView.scrollBar) UiPop() UiPop() end, } local itemTemplate = { w = 232.0, h = 42.0, draw = function(self, p0, p1) drawComponent_fI458_6533_388_987_item_353_844(p0, p1) end, } UiDropDownList(ddMainView, ddListView, itemTemplate, p1) UiPop() UiPop() else -- draw frame F458_6533_Settings_layout UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() UiTranslate(11.947006225585938, 15.12399215698241) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p0) UiPop() -- draw frame FI458_6533_388_890_UiSettingSwitch UiPush() UiTranslate(660.0, 10.0) local ddMainView = { w = 341.0, h = 27.0, drawOpened = function(self, p0) -- draw frame FI458_6533_388_975_Opened UiPush() UiTranslate(235.0, 0.0) UiPush() UiColor(1, 1, 1, 1) UiTranslate(82.258544921875, 10.486602783203125) UiImageBox("common/img_I218_284_388_980.png", 18, 12, 0, 0) UiPop() UiPush() UiAlign("top right") UiTranslate(72.5999755859375, 3.123999786376956) UiColor(1.0, 1.0, 1.0, 0.6499999761581421) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiNavComponent(101.0, 27.0) UiPop() end, drawClosed = function(self, p0) -- draw frame FI458_6533_388_968_Closed UiPush() UiTranslate(235.0, 0.0) UiPush() UiColor(1, 1, 1, 1) UiTranslate(82.258544921875, 10.0) UiImageBox("common/img_I218_284_388_973.png", 18, 12, 0, 0) UiPop() UiPush() UiAlign("top right") UiTranslate(72.5999755859375, 3.123999786376956) UiColor(1.0, 1.0, 1.0, 0.6499999761581421) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiNavComponent(101.0, 27.0) UiPop() end, } local ddListView = { w = 252.0, h = #p1.values * 42 + 25, list = ChosenDisplay.listView, offsetX = 97.0, offsetY = 50.0, draw = function() -- draw frame FI458_6533_388_982_List UiPush() UiPush() UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#3a3a3a_o1.00_cr8.png", 252.0, #p1.values * 42 + 25, 8, 8) UiPop() UiPush() UiTranslate(10.0, 11.0) UiList(232.0, 455.0, ChosenDisplay.listView.listItems, ChosenDisplay.listView.scrollBar) UiPop() UiPop() end, } local itemTemplate = { w = 232.0, h = 42.0, draw = function(self, p0, p1) drawComponent_fI458_6533_388_987_item_353_844(p0, p1) end, } UiDropDownList(ddMainView, ddListView, itemTemplate, p1) UiPop() UiPop() end UiNavGroupEnd() end DisplaySettings.listItems = {} DisplaySettings.item1 = { w = 1008.0, h = 50.0, draw = function() drawComponent_f458_6533_Settings_layout_218_273(chosenDisplayText, ChosenDisplay.dropDownData) end, } if IsRunningOnPC() or IsRunningOnMac() then table.insert(DisplaySettings.listItems, DisplaySettings.item1) end DisplaySettings.item2 = { w = 1008.0, h = 50.0, draw = function(self) screenModeTooltip.x = self.w + 100 screenModeTooltip.y = 0 drawOptionsListItemWithStepper(screenModeText, stepperScreenModeParams, screenModeTooltip) end, } if IsRunningOnPC() or IsRunningOnMac() then table.insert(DisplaySettings.listItems, DisplaySettings.item2) end DisplaySettings.item3 = { w = 1008.0, h = 50.0, draw = function() drawComponent_f458_6533_Settings_layout_218_273(resolutionText, Resolution.dropDownData) end, } table.insert(DisplaySettings.listItems, DisplaySettings.item3) DisplaySettings.backGround = { w = 12.0, h = 432.0, draw = function() UiPush() UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#525252_o1.00_cr4.png", 12.0, 432.0, 4, 4) UiPop() end, } DisplaySettings.thumb = { w = 8.0, h = 127.0, draw = function() UiPush() UiTranslate(2.0, 2.0) UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#ffffff_o1.00_cr3.png", 8.0, 127.0, 3, 3) UiPop() end, } DisplaySettings.scrollBar = UiCreateScrollBar(DisplaySettings.thumb, DisplaySettings.backGround) DisplaySettings.draw = function(self) -- draw frame F458_6524_DisplayTab UiPush() UiAlign("top left") UiTranslate(-495, -50) UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() UiTranslate(13.0, 0.0) UiList(1008.0, 434.0, DisplaySettings.listItems, DisplaySettings.scrollBar) UiPop() UiPop() if self.showApplyButton then if LastInputDevice() == UI_DEVICE_GAMEPAD then UiPush() UiTranslateToScreenCenter(0, 770) UiDrawHintsCentered({{ ico="[[menu:menu_accept;iconsize=42,42]]", txt="loc@UI_BUTTON_APPLY_DISPLAY" }}) if InputPressed("menu_accept") then Command("game.applydisplay") end UiPop() else UiPush() UiTranslateToScreenCenter(0, 770) UiAlign("middle center") UiColor(0.8, 0.8, 0.8, 1) UiButtonHoverColor(1.25, 1.25, 0.625, 1) UiButtonImageBox("common/rect_c#000000_o0.00_sw1.50_sc#ffffff_so0.30_cr4.png", 6, 6, 1, 1, 1) UiFont("regular.ttf", 25) if UiTextButton("loc@UI_BUTTON_APPLY_DISPLAY", 271.5, 39.5) then Command("game.applydisplay") end UiPop() end end end