diff --git a/CMakeLists.txt b/CMakeLists.txt index 09023fb..bf2cba3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) set(NAME "LamasTinyHUD" CACHE STRING "") -set(VERSION 1.0.0.8 CACHE STRING "") +set(VERSION 1.0.0.9 CACHE STRING "") # ---- Options ---- diff --git a/mcm/Config/LamasTinyHUD/config.json b/mcm/Config/LamasTinyHUD/config.json index 41ba57f..c4aca8a 100644 --- a/mcm/Config/LamasTinyHUD/config.json +++ b/mcm/Config/LamasTinyHUD/config.json @@ -50,26 +50,912 @@ "sourceType": "ModSettingInt" } }, + { + "id": "uToggleKey:Controls", + "text": "$LamasTinyHUD_ToggleKey_OptionText", + "type": "keymap", + "help": "$LamasTinyHUD_ToggleKey_InfoText", + "ignoreConflicts": false, + "valueOptions": { + "sourceType": "ModSettingInt" + } + }, { "text": "$LamasTinyHUD_Controls_Controller", "type": "header", "position": 1 }, { - "id": "uControllerSet:Controls", - "text": "$LamasTinyHUD_Controls_Controller_OptionText", + "id": "uControllerSet:Controls", + "text": "$LamasTinyHUD_Controls_Controller_OptionText", + "type": "enum", + "help": "$LamasTinyHUD_Controls_Controller_InfoText", + "valueOptions": { + "options": ["$LamasTinyHUD_Controls_PS", "$LamasTinyHUD_Controls_XBOX"], + "sourceType": "ModSettingInt", + "defaultValue": 0 + } + } + ] + }, + { + "pageDisplayName": "$LamasTinyHUD_TopPage", + "cursorFillMode": "topToBottom", + "content": [{ + "text": "$LamasTinyHUD_Header_RightBoth", + "type": "header" + }, + { + "type": "hiddenToggle", + "groupControl": 1, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bMagicSelected" + } + }, + { + "type": "hiddenToggle", + "groupControl": 3, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bPowerSelected" + } + }, + { + "type": "hiddenToggle", + "groupControl": 4, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bWeaponSelected" + } + }, + { + "type": "hiddenToggle", + "groupControl": 2, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bShieldSelected" + } + }, + { + "type": "hiddenToggle", + "groupControl": 6, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bBothHands" + } + }, + { + "id": "uType:TopPage", + "text": "$LamasTinyHUD_Type", + "type": "enum", + "help": "$LamasTinyHUD_Type_InfoText", + "valueOptions": { + "options": ["$LamasTinyHUD_Type_Weapon", "$LamasTinyHUD_Type_Magic", "$LamasTinyHUD_Type_Shield", "$LamasTinyHUD_Type_Shout", "$LamasTinyHUD_Type_Power", "$LamasTinyHUD_Type_Consumable", "$LamasTinyHUD_Type_Item"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "uHandSelection:TopPage", + "text": "$LamasTinyHUD_HandSelection", + "type": "enum", + "help": "$LamasTinyHUD_HandSelection_InfoText", + "groupCondition": { + "OR": [1, 2, 4] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Single", "$LamasTinyHUD_Both"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "uSlotAction:TopPage", + "text": "$LamasTinyHUD_SlotAction", + "type": "enum", + "help": "$LamasTinyHUD_SlotAction_InfoText", + "groupCondition": { + "OR": [1, 3] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Action_Default", "$LamasTinyHUD_Action_Instant"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "sRefreshItems:TopPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_RefreshItems", + "help": "$LamasTinyHUD_RefreshItems_Help", + "action": { + "type": "CallFunction", + "function": "RefreshItems" + } + }, + { + "id": "uSelectedItem:TopPage", + "text": "$LamasTinyHUD_SelectedItem", + "type": "enum", + "help": "$LamasTinyHUD_SelectedItem_InfoText", + "valueOptions": { + "options": [ + "$LamasTinyHUD_ENUM" + ], + "sourceType": "ModSettingInt", + "defaultValue": 0 + } + }, + { + "id": "sSelectedItemForm:TopPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_SelectedItemForm", + "help": "$LamasTinyHUD_SelectedItemForm_Help" + }, + { + "text": "$LamasTinyHUD_Header_Left", + "type": "header", + "position": 1 + }, + { + "type": "hiddenToggle", + "groupControl": 11, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bMagicSelectedLeft" + } + }, + { + "type": "hiddenToggle", + "groupControl": 13, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bPowerSelectedLeft" + } + }, + { + "id": "uTypeLeft:TopPage", + "text": "$LamasTinyHUD_Type", + "type": "enum", + "help": "$LamasTinyHUD_Type_InfoText", + "groupCondition": 6, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Type_Weapon", "$LamasTinyHUD_Type_Magic", "$LamasTinyHUD_Type_Shield"], + "sourceType": "ModSettingInt" + } + }, + { + "type": "empty" + }, + { + "id": "uSlotActionLeft:TopPage", + "text": "$LamasTinyHUD_SlotAction", + "type": "enum", + "help": "$LamasTinyHUD_SlotAction_InfoText", + "groupCondition": { + "AND": [{ + "OR": [11, 13] + }, 6] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Action_Default", "$LamasTinyHUD_Action_Instant"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "sRefreshItemsLeft:TopPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_RefreshItems", + "help": "$LamasTinyHUD_RefreshItems_Help", + "groupCondition": 6, + "groupBehavior": "disable", + "action": { + "type": "CallFunction", + "function": "RefreshItemsLeft" + } + }, + { + "id": "uSelectedItemLeft:TopPage", + "text": "$LamasTinyHUD_SelectedItem", + "type": "enum", + "help": "$LamasTinyHUD_SelectedItem_InfoText", + "groupCondition": 6, + "groupBehavior": "disable", + "valueOptions": { + "options": [ + "$LamasTinyHUD_ENUM" + ], + "sourceType": "ModSettingInt", + "defaultValue": 0 + } + }, + { + "id": "sSelectedItemFormLeft:TopPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_SelectedItemForm", + "help": "$LamasTinyHUD_SelectedItemForm_Help", + "groupCondition": 6, + "groupBehavior": "disable" + } + ] + }, + { + "pageDisplayName": "$LamasTinyHUD_RightPage", + "cursorFillMode": "topToBottom", + "content": [{ + "text": "$LamasTinyHUD_Header_RightBoth", + "type": "header" + }, + { + "type": "hiddenToggle", + "groupControl": 21, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bMagicSelectedRight" + } + }, + { + "type": "hiddenToggle", + "groupControl": 23, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bPowerSelectedRight" + } + }, + { + "type": "hiddenToggle", + "groupControl": 24, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bWeaponSelectedRight" + } + }, + { + "type": "hiddenToggle", + "groupControl": 22, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bShieldSelectedRight" + } + }, + { + "type": "hiddenToggle", + "groupControl": 26, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bBothHandsRight" + } + }, + { + "id": "uType:RightPage", + "text": "$LamasTinyHUD_Type", + "type": "enum", + "help": "$LamasTinyHUD_Type_InfoText", + "valueOptions": { + "options": ["$LamasTinyHUD_Type_Weapon", "$LamasTinyHUD_Type_Magic", "$LamasTinyHUD_Type_Shield", "$LamasTinyHUD_Type_Shout", "$LamasTinyHUD_Type_Power", "$LamasTinyHUD_Type_Consumable", "$LamasTinyHUD_Type_Item"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "uHandSelection:RightPage", + "text": "$LamasTinyHUD_HandSelection", + "type": "enum", + "help": "$LamasTinyHUD_HandSelection_InfoText", + "groupCondition": { + "OR": [21, 22, 24] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Single", "$LamasTinyHUD_Both"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "uSlotAction:RightPage", + "text": "$LamasTinyHUD_SlotAction", + "type": "enum", + "help": "$LamasTinyHUD_SlotAction_InfoText", + "groupCondition": { + "OR": [21, 23] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Action_Default", "$LamasTinyHUD_Action_Instant"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "sRefreshItems:RightPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_RefreshItems", + "help": "$LamasTinyHUD_RefreshItems_Help", + "action": { + "type": "CallFunction", + "function": "RefreshItemsRight" + } + }, + { + "id": "uSelectedItem:RightPage", + "text": "$LamasTinyHUD_SelectedItem", + "type": "enum", + "help": "$LamasTinyHUD_SelectedItem_InfoText", + "valueOptions": { + "options": [ + "$LamasTinyHUD_ENUM" + ], + "sourceType": "ModSettingInt", + "defaultValue": 0 + } + }, + { + "id": "sSelectedItemForm:RightPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_SelectedItemForm", + "help": "$LamasTinyHUD_SelectedItemForm_Help" + }, + { + "text": "$LamasTinyHUD_Header_Left", + "type": "header", + "position": 1 + }, + { + "type": "hiddenToggle", + "groupControl": 31, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bMagicSelectedRightLeft" + } + }, + { + "type": "hiddenToggle", + "groupControl": 33, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bPowerSelectedRightLeft" + } + }, + { + "id": "uTypeLeft:RightPage", + "text": "$LamasTinyHUD_Type", + "type": "enum", + "help": "$LamasTinyHUD_TopType_InfoText", + "groupCondition": 26, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Type_Weapon", "$LamasTinyHUD_Type_Magic", "$LamasTinyHUD_Type_Shield"], + "sourceType": "ModSettingInt" + } + }, + { + "type": "empty" + }, + { + "id": "uSlotActionLeft:RightPage", + "text": "$LamasTinyHUD_SlotAction", + "type": "enum", + "help": "$LamasTinyHUD_SlotAction_InfoText", + "groupCondition": { + "AND": [{ + "OR": [31, 33] + }, 26] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Action_Default", "$LamasTinyHUD_Action_Instant"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "sRefreshItemsLeft:RightPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_RefreshItems", + "help": "$LamasTinyHUD_RefreshItems_Help", + "groupCondition": 26, + "groupBehavior": "disable", + "action": { + "type": "CallFunction", + "function": "RefreshItemsRightLeft" + } + }, + { + "id": "uSelectedItemLeft:RightPage", + "text": "$LamasTinyHUD_SelectedItem", + "type": "enum", + "help": "$LamasTinyHUD_SelectedItem_InfoText", + "groupCondition": 26, + "groupBehavior": "disable", + "valueOptions": { + "options": [ + "$LamasTinyHUD_ENUM" + ], + "sourceType": "ModSettingInt", + "defaultValue": 0 + } + }, + { + "id": "sSelectedItemFormLeft:RightPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_SelectedItemForm", + "help": "$LamasTinyHUD_SelectedItemForm_Help", + "groupCondition": 26, + "groupBehavior": "disable" + } + ] + }, + { + "pageDisplayName": "$LamasTinyHUD_BottomPage", + "cursorFillMode": "topToBottom", + "content": [{ + "text": "$LamasTinyHUD_Header_RightBoth", + "type": "header" + }, + { + "type": "hiddenToggle", + "groupControl": 41, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bMagicSelectedBottom" + } + }, + { + "type": "hiddenToggle", + "groupControl": 43, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bPowerSelectedBottom" + } + }, + { + "type": "hiddenToggle", + "groupControl": 44, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bWeaponSelectedBottom" + } + }, + { + "type": "hiddenToggle", + "groupControl": 42, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bShieldSelectedBottom" + } + }, + { + "type": "hiddenToggle", + "groupControl": 46, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bBothHandsBottom" + } + }, + { + "id": "uType:BottomPage", + "text": "$LamasTinyHUD_Type", + "type": "enum", + "help": "$LamasTinyHUD_Type_InfoText", + "valueOptions": { + "options": ["$LamasTinyHUD_Type_Weapon", "$LamasTinyHUD_Type_Magic", "$LamasTinyHUD_Type_Shield", "$LamasTinyHUD_Type_Shout", "$LamasTinyHUD_Type_Power", "$LamasTinyHUD_Type_Consumable", "$LamasTinyHUD_Type_Item"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "uHandSelection:BottomPage", + "text": "$LamasTinyHUD_HandSelection", + "type": "enum", + "help": "$LamasTinyHUD_HandSelection_InfoText", + "groupCondition": { + "OR": [41, 42, 44] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Single", "$LamasTinyHUD_Both"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "uSlotAction:BottomPage", + "text": "$LamasTinyHUD_SlotAction", + "type": "enum", + "help": "$LamasTinyHUD_SlotAction_InfoText", + "groupCondition": { + "OR": [41, 43] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Action_Default", "$LamasTinyHUD_Action_Instant"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "sRefreshItems:BottomPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_RefreshItems", + "help": "$LamasTinyHUD_RefreshItems_Help", + "action": { + "type": "CallFunction", + "function": "RefreshItemsBottom" + } + }, + { + "id": "uSelectedItem:BottomPage", + "text": "$LamasTinyHUD_SelectedItem", + "type": "enum", + "help": "$LamasTinyHUD_SelectedItem_InfoText", + "valueOptions": { + "options": [ + "$LamasTinyHUD_ENUM" + ], + "sourceType": "ModSettingInt", + "defaultValue": 0 + } + }, + { + "id": "sSelectedItemForm:BottomPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_SelectedItemForm", + "help": "$LamasTinyHUD_SelectedItemForm_Help" + }, + { + "text": "$LamasTinyHUD_Header_Left", + "type": "header", + "position": 1 + }, + { + "type": "hiddenToggle", + "groupControl": 51, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bMagicSelectedBottomLeft" + } + }, + { + "type": "hiddenToggle", + "groupControl": 53, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bPowerSelectedBottomLeft" + } + }, + { + "id": "uTypeLeft:BottomPage", + "text": "$LamasTinyHUD_Type", + "type": "enum", + "help": "$LamasTinyHUD_TopType_InfoText", + "groupCondition": 46, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Type_Weapon", "$LamasTinyHUD_Type_Magic", "$LamasTinyHUD_Type_Shield"], + "sourceType": "ModSettingInt" + } + }, + { + "type": "empty" + }, + { + "id": "uSlotActionLeft:BottomPage", + "text": "$LamasTinyHUD_SlotAction", + "type": "enum", + "help": "$LamasTinyHUD_SlotAction_InfoText", + "groupCondition": { + "AND": [{ + "OR": [51, 53] + }, 46] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Action_Default", "$LamasTinyHUD_Action_Instant"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "sRefreshItemsLeft:BottomPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_RefreshItems", + "help": "$LamasTinyHUD_RefreshItems_Help", + "groupCondition": 46, + "groupBehavior": "disable", + "action": { + "type": "CallFunction", + "function": "RefreshItemsBottomLeft" + } + }, + { + "id": "uSelectedItemLeft:BottomPage", + "text": "$LamasTinyHUD_SelectedItem", + "type": "enum", + "help": "$LamasTinyHUD_SelectedItem_InfoText", + "groupCondition": 46, + "groupBehavior": "disable", + "valueOptions": { + "options": [ + "$LamasTinyHUD_ENUM" + ], + "sourceType": "ModSettingInt", + "defaultValue": 0 + } + }, + { + "id": "sSelectedItemFormLeft:BottomPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_SelectedItemForm", + "help": "$LamasTinyHUD_SelectedItemForm_Help", + "groupCondition": 46, + "groupBehavior": "disable" + } + ] + }, + { + "pageDisplayName": "$LamasTinyHUD_LeftPage", + "cursorFillMode": "topToBottom", + "content": [{ + "text": "$LamasTinyHUD_Header_RightBoth", + "type": "header" + }, + { + "type": "hiddenToggle", + "groupControl": 61, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bMagicSelectedLeftSetting" + } + }, + { + "type": "hiddenToggle", + "groupControl": 63, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bPowerSelectedLeftSetting" + } + }, + { + "type": "hiddenToggle", + "groupControl": 64, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bWeaponSelectedLeft" + } + }, + { + "type": "hiddenToggle", + "groupControl": 62, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bShieldSelectedLeft" + } + }, + { + "type": "hiddenToggle", + "groupControl": 66, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bBothHandsLeft" + } + }, + { + "id": "uType:LeftPage", + "text": "$LamasTinyHUD_Type", + "type": "enum", + "help": "$LamasTinyHUD_Type_InfoText", + "valueOptions": { + "options": ["$LamasTinyHUD_Type_Weapon", "$LamasTinyHUD_Type_Magic", "$LamasTinyHUD_Type_Shield", "$LamasTinyHUD_Type_Shout", "$LamasTinyHUD_Type_Power", "$LamasTinyHUD_Type_Consumable", "$LamasTinyHUD_Type_Item"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "uHandSelection:LeftPage", + "text": "$LamasTinyHUD_HandSelection", + "type": "enum", + "help": "$LamasTinyHUD_HandSelection_InfoText", + "groupCondition": { + "OR": [61, 62, 64] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Single", "$LamasTinyHUD_Both"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "uSlotAction:LeftPage", + "text": "$LamasTinyHUD_SlotAction", + "type": "enum", + "help": "$LamasTinyHUD_SlotAction_InfoText", + "groupCondition": { + "OR": [61, 63] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Action_Default", "$LamasTinyHUD_Action_Instant"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "sRefreshItems:LeftPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_RefreshItems", + "help": "$LamasTinyHUD_RefreshItems_Help", + "action": { + "type": "CallFunction", + "function": "RefreshItemsLeftList" + } + }, + { + "id": "uSelectedItem:LeftPage", + "text": "$LamasTinyHUD_SelectedItem", + "type": "enum", + "help": "$LamasTinyHUD_SelectedItem_InfoText", + "valueOptions": { + "options": [ + "$LamasTinyHUD_ENUM" + ], + "sourceType": "ModSettingInt", + "defaultValue": 0 + } + }, + { + "id": "sSelectedItemForm:LeftPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_SelectedItemForm", + "help": "$LamasTinyHUD_SelectedItemForm_Help" + }, + { + "text": "$LamasTinyHUD_Header_Left", + "type": "header", + "position": 1 + }, + { + "type": "hiddenToggle", + "groupControl": 71, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bMagicSelectedLeftLeft" + } + }, + { + "type": "hiddenToggle", + "groupControl": 73, + "valueOptions": { + "sourceType": "PropertyValueBool", + "propertyName": "bPowerSelectedLeftLeft" + } + }, + { + "id": "uTypeLeft:LeftPage", + "text": "$LamasTinyHUD_Type", "type": "enum", - "help": "$LamasTinyHUD_Controls_Controller_InfoText", + "help": "$LamasTinyHUD_TopType_InfoText", + "groupCondition": 66, + "groupBehavior": "disable", "valueOptions": { - "options": ["$LamasTinyHUD_Controls_PS", "$LamasTinyHUD_Controls_XBOX"], + "options": ["$LamasTinyHUD_Type_Weapon", "$LamasTinyHUD_Type_Magic", "$LamasTinyHUD_Type_Shield"], + "sourceType": "ModSettingInt" + } + }, + { + "type": "empty" + }, + { + "id": "uSlotActionLeft:LeftPage", + "text": "$LamasTinyHUD_SlotAction", + "type": "enum", + "help": "$LamasTinyHUD_SlotAction_InfoText", + "groupCondition": { + "AND": [{ + "OR": [71, 73] + }, 66] + }, + "groupBehavior": "disable", + "valueOptions": { + "options": ["$LamasTinyHUD_Action_Default", "$LamasTinyHUD_Action_Instant"], + "sourceType": "ModSettingInt" + } + }, + { + "id": "sRefreshItemsLeft:LeftPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_RefreshItems", + "help": "$LamasTinyHUD_RefreshItems_Help", + "groupCondition": 66, + "groupBehavior": "disable", + "action": { + "type": "CallFunction", + "function": "RefreshItemsLeftLeft" + } + }, + { + "id": "uSelectedItemLeft:LeftPage", + "text": "$LamasTinyHUD_SelectedItem", + "type": "enum", + "help": "$LamasTinyHUD_SelectedItem_InfoText", + "groupCondition": 66, + "groupBehavior": "disable", + "valueOptions": { + "options": [ + "$LamasTinyHUD_ENUM" + ], "sourceType": "ModSettingInt", "defaultValue": 0 } + }, + { + "id": "sSelectedItemFormLeft:LeftPage", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_SelectedItemForm", + "help": "$LamasTinyHUD_SelectedItemForm_Help", + "groupCondition": 66, + "groupBehavior": "disable" } ] }, { - "pageDisplayName": "$LamasTinyHUD_TopPage", + "pageDisplayName": "$LamasTinyHUD_TopPageSetOne", "cursorFillMode": "topToBottom", "content": [{ "text": "$LamasTinyHUD_Header_RightBoth", @@ -80,7 +966,7 @@ "groupControl": 1, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bMagicSelected" + "propertyName": "bMagicSelectedSetOne" } }, { @@ -88,7 +974,7 @@ "groupControl": 3, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bPowerSelected" + "propertyName": "bPowerSelectedSetOne" } }, { @@ -96,7 +982,7 @@ "groupControl": 4, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bWeaponSelected" + "propertyName": "bWeaponSelectedSetOne" } }, { @@ -104,7 +990,7 @@ "groupControl": 2, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bShieldSelected" + "propertyName": "bShieldSelectedSetOne" } }, { @@ -112,11 +998,11 @@ "groupControl": 6, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bBothHands" + "propertyName": "bBothHandsSetOne" } }, { - "id": "uType:TopPage", + "id": "uType:TopPageSetOne", "text": "$LamasTinyHUD_Type", "type": "enum", "help": "$LamasTinyHUD_Type_InfoText", @@ -126,7 +1012,7 @@ } }, { - "id": "uHandSelection:TopPage", + "id": "uHandSelection:TopPageSetOne", "text": "$LamasTinyHUD_HandSelection", "type": "enum", "help": "$LamasTinyHUD_HandSelection_InfoText", @@ -140,7 +1026,7 @@ } }, { - "id": "uSlotAction:TopPage", + "id": "uSlotAction:TopPageSetOne", "text": "$LamasTinyHUD_SlotAction", "type": "enum", "help": "$LamasTinyHUD_SlotAction_InfoText", @@ -154,7 +1040,7 @@ } }, { - "id": "sRefreshItems:TopPage", + "id": "sRefreshItems:TopPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -164,11 +1050,11 @@ "help": "$LamasTinyHUD_RefreshItems_Help", "action": { "type": "CallFunction", - "function": "RefreshItems" + "function": "RefreshItemsPageOne" } }, { - "id": "uSelectedItem:TopPage", + "id": "uSelectedItem:TopPageSetOne", "text": "$LamasTinyHUD_SelectedItem", "type": "enum", "help": "$LamasTinyHUD_SelectedItem_InfoText", @@ -181,7 +1067,7 @@ } }, { - "id": "sSelectedItemForm:TopPage", + "id": "sSelectedItemForm:TopPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -200,7 +1086,7 @@ "groupControl": 11, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bMagicSelectedLeft" + "propertyName": "bMagicSelectedLeftSetOne" } }, { @@ -208,11 +1094,11 @@ "groupControl": 13, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bPowerSelectedLeft" + "propertyName": "bPowerSelectedLeftSetOne" } }, { - "id": "uTypeLeft:TopPage", + "id": "uTypeLeft:TopPageSetOne", "text": "$LamasTinyHUD_Type", "type": "enum", "help": "$LamasTinyHUD_Type_InfoText", @@ -227,7 +1113,7 @@ "type": "empty" }, { - "id": "uSlotActionLeft:TopPage", + "id": "uSlotActionLeft:TopPageSetOne", "text": "$LamasTinyHUD_SlotAction", "type": "enum", "help": "$LamasTinyHUD_SlotAction_InfoText", @@ -243,7 +1129,7 @@ } }, { - "id": "sRefreshItemsLeft:TopPage", + "id": "sRefreshItemsLeft:TopPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -255,11 +1141,11 @@ "groupBehavior": "disable", "action": { "type": "CallFunction", - "function": "RefreshItemsLeft" + "function": "RefreshItemsLeftPageOne" } }, { - "id": "uSelectedItemLeft:TopPage", + "id": "uSelectedItemLeft:TopPageSetOne", "text": "$LamasTinyHUD_SelectedItem", "type": "enum", "help": "$LamasTinyHUD_SelectedItem_InfoText", @@ -274,7 +1160,7 @@ } }, { - "id": "sSelectedItemFormLeft:TopPage", + "id": "sSelectedItemFormLeft:TopPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -288,7 +1174,7 @@ ] }, { - "pageDisplayName": "$LamasTinyHUD_RightPage", + "pageDisplayName": "$LamasTinyHUD_RightPageSetOne", "cursorFillMode": "topToBottom", "content": [{ "text": "$LamasTinyHUD_Header_RightBoth", @@ -299,7 +1185,7 @@ "groupControl": 21, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bMagicSelectedRight" + "propertyName": "bMagicSelectedRightSetOne" } }, { @@ -307,7 +1193,7 @@ "groupControl": 23, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bPowerSelectedRight" + "propertyName": "bPowerSelectedRightSetOne" } }, { @@ -315,7 +1201,7 @@ "groupControl": 24, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bWeaponSelectedRight" + "propertyName": "bWeaponSelectedRightSetOne" } }, { @@ -323,7 +1209,7 @@ "groupControl": 22, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bShieldSelectedRight" + "propertyName": "bShieldSelectedRightSetOne" } }, { @@ -331,11 +1217,11 @@ "groupControl": 26, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bBothHandsRight" + "propertyName": "bBothHandsRightSetOne" } }, { - "id": "uType:RightPage", + "id": "uType:RightPageSetOne", "text": "$LamasTinyHUD_Type", "type": "enum", "help": "$LamasTinyHUD_Type_InfoText", @@ -345,7 +1231,7 @@ } }, { - "id": "uHandSelection:RightPage", + "id": "uHandSelection:RightPageSetOne", "text": "$LamasTinyHUD_HandSelection", "type": "enum", "help": "$LamasTinyHUD_HandSelection_InfoText", @@ -359,7 +1245,7 @@ } }, { - "id": "uSlotAction:RightPage", + "id": "uSlotAction:RightPageSetOne", "text": "$LamasTinyHUD_SlotAction", "type": "enum", "help": "$LamasTinyHUD_SlotAction_InfoText", @@ -373,7 +1259,7 @@ } }, { - "id": "sRefreshItems:RightPage", + "id": "sRefreshItems:RightPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -383,11 +1269,11 @@ "help": "$LamasTinyHUD_RefreshItems_Help", "action": { "type": "CallFunction", - "function": "RefreshItemsRight" + "function": "RefreshItemsRightPageOne" } }, { - "id": "uSelectedItem:RightPage", + "id": "uSelectedItem:RightPageSetOne", "text": "$LamasTinyHUD_SelectedItem", "type": "enum", "help": "$LamasTinyHUD_SelectedItem_InfoText", @@ -400,7 +1286,7 @@ } }, { - "id": "sSelectedItemForm:RightPage", + "id": "sSelectedItemForm:RightPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -419,7 +1305,7 @@ "groupControl": 31, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bMagicSelectedRightLeft" + "propertyName": "bMagicSelectedRightLeftSetOne" } }, { @@ -427,11 +1313,11 @@ "groupControl": 33, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bPowerSelectedRightLeft" + "propertyName": "bPowerSelectedRightLeftSetOne" } }, { - "id": "uTypeLeft:RightPage", + "id": "uTypeLeft:RightPageSetOne", "text": "$LamasTinyHUD_Type", "type": "enum", "help": "$LamasTinyHUD_TopType_InfoText", @@ -446,7 +1332,7 @@ "type": "empty" }, { - "id": "uSlotActionLeft:RightPage", + "id": "uSlotActionLeft:RightPageSetOne", "text": "$LamasTinyHUD_SlotAction", "type": "enum", "help": "$LamasTinyHUD_SlotAction_InfoText", @@ -462,7 +1348,7 @@ } }, { - "id": "sRefreshItemsLeft:RightPage", + "id": "sRefreshItemsLeft:RightPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -474,11 +1360,11 @@ "groupBehavior": "disable", "action": { "type": "CallFunction", - "function": "RefreshItemsRightLeft" + "function": "RefreshItemsRightLeftPageOne" } }, { - "id": "uSelectedItemLeft:RightPage", + "id": "uSelectedItemLeft:RightPageSetOne", "text": "$LamasTinyHUD_SelectedItem", "type": "enum", "help": "$LamasTinyHUD_SelectedItem_InfoText", @@ -493,7 +1379,7 @@ } }, { - "id": "sSelectedItemFormLeft:RightPage", + "id": "sSelectedItemFormLeft:RightPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -507,7 +1393,7 @@ ] }, { - "pageDisplayName": "$LamasTinyHUD_BottomPage", + "pageDisplayName": "$LamasTinyHUD_BottomPageSetOne", "cursorFillMode": "topToBottom", "content": [{ "text": "$LamasTinyHUD_Header_RightBoth", @@ -518,7 +1404,7 @@ "groupControl": 41, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bMagicSelectedBottom" + "propertyName": "bMagicSelectedBottomSetOne" } }, { @@ -526,7 +1412,7 @@ "groupControl": 43, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bPowerSelectedBottom" + "propertyName": "bPowerSelectedBottomSetOne" } }, { @@ -534,7 +1420,7 @@ "groupControl": 44, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bWeaponSelectedBottom" + "propertyName": "bWeaponSelectedBottomSetOne" } }, { @@ -542,7 +1428,7 @@ "groupControl": 42, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bShieldSelectedBottom" + "propertyName": "bShieldSelectedBottomSetOne" } }, { @@ -550,11 +1436,11 @@ "groupControl": 46, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bBothHandsBottom" + "propertyName": "bBothHandsBottomSetOne" } }, { - "id": "uType:BottomPage", + "id": "uType:BottomPageSetOne", "text": "$LamasTinyHUD_Type", "type": "enum", "help": "$LamasTinyHUD_Type_InfoText", @@ -564,7 +1450,7 @@ } }, { - "id": "uHandSelection:BottomPage", + "id": "uHandSelection:BottomPageSetOne", "text": "$LamasTinyHUD_HandSelection", "type": "enum", "help": "$LamasTinyHUD_HandSelection_InfoText", @@ -578,7 +1464,7 @@ } }, { - "id": "uSlotAction:BottomPage", + "id": "uSlotAction:BottomPageSetOne", "text": "$LamasTinyHUD_SlotAction", "type": "enum", "help": "$LamasTinyHUD_SlotAction_InfoText", @@ -592,7 +1478,7 @@ } }, { - "id": "sRefreshItems:BottomPage", + "id": "sRefreshItems:BottomPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -602,11 +1488,11 @@ "help": "$LamasTinyHUD_RefreshItems_Help", "action": { "type": "CallFunction", - "function": "RefreshItemsBottom" + "function": "RefreshItemsBottomPageOne" } }, { - "id": "uSelectedItem:BottomPage", + "id": "uSelectedItem:BottomPageSetOne", "text": "$LamasTinyHUD_SelectedItem", "type": "enum", "help": "$LamasTinyHUD_SelectedItem_InfoText", @@ -619,7 +1505,7 @@ } }, { - "id": "sSelectedItemForm:BottomPage", + "id": "sSelectedItemForm:BottomPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -638,7 +1524,7 @@ "groupControl": 51, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bMagicSelectedBottomLeft" + "propertyName": "bMagicSelectedBottomLeftSetOne" } }, { @@ -646,11 +1532,11 @@ "groupControl": 53, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bPowerSelectedBottomLeft" + "propertyName": "bPowerSelectedBottomLeftSetOne" } }, { - "id": "uTypeLeft:BottomPage", + "id": "uTypeLeft:BottomPageSetOne", "text": "$LamasTinyHUD_Type", "type": "enum", "help": "$LamasTinyHUD_TopType_InfoText", @@ -665,7 +1551,7 @@ "type": "empty" }, { - "id": "uSlotActionLeft:BottomPage", + "id": "uSlotActionLeft:BottomPageSetOne", "text": "$LamasTinyHUD_SlotAction", "type": "enum", "help": "$LamasTinyHUD_SlotAction_InfoText", @@ -681,7 +1567,7 @@ } }, { - "id": "sRefreshItemsLeft:BottomPage", + "id": "sRefreshItemsLeft:BottomPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -693,11 +1579,11 @@ "groupBehavior": "disable", "action": { "type": "CallFunction", - "function": "RefreshItemsBottomLeft" + "function": "RefreshItemsBottomLeftPageOne" } }, { - "id": "uSelectedItemLeft:BottomPage", + "id": "uSelectedItemLeft:BottomPageSetOne", "text": "$LamasTinyHUD_SelectedItem", "type": "enum", "help": "$LamasTinyHUD_SelectedItem_InfoText", @@ -712,7 +1598,7 @@ } }, { - "id": "sSelectedItemFormLeft:BottomPage", + "id": "sSelectedItemFormLeft:BottomPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -726,7 +1612,7 @@ ] }, { - "pageDisplayName": "$LamasTinyHUD_LeftPage", + "pageDisplayName": "$LamasTinyHUD_LeftPageSetOne", "cursorFillMode": "topToBottom", "content": [{ "text": "$LamasTinyHUD_Header_RightBoth", @@ -737,7 +1623,7 @@ "groupControl": 61, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bMagicSelectedLeftSetting" + "propertyName": "bMagicSelectedLeftSettingSetOne" } }, { @@ -745,7 +1631,7 @@ "groupControl": 63, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bPowerSelectedLeftSetting" + "propertyName": "bPowerSelectedLeftSettingSetOne" } }, { @@ -753,7 +1639,7 @@ "groupControl": 64, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bWeaponSelectedLeft" + "propertyName": "bWeaponSelectedLeftSetOne" } }, { @@ -761,7 +1647,7 @@ "groupControl": 62, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bShieldSelectedLeft" + "propertyName": "bShieldSelectedLeftSetOne" } }, { @@ -769,11 +1655,11 @@ "groupControl": 66, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bBothHandsLeft" + "propertyName": "bBothHandsLeftSetOne" } }, { - "id": "uType:LeftPage", + "id": "uType:LeftPageSetOne", "text": "$LamasTinyHUD_Type", "type": "enum", "help": "$LamasTinyHUD_Type_InfoText", @@ -783,7 +1669,7 @@ } }, { - "id": "uHandSelection:LeftPage", + "id": "uHandSelection:LeftPageSetOne", "text": "$LamasTinyHUD_HandSelection", "type": "enum", "help": "$LamasTinyHUD_HandSelection_InfoText", @@ -797,7 +1683,7 @@ } }, { - "id": "uSlotAction:LeftPage", + "id": "uSlotAction:LeftPageSetOne", "text": "$LamasTinyHUD_SlotAction", "type": "enum", "help": "$LamasTinyHUD_SlotAction_InfoText", @@ -811,7 +1697,7 @@ } }, { - "id": "sRefreshItems:LeftPage", + "id": "sRefreshItems:LeftPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -821,11 +1707,11 @@ "help": "$LamasTinyHUD_RefreshItems_Help", "action": { "type": "CallFunction", - "function": "RefreshItemsLeftList" + "function": "RefreshItemsLeftListPageOne" } }, { - "id": "uSelectedItem:LeftPage", + "id": "uSelectedItem:LeftPageSetOne", "text": "$LamasTinyHUD_SelectedItem", "type": "enum", "help": "$LamasTinyHUD_SelectedItem_InfoText", @@ -838,7 +1724,7 @@ } }, { - "id": "sSelectedItemForm:LeftPage", + "id": "sSelectedItemForm:LeftPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -857,7 +1743,7 @@ "groupControl": 71, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bMagicSelectedLeftLeft" + "propertyName": "bMagicSelectedLeftLeftSetOne" } }, { @@ -865,11 +1751,11 @@ "groupControl": 73, "valueOptions": { "sourceType": "PropertyValueBool", - "propertyName": "bPowerSelectedLeftLeft" + "propertyName": "bPowerSelectedLeftLeftSetOne" } }, { - "id": "uTypeLeft:LeftPage", + "id": "uTypeLeft:LeftPageSetOne", "text": "$LamasTinyHUD_Type", "type": "enum", "help": "$LamasTinyHUD_TopType_InfoText", @@ -884,7 +1770,7 @@ "type": "empty" }, { - "id": "uSlotActionLeft:LeftPage", + "id": "uSlotActionLeft:LeftPageSetOne", "text": "$LamasTinyHUD_SlotAction", "type": "enum", "help": "$LamasTinyHUD_SlotAction_InfoText", @@ -900,7 +1786,7 @@ } }, { - "id": "sRefreshItemsLeft:LeftPage", + "id": "sRefreshItemsLeft:LeftPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -912,11 +1798,11 @@ "groupBehavior": "disable", "action": { "type": "CallFunction", - "function": "RefreshItemsLeftLeft" + "function": "RefreshItemsLeftLeftPageOne" } }, { - "id": "uSelectedItemLeft:LeftPage", + "id": "uSelectedItemLeft:LeftPageSetOne", "text": "$LamasTinyHUD_SelectedItem", "type": "enum", "help": "$LamasTinyHUD_SelectedItem_InfoText", @@ -931,7 +1817,7 @@ } }, { - "id": "sSelectedItemFormLeft:LeftPage", + "id": "sSelectedItemFormLeft:LeftPageSetOne", "valueOptions": { "value": "", "sourceType": "ModSettingString" @@ -948,6 +1834,31 @@ "pageDisplayName": "$LamasTinyHUD_HudSetting", "cursorFillMode": "topToBottom", "content": [{ + "text": "$LamasTinyHUD_HudSetting_HeaderText_Resolution", + "type": "header" + }, + { + "id": "sDisplayResolutionWidth:HudSetting", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_DisplayResolutionWidth", + "help": "$LamasTinyHUD_DisplayResolutionWidth_Help" + }, + { + "id": "sDisplayResolutionHeight:HudSetting", + "valueOptions": { + "value": "", + "sourceType": "ModSettingString" + }, + "type": "text", + "text": "$LamasTinyHUD_DisplayResolutionHeight", + "help": "$LamasTinyHUD_DisplayResolutionHeight_Help" + }, + + { "text": "$LamasTinyHUD_HudSetting_HeaderText_Position", "type": "header" }, @@ -1059,35 +1970,13 @@ "sourceType": "ModSettingFloat" } }, + + { - "text": "$LamasTinyHUD_HudSetting_HeaderText_Resolution", + "text": "$LamasTinyHUD_HudSetting_HeaderText_Offset", "type": "header", "position": 1 }, - { - "id": "sDisplayResolutionWidth:HudSetting", - "valueOptions": { - "value": "", - "sourceType": "ModSettingString" - }, - "type": "text", - "text": "$LamasTinyHUD_DisplayResolutionWidth", - "help": "$LamasTinyHUD_DisplayResolutionWidth_Help" - }, - { - "id": "sDisplayResolutionHeight:HudSetting", - "valueOptions": { - "value": "", - "sourceType": "ModSettingString" - }, - "type": "text", - "text": "$LamasTinyHUD_DisplayResolutionHeight", - "help": "$LamasTinyHUD_DisplayResolutionHeight_Help" - }, - { - "text": "$LamasTinyHUD_HudSetting_HeaderText_Offset", - "type": "header" - }, { "id": "fHudSlotPositionOffset:HudSetting", "text": "$LamasTinyHUD_HudSetting_SlotPositionOffset_OptionText", @@ -1127,6 +2016,32 @@ "sourceType": "ModSettingFloat" } }, + { + "id": "fToggleKeyOffsetX:HudSetting", + "text": "$LamasTinyHUD_HudSetting_ToggleKeyOffsetX_OptionText", + "type": "slider", + "help": "$LamasTinyHUD_HudSetting_ToggleKeyOffsetX_InfoText", + "valueOptions": { + "min": -300.0, + "max": 300.0, + "step": 1.0, + "formatString": "{0}", + "sourceType": "ModSettingFloat" + } + }, + { + "id": "fToggleKeyOffsetY:HudSetting", + "text": "$LamasTinyHUD_HudSetting_ToggleKeyOffsetY_OptionText", + "type": "slider", + "help": "$LamasTinyHUD_HudSetting_ToggleKeyOffsetY_InfoText", + "valueOptions": { + "min": -300.0, + "max": 300.0, + "step": 1.0, + "formatString": "{0}", + "sourceType": "ModSettingFloat" + } + }, { "text": "$LamasTinyHUD_HudSetting_HeaderText_Misc", "type": "header" @@ -1169,6 +2084,15 @@ "formatString": "{0}", "sourceType": "ModSettingFloat" } + }, + { + "id": "bDrawToggleButton:HudSetting", + "text": "$LamasTinyHUD_DrawToggleButton_OptionText", + "type": "toggle", + "help": "$LamasTinyHUD_DrawToggleButton_InfoText", + "valueOptions": { + "sourceType": "ModSettingBool" + } } ] } diff --git a/mcm/Config/LamasTinyHUD/settings.ini b/mcm/Config/LamasTinyHUD/settings.ini index 82193ed..f43d412 100644 --- a/mcm/Config/LamasTinyHUD/settings.ini +++ b/mcm/Config/LamasTinyHUD/settings.ini @@ -1,8 +1,9 @@ [Controls] -uTopActionKey = 45 -uRightActionKey = 46 -uBottomActionKey = 47 -uLeftActionKey = 48 +uTopActionKey = 10 +uRightActionKey = 11 +uBottomActionKey = 12 +uLeftActionKey = 13 +uToggleKey = 27 uControllerSet = 0 [TopPage] @@ -57,6 +58,58 @@ sSelectedItemFormLeft = 0 uSelectedItemLeft = 0 uSlotActionLeft = 0 +[TopPageSetOne] +uType = 0 +uHandSelection = 1 +sRefreshItems = +sSelectedItemForm = 0 +uSelectedItem = 0 +uSlotAction = 0 +uTypeLeft = 0 +sRefreshItemsLeft = +sSelectedItemFormLeft = 0 +uSelectedItemLeft = 0 +uSlotActionLeft = 0 + +[RightPageSetOne] +uType = 0 +uHandSelection = 1 +sRefreshItems = +sSelectedItemForm = 0 +uSelectedItem = 0 +uSlotAction = 0 +uTypeLeft = 0 +sRefreshItemsLeft = +sSelectedItemFormLeft = 0 +uSelectedItemLeft = 0 +uSlotActionLeft = 0 + +[BottomPageSetOne] +uType = 0 +uHandSelection = 1 +sRefreshItems = +sSelectedItemForm = 0 +uSelectedItem = 0 +uSlotAction = 0 +uTypeLeft = 0 +sRefreshItemsLeft = +sSelectedItemFormLeft = 0 +uSelectedItemLeft = 0 +uSlotActionLeft = 0 + +[LeftPageSetOne] +uType = 0 +uHandSelection = 1 +sRefreshItems = +sSelectedItemForm = 0 +uSelectedItem = 0 +uSlotAction = 0 +uTypeLeft = 0 +sRefreshItemsLeft = +sSelectedItemFormLeft = 0 +uSelectedItemLeft = 0 +uSlotActionLeft = 0 + [HudSetting] sDisplayResolutionWidth = sDisplayResolutionHeight = @@ -73,4 +126,7 @@ fIconScaleWidth = 0.110000 fIconScaleHeight = 0.110000 uSlotButtonFeedback = 200 fSlotCountTextOffset = 10 -fSlotCountTextFontSize = 20 \ No newline at end of file +fSlotCountTextFontSize = 20 +bDrawToggleButton = 1 +fToggleKeyOffsetX = 90 +fToggleKeyOffsetY = 90 \ No newline at end of file diff --git a/mcm/Interface/Translations/LamasTinyHUD_english.txt b/mcm/Interface/Translations/LamasTinyHUD_english.txt index 861237c..4fe63a3 100644 Binary files a/mcm/Interface/Translations/LamasTinyHUD_english.txt and b/mcm/Interface/Translations/LamasTinyHUD_english.txt differ diff --git a/mcm/scripts/LamasTinyHUD_MCM.pex b/mcm/scripts/LamasTinyHUD_MCM.pex index 52fd3e3..5aa1e3e 100644 Binary files a/mcm/scripts/LamasTinyHUD_MCM.pex and b/mcm/scripts/LamasTinyHUD_MCM.pex differ diff --git a/mcm/source/Scripts/LamasTinyHUD_MCM.psc b/mcm/source/Scripts/LamasTinyHUD_MCM.psc index 434dafc..d302aff 100644 --- a/mcm/source/Scripts/LamasTinyHUD_MCM.psc +++ b/mcm/source/Scripts/LamasTinyHUD_MCM.psc @@ -36,6 +36,42 @@ Bool Property bBothHandsLeft Auto Bool Property bMagicSelectedLeftLeft Auto Bool Property bPowerSelectedLeftLeft Auto +;Top +Bool Property bMagicSelectedSetOne Auto +Bool Property bPowerSelectedSetOne Auto +Bool Property bWeaponSelectedSetOne Auto +Bool Property bShieldSelectedSetOne Auto +Bool Property bBothHandsSetOne Auto +Bool Property bMagicSelectedLeftSetOne Auto +Bool Property bPowerSelectedLeftSetOne Auto + +;Right +Bool Property bMagicSelectedRightSetOne Auto +Bool Property bPowerSelectedRightSetOne Auto +Bool Property bWeaponSelectedRightSetOne Auto +Bool Property bShieldSelectedRightSetOne Auto +Bool Property bBothHandsRightSetOne Auto +Bool Property bMagicSelectedRightLeftSetOne Auto +Bool Property bPowerSelectedRightLeftSetOne Auto + +;Bottom +Bool Property bMagicSelectedBottomSetOne Auto +Bool Property bPowerSelectedBottomSetOne Auto +Bool Property bWeaponSelectedBottomSetOne Auto +Bool Property bShieldSelectedBottomSetOne Auto +Bool Property bBothHandsBottomSetOne Auto +Bool Property bMagicSelectedBottomLeftSetOne Auto +Bool Property bPowerSelectedBottomLeftSetOne Auto + +;Left +Bool Property bMagicSelectedLeftSettingSetOne Auto +Bool Property bPowerSelectedLeftSettingSetOne Auto +Bool Property bWeaponSelectedLeftSetOne Auto +Bool Property bShieldSelectedLeftSetOne Auto +Bool Property bBothHandsLeftSetOne Auto +Bool Property bMagicSelectedLeftLeftSetOne Auto +Bool Property bPowerSelectedLeftLeftSetOne Auto + Event OnConfigClose() native string[] function GetSelectedOptions(int a_id, bool a_both, bool a_instant) native string function GetFormIdForSelection(int a_index) native @@ -82,6 +118,46 @@ function SetToggles() bMagicSelectedLeftLeft = GetModSettingInt("uTypeLeft:LeftPage") == 1 ;is normally not possible bPowerSelectedLeftLeft = GetModSettingInt("uTypeLeft:LeftPage") == 4 + + ;Top + bMagicSelectedSetOne = GetModSettingInt("uType:TopPageSetOne") == 1 + bPowerSelectedSetOne = GetModSettingInt("uType:TopPageSetOne") == 4 + bWeaponSelectedSetOne = GetModSettingInt("uType:TopPageSetOne") == 0 + bShieldSelectedSetOne = GetModSettingInt("uType:TopPageSetOne") == 2 + bBothHandsSetOne = GetModSettingInt("uHandSelection:TopPageSetOne") == 0 + bMagicSelectedLeftSetOne = GetModSettingInt("uTypeLeft:TopPageSetOne") == 1 + ;is normally not possible + bPowerSelectedLeftSetOne = GetModSettingInt("uTypeLeft:TopPageSetOne") == 4 + + ;Right + bMagicSelectedRightSetOne = GetModSettingInt("uType:RightPageSetOne") == 1 + bPowerSelectedRightSetOne = GetModSettingInt("uType:RightPageSetOne") == 4 + bWeaponSelectedRightSetOne = GetModSettingInt("uType:RightPageSetOne") == 0 + bShieldSelectedRightSetOne = GetModSettingInt("uType:RightPageSetOne") == 2 + bBothHandsRightSetOne = GetModSettingInt("uHandSelection:RightPageSetOne") == 0 + bMagicSelectedRightLeftSetOne = GetModSettingInt("uTypeLeft:RightPageSetOne") == 1 + ;is normally not possible + bPowerSelectedRightLeftSetOne = GetModSettingInt("uTypeLeft:RightPageSetOne") == 4 + + ;Bottom + bMagicSelectedBottomSetOne = GetModSettingInt("uType:BottomPageSetOne") == 1 + bPowerSelectedBottomSetOne = GetModSettingInt("uType:BottomPageSetOne") == 4 + bWeaponSelectedBottomSetOne = GetModSettingInt("uType:BottomPageSetOne") == 0 + bShieldSelectedBottomSetOne = GetModSettingInt("uType:BottomPageSetOne") == 2 + bBothHandsBottomSetOne = GetModSettingInt("uHandSelection:BottomPageSetOne") == 0 + bMagicSelectedBottomLeftSetOne = GetModSettingInt("uTypeLeft:BottomPageSetOne") == 1 + ;is normally not possible + bPowerSelectedBottomLeftSetOne = GetModSettingInt("uTypeLeft:BottomPageSetOne") == 4 + + ;Left + bMagicSelectedLeftSettingSetOne = GetModSettingInt("uType:LeftPageSetOne") == 1 + bPowerSelectedLeftSettingSetOne = GetModSettingInt("uType:LeftPageSetOne") == 4 + bWeaponSelectedLeftSetOne = GetModSettingInt("uType:LeftPageSetOne") == 0 + bShieldSelectedLeftSetOne = GetModSettingInt("uType:LeftPageSetOne") == 2 + bBothHandsLeftSetOne = GetModSettingInt("uHandSelection:LeftPageSetOne") == 0 + bMagicSelectedLeftLeftSetOne = GetModSettingInt("uTypeLeft:LeftPageSetOne") == 1 + ;is normally not possible + bPowerSelectedLeftLeftSetOne = GetModSettingInt("uTypeLeft:LeftPageSetOne") == 4 endfunction function SetHands(String a_id, String a_mod_set) @@ -115,6 +191,30 @@ function SetFormZero(String a_id) elseIf (a_ID == "uTypeLeft:LeftPage") SetModSettingString("sSelectedItemFormLeft:LeftPage", "0") endif + + if(a_ID == "uType:TopPageSet") + SetModSettingString("sSelectedItemForm:TopPageSetOne", "0") + elseIf (a_ID == "uTypeLeft:TopPageSetOne") + SetModSettingString("sSelectedItemFormLeft:TopPageSetOne", "0") + endif + + if(a_ID == "uType:RightPageSetOne") + SetModSettingString("sSelectedItemForm:RightPageSetOne", "0") + elseIf (a_ID == "uTypeLeft:RightPageSetOne") + SetModSettingString("sSelectedItemFormLeft:RightPageSetOne", "0") + endif + + if(a_ID == "uType:BottomPageSetOne") + SetModSettingString("sSelectedItemForm:BottomPageSetOne", "0") + elseIf (a_ID == "uTypeLeft:BottomPageSetOne") + SetModSettingString("sSelectedItemFormLeft:BottomPageSetOne", "0") + endif + + if(a_ID == "uType:LeftPageSetOne") + SetModSettingString("sSelectedItemForm:LeftPageSetOne", "0") + elseIf (a_ID == "uTypeLeft:LeftPageSetOne") + SetModSettingString("sSelectedItemFormLeft:LeftPageSetOne", "0") + endif endfunction function RefreshItemsMain(string a_type, string a_selection, string a_action, bool a_hands, string a_instant_setting) @@ -162,6 +262,40 @@ function RefreshItemsLeftLeft() RefreshItemsMain("uTypeLeft:LeftPage", "uSelectedItemLeft:LeftPage", "uSlotActionLeft:LeftPage", bBothHandsLeft, "uSlotActionLeft:LeftPage") endfunction +function RefreshItemsPageOne() + SetToggles() + RefreshItemsMain("uType:TopPageSetOne", "uSelectedItem:TopPageSetOne", "uSlotAction:TopPageSetOne", bBothHandsSetOne, "uSlotAction:TopPageSetOne") +endfunction + +function RefreshItemsLeftPageOne() + SetToggles() + RefreshItemsMain("uTypeLeft:TopPageSetOne", "uSelectedItemLeft:TopPageSetOne", "uSlotActionLeft:TopPageSetOne", bBothHandsSetOne, "uSlotActionLeft:TopPageSetOne") +endfunction + +function RefreshItemsRightPageOne() + RefreshItemsMain("uType:RightPageSetOne", "uSelectedItem:RightPageSetOne", "uSlotAction:RightPageSetOne", bBothHandsRightSetOne, "uSlotAction:RightPageSetOne") +endfunction + +function RefreshItemsRightLeftPageOne() + RefreshItemsMain("uTypeLeft:RightPageSetOne", "uSelectedItemLeft:RightPageSetOne", "uSlotActionLeft:RightPageSetOne", bBothHandsRightSetOne, "uSlotActionLeft:RightPageSetOne") +endfunction + +function RefreshItemsBottomPageOne() + RefreshItemsMain("uType:BottomPageSetOne", "uSelectedItem:BottomPageSetOne", "uSlotAction:BottomPageSetOne", bBothHandsBottomSetOne, "uSlotAction:BottomPageSetOne") +endfunction + +function RefreshItemsBottomLeftPageOne() + RefreshItemsMain("uTypeLeft:BottomPageSetOne", "uSelectedItemLeft:BottomPageSetOne", "uSlotActionLeft:BottomPageSetOne", bBothHandsBottomSetOne, "uSlotActionLeft:BottomPageSetOne") +endfunction + +function RefreshItemsLeftListPageOne() + RefreshItemsMain("uType:LeftPageSetOne", "uSelectedItem:LeftPageSetOne", "uSlotAction:LeftPageSetOne", bBothHandsLeftSetOne, "uSlotAction:LeftPageSetOne") +endfunction + +function RefreshItemsLeftLeftPageOne() + RefreshItemsMain("uTypeLeft:LeftPageSetOne", "uSelectedItemLeft:LeftPageSetOne", "uSlotActionLeft:LeftPageSetOne", bBothHandsLeftSetOne, "uSlotActionLeft:LeftPageSetOne") +endfunction + Event OnSettingChange(String a_ID) ;could also do a refresh of the items on a "uTopType:TopPage" or "uTopTypeLeft:TopPage" setting change ;not sure if zero formid setting is nice like that @@ -264,6 +398,106 @@ Event OnSettingChange(String a_ID) SetToggles() RefreshMenu() endif + + if (a_ID == "uSelectedItem:TopPageSetOne") + SetModSettingString("sSelectedItemForm:TopPageSetOne", GetFormIdForSelection(GetModSettingInt(a_ID))) + + if (!bBothHandsSetOne) + SetModSettingString("sSelectedItemFormLeft:TopPageSetOne", "0") + endif + + RefreshMenu() + elseIf (a_ID == "uSelectedItemLeft:TopPageSetOne") + SetModSettingString("sSelectedItemFormLeft:TopPageSetOne", GetFormIdForSelection(GetModSettingInt(a_ID))) + RefreshMenu() + elseif (a_ID == "uType:TopPageSetOne") + SetFormZero(a_ID) + SetHands(a_ID, "uHandSelection:TopPageSetOne") + SetToggles() + RefreshMenu() + elseif (a_ID == "uTypeLeft:TopPageSetOne") + SetFormZero(a_ID) + SetToggles() + RefreshMenu() + elseif (a_ID == "uHandSelection:TopPageSetOne") + SetToggles() + RefreshMenu() + endif + + if (a_ID == "uSelectedItem:RightPageSetOne") + SetModSettingString("sSelectedItemForm:RightPageSetOne", GetFormIdForSelection(GetModSettingInt(a_ID))) + + if (!bBothHandsRightSetOne) + SetModSettingString("sSelectedItemFormLeft:RightPageSetOne", "0") + endif + + RefreshMenu() + elseIf (a_ID == "uSelectedItemLeft:RightPageSetOne") + SetModSettingString("sSelectedItemFormLeft:RightPageSetOne", GetFormIdForSelection(GetModSettingInt(a_ID))) + RefreshMenu() + elseif (a_ID == "uType:RightPageSetOne") + SetFormZero(a_ID) + SetHands(a_ID, "uHandSelection:RightPageSetOne") + SetToggles() + RefreshMenu() + elseif (a_ID == "uTypeLeft:RightPageSetOne") + SetFormZero(a_ID) + SetToggles() + RefreshMenu() + elseif (a_ID == "uHandSelection:RightPageSetOne") + SetToggles() + RefreshMenu() + endif + + if (a_ID == "uSelectedItem:BottomPageSetOne") + SetModSettingString("sSelectedItemForm:BottomPageSetOne", GetFormIdForSelection(GetModSettingInt(a_ID))) + + if (!bBothHandsBottomSetOne) + SetModSettingString("sSelectedItemFormLeft:BottomPageSetOne", "0") + endif + + RefreshMenu() + elseIf (a_ID == "uSelectedItemLeft:BottomPageSetOne") + SetModSettingString("sSelectedItemFormLeft:BottomPageSetOne", GetFormIdForSelection(GetModSettingInt(a_ID))) + RefreshMenu() + elseif (a_ID == "uType:BottomPageSetOne") + SetFormZero(a_ID) + SetHands(a_ID, "uHandSelection:BottomPageSetOne") + SetToggles() + RefreshMenu() + elseif (a_ID == "uTypeLeft:BottomPageSetOne") + SetFormZero(a_ID) + SetToggles() + RefreshMenu() + elseif (a_ID == "uHandSelection:BottomPageSetOne") + SetToggles() + RefreshMenu() + endif + + if (a_ID == "uSelectedItem:LeftPageSetOne") + SetModSettingString("sSelectedItemForm:LeftPageSetOne", GetFormIdForSelection(GetModSettingInt(a_ID))) + + if (!bBothHandsLeftSetOne) + SetModSettingString("sSelectedItemFormLeft:LeftPageSetOne", "0") + endif + + RefreshMenu() + elseIf (a_ID == "uSelectedItemLeft:LeftPageSetOne") + SetModSettingString("sSelectedItemFormLeft:LeftPageSetOne", GetFormIdForSelection(GetModSettingInt(a_ID))) + RefreshMenu() + elseif (a_ID == "uType:LeftPageSetOne") + SetFormZero(a_ID) + SetHands(a_ID, "uHandSelection:LeftPageSetOne") + SetToggles() + RefreshMenu() + elseif (a_ID == "uTypeLeft:LeftPageSetOne") + SetFormZero(a_ID) + SetToggles() + RefreshMenu() + elseif (a_ID == "uHandSelection:LeftPageSetOne") + SetToggles() + RefreshMenu() + endif EndEvent Event OnPageSelect(string a_page) @@ -306,6 +540,46 @@ Event OnPageSelect(string a_page) menu_list = GetSelectedOptions(GetModSettingInt("uTypeLeft:LeftPage"), bBothHandsLeft, "uSlotActionLeft:LeftPage") SetMenuOptions("uSelectedItemLeft:LeftPage", menu_list, menu_list) + RefreshMenu() + elseif (a_page == "$LamasTinyHUD_TopPageSetOne") + SetToggles() + ;no need to set uTopSelectedItem:TopPageSetOne here + string[] menu_list = GetSelectedOptions(GetModSettingInt("uType:TopPageSetOne"), bBothHandsSetOne, "uSlotAction:TopPageSetOne") + SetMenuOptions("uSelectedItem:TopPageSetOne", menu_list, menu_list) + + menu_list = GetSelectedOptions(GetModSettingInt("uTypeLeft:TopPageSetOne"), bBothHandsSetOne, "uSlotActionLeft:TopPageSetOne") + SetMenuOptions("uSelectedItemLeft:TopPageSetOne", menu_list, menu_list) + + RefreshMenu() + elseif (a_page == "$LamasTinyHUD_RightPageSetOne") + SetToggles() + ;no need to set uTopSelectedItem:TopPageSetOne here + string[] menu_list = GetSelectedOptions(GetModSettingInt("uType:RightPageSetOne"), bBothHandsRightSetOne, "uSlotAction:RightPageSetOne") + SetMenuOptions("uSelectedItem:RightPageSetOne", menu_list, menu_list) + + menu_list = GetSelectedOptions(GetModSettingInt("uTypeLeft:RightPageSetOne"), bBothHandsRightSetOne, "uSlotActionLeft:RightPageSetOne") + SetMenuOptions("uSelectedItemLeft:RightPageSetOne", menu_list, menu_list) + + RefreshMenu() + elseif (a_page == "$LamasTinyHUD_BottomPageSetOne") + SetToggles() + ;no need to set uTopSelectedItem:TopPageSetOne here + string[] menu_list = GetSelectedOptions(GetModSettingInt("uType:BottomPageSetOne"), bBothHandsBottomSetOne, "uSlotAction:BottomPageSetOne") + SetMenuOptions("uSelectedItem:BottomPageSetOne", menu_list, menu_list) + + menu_list = GetSelectedOptions(GetModSettingInt("uTypeLeft:BottomPageSetOne"), bBothHandsBottomSetOne, "uSlotActionLeft:BottomPageSetOne") + SetMenuOptions("uSelectedItemLeft:BottomPageSetOne", menu_list, menu_list) + + RefreshMenu() + elseif (a_page == "$LamasTinyHUD_LeftPageSetOne") + SetToggles() + ;no need to set uTopSelectedItem:TopPageSetOne here + string[] menu_list = GetSelectedOptions(GetModSettingInt("uType:LeftPageSetOne"), bBothHandsLeftSetOne, "uSlotAction:LeftPageSetOne") + SetMenuOptions("uSelectedItem:LeftPageSetOne", menu_list, menu_list) + + menu_list = GetSelectedOptions(GetModSettingInt("uTypeLeft:LeftPageSetOne"), bBothHandsLeftSetOne, "uSlotActionLeft:LeftPageSetOne") + SetMenuOptions("uSelectedItemLeft:LeftPageSetOne", menu_list, menu_list) + RefreshMenu() elseif ( a_page == "$LamasTinyHUD_HudSetting" ) SetModSettingString("sDisplayResolutionWidth:HudSetting",GetResolutionWidth()) diff --git a/src/equip/equip_slot.cpp b/src/equip/equip_slot.cpp index 2579b86..910a839 100644 --- a/src/equip/equip_slot.cpp +++ b/src/equip/equip_slot.cpp @@ -15,7 +15,7 @@ namespace item { const REL::Relocation func{ REL::ID(offset::get_left_hand_slot) }; return func(); } - + bool equip_slot::unequip_if_equipped(RE::TESBoundObject*& a_obj, RE::PlayerCharacter*& a_player, RE::ActorEquipManager*& a_actor_equip_manager) { diff --git a/src/equip/equip_slot.h b/src/equip/equip_slot.h index 8c11033..6b01867 100644 --- a/src/equip/equip_slot.h +++ b/src/equip/equip_slot.h @@ -5,7 +5,7 @@ namespace item { public: static RE::BGSEquipSlot* get_right_hand_slot(); static RE::BGSEquipSlot* get_left_hand_slot(); - + static bool unequip_if_equipped(RE::TESBoundObject*& a_obj, RE::PlayerCharacter*& a_player, RE::ActorEquipManager*& a_actor_equip_manager); diff --git a/src/equip/item/weapon.cpp b/src/equip/item/weapon.cpp index 44dfedc..3d6ca84 100644 --- a/src/equip/item/weapon.cpp +++ b/src/equip/item/weapon.cpp @@ -25,24 +25,24 @@ namespace item { break; } } - + if (obj == nullptr) { logger::warn("could not find selected weapon/shield, maybe it is gone"sv); //update ui in this case return; } - if (const auto equipped_object = a_player->GetEquippedObject(left); equipped_object->formID == obj->formID ) { + if (const auto equipped_object = a_player->GetEquippedObject(left); equipped_object->formID == obj->formID) { logger::debug("Object {} already equipped. return."sv, obj->GetName()); return; } - if (const auto equipped_object = a_player->GetEquippedObject(left); equipped_object->formID == obj->formID ) { + if (const auto equipped_object = a_player->GetEquippedObject(left); equipped_object->formID == obj->formID) { logger::debug("Object {} already equipped. return."sv, obj->GetName()); return; } - + logger::trace("try to equip weapon/shield {}"sv, a_form->GetName()); const auto equip_manager = RE::ActorEquipManager::GetSingleton(); - + equip_manager->EquipObject(a_player, obj, extra, 1, a_slot); //TODO add setting for that //a_player->DrawWeaponMagicHands(true); diff --git a/src/event/key_manager.cpp b/src/event/key_manager.cpp index 15ae05d..04d90ac 100644 --- a/src/event/key_manager.cpp +++ b/src/event/key_manager.cpp @@ -1,4 +1,6 @@ #include "key_manager.h" + +#include "handle/page_handle.h" #include "handle/setting_execute.h" #include "setting/mcm_setting.h" @@ -25,7 +27,7 @@ namespace event { key_right_action_ = config::mcm_setting::get_right_action_key(); key_bottom_action_ = config::mcm_setting::get_bottom_action_key(); key_left_action_ = config::mcm_setting::get_left_action_key(); - + key_toggle_ = config::mcm_setting::get_toggle_key(); button_press_modify_ = config::mcm_setting::get_slot_button_feedback(); @@ -84,6 +86,7 @@ namespace event { continue; } + //init fade setting here //currently not used, not sure this is te correct place /*if (button->IsDown() && (key_ == key_top_action_ || key_ == key_right_action_ || key_ == key_bottom_action_ @@ -106,7 +109,7 @@ namespace event { if (button->IsDown() && (key_ == key_top_action_ || key_ == key_right_action_ || key_ == key_bottom_action_ || key_ == key_left_action_)) { - logger::debug("configured Key ({}) is down"sv, key_); + logger::debug("configured key ({}) is down"sv, key_); //set slot to a different color const auto page_setting = handle::setting_execute::get_page_setting_for_key(key_); if (page_setting == nullptr) { @@ -133,6 +136,13 @@ namespace event { continue; } + if (is_key_valid(key_toggle_) && key_ == key_toggle_) { + logger::debug("configured toggle key ({}) is pressed"sv, key_); + //get_next_page_id + const auto handler = handle::page_handle::get_singleton(); + handler->set_active_page(handler->get_next_page_id()); + } + if (key_ == key_top_action_ || key_ == key_right_action_ || key_ == key_bottom_action_ || key_ == key_left_action_) { logger::debug("configured Key ({}) pressed"sv, key_); diff --git a/src/event/key_manager.h b/src/event/key_manager.h index 9801863..04c66f5 100644 --- a/src/event/key_manager.h +++ b/src/event/key_manager.h @@ -40,6 +40,7 @@ namespace event { uint32_t key_right_action_ = k_invalid; uint32_t key_bottom_action_ = k_invalid; uint32_t key_left_action_ = k_invalid; + uint32_t key_toggle_ = k_invalid; uint32_t button_press_modify_ = ui::draw_full; }; diff --git a/src/handle/page_handle.cpp b/src/handle/page_handle.cpp index d7b9fba..8bd0371 100644 --- a/src/handle/page_handle.cpp +++ b/src/handle/page_handle.cpp @@ -81,24 +81,68 @@ namespace handle { page->key = a_key_pos->get_key_for_position(a_position); - data->page_settings[a_position] = page; + data->page_settings[a_page][a_position] = page; logger::trace("done setting page {}, position {}."sv, a_page, static_cast(a_position)); } - page_setting* page_handle::get_page_setting(const page_setting::position a_position) const { + void page_handle::set_active_page(const uint32_t a_page) const { + if (!this->data_) { + return; + } + page_handle_data* data = this->data_; + + logger::trace("set active page to {}"sv, a_page); + + data->active_page = a_page; + } + + page_setting* page_handle::get_page_setting(const uint32_t a_page, const page_setting::position a_position) const { if (const page_handle_data* data = this->data_; - data && !data_->page_settings.empty() && data_->page_settings[a_position]) { - return data_->page_settings[a_position]; + data && !data->page_settings.empty() && !data->page_settings.at(a_page).empty() && data->page_settings. + at(a_page).at(a_position)) { + return data->page_settings.at(a_page).at(a_position); } return nullptr; } - std::map page_handle::get_page() const { - if (const page_handle_data* data = this->data_; data && !data_->page_settings.empty()) { - return data_->page_settings; + std::map page_handle::get_page(const uint32_t a_page) const { + if (const page_handle_data* data = this->data_; data && !data->page_settings.empty()) { + return data->page_settings.at(a_page); + } + return {}; + } + + std::map> page_handle::get_pages() const { + if (const page_handle_data* data = this->data_; data && !data->page_settings.empty()) { + return data->page_settings; + } + return {}; + } + + std::map page_handle::get_active_page() const { + if (const page_handle_data* data = this->data_; data && !data->page_settings.empty()) { + return data->page_settings.at(data->active_page); + } + return {}; + } + + uint32_t page_handle::get_active_page_id() const { + if (const page_handle_data* data = this->data_; data) { + return data->active_page; + } + return {}; + } + + uint32_t page_handle::get_next_page_id() const { + if (const page_handle_data* data = this->data_; data) { + //lets make it easy for now + if (data->active_page == 0) { + return 1; + } + return 0; } return {}; } diff --git a/src/handle/page_handle.h b/src/handle/page_handle.h index 4a873f9..3ad1972 100644 --- a/src/handle/page_handle.h +++ b/src/handle/page_handle.h @@ -8,7 +8,7 @@ namespace handle { class page_handle { public: static page_handle* get_singleton(); - void init_page([[maybe_unused]] uint32_t a_page, + void init_page(uint32_t a_page, page_setting::position a_position, const std::vector& data_helpers, float a_slot_offset, @@ -16,8 +16,15 @@ namespace handle { slot_setting::hand_equip a_hand, uint32_t a_opacity, key_position*& a_key_pos); - [[nodiscard]] page_setting* get_page_setting(page_setting::position a_position) const; - [[nodiscard]] std::map get_page() const; + + void set_active_page(uint32_t a_page) const; + + [[nodiscard]] page_setting* get_page_setting(uint32_t a_page, page_setting::position a_position) const; + [[nodiscard]] std::map get_page(uint32_t a_page) const; + [[nodiscard]] std::map> get_pages() const; + [[nodiscard]] std::map get_active_page() const; + [[nodiscard]] uint32_t get_active_page_id() const; + [[nodiscard]] uint32_t get_next_page_id() const; page_handle(const page_handle&) = delete; page_handle(page_handle&&) = delete; @@ -49,7 +56,8 @@ namespace handle { static void get_icon_for_item(RE::TESForm*& a_form, ui::icon_image_type& a_icon); struct page_handle_data { - std::map page_settings; + std::map> page_settings; + uint32_t active_page = 0; }; page_handle_data* data_; diff --git a/src/handle/set_data.cpp b/src/handle/set_data.cpp index 486d190..fee0f2d 100644 --- a/src/handle/set_data.cpp +++ b/src/handle/set_data.cpp @@ -16,14 +16,16 @@ namespace handle { key_pos->init_key_position_map(); //set empty for each position, it will be overwritten if it is configured - for (auto i = 0; i < static_cast(page_setting::position::total); ++i) { - set_empty_slot(i, key_pos); + for (auto i = 0; i < util::page_count; ++i) { + for (auto j = 0; j < static_cast(page_setting::position::total); ++j) { + set_empty_slot(i, j, key_pos); + } } logger::trace("continue with overwriting data from configuration ..."sv); - - set_slot(page_setting::position::top, + set_slot(0, + page_setting::position::top, mcm::get_top_selected_item_form(), mcm::get_top_type(), mcm::get_top_hand_selection(), @@ -33,7 +35,8 @@ namespace handle { mcm::get_top_slot_action_left(), key_pos); - set_slot(page_setting::position::right, + set_slot(0, + page_setting::position::right, mcm::get_right_selected_item_form(), mcm::get_right_type(), mcm::get_right_hand_selection(), @@ -43,7 +46,8 @@ namespace handle { mcm::get_right_slot_action_left(), key_pos); - set_slot(page_setting::position::bottom, + set_slot(0, + page_setting::position::bottom, mcm::get_bottom_selected_item_form(), mcm::get_bottom_type(), mcm::get_bottom_hand_selection(), @@ -53,7 +57,8 @@ namespace handle { mcm::get_bottom_slot_action_left(), key_pos); - set_slot(page_setting::position::left, + set_slot(0, + page_setting::position::left, mcm::get_left_selected_item_form(), mcm::get_left_type(), mcm::get_left_hand_selection(), @@ -63,6 +68,50 @@ namespace handle { mcm::get_left_slot_action_left(), key_pos); + set_slot(1, + page_setting::position::top, + mcm::get_top_selected_item_form_page_one(), + mcm::get_top_type_page_one(), + mcm::get_top_hand_selection_page_one(), + mcm::get_top_slot_action_page_one(), + mcm::get_top_selected_item_form_left_page_one(), + mcm::get_top_type_left_page_one(), + mcm::get_top_slot_action_left_page_one(), + key_pos); + + set_slot(1, + page_setting::position::right, + mcm::get_right_selected_item_form_page_one(), + mcm::get_right_type_page_one(), + mcm::get_right_hand_selection_page_one(), + mcm::get_right_slot_action_page_one(), + mcm::get_right_selected_item_form_left_page_one(), + mcm::get_right_type_left_page_one(), + mcm::get_right_slot_action_left_page_one(), + key_pos); + + set_slot(1, + page_setting::position::bottom, + mcm::get_bottom_selected_item_form_page_one(), + mcm::get_bottom_type_page_one(), + mcm::get_bottom_hand_selection_page_one(), + mcm::get_bottom_slot_action_page_one(), + mcm::get_bottom_selected_item_form_left_page_one(), + mcm::get_bottom_type_left_page_one(), + mcm::get_bottom_slot_action_left_page_one(), + key_pos); + + set_slot(1, + page_setting::position::left, + mcm::get_left_selected_item_form_page_one(), + mcm::get_left_type_page_one(), + mcm::get_left_hand_selection_page_one(), + mcm::get_left_slot_action_page_one(), + mcm::get_left_selected_item_form_left_page_one(), + mcm::get_left_type_left_page_one(), + mcm::get_left_slot_action_left_page_one(), + key_pos); + logger::trace("done setting. return."sv); } @@ -70,8 +119,8 @@ namespace handle { set_new_item_count(a_obj->GetFormID(), a_obj->GetName(), a_count); } - void set_data::set_empty_slot(int a_pos, key_position*& a_key_pos) { - logger::trace("setting empty config for position {}"sv, a_pos); + void set_data::set_empty_slot(const int a_page, int a_pos, key_position*& a_key_pos) { + logger::trace("setting empty config for page {}, position {}"sv, a_page, a_pos); std::vector data; const auto item = new data_helper(); item->form = nullptr; @@ -79,7 +128,7 @@ namespace handle { item->type = util::selection_type::unset; data.push_back(item); - page_handle::get_singleton()->init_page(0, + page_handle::get_singleton()->init_page(a_page, static_cast(a_pos), data, mcm::get_hud_slot_position_offset(), @@ -89,7 +138,8 @@ namespace handle { a_key_pos); } - void set_data::set_slot(page_setting::position a_pos, + void set_data::set_slot(const uint32_t a_page, + page_setting::position a_pos, const std::string& a_form, uint32_t a_type, uint32_t a_hand, @@ -106,7 +156,10 @@ namespace handle { auto hand = static_cast(a_hand); std::vector data; - logger::trace("start working data hands {} ..."sv, a_hand); + logger::trace("page {}, pos {}, start working data hands {} ..."sv, + a_page, + static_cast(a_pos), + a_hand); slot_setting::acton_type action; @@ -151,28 +204,30 @@ namespace handle { logger::trace("checking if we need to build a second data set, already got {}"sv, data.size()); - if (const auto type_left = static_cast(a_type_left); - (form_left != nullptr && type_left == util::selection_type::magic || type_left == - util::selection_type::weapon || type_left == - util::selection_type::shield) && hand == slot_setting::hand_equip::single) { - logger::trace("start building data pos {}, form {}, type {}, action {}, hand {}"sv, - static_cast(a_pos), - util::string_util::int_to_hex(form_left->GetFormID()), - static_cast(type_left), - static_cast(action), - static_cast(hand)); - - const auto item_left = new data_helper(); - item_left->form = form_left; - item_left->type = type_left; - item_left->action_type = action; - item_left->left = true; - data.push_back(item_left); + if (form_left != nullptr) { + if (const auto type_left = static_cast(a_type_left); + (type_left == util::selection_type::magic || type_left == + util::selection_type::weapon || type_left == + util::selection_type::shield) && hand == slot_setting::hand_equip::single) { + logger::trace("start building data pos {}, form {}, type {}, action {}, hand {}"sv, + static_cast(a_pos), + util::string_util::int_to_hex(form_left->GetFormID()), + static_cast(type_left), + static_cast(action), + static_cast(hand)); + + const auto item_left = new data_helper(); + item_left->form = form_left; + item_left->type = type_left; + item_left->action_type = action; + item_left->left = true; + data.push_back(item_left); + } } logger::trace("build data, calling handler, data size {}"sv, data.size()); if (!data.empty()) { - page_handle::get_singleton()->init_page(0, + page_handle::get_singleton()->init_page(a_page, a_pos, data, config::mcm_setting::get_hud_slot_position_offset(), @@ -186,13 +241,15 @@ namespace handle { void set_data::set_new_item_count(const RE::FormID a_form_id, const char* a_name, int32_t a_count) { //just consider magic items for now, that includes const auto page_handle = page_handle::get_singleton(); - for (auto pages = page_handle->get_page(); auto [position, page] : pages) { - for (const auto setting : page->slot_settings) { - if (setting->type == util::selection_type::consumable && setting->form->formID == a_form_id) { - setting->item_count = setting->item_count + a_count; - logger::trace("Name {}, new count {}, change count {}"sv, a_name, setting->item_count, a_count); - - //TODO maybe add indicator to ui that the items are gone + for (auto pages = page_handle->get_pages(); auto [page, page_settings] : pages) { + for (auto [position, page_setting] : page_settings) { + for (const auto setting : page_setting->slot_settings) { + if (setting->type == util::selection_type::consumable && setting->form->formID == a_form_id) { + setting->item_count = setting->item_count + a_count; + logger::trace("Name {}, new count {}, change count {}"sv, a_name, setting->item_count, a_count); + + //TODO maybe add indicator to ui that the items are gone + } } } } @@ -212,6 +269,10 @@ namespace handle { RE::FormID form_id; std::istringstream(id) >> std::hex >> form_id; + if (plugin.empty()) { + return nullptr; + } + if (plugin == util::dynamic_name) { form = RE::TESForm::LookupByID(form_id); } else { diff --git a/src/handle/set_data.h b/src/handle/set_data.h index 34486c1..83bd123 100644 --- a/src/handle/set_data.h +++ b/src/handle/set_data.h @@ -9,8 +9,9 @@ namespace handle { static void set_new_item_count_if_needed(const RE::TESBoundObject* a_obj, int32_t a_count); private: - static void set_empty_slot(int a_pos, key_position*& a_key_pos); - static void set_slot(page_setting::position a_pos, + static void set_empty_slot(int a_page, int a_pos, key_position*& a_key_pos); + static void set_slot(uint32_t a_page, + page_setting::position a_pos, const std::string& a_form, uint32_t a_type, uint32_t a_hand, diff --git a/src/handle/setting_execute.cpp b/src/handle/setting_execute.cpp index 8820b6b..e0098a2 100644 --- a/src/handle/setting_execute.cpp +++ b/src/handle/setting_execute.cpp @@ -31,11 +31,14 @@ namespace handle { return nullptr; } - const auto page_setting = page_handle::get_singleton()->get_page_setting(position); + const auto page_handle = page_handle::get_singleton(); + auto page = page_handle->get_active_page_id(); + const auto page_setting = page_handle->get_page_setting(page, position); if (page_setting == nullptr) { logger::warn("nothing to do, nothing set. return."sv); } - logger::debug("position is {}, setting count {}"sv, + logger::debug("page {}, position is {}, setting count {}"sv, + page, static_cast(position), page_setting->slot_settings.size()); diff --git a/src/hook/hook.cpp b/src/hook/hook.cpp index 85fc280..56adaeb 100644 --- a/src/hook/hook.cpp +++ b/src/hook/hook.cpp @@ -1,5 +1,4 @@ #include "hook.h" - #include "handle/set_data.h" namespace hook { diff --git a/src/setting/mcm_setting.cpp b/src/setting/mcm_setting.cpp index fe8b09b..254024f 100644 --- a/src/setting/mcm_setting.cpp +++ b/src/setting/mcm_setting.cpp @@ -9,6 +9,7 @@ namespace config { static uint32_t right_action_key; static uint32_t bottom_action_key; static uint32_t left_action_key; + static uint32_t toggle_key; static uint32_t controller_set; static uint32_t top_type; @@ -43,6 +44,38 @@ namespace config { static std::string left_selected_item_form_left; static uint32_t left_slot_action_left; + static uint32_t top_type_page_one; + static std::string top_selected_item_form_page_one; + static uint32_t top_slot_action_page_one; + static uint32_t top_hand_selection_page_one; + static uint32_t top_type_left_page_one; + static std::string top_selected_item_form_left_page_one; + static uint32_t top_slot_action_left_page_one; + + static uint32_t right_type_page_one; + static std::string right_selected_item_form_page_one; + static uint32_t right_slot_action_page_one; + static uint32_t right_hand_selection_page_one; + static uint32_t right_type_left_page_one; + static std::string right_selected_item_form_left_page_one; + static uint32_t right_slot_action_left_page_one; + + static uint32_t bottom_type_page_one; + static std::string bottom_selected_item_form_page_one; + static uint32_t bottom_slot_action_page_one; + static uint32_t bottom_hand_selection_page_one; + static uint32_t bottom_type_left_page_one; + static std::string bottom_selected_item_form_left_page_one; + static uint32_t bottom_slot_action_left_page_one; + + static uint32_t left_type_page_one; + static std::string left_selected_item_form_page_one; + static uint32_t left_slot_action_page_one; + static uint32_t left_hand_selection_page_one; + static uint32_t left_type_left_page_one; + static std::string left_selected_item_form_left_page_one; + static uint32_t left_slot_action_left_page_one; + static float hud_image_scale_width; static float hud_image_scale_height; static float hud_image_position_width; @@ -57,6 +90,9 @@ namespace config { static float key_icon_scale_height; static float slot_count_text_offset; static float slot_count_text_font_size; + static bool draw_toggle_button; + static float toggle_key_offset_x; + static float toggle_key_offset_y; void mcm_setting::read_setting() { logger::info("reading mcm ini files"); @@ -66,10 +102,11 @@ namespace config { mcm.SetUnicode(); mcm.LoadFile(path.string().c_str()); - top_action_key = static_cast(mcm.GetLongValue("Controls", "uTopActionKey", 45)); - right_action_key = static_cast(mcm.GetLongValue("Controls", "uRightActionKey", 46)); - bottom_action_key = static_cast(mcm.GetLongValue("Controls", "uBottomActionKey", 46)); - left_action_key = static_cast(mcm.GetLongValue("Controls", "uLeftActionKey", 48)); + top_action_key = static_cast(mcm.GetLongValue("Controls", "uTopActionKey", 10)); + right_action_key = static_cast(mcm.GetLongValue("Controls", "uRightActionKey", 11)); + bottom_action_key = static_cast(mcm.GetLongValue("Controls", "uBottomActionKey", 12)); + left_action_key = static_cast(mcm.GetLongValue("Controls", "uLeftActionKey", 13)); + toggle_key = static_cast(mcm.GetLongValue("Controls", "uToggleKey", 27)); controller_set = static_cast(mcm.GetLongValue("Controls", "uControllerSet", 0)); //got more settings, variables, but for now we are ok @@ -108,6 +145,55 @@ namespace config { left_selected_item_form_left = mcm.GetValue("LeftPage", "sSelectedItemFormLeft", ""); left_slot_action_left = static_cast(mcm.GetLongValue("LeftPage", "uSlotActionLeft", 0)); + //got more settings, variables, but for now we are ok + top_type_page_one = static_cast(mcm.GetLongValue("TopPageSetOne", "uType", 0)); + top_selected_item_form_page_one = mcm.GetValue("TopPageSetOne", "sSelectedItemForm", ""); + top_slot_action_page_one = static_cast(mcm.GetLongValue("TopPageSetOne", "uSlotAction", 0)); + top_hand_selection_page_one = static_cast(mcm.GetLongValue("TopPageSetOne", "uHandSelection", 1)); + top_type_left_page_one = static_cast(mcm.GetLongValue("TopPageSetOne", "uTypeLeft", 0)); + top_selected_item_form_left_page_one = mcm.GetValue("TopPageSetOne", "sSelectedItemFormLeft", ""); + top_slot_action_left_page_one = static_cast(mcm.GetLongValue("TopPageSetOne", + "uSlotActionLeft", + 0)); + + //got more settings, variables, but for now we are ok + right_type_page_one = static_cast(mcm.GetLongValue("RightPageSetOne", "uType", 0)); + right_selected_item_form_page_one = mcm.GetValue("RightPageSetOne", "sSelectedItemForm", ""); + right_slot_action_page_one = static_cast(mcm.GetLongValue("RightPageSetOne", "uSlotAction", 0)); + right_hand_selection_page_one = static_cast(mcm.GetLongValue("RightPageSetOne", + "uHandSelection", + 1)); + right_type_left_page_one = static_cast(mcm.GetLongValue("RightPageSetOne", "uTypeLeft", 0)); + right_selected_item_form_left_page_one = mcm.GetValue("RightPageSetOne", "sSelectedItemFormLeft", ""); + right_slot_action_left_page_one = static_cast(mcm.GetLongValue("RightPageSetOne", + "uSlotActionLeft", + 0)); + + //got more settings, variables, but for now we are ok + bottom_type_page_one = static_cast(mcm.GetLongValue("BottomPageSetOne", "uType", 0)); + bottom_selected_item_form_page_one = mcm.GetValue("BottomPageSetOne", "sSelectedItemForm", ""); + bottom_slot_action_page_one = static_cast(mcm.GetLongValue("BottomPageSetOne", "uSlotAction", 0)); + bottom_hand_selection_page_one = static_cast(mcm.GetLongValue("BottomPageSetOne", + "uHandSelection", + 1)); + bottom_type_left_page_one = static_cast(mcm.GetLongValue("BottomPageSetOne", "uTypeLeft", 0)); + bottom_selected_item_form_left_page_one = mcm.GetValue("BottomPageSetOne", "sSelectedItemFormLeft", ""); + bottom_slot_action_left_page_one = static_cast(mcm.GetLongValue("BottomPageSetOne", + "uSlotActionLeft", + 0)); + + //got more settings, variables, but for now we are ok + left_type_page_one = static_cast(mcm.GetLongValue("LeftPageSetOne", "uType", 0)); + left_selected_item_form_page_one = mcm.GetValue("LeftPageSetOne", "sSelectedItemForm", ""); + left_slot_action_page_one = static_cast(mcm.GetLongValue("LeftPageSetOne", "uSlotAction", 0)); + left_hand_selection_page_one = static_cast(mcm. + GetLongValue("LeftPageSetOne", "uHandSelection", 1)); + left_type_left_page_one = static_cast(mcm.GetLongValue("LeftPageSetOne", "uTypeLeft", 0)); + left_selected_item_form_left_page_one = mcm.GetValue("LeftPageSetOne", "sSelectedItemFormLeft", ""); + left_slot_action_left_page_one = static_cast(mcm.GetLongValue("LeftPageSetOne", + "uSlotActionLeft", + 0)); + hud_image_scale_width = static_cast(mcm.GetDoubleValue("HudSetting", "fHudImageScaleWidth", 0.25)); hud_image_scale_height = static_cast(mcm.GetDoubleValue("HudSetting", "fHudImageScaleHeight", 0.25)); hud_image_position_width = static_cast(mcm.GetDoubleValue("HudSetting", @@ -129,6 +215,13 @@ namespace config { slot_count_text_font_size = static_cast(mcm.GetDoubleValue("HudSetting", "fSlotCountTextFontSize", 20)); + draw_toggle_button = mcm.GetBoolValue("HudSetting", "bDrawToggleButton", true); + toggle_key_offset_x = static_cast(mcm.GetDoubleValue("HudSetting", + "fToggleKeyOffsetX", + 90)); + toggle_key_offset_y = static_cast(mcm.GetDoubleValue("HudSetting", + "fToggleKeyOffsetY", + 90)); }; read_mcm(mcm_default_setting); @@ -142,6 +235,7 @@ namespace config { uint32_t mcm_setting::get_right_action_key() { return right_action_key; } uint32_t mcm_setting::get_bottom_action_key() { return bottom_action_key; } uint32_t mcm_setting::get_left_action_key() { return left_action_key; } + uint32_t mcm_setting::get_toggle_key() { return toggle_key; } uint32_t mcm_setting::get_controller_set() { return controller_set; } uint32_t mcm_setting::get_top_type() { return top_type; } @@ -176,6 +270,50 @@ namespace config { std::string mcm_setting::get_left_selected_item_form_left() { return left_selected_item_form_left; } uint32_t mcm_setting::get_left_slot_action_left() { return left_slot_action_left; } + uint32_t mcm_setting::get_top_type_page_one() { return top_type_page_one; } + std::string mcm_setting::get_top_selected_item_form_page_one() { return top_selected_item_form_page_one; } + uint32_t mcm_setting::get_top_slot_action_page_one() { return top_slot_action_page_one; } + uint32_t mcm_setting::get_top_hand_selection_page_one() { return top_hand_selection_page_one; } + uint32_t mcm_setting::get_top_type_left_page_one() { return top_type_left_page_one; } + std::string mcm_setting::get_top_selected_item_form_left_page_one() { return top_selected_item_form_left_page_one; } + uint32_t mcm_setting::get_top_slot_action_left_page_one() { return top_slot_action_left_page_one; } + + uint32_t mcm_setting::get_right_type_page_one() { return right_type_page_one; } + std::string mcm_setting::get_right_selected_item_form_page_one() { return right_selected_item_form_page_one; } + uint32_t mcm_setting::get_right_slot_action_page_one() { return right_slot_action_page_one; } + uint32_t mcm_setting::get_right_hand_selection_page_one() { return right_hand_selection_page_one; } + uint32_t mcm_setting::get_right_type_left_page_one() { return right_type_left_page_one; } + + std::string mcm_setting::get_right_selected_item_form_left_page_one() { + return right_selected_item_form_left_page_one; + } + + uint32_t mcm_setting::get_right_slot_action_left_page_one() { return right_slot_action_left_page_one; } + + uint32_t mcm_setting::get_bottom_type_page_one() { return bottom_type_page_one; } + std::string mcm_setting::get_bottom_selected_item_form_page_one() { return bottom_selected_item_form_page_one; } + uint32_t mcm_setting::get_bottom_slot_action_page_one() { return bottom_slot_action_page_one; } + uint32_t mcm_setting::get_bottom_hand_selection_page_one() { return bottom_hand_selection_page_one; } + uint32_t mcm_setting::get_bottom_type_left_page_one() { return bottom_type_left_page_one; } + + std::string mcm_setting::get_bottom_selected_item_form_left_page_one() { + return bottom_selected_item_form_left_page_one; + } + + uint32_t mcm_setting::get_bottom_slot_action_left_page_one() { return bottom_slot_action_left_page_one; } + + uint32_t mcm_setting::get_left_type_page_one() { return left_type_page_one; } + std::string mcm_setting::get_left_selected_item_form_page_one() { return left_selected_item_form_page_one; } + uint32_t mcm_setting::get_left_slot_action_page_one() { return left_slot_action_page_one; } + uint32_t mcm_setting::get_left_hand_selection_page_one() { return left_hand_selection_page_one; } + uint32_t mcm_setting::get_left_type_left_page_one() { return left_type_left_page_one; } + + std::string mcm_setting::get_left_selected_item_form_left_page_one() { + return left_selected_item_form_left_page_one; + } + + uint32_t mcm_setting::get_left_slot_action_left_page_one() { return left_slot_action_left_page_one; } + float mcm_setting::get_hud_image_scale_width() { return hud_image_scale_width; } float mcm_setting::get_hud_image_scale_height() { return hud_image_scale_height; } float mcm_setting::get_hud_image_position_width() { return hud_image_position_width; } @@ -190,4 +328,7 @@ namespace config { float mcm_setting::get_key_icon_scale_height() { return key_icon_scale_height; } float mcm_setting::get_slot_count_text_offset() { return slot_count_text_offset; } float mcm_setting::get_slot_count_text_font_size() { return slot_count_text_font_size; } + bool mcm_setting::get_draw_toggle_button() { return draw_toggle_button; } + float mcm_setting::get_toggle_key_offset_x() { return toggle_key_offset_x; } + float mcm_setting::get_toggle_key_offset_y() { return toggle_key_offset_y; } } diff --git a/src/setting/mcm_setting.h b/src/setting/mcm_setting.h index f01bf84..178f04a 100644 --- a/src/setting/mcm_setting.h +++ b/src/setting/mcm_setting.h @@ -9,6 +9,7 @@ namespace config { static uint32_t get_right_action_key(); static uint32_t get_bottom_action_key(); static uint32_t get_left_action_key(); + static uint32_t get_toggle_key(); static uint32_t get_controller_set(); static uint32_t get_top_type(); @@ -43,6 +44,38 @@ namespace config { static std::string get_left_selected_item_form_left(); static uint32_t get_left_slot_action_left(); + static uint32_t get_top_type_page_one(); + static std::string get_top_selected_item_form_page_one(); + static uint32_t get_top_slot_action_page_one(); + static uint32_t get_top_hand_selection_page_one(); + static uint32_t get_top_type_left_page_one(); + static std::string get_top_selected_item_form_left_page_one(); + static uint32_t get_top_slot_action_left_page_one(); + + static uint32_t get_right_type_page_one(); + static std::string get_right_selected_item_form_page_one(); + static uint32_t get_right_slot_action_page_one(); + static uint32_t get_right_hand_selection_page_one(); + static uint32_t get_right_type_left_page_one(); + static std::string get_right_selected_item_form_left_page_one(); + static uint32_t get_right_slot_action_left_page_one(); + + static uint32_t get_bottom_type_page_one(); + static std::string get_bottom_selected_item_form_page_one(); + static uint32_t get_bottom_slot_action_page_one(); + static uint32_t get_bottom_hand_selection_page_one(); + static uint32_t get_bottom_type_left_page_one(); + static std::string get_bottom_selected_item_form_left_page_one(); + static uint32_t get_bottom_slot_action_left_page_one(); + + static uint32_t get_left_type_page_one(); + static std::string get_left_selected_item_form_page_one(); + static uint32_t get_left_slot_action_page_one(); + static uint32_t get_left_hand_selection_page_one(); + static uint32_t get_left_type_left_page_one(); + static std::string get_left_selected_item_form_left_page_one(); + static uint32_t get_left_slot_action_left_page_one(); + static float get_hud_image_scale_width(); static float get_hud_image_scale_height(); static float get_hud_image_position_width(); @@ -57,5 +90,8 @@ namespace config { static float get_key_icon_scale_height(); static float get_slot_count_text_offset(); static float get_slot_count_text_font_size(); + static bool get_draw_toggle_button(); + static float get_toggle_key_offset_x(); + static float get_toggle_key_offset_y(); }; } diff --git a/src/ui/ui_renderer.cpp b/src/ui/ui_renderer.cpp index 4d2f15e..03ec7d5 100644 --- a/src/ui/ui_renderer.cpp +++ b/src/ui/ui_renderer.cpp @@ -292,9 +292,9 @@ namespace ui { offset_setting->offset_slot_y, page_setting->icon_type, page_setting->icon_opacity); + if (auto slot_settings = page_setting->slot_settings; - position == handle::page_setting::position::left && !slot_settings.empty() && slot_settings.front()-> - item_count > 0) { + !slot_settings.empty() && slot_settings.front()->item_count > 0) { draw_text(a_x, a_y, offset_setting->offset_slot_x, @@ -345,6 +345,15 @@ namespace ui { page_setting->key, draw_full); } + + if (config::mcm_setting::get_draw_toggle_button()) { + draw_key_icon(a_x, + a_y, + config::mcm_setting::get_toggle_key_offset_x(), + config::mcm_setting::get_toggle_key_offset_y(), + config::mcm_setting::get_toggle_key(), + draw_full); + } } void ui_renderer::draw_icon(const float a_x, @@ -438,7 +447,7 @@ namespace ui { ImGui::Begin(hud_name, nullptr, window_flag); - const auto settings = handle::page_handle::get_singleton()->get_page(); + const auto settings = handle::page_handle::get_singleton()->get_active_page(); draw_hud(screen_size_x, screen_size_y); draw_slots(screen_size_x, screen_size_y, settings); diff --git a/src/util/constant.h b/src/util/constant.h index 335eefc..bf2d41f 100644 --- a/src/util/constant.h +++ b/src/util/constant.h @@ -19,4 +19,6 @@ namespace util { constexpr auto dynamic_name = "dynamic"; constexpr auto delimiter = "|"; + + constexpr auto page_count = 2; } diff --git a/src/util/string_util.h b/src/util/string_util.h index cdc2283..8501a0b 100644 --- a/src/util/string_util.h +++ b/src/util/string_util.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -11,14 +11,16 @@ namespace util { static std::string int_to_hex(T a_i) { std::stringstream stream; stream << std::hex << a_i; - + return ltrim_copy(stream.str()); } - static void ltrim(std::string &s) { - s.erase(s.begin(), std::ranges::find_if(s, [](const unsigned char ch) { - return !std::isspace(ch); - })); + static void ltrim(std::string& s) { + s.erase(s.begin(), + std::ranges::find_if(s, + [](const unsigned char ch) { + return !std::isspace(ch); + })); } static std::string ltrim_copy(std::string s) {