diff --git a/ModConfigMenu.lua b/ModConfigMenu.lua index 93e685e..b372402 100644 --- a/ModConfigMenu.lua +++ b/ModConfigMenu.lua @@ -57,7 +57,7 @@ local function UpdateCheckBox( button, value ) end local function ShowCurrentMenu( screen ) - local rowStartX = 350 + local rowStartX = 300 local columnSpacingX = 600 local itemLocationX = rowStartX local itemLocationY = 250 @@ -89,7 +89,8 @@ local function ShowCurrentMenu( screen ) }) local itemsInRow = 0 - for name, value in orderedPairs( currentMenu ) do + for _, name in ipairs( currentMenu ) do + value = currentMenu[name] local previousItemLocationX = itemLocationX if value == true or value == false or type(value) == "number" then itemsInRow = itemsInRow + 1 @@ -102,7 +103,7 @@ local function ShowCurrentMenu( screen ) components[name .. "TextBox"] = CreateScreenComponent({ Name = "BlankObstacle", Scale = 1, - X = itemLocationX, + X = itemLocationX + itemSpacingX - 70, Y = itemLocationY, Group = "Combat_Menu" }) CreateTextBox({ @@ -113,7 +114,7 @@ local function ShowCurrentMenu( screen ) OffsetX = 0, OffsetY = 0, Font = "AlegrayaSansSCRegular", ShadowBlur = 0, ShadowColor = { 0, 0, 0, 1 }, ShadowOffset = { 0, 2 }, - Justification = "Center" + Justification = "Right" }) itemLocationX = itemLocationX + itemSpacingX end @@ -130,28 +131,29 @@ local function ShowCurrentMenu( screen ) components[name .. "CheckBox"].OnPressedFunctionName = "ModConfigMenu__ToggleBoolean" itemLocationX = previousItemLocationX + columnSpacingX elseif type(value) == "number" then - components[name .. "ButtonPlus"] = CreateScreenComponent({ - Name = "LevelUpArrowRight", + components[name .. "ButtonMinus"] = CreateScreenComponent({ + Name = "LevelUpArrowLeft", Scale = 1, X = itemLocationX - 40, Y = itemLocationY, Group = "CombatMenu" }) - components[name .. "ButtonPlus"].MenuItemName = name - components[name .. "ButtonPlus"].OnPressedFunctionName = "ModConfigMenu__ButtonPlus" - components[name .. "ButtonMinus"] = CreateScreenComponent({ - Name = "LevelUpArrowLeft", + components[name .. "ButtonMinus"].MenuItemName = name + components[name .. "ButtonMinus"].OnPressedFunctionName = "ModConfigMenu__ButtonMinus" + + components[name .. "ButtonPlus"] = CreateScreenComponent({ + Name = "LevelUpArrowRight", Scale = 1, - X = itemLocationX, + X = itemLocationX + 40, Y = itemLocationY, Group = "CombatMenu" }) - components[name .. "ButtonMinus"].MenuItemName = name - components[name .. "ButtonMinus"].OnPressedFunctionName = "ModConfigMenu__ButtonMinus" + components[name .. "ButtonPlus"].MenuItemName = name + components[name .. "ButtonPlus"].OnPressedFunctionName = "ModConfigMenu__ButtonPlus" components[name .. "NumberText"] = CreateScreenComponent({ Name = "BlankObstacle", Scale = 1, - X = itemLocationX + 40, + X = itemLocationX, Y = itemLocationY, Group = "Combat_Menu" }) CreateTextBox({ @@ -333,4 +335,3 @@ ModUtil.WrapBaseFunction("CreatePrimaryBacking", function ( baseFunc ) Attach({ Id = components.ModConfigButton.Id, DestinationId = components.ModConfigButton, OffsetX = 500, OffsetY = 500 }) baseFunc() end, ModConfigMenu) - diff --git a/README.md b/README.md index bf00843..704ee49 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ other Hades mods via an in-game UI, so you can change them on the fly. Features: - - UI for toggling boolean values + - UI for boolean values toggle + - UI for adjustment of numerical values - Minimal setup Settings are saved in your save file, so they're only @@ -17,8 +18,11 @@ To use, add config like the following to your mod: local config = { ModName = "Your Mod's name", + "YourFirstSetting","YourThirdSetting", -- only these settings will be exposed in the mod menu, in this order + YourFirstSetting = true, - YourSecondSetting = false + YourSecondSetting = false, + YourThirdSetting = 5, } ModConfigMenu.Register(config)