|
2 | 2 | using System.Collections.Generic;
|
3 | 3 | using UnityEngine;
|
4 | 4 | using static KeepCoding.ComponentPool;
|
| 5 | +using static Localization; |
5 | 6 | using Connection = IRCConnection;
|
6 |
| -using KTInfo = Assets.Scripts.Mods.ModInfo; |
7 | 7 | using KTInput = KTInputManager;
|
8 | 8 | using KTMod = ModManager;
|
9 | 9 | using KTPlayer = Assets.Scripts.Settings.PlayerSettingsManager;
|
10 | 10 | using KTScene = SceneManager;
|
| 11 | +using KTModSourceEnum = Assets.Scripts.Mods.ModInfo.ModSourceEnum; |
11 | 12 |
|
12 | 13 | namespace KeepCoding
|
13 | 14 | {
|
@@ -131,12 +132,12 @@ public static class Mission
|
131 | 132 | /// <value>
|
132 | 133 | /// The description as it appears in the bomb binder.
|
133 | 134 | /// </value>
|
134 |
| - public static string Description => Localization.GetLocalizedString(KTScene.Instance.GameplayState.Mission.DescriptionTerm); |
| 135 | + public static string Description => GetLocalizedString(KTScene.Instance.GameplayState.Mission.DescriptionTerm); |
135 | 136 |
|
136 | 137 | /// <value>
|
137 | 138 | /// The mission name as it appears in the bomb binder.
|
138 | 139 | /// </value>
|
139 |
| - public static string DisplayName => Localization.GetLocalizedString(KTScene.Instance.GameplayState.Mission.DisplayNameTerm); |
| 140 | + public static string DisplayName => GetLocalizedString(KTScene.Instance.GameplayState.Mission.DisplayNameTerm); |
140 | 141 |
|
141 | 142 | /// <value>
|
142 | 143 | /// The ID of the mission.
|
@@ -193,12 +194,12 @@ public static class ModManager
|
193 | 194 | /// <value>
|
194 | 195 | /// Gets all of the mod paths within the <see cref="ModSourceEnum"/> constraint.
|
195 | 196 | /// </value>
|
196 |
| - public static Func<ModSourceEnum, List<string>> GetAllModPathsFromSource => source => KTMod.Instance.GetAllModPathsFromSource((KTInfo.ModSourceEnum)source); |
| 197 | + public static Func<ModSourceEnum, List<string>> GetAllModPathsFromSource => source => KTMod.Instance.GetAllModPathsFromSource((KTModSourceEnum)source); |
197 | 198 |
|
198 | 199 | /// <value>
|
199 | 200 | /// Gets all of the enabled mod paths within the <see cref="ModSourceEnum"/> constraint.
|
200 | 201 | /// </value>
|
201 |
| - public static Func<ModSourceEnum, List<string>> GetEnabledModPaths => source => KTMod.Instance.GetEnabledModPaths((KTInfo.ModSourceEnum)source); |
| 202 | + public static Func<ModSourceEnum, List<string>> GetEnabledModPaths => source => KTMod.Instance.GetEnabledModPaths((KTModSourceEnum)source); |
202 | 203 | }
|
203 | 204 |
|
204 | 205 | /// <summary>
|
@@ -288,19 +289,11 @@ public static class PlayerSettings
|
288 | 289 | }
|
289 | 290 |
|
290 | 291 | /// <value>
|
291 |
| - /// Gets the bomb by recursively looking at parent objects until it is found. |
| 292 | + /// Gets the game's internal bomb component, not to be mistaken with <see cref="KMBomb"/>. |
292 | 293 | /// </value>
|
293 | 294 | /// <remarks>
|
294 | 295 | /// To prevent a reference to the game, the type is boxed in <see cref="object"/>. You can cast it to Bomb or <see cref="MonoBehaviour"/> type to restore its functionality.
|
295 | 296 | /// </remarks>
|
296 |
| - public static Func<GameObject, object> Bomb => gameObject => |
297 |
| - { |
298 |
| - if (gameObject.transform.parent is null) |
299 |
| - return null; |
300 |
| - |
301 |
| - var bomb = gameObject.GetComponentInParent(typeof(Bomb)); |
302 |
| - |
303 |
| - return bomb ?? Bomb(gameObject.transform.parent.gameObject); |
304 |
| - }; |
| 297 | + public static Func<GameObject, object> Bomb => gameObject => gameObject.GetComponentInParent(typeof(Bomb)); |
305 | 298 | }
|
306 | 299 | }
|
0 commit comments