Skip to content

Commit 95576cb

Browse files
authored
Merge branch 'editoronly' into main
2 parents a89063a + 74f236f commit 95576cb

File tree

3 files changed

+34
-105
lines changed

3 files changed

+34
-105
lines changed

KeepCoding.csproj

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@
3939
</PropertyGroup>
4040

4141
<ItemGroup>
42-
<Reference Include="Assembly-CSharp">
43-
<HintPath>D:\Steam\steamapps\common\Keep Talking and Nobody Explodes\ktane_Data\Managed\Assembly-CSharp.dll</HintPath>
44-
<Private>false</Private>
45-
<Aliases></Aliases>
46-
</Reference>
4742
<Reference Include="KMFramework">
4843
<HintPath>D:\ktanemodkit-master\Assets\Plugins\Managed\KMFramework.dll</HintPath>
4944
<Private>false</Private>
@@ -57,14 +52,6 @@
5752
<Reference Include="UnityEditor">
5853
<HintPath>..\..\..\..\..\Program Files\Editor\Data\Managed\UnityEditor.dll</HintPath>
5954
<Private>false</Private>
60-
</Reference>
61-
<Reference Include="TweaksAssembly">
62-
<HintPath>D:\Steam\steamapps\workshop\content\341800\1366808675\TweaksAssembly.dll</HintPath>
63-
<Private>false</Private>
64-
</Reference>
65-
<Reference Include="TwitchPlaysAssembly">
66-
<HintPath>D:\Steam\steamapps\workshop\content\341800\1711408527\TwitchPlaysAssembly.dll</HintPath>
67-
<Private>false</Private>
6855
</Reference>
6956
<Reference Include="UnityEngine">
7057
<HintPath>..\..\..\..\..\Program Files\Editor\Data\Managed\UnityEngine.dll</HintPath>

Source/MonoBehaviours/ModuleScript.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@ public void Solve(params string[] logs)
216216
if (IsSolved)
217217
return;
218218

219-
if (!IsEditor && _hasException)
220-
Game.AddStrikes(gameObject, -_strikes);
221-
222219
LogMultiple(logs);
223220

224221
IsSolved = true;
@@ -440,13 +437,7 @@ private void OnException(string condition, string stackTrace, LogType type)
440437

441438
private void TimerTick()
442439
{
443-
var timer = (TimerComponent)Game.Timer(gameObject);
444-
445-
timer.TimerTick += (elapsed, remaining) =>
446-
{
447-
TimeLeft = remaining;
448-
OnTimerTick();
449-
};
440+
var timer = Game.Timer(gameObject);
450441
}
451442

452443
private void TimerTickEditor(in KMBombInfo bombInfo)

Source/Statics/Game.cs

Lines changed: 33 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using UnityEngine;
4-
using static KeepCoding.ComponentPool;
5-
using static Localization;
6-
using Connection = IRCConnection;
7-
using KTInput = KTInputManager;
8-
using KTMod = ModManager;
9-
using KTPlayer = Assets.Scripts.Settings.PlayerSettingsManager;
10-
using KTScene = SceneManager;
11-
using KTModSourceEnum = Assets.Scripts.Mods.ModInfo.ModSourceEnum;
124

135
namespace KeepCoding
146
{
@@ -88,19 +80,19 @@ public static class IRCConnection
8880
/// Sends a message to the chat.
8981
/// </value>
9082
/// <remarks>Arguments: <c>message</c>.</remarks>
91-
public static Action<string> SendMessage => Connection.SendMessage;
83+
public static Action<string> SendMessage => message => Debug.Log($"Sending message to chat: {message}");
9284

9385
/// <value>
9486
/// Sends a message to the chat.
9587
/// </value>
9688
/// <remarks>Arguments: <c>message</c> and <c>args</c>.</remarks>
97-
public static Action<string, object[]> SendMessageFormat => Connection.SendMessageFormat;
98-
89+
public static Action<string, object[]> SendMessageFormat => (message, args) => Debug.Log($"Sending message to chat: {message.Form(args)}");
90+
9991
/// <value>
10092
/// Whispers a message to a person.
10193
/// </value>
10294
/// <remarks>Arguments: <c>userNickName</c>, <c>message</c>, and <c>args</c>.</remarks>
103-
public static Action<string, string, object[]> SendWhisper => Connection.SendWhisper;
95+
public static Action<string, string, object[]> SendWhisper => (userNickName, message, args) => Debug.Log($"Whispering message to user {userNickName}: {message.Form(args)}");
10496
}
10597

10698
/// <summary>
@@ -116,7 +108,7 @@ public static class KTInputManager
116108
/// <value>
117109
/// The current way the game is being controlled.
118110
/// </value>
119-
public static ControlType CurrentControlType => (ControlType)KTInput.Instance.CurrentControlType;
111+
public static ControlType CurrentControlType => ControlType.Mouse;
120112
}
121113

122114
/// <summary>
@@ -127,58 +119,27 @@ public static class Mission
127119
/// <value>
128120
/// Determines whether or not all pacing events are enabled.
129121
/// </value>
130-
public static bool IsPacingEvents => KTScene.Instance.GameplayState.Mission.PacingEventsEnabled;
122+
public static bool IsPacingEvents => false;
131123

132124
/// <value>
133125
/// The description as it appears in the bomb binder.
134126
/// </value>
135-
public static string Description => GetLocalizedString(KTScene.Instance.GameplayState.Mission.DescriptionTerm);
127+
public static string Description => "Everybody has to start somewhere. Let's just hope it doesn't end here too.\n\nMake sure your experts have the manual and are ready to help.";
136128

137129
/// <value>
138130
/// The mission name as it appears in the bomb binder.
139131
/// </value>
140-
public static string DisplayName => GetLocalizedString(KTScene.Instance.GameplayState.Mission.DisplayNameTerm);
132+
public static string DisplayName => "The First Bomb";
141133

142134
/// <value>
143135
/// The ID of the mission.
144136
/// </value>
145-
public static string ID => KTScene.Instance.GameplayState.Mission.ID;
137+
public static string ID => "firsttime";
146138

147139
/// <value>
148140
/// Gets the generator setting of the mission.
149141
/// </value>
150-
public static GeneratorSetting GeneratorSetting
151-
{
152-
get
153-
{
154-
var setting = KTScene.Instance.GameplayState.Mission.GeneratorSetting;
155-
156-
var list = new List<ComponentPool>();
157-
158-
foreach (var pool in setting.ComponentPools)
159-
{
160-
var types = new List<ComponentTypeEnum>();
161-
162-
foreach (var type in pool.ComponentTypes)
163-
types.Add((ComponentTypeEnum)type);
164-
165-
list.Add(new ComponentPool(
166-
pool.Count,
167-
(ComponentSource)pool.AllowedSources,
168-
(SpecialComponentTypeEnum)pool.SpecialComponentType,
169-
pool.ModTypes,
170-
types));
171-
}
172-
173-
return new GeneratorSetting(
174-
setting.FrontFaceOnly,
175-
setting.OptionalWidgetCount,
176-
setting.NumStrikes,
177-
setting.TimeBeforeNeedyActivation,
178-
setting.TimeLimit,
179-
list);
180-
}
181-
}
142+
public static GeneratorSetting GeneratorSetting => new GeneratorSetting();
182143
}
183144

184145
/// <summary>
@@ -189,17 +150,17 @@ public static class ModManager
189150
/// <value>
190151
/// Gets all of the disabled mod paths.
191152
/// </value>
192-
public static Func<List<string>> GetDisabledModPaths => KTMod.Instance.GetDisabledModPaths;
153+
public static Func<List<string>> GetDisabledModPaths => () => new List<string>();
193154

194155
/// <value>
195156
/// Gets all of the mod paths within the <see cref="ModSourceEnum"/> constraint.
196157
/// </value>
197-
public static Func<ModSourceEnum, List<string>> GetAllModPathsFromSource => source => KTMod.Instance.GetAllModPathsFromSource((KTModSourceEnum)source);
158+
public static Func<ModSourceEnum, List<string>> GetAllModPathsFromSource => source => new List<string>();
198159

199160
/// <value>
200161
/// Gets all of the enabled mod paths within the <see cref="ModSourceEnum"/> constraint.
201162
/// </value>
202-
public static Func<ModSourceEnum, List<string>> GetEnabledModPaths => source => KTMod.Instance.GetEnabledModPaths((KTModSourceEnum)source);
163+
public static Func<ModSourceEnum, List<string>> GetEnabledModPaths => source => new List<string>();
203164
}
204165

205166
/// <summary>
@@ -210,118 +171,108 @@ public static class PlayerSettings
210171
/// <value>
211172
/// Determines if vertical tilting is flipped or not.
212173
/// </value>
213-
public static bool InvertTiltControls => KTPlayer.Instance.PlayerSettings.InvertTiltControls;
174+
public static bool InvertTiltControls => false;
214175

215176
/// <value>
216177
/// Determines if the option to lock the mouse to the window is enabled.
217178
/// </value>
218-
public static bool LockMouseToWindow => KTPlayer.Instance.PlayerSettings.LockMouseToWindow;
179+
public static bool LockMouseToWindow => false;
219180

220181
/// <value>
221182
/// Determines if the option to show the leaderboards from the pamphlet.
222183
/// </value>
223-
public static bool ShowLeaderBoards => KTPlayer.Instance.PlayerSettings.ShowLeaderBoards;
184+
public static bool ShowLeaderBoards => true;
224185

225186
/// <value>
226187
/// Determines if the option to show the rotation of the User Interface is enabled.
227188
/// </value>
228-
public static bool ShowRotationUI => KTPlayer.Instance.PlayerSettings.ShowRotationUI;
189+
public static bool ShowRotationUI => true;
229190

230191
/// <value>
231192
/// Determines if the option to show scanlines is enabled.
232193
/// </value>
233-
public static bool ShowScanline => KTPlayer.Instance.PlayerSettings.ShowScanline;
194+
public static bool ShowScanline => true;
234195

235196
/// <value>
236197
/// Determines if the option to skip the title screen is enabled.
237198
/// </value>
238-
public static bool SkipTitleScreen => KTPlayer.Instance.PlayerSettings.SkipTitleScreen;
199+
public static bool SkipTitleScreen => false;
239200

240201
/// <value>
241202
/// Determines if the VR or regular controllers vibrate.
242203
/// </value>
243-
public static bool RumbleEnabled => KTPlayer.Instance.PlayerSettings.RumbleEnabled;
204+
public static bool RumbleEnabled => false;
244205

245206
/// <value>
246207
/// Determines if the touchpad controls are inverted.
247208
/// </value>
248-
public static bool TouchpadInvert => KTPlayer.Instance.PlayerSettings.TouchpadInvert;
209+
public static bool TouchpadInvert => false;
249210

250211
/// <value>
251212
/// Determines if the option to always use mods is enabled.
252213
/// </value>
253-
public static bool UseModsAlways => KTPlayer.Instance.PlayerSettings.UseModsAlways;
214+
public static bool UseModsAlways => false;
254215

255216
/// <value>
256217
/// Determines if the option to use parallel/simultaneous mod loading is enabled.
257218
/// </value>
258-
public static bool UseParallelModLoading => KTPlayer.Instance.PlayerSettings.UseParallelModLoading;
219+
public static bool UseParallelModLoading => false;
259220

260221
/// <value>
261222
/// Determines if VR mode is requested.
262223
/// </value>
263-
public static bool VRModeRequested => KTPlayer.Instance.PlayerSettings.VRModeRequested;
224+
public static bool VRModeRequested => true;
264225

265226
/// <value>
266227
/// The intensity of anti-aliasing currently on the game. Ranges 0 to 8.
267228
/// </value>
268-
public static int AntiAliasing => KTPlayer.Instance.PlayerSettings.AntiAliasing;
229+
public static int AntiAliasing => 8;
269230

270231
/// <value>
271232
/// The current music volume from the dossier menu. Ranges 0 to 100.
272233
/// </value>
273-
public static int MusicVolume => KTPlayer.Instance.PlayerSettings.MusicVolume;
234+
public static int MusicVolume => 100;
274235

275236
/// <value>
276237
/// The current sound effects volume from the dosssier menu. Ranges 0 to 100.
277238
/// </value>
278-
public static int SFXVolume => KTPlayer.Instance.PlayerSettings.SFXVolume;
239+
public static int SFXVolume => 100;
279240

280241
/// <value>
281242
/// Determines if VSync is on or off.
282243
/// </value>
283-
public static int VSync => KTPlayer.Instance.PlayerSettings.VSync;
244+
public static int VSync => 1;
284245

285246
/// <value>
286247
/// The current language code.
287248
/// </value>
288-
public static string LanguageCode => KTPlayer.Instance.PlayerSettings.LanguageCode;
249+
public static string LanguageCode => "en";
289250
}
290251

291252
/// <value>
292253
/// Adds an amount of strikes on the bomb.
293254
/// </value>
294-
public static Action<GameObject, int> AddStrikes => (gameObject, amount) =>
295-
{
296-
Logger.Self($"Adding the bomb's strike count with {amount}.");
297-
var bomb = (Bomb)Bomb(gameObject);
298-
bomb.StrikeIndicator.StrikeCount = bomb.NumStrikes += amount;
299-
};
255+
public static Action<GameObject, int> AddStrikes => (gameObject, amount) => Logger.Self($"Adding the bomb's strike count with {amount}.");
300256

301257
/// <value>
302258
/// Sets an amount of strikes on the bomb.
303259
/// </value>
304-
public static Action<GameObject, int> SetStrikes => (gameObject, amount) =>
305-
{
306-
Logger.Self($"Setting the bomb's strike count to {amount}.");
307-
var bomb = (Bomb)Bomb(gameObject);
308-
bomb.StrikeIndicator.StrikeCount = bomb.NumStrikes = amount;
309-
};
260+
public static Action<GameObject, int> SetStrikes => (gameObject, amount) => Logger.Self($"Setting the bomb's strike count to {amount}.");
310261

311262
/// <value>
312263
/// Gets the game's internal bomb component, not to be mistaken with <see cref="KMBomb"/>.
313264
/// </value>
314265
/// <remarks>
315266
/// 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.
316267
/// </remarks>
317-
public static Func<GameObject, object> Bomb => gameObject => gameObject.GetComponentInParent(typeof(Bomb));
268+
public static Func<GameObject, object> Bomb => gameObject => null;
318269

319270
/// <value>
320271
/// Gets the game's internal timer component.
321272
/// </value>
322273
/// <remarks>
323274
/// To prevent a reference to the game, the type is boxed in <see cref="object"/>. You can cast it to TimerComponent or <see cref="MonoBehaviour"/> type to restore its functionality.
324275
/// </remarks>
325-
public static Func<GameObject, object> Timer => gameObject => ((Bomb)Bomb(gameObject)).GetTimer();
276+
public static Func<GameObject, object> Timer => gameObject => null;
326277
}
327278
}

0 commit comments

Comments
 (0)