-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
81 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using BattleTech; | ||
using BattleTech.Data; | ||
|
||
namespace CustomComponents | ||
{ | ||
class BTLoadUtils | ||
{ | ||
internal static void PreloadComponents(DataManager manager) | ||
{ | ||
var loadRequest = manager.CreateLoadRequest(); | ||
loadRequest.AddAllOfTypeLoadRequest<HeatSinkDef>(BattleTechResourceType.HeatSinkDef, null); | ||
loadRequest.AddAllOfTypeLoadRequest<UpgradeDef>(BattleTechResourceType.UpgradeDef, null); | ||
loadRequest.AddAllOfTypeLoadRequest<WeaponDef>(BattleTechResourceType.WeaponDef, null); | ||
loadRequest.AddAllOfTypeLoadRequest<AmmunitionBoxDef>(BattleTechResourceType.AmmunitionBoxDef, null); | ||
loadRequest.ProcessRequests(); | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
source/Fixes/SkirmishMechBayPanel_RequestResources_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using BattleTech.UI; | ||
using Harmony; | ||
|
||
namespace CustomComponents | ||
{ | ||
[HarmonyPatch(typeof(SkirmishMechBayPanel), "RequestResources")] | ||
public static class SkirmishMechBayPanel_RequestResources_Patch | ||
{ | ||
public static void Prefix(SkirmishMechBayPanel __instance) | ||
{ | ||
try | ||
{ | ||
BTLoadUtils.PreloadComponents(__instance.dataManager); | ||
} | ||
catch (Exception e) | ||
{ | ||
Control.Logger.LogError(e); | ||
} | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
source/Fixes/SkirmishSettings_Beta_LoadLanceConfiguratorData_Patch.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using BattleTech.UI; | ||
using Harmony; | ||
|
||
namespace CustomComponents | ||
{ | ||
[HarmonyPatch(typeof(SkirmishSettings_Beta), "LoadLanceConfiguratorData")] | ||
public static class SkirmishSettings_Beta_LoadLanceConfiguratorData_Patch | ||
{ | ||
public static void Prefix(SkirmishSettings_Beta __instance, UIManager ___uiManager) | ||
{ | ||
try | ||
{ | ||
BTLoadUtils.PreloadComponents(___uiManager.dataManager); | ||
} | ||
catch (Exception e) | ||
{ | ||
Control.Logger.LogError(e); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters