#include "input_options_logic.lua" #include "ui/ui_extensions.lua" #include "common_components.lua" InputSettings = { } function drawComponent_f519_1240_item_(p0, p1) local f519_1240_item_navId = UiNavGroupBegin() UiNavGroupSize(1008.0, 50.0) local f519_1240_item_isFocued = UiReceivesInput() and (UiIsMouseInRect(1008.0, 50.0) or UiIsComponentInFocus(f519_1240_item_navId)) if f519_1240_item_isFocued then -- draw frame F519_1240_item 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.124007415771473) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiPush() UiButtonImageBox("common/rect_c#000000_o0.00_sw1.50_sc#868686_so1.00_cr4.png", 6, 6, 1, 1, 1) UiTranslate(661.25, 5.25) UiColor(0.8, 0.8, 0.8, 1) UiFont("regular.ttf", 25) if UiTextButton(p1.text, 331.5, 39.5) then p1:onPressed() end UiPop() UiPop() else -- draw frame F519_1240_item UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() UiTranslate(11.947006225585938, 15.124007415771473) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiPush() UiButtonImageBox("common/rect_c#000000_o0.00_sw1.50_sc#868686_so1.00_cr4.png", 6, 6, 1, 1, 1) UiTranslate(661.25, 5.25) UiColor(0.8, 0.8, 0.8, 1) UiFont("regular.ttf", 25) if UiTextButton(p1.text, 331.5, 39.5) then p1:onPressed() end UiPop() UiPop() end UiNavGroupEnd() end function drawInputItemInteractive(p0, p1) local f521_1720_item_navId = UiNavGroupBegin() UiNavGroupSize(1008.0, 50.0) local f521_1720_item_isFocued = UiReceivesInput() and (UiIsMouseInRect(1008.0, 50.0) or UiIsComponentInFocus(f521_1720_item_navId)) if f521_1720_item_isFocued then -- draw frame F521_1720_item 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.124007415771473) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiPush() UiButtonPressDist(0, 0) UiButtonImageBox("common/rect_c#000000_o0.00_sw1.50_sc#ffff7f_so1.00_cr6.png", 8, 8, 1, 1, 1) UiTranslate(990.0, 4.0) UiAlign("top right") UiColor(1.0, 1.0, 0.49803921580314636, 1) UiFont("regular.ttf", 25) if UiTextButton(p1:text(), 42.0, 42.0) then p1:onPressed() end UiPop() UiPop() else -- draw frame F521_1720_item UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() UiTranslate(11.947006225585938, 15.124007415771473) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiPush() UiButtonPressDist(0, 0) UiButtonImageBox("common/rect_c#000000_o0.00_sw1.50_sc#868686_so1.00_cr6.png", 8, 8, 1, 1, 1) UiTranslate(990.0, 4.0) UiAlign("top right") UiColor(0.7, 0.7, 0.7, 1) UiFont("regular.ttf", 25) if UiTextButton(p1:text(), 42.0, 42.0) then p1:onPressed() end UiPop() UiPop() end UiNavGroupEnd() end function drawInputItemNonInteractive(p0, p1) local f521_1720_item_navId = UiNavGroupBegin() UiNavGroupSize(1008.0, 50.0) local f521_1720_item_isFocued = UiReceivesInput() and (UiIsMouseInRect(1008.0, 50.0) or UiIsComponentInFocus(f521_1720_item_navId)) if f521_1720_item_isFocued then -- draw frame F521_1720_item 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.124007415771473) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiPush() UiTranslate(990.0, 15.0) UiAlign("top right") UiColor(1.0, 1.0, 0.49803921580314636, 1) UiFont("regular.ttf", 25) UiText(GetTranslatedStringByKey(p1)) UiNavComponent(42, 42) UiPop() UiPop() else -- draw frame F521_1720_item UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() UiTranslate(11.947006225585938, 15.124007415771473) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("regular.ttf", 27) UiText(p0) UiPop() UiPush() UiButtonImageBox("common/rect_c#000000_o0.00_sw1.50_sc#868686_so1.00_cr6.png", 8, 8, 1, 1, 1) UiTranslate(990.0, 15.0) UiAlign("top right") UiColor(0.5291666388511658, 0.5291666388511658, 0.5291666388511658, 1) UiFont("regular.ttf", 25) UiText(GetTranslatedStringByKey(p1)) UiNavComponent(42, 42) UiPop() UiPop() end UiNavGroupEnd() end function drawComponent_f520_1418_LabelSetting_431_5156(p2) -- draw frame F520_1418_LabelSetting UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiPush() UiTranslate(2.0, 47.0) UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#d9d9d9_o0.40.png", 1005.0, 2.0, 2, 2) UiPop() UiPush() UiAlign("top center") UiTranslateToScreenCenter(0, 16) UiColor(1.0, 1.0, 1.0, 0.800000011920929) UiFont("bold.ttf", 27) UiText(p2) UiPop() UiPop() end function drawComponent_f520_1421_item_(p0, p1, p2) -- draw frame F520_1421_item UiPush() UiColorFilter(1.0, 1.0, 1.0, 1) UiTranslate(0.0, 60.0) drawInputItemInteractive(p0, p1) UiTranslate(0.0, -60.0) drawComponent_f520_1418_LabelSetting_431_5156(p2) UiPop() end InputSettings.listItems = {} InputSettings.item1 = { w = 1008.0, h = 50.0, draw = function(self) drawOptionsListItemWithSlider(sensitivityText, sliderSensitivityParams) end, } table.insert(InputSettings.listItems, InputSettings.item1) InputSettings.item2 = { w = 1008.0, h = 50.0, draw = function(self) drawOptionsListItemWithSlider(smoothingText, sliderSmoothingParams) end, } table.insert(InputSettings.listItems, InputSettings.item2) InputSettings.item3 = { w = 1008.0, h = 50.0, draw = function(self) drawOptionsListItemWithStepper(invertLookText, stepperInvertLookParams) end, } table.insert(InputSettings.listItems, InputSettings.item3) InputSettings.item4 = { w = 1008.0, h = 50.0, draw = function(self) toolSwayTooltip.x = self.w + 100 toolSwayTooltip.y = 0 drawOptionsListItemWithStepper(toolSwayText, stepperToolSwayParams, toolSwayTooltip) end, } table.insert(InputSettings.listItems, InputSettings.item4) InputSettings.item5 = { w = 1008.0, h = 50.0, draw = function(self) headBobTooltip.x = self.w + 100 headBobTooltip.y = 0 drawOptionsListItemWithSlider(headBobText, sliderHeadBobParams, headBobTooltip) end, } table.insert(InputSettings.listItems, InputSettings.item5) InputSettings.item6 = { w = 1008.0, h = 50.0, draw = function(self) drawComponent_f519_1240_item_(gamepadText, gamepadButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item6) InputSettings.item7 = { w = 994.0, h = 110.0, draw = function(self) drawComponent_f520_1421_item_(moveForwardText, moveForwardButtonParams, kbLayoutLabelText) end, } table.insert(InputSettings.listItems, InputSettings.item7) InputSettings.item8 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemInteractive(moveBackText, moveBackButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item8) InputSettings.item9 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemInteractive(moveLeftText, moveLeftButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item9) InputSettings.item10 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemInteractive(moveRightText, moveRightButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item10) InputSettings.item11 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemInteractive(jumpText, jumpButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item11) InputSettings.item12 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemInteractive(crouchText, crouchButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item12) InputSettings.item13 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemInteractive(interactText, interactButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item13) InputSettings.item14 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemInteractive(flashlightText, flashlightButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item14) InputSettings.item15 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemNonInteractive(mapActionText, mapActionButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item15) InputSettings.item16 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemNonInteractive(pauseActionText, pauseActionButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item16) InputSettings.item17 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemNonInteractive(changeToolActionText, changeToolActionButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item17) InputSettings.item18 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemNonInteractive(useToolActionText, useToolActionButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item18) InputSettings.item19 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemNonInteractive(grabActionText, grabActionButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item19) InputSettings.item20 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemNonInteractive(grabDistanceActionText, grabDistanceActionButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item20) InputSettings.item21 = { w = 1008.0, h = 50.0, draw = function(self) drawInputItemNonInteractive(throwActionText, throwActionButtonParams) end, } table.insert(InputSettings.listItems, InputSettings.item21) InputSettings.backGround = { w = 12.0, h = 780.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, } InputSettings.thumb = { w = 8.0, h = 200.0, draw = function(self) UiPush() UiTranslate(2.0, 2.0) UiColor(1, 1, 1, 1) UiImageBox("common/rect_c#ffffff_o1.00_cr3.png", self.w, self.h, 3, 3) UiPop() end, } InputSettings.scrollBar = UiCreateScrollBar(InputSettings.thumb, InputSettings.backGround) InputSettings.scrollBar.scrollbarOffset = 20 function drawInputOptionsHint() if LastInputDevice() == UI_DEVICE_MOUSE then UiPush() 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", 27) if UiTextButton(resetInputButtonParams.text, 271.5, 39.5) then resetInputButtonParams:onPressed() end UiPop() else UiPush() UiColor(1, 1, 1, 1) local change_ico = "[[menu:gamepad_dpad_leftright;iconsize=42,42]]" if IsRunningOnSteam() then change_ico = "[[menu:gamepad_dpad_left;iconsize=42,42]], [[menu:gamepad_dpad_right;iconsize=42,42]]" end UiDrawHintsCentered({ { ico = change_ico, txt = "loc@UI_CHANGE" }, { ico = "[[menu:interact;iconsize=42,42]]", txt = "loc@UI_RESET_TO_DEFAULT_LAYOUT" }, { ico = "[[menu:menu_cancel;iconsize=42,42]]", txt = "loc@UI_BACK" } }) if InputPressed("interact") then resetInputButtonParams:onPressed() end UiPop() end end function drawInputOptions() GamepadSettings.dialog:update() GamepadLayout.dialog:update() newKeyDialogState:update() gamepadButtonParams:update() gamepadLayoutButtonParams:update() if gOptionTemporaryHideScale == 0 then return end -- draw frame F458_6524_InputTab UiPush() UiAlign("top left") UiTranslate(-495, -50) UiColorFilter(1.0, 1.0, 1.0, 1) UiTranslate(13.0, 0.0) UiList(1008.0, 779.0, InputSettings.listItems, InputSettings.scrollBar) UiPop() UiPush() UiTranslateToScreenCenter(0, 790) drawInputOptionsHint() UiPop() end