diff --git a/IRTweaks/IRTweaks/ModConfig.cs b/IRTweaks/IRTweaks/ModConfig.cs index b896c8c..8e47250 100644 --- a/IRTweaks/IRTweaks/ModConfig.cs +++ b/IRTweaks/IRTweaks/ModConfig.cs @@ -210,6 +210,7 @@ public class FixesFlags public bool SkirmishAlwaysUnlimited = true; public bool SimGameDifficultyLabelsReplacer = true; public bool StreamlinedMainMenu = true; + public bool ShiftMenuElements = false; public bool WeaponTooltip = true; } diff --git a/IRTweaks/IRTweaks/Modules/UI/StreamlinedMainMenu.cs b/IRTweaks/IRTweaks/Modules/UI/StreamlinedMainMenu.cs index 0a16069..6178cab 100644 --- a/IRTweaks/IRTweaks/Modules/UI/StreamlinedMainMenu.cs +++ b/IRTweaks/IRTweaks/Modules/UI/StreamlinedMainMenu.cs @@ -129,6 +129,11 @@ static void Postfix(SGNavigationButton __instance, SGNavigationList ___buttonPar ___buttonParent.ArgoButtonFlyoutChangeRoom(DropshipLocation.SHOP); } QueueOrForceActivation(DropshipMenuType.Shop, DropshipLocation.SHOP, ___buttonParent.navParent, simulation); + } else if (___text.text.Contains("Hiring Hall")) { + if (simulation.CurRoomState != DropshipLocation.HIRING) { + ___buttonParent.ArgoButtonFlyoutChangeRoom(DropshipLocation.HIRING); + } + QueueOrForceActivation(DropshipMenuType.HiringHall, DropshipLocation.HIRING, ___buttonParent.navParent, simulation); } else if (___text.text.Contains("Memorial")) { if (simulation.CurRoomState != DropshipLocation.BARRACKS) { ___buttonParent.ArgoButtonFlyoutChangeRoom(DropshipLocation.BARRACKS); @@ -156,14 +161,43 @@ private static void QueueOrForceActivation(DropshipMenuType menuType, DropshipLo public static class SGNavigationWidgetLeft_Init { static bool Prepare() { return Mod.Config.Fixes.StreamlinedMainMenu; } - static void Postfix(SGNavigationWidgetLeft __instance, SGShipMap ___shipMap, SGNavigationList ___locationList) { + static void Postfix(SGNavigationWidgetLeft __instance, SGShipMap ___shipMap, SGFinancialForecastWidget ___financialForecast, + SGMoraleBar ___theMoraleBar, SGMedTechPointsDisplay ___theMedTechs, SGMechTechPointsDisplay ___theMechTechs, SGNavigationList ___locationList) + { Mod.Log.Info?.Write($"SGNWL:I - entered with instanceType: {__instance.GetType()}."); ___shipMap.gameObject.SetActive(false); - Vector3 startPos = ___locationList.transform.position; - startPos.y += 200; - ___locationList.transform.position = startPos; + if (Mod.Config.Fixes.ShiftMenuElements) + { + Mod.Log.Info?.Write(" - Shifting Left Menu Elements"); + + Vector3 startPos = ___financialForecast.transform.position; + startPos.y += 10; + ___financialForecast.transform.position = startPos; + + startPos = ___theMoraleBar.transform.position; + startPos.y += 12; + ___theMoraleBar.transform.position = startPos; + + startPos = ___theMedTechs.transform.position; + startPos.y += 10; + ___theMedTechs.transform.position = startPos; + + startPos = ___theMechTechs.transform.position; + startPos.y += 10; + ___theMechTechs.transform.position = startPos; + + startPos = ___locationList.transform.position; + startPos.y += 245; + ___locationList.transform.position = startPos; + } + else + { + Vector3 startPos = ___locationList.transform.position; + startPos.y += 200; + ___locationList.transform.position = startPos; + } } } @@ -216,6 +250,7 @@ static void Postfix(SGNavigationList __instance, SimGameState simState) { public static class SGNavigationList_Start { public static SGNavigationButton storeButton; + public static SGNavigationButton hiringHallButton; public static SGNavigationButton staffButton; public static SGNavigationButton memorialButton; @@ -240,7 +275,27 @@ static void Postfix(SGNavigationList __instance, HBSRadioSet ___radioSet, SGNavi Traverse storeButtonT = Traverse.Create(storeButton).Field("id"); storeButtonT.SetValue(DropshipLocation.SHIP); storeButton.SetupElement(__instance, ___radioSet, "Store", - LazySingletonBehavior.Instance.UILookAndColorConstants.DropshipRoomCaptainsQuartersIcon, simulation); + LazySingletonBehavior.Instance.UILookAndColorConstants.DropshipRoomCaptainsQuartersIcon, simulation); + + // Create the hiring hall button + if (Mod.Config.Fixes.ShiftMenuElements) + { + Mod.Log.Info?.Write(" - Creating Hiring Hall button"); + GameObject hiringHallButtonGO = GameObject.Instantiate(___argoButton.gameObject); + hiringHallButtonGO.SetActive(true); + hiringHallButtonGO.transform.position = ___argoButton.gameObject.transform.position; + hiringHallButtonGO.transform.SetParent(___argoButton.gameObject.transform.parent); + hiringHallButtonGO.transform.localScale = Vector3.one; + hiringHallButtonGO.transform.SetSiblingIndex(2); + + + hiringHallButton = hiringHallButtonGO.GetComponent(); + Traverse hiringHallButtonT = Traverse.Create(memorialButton).Field("id"); + hiringHallButtonT.SetValue(DropshipLocation.SHIP); + + hiringHallButton.SetupElement(__instance, ___radioSet, "Hiring Hall", + LazySingletonBehavior.Instance.UILookAndColorConstants.DropshipRoomBarracksIcon, simulation); + } // Create the staff button Mod.Log.Info?.Write(" - Creating staff button"); @@ -248,8 +303,11 @@ static void Postfix(SGNavigationList __instance, HBSRadioSet ___radioSet, SGNavi staffButtonGO.SetActive(true); staffButtonGO.transform.position = ___argoButton.gameObject.transform.position; staffButtonGO.transform.SetParent(___argoButton.gameObject.transform.parent); - staffButtonGO.transform.localScale = Vector3.one; - staffButtonGO.transform.SetSiblingIndex(7); + staffButtonGO.transform.localScale = Vector3.one; + if (Mod.Config.Fixes.ShiftMenuElements) + staffButtonGO.transform.SetSiblingIndex(8); + else + staffButtonGO.transform.SetSiblingIndex(7); staffButton = staffButtonGO.GetComponent(); Traverse staffButtonT = Traverse.Create(staffButton).Field("id"); @@ -271,8 +329,11 @@ static void Postfix(SGNavigationList __instance, HBSRadioSet ___radioSet, SGNavi memorialButtonGO.SetActive(true); memorialButtonGO.transform.position = ___argoButton.gameObject.transform.position; memorialButtonGO.transform.SetParent(___argoButton.gameObject.transform.parent); - memorialButtonGO.transform.localScale = Vector3.one; - memorialButtonGO.transform.SetSiblingIndex(9); + memorialButtonGO.transform.localScale = Vector3.one; + if (Mod.Config.Fixes.ShiftMenuElements) + memorialButtonGO.transform.SetSiblingIndex(10); + else + memorialButtonGO.transform.SetSiblingIndex(9); memorialButton = memorialButtonGO.GetComponent(); Traverse memorialButtonT = Traverse.Create(memorialButton).Field("id"); diff --git a/mod.json b/mod.json index 49e0b72..0b2b861 100644 --- a/mod.json +++ b/mod.json @@ -1,160 +1,165 @@ -{ - "Name": "IRTweaks", - "Enabled": true, - "Hidden": true, - "Version": "0.9.2", - "Description": "Miscellaneous Tweaks and Fixes", - "Author": "IceRaptor", - "Website": "https://github.com/IceRaptor/IRTweaks", - "Contact": "", - "DLL": "IRTweaks.dll", - "DependsOn": [ "IRBTModUtils", "Custom Ammo Categories" ], - "Settings": { - "Debug": false, - "Trace": false, - "Fixes": { - "AlternateMechNamingStyle": false, - "BuildingDamageColorChange": false, - "BraceOnMeleeWithJuggernaut": true, - "BulkPurchasing": false, - "BulkScrapping": false, - "CombatLog": false, - "DisableCampaign": true, - "DisableCombatSaves": true, - "DisableCombatRestarts": true, - "DisableLowFundsNotification": true, - "DisableMPHashCalculation": true, - "ExtendedStats": false, - "FlexibleSensorLock": false, - "MaxArmorMaxesArmor": true, - "MechbayAdvancedStripping": true, - "MechbayLayout": true, - "MechbayLayoutDisableStore": true, - "MultiTargetStat": true, - "PainTolerance": true, - "PathfinderTeamFix": true, - "PreventHeadShots": false, - "RandomStartByDifficulty": true, - "ReduceSaveCompression": true, - "ScaleObjectiveBuildingStructure": true, - "ShowAllArgoUpgrades": true, - "SimGameDifficultyLabelsReplacer": false, - "SkirmishAlwaysUnlimited": true, - "SkirmishReset": false, - "SkipDeleteSavePopup": true, - "SpawnProtection": true, - "StreamlinedMainMenu": true, - "TurnDirectorStartFirstRoundFix" : true, - "UrbanExplosionsFix": false, - "WeakAgainstMeleeFix": true, - "WeaponTooltip": true - }, - "Abilities": { - "FlexibleSensorLockId": "AbilityDefT5A", - "JuggernautId": "AbilityDefGu8", - "MultiTargetId": "AbilityDefG5" - }, - "Combat": { - "CalledShot": { - "DisableAllLocations": true, - "DisableHeadshots": true, - "EnableTacticsModifier": true, - "BaseModifier": -1, - "PilotTags": {} - }, - "DamageModsBySkill": { - "StabilityMods": [ - { - "StatName": "GunneryStabBonus1", - "Probability": 0.15, - "Multiplier": 1.15 - } - ], - "HeatMods": [ - { - "StatName": "GunneryHeatBonus1", - "Probability": 0.15, - "Multiplier": 1.15 - } - ], - "APDmgMods": [], - "StdDmgMods": [ - { - "StatName": "GunnderyDmgBonus1", - "Probability": 0.15, - "Multiplier": 1.15 - } - ] - }, - "FlexibleSensorLock": { - "FreeActionWithAbility": false, - "FreeActionWithStat": false, - "FreeActionStatName": "IR_FreeSensorLock", - "AlsoAppliesToActiveProbe": false - }, - "ObstructionTweaks": { - "DRMechLocs": [ - "LeftLeg", - "RightLeg" - ], - "DRVehicleLocs": [ - "Front", - "Rear", - "Left", - "Right" - ], - "QuadTags": [ - "unit_quad" - ], - "ObstructionDRByTags": { - "unit_mech": 0.5, - "unit_vehicle": 0.5, - "unit_quad": 0.25 - } - }, - "PainTolerance": { - "ResistPerGuts": 15, - "HeadDamageResistPenaltyPerArmorPoint": 2, - "HeadHitArmorOnlyResistPenaltyMulti": 0.3, - "AmmoExplosionResistPenaltyPerCapacityPercentile": 1, - "OverheatResistPenaltyPerHeatPercentile": 1, - "KnockdownResistPenalty": 6, - "SideLocationDestroyedResistPenalty": 10 - }, - "ScaledStructure" : { - "DefaultScale" : { "Mod" : 0, "Multi" : 1.0 }, - "DifficultyScaling" : { - "1" : { "Mod" : 5, "Multi" : 1.0 }, - "2" : { "Mod" : 10, "Multi" : 1.25 }, - "3" : { "Mod" : 15, "Multi" : 1.5 }, - "4" : { "Mod" : 20, "Multi" : 2.0 }, - "5" : { "Mod" : 25, "Multi" : 2.5 }, - "6" : { "Mod" : 30, "Multi" : 3.0 }, - "7" : { "Mod" : 35, "Multi" : 3.5 }, - "8" : { "Mod" : 40, "Multi" : 4.0 }, - "9" : { "Mod" : 45, "Multi" : 4.5 }, - "10" : { "Mod" : 50, "Multi" : 5.0 }, - "11" : { "Mod" : 55, "Multi" : 5.5 }, - "12" : { "Mod" : 60, "Multi" : 6.0 } - } - }, - "SpawnProtection": { - "ApplyGuard": true, - "EvasionPips": 8, - "ApplyToEnemies": true, - "ApplyToAllies": true, - "ApplyToNeutrals": true, - "ApplyToReinforcements": true - }, - - "TurretArmorAndStructure": { - "StructureMultiplierTurret": 0, - "ArmorMultiplierTurret": 0 - } - }, - "Store": { - "QuantityOnShift": 5, - "QuantityOnControl": 20 - } - } +{ + "Name": "IRTweaks", + "Enabled": true, + "Hidden": true, + "Version": "0.9.2.2", + "Description": "Miscellaneous Tweaks and Fixes", + "Author": "IceRaptor", + "Website": "https://github.com/IceRaptor/IRTweaks", + "Contact": "", + "DLL": "IRTweaks.dll", + "DependsOn": [ + "IRBTModUtils", + "Custom Ammo Categories" + ], + "Settings": { + "Debug": true, + "Trace": true, + "Fixes": { + "AlternateMechNamingStyle": false, + "BuildingDamageColorChange": false, + "BraceOnMeleeWithJuggernaut": true, + "BulkPurchasing": false, + "BulkScrapping": false, + "CombatLog": false, + "CTDestructInjuryFix": true, + "DisableCampaign": true, + "DisableCombatSaves": true, + "DisableCombatRestarts": true, + "DisableLowFundsNotification": true, + "DisableMPHashCalculation": true, + "ExtendedStats": false, + "FlexibleSensorLock": false, + "MaxArmorMaxesArmor": true, + "MechbayLayout": true, + "MechbayLayoutDisableStore": true, + "MechbayAdvancedStripping": true, + "MultiTargetStat": true, + "PainTolerance": true, + "PathfinderTeamFix": true, + "PreventHeadShots": false, + "RandomStartByDifficulty": true, + "ReduceSaveCompression": true, + "ScaleObjectiveBuildingStructure": true, + "ShowAllArgoUpgrades": true, + "SimGameDifficultyLabelsReplacer": false, + "SkirmishAlwaysUnlimited": true, + "SkirmishReset": false, + "SkipDeleteSavePopup": true, + "SpawnProtection": true, + "StreamlinedMainMenu": true, + "ShiftMenuElements": true, + "TurnDirectorStartFirstRoundFix": false, + "UrbanExplosionsFix": false, + "WeakAgainstMeleeFix": true, + "WeaponTooltip": true + }, + "Abilities": { + "FlexibleSensorLockId": "AbilityDefT5A", + "JuggernautId": "AbilityDefGu8", + "MultiTargetId": "AbilityDefG5" + }, + "Combat": { + "CalledShot": { + "DisableAllLocations": true, + "DisableHeadshots": true, + "EnableTacticsModifier": true, + "BaseModifier": -1, + "PilotTags": {} + }, + "DamageModsBySkill": { + "StabilityMods": [ + { + "StatName": "GunneryStabBonus1", + "Probability": 0.15, + "Multiplier": 1.15 + } + ], + "HeatMods": [ + { + "StatName": "GunneryHeatBonus1", + "Probability": 0.15, + "Multiplier": 1.15 + } + ], + "APDmgMods": [], + "StdDmgMods": [ + { + "StatName": "GunnderyDmgBonus1", + "Probability": 0.15, + "Multiplier": 1.15 + } + ] + }, + "FlexibleSensorLock": { + "FreeActionWithAbility": false, + "FreeActionWithStat": false, + "FreeActionStatName": "IR_FreeSensorLock", + "AlsoAppliesToActiveProbe": false + }, + "PainTolerance": { + "ResistPerGuts": 15, + "HeadDamageResistPenaltyPerArmorPoint": 2, + "HeadHitArmorOnlyResistPenaltyMulti": 0.3, + "AmmoExplosionResistPenaltyPerCapacityPercentile": 1, + "OverheatResistPenaltyPerHeatPercentile": 1, + "KnockdownResistPenalty": 6, + "SideLocationDestroyedResistPenalty": 10, + "CTLocationDestroyedResistPenalty": 10 + }, + "ScaledStructure" : { + "DefaultScale" : { "Mod" : 0, "Multi" : 1.0 }, + "DifficultyScaling" : { + "1" : { "Mod" : 5, "Multi" : 1.0 }, + "2" : { "Mod" : 10, "Multi" : 1.25 }, + "3" : { "Mod" : 15, "Multi" : 1.5 }, + "4" : { "Mod" : 20, "Multi" : 2.0 }, + "5" : { "Mod" : 25, "Multi" : 2.5 }, + "6" : { "Mod" : 30, "Multi" : 3.0 }, + "7" : { "Mod" : 35, "Multi" : 3.5 }, + "8" : { "Mod" : 40, "Multi" : 4.0 }, + "9" : { "Mod" : 45, "Multi" : 4.5 }, + "10" : { "Mod" : 50, "Multi" : 5.0 }, + "11" : { "Mod" : 55, "Multi" : 5.5 }, + "12" : { "Mod" : 60, "Multi" : 6.0 } + } + }, + "SpawnProtection": { + "ApplyGuard": true, + "EvasionPips": 8, + "ApplyToEnemies": true, + "ApplyToAllies": true, + "ApplyToNeutrals": true, + "ApplyToReinforcements": true + }, + "ObstructionTweaks": { + "DRMechLocs": [ + "LeftLeg", + "RightLeg" + ], + "DRVehicleLocs": [ + "Front", + "Rear", + "Left", + "Right" + ], + "QuadTags": [ + "unit_quad" + ], + "ObstructionDRByTags": { + "unit_mech": 0.5, + "unit_vehicle": 0.5, + "unit_quad": 0.25 + } + }, + "TurretArmorAndStructure": { + "StructureMultiplierTurret": 0, + "ArmorMultiplierTurret": 0 + } + }, + "Store": { + "QuantityOnShift": 5, + "QuantityOnControl": 20 + } + } } \ No newline at end of file