Skip to content

Commit

Permalink
v2.0.5
Browse files Browse the repository at this point in the history
bugfix:  Cutscene is wrongly auto-watched
  • Loading branch information
LozenChen committed Sep 11, 2024
1 parent 1c6156a commit 72b9951
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 10 deletions.
Binary file removed Libs/CelesteTAS-EverestInterop.dll
Binary file not shown.
Binary file removed Libs/StudioCommunication.dll
Binary file not shown.
2 changes: 2 additions & 0 deletions Source/Gameplay/AutoWatchEntity/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ internal static class Config {

public static Mode TheoCrystal => TasHelperSettings.AutoWatch_TheoCrystal;

public static Mode Trigger = Mode.Never;

public static Mode ZipMover => TasHelperSettings.AutoWatch_ZipMover;

}
Expand Down
2 changes: 1 addition & 1 deletion Source/Gameplay/AutoWatchEntity/CoreLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static void OnConfigChange() {
if (Engine.Scene is not Level level) {
return;
}
if (TasHelperSettings.AutoWatchEnable) {
if (Config.MainEnabled) {
AddRenderersToLevel(level);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion Source/Gameplay/AutoWatchEntity/CutsceneEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private static void Unload() {
private static void CutsceneEntity_Added(On.Celeste.CutsceneEntity.orig_Added orig, CutsceneEntity self, Scene scene) {
// CS are usually not present when loading level, e.g. CS06_Campfire
orig(self, scene);
if (scene is Level level && self.Components.FirstOrDefault(c => c is AutoWatchRenderer) is null) {
if (scene is Level level && Config.MainEnabled && factory?.Mode() == RenderMode.Always && self.Components.FirstOrDefault(c => c is AutoWatchRenderer) is null) {
factory.AddComponent(self);
}
}
Expand Down
46 changes: 46 additions & 0 deletions Source/Gameplay/AutoWatchEntity/Trigger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

using Monocle;

namespace Celeste.Mod.TASHelper.Gameplay.AutoWatchEntity;


internal class TriggerRenderer : AutoWatchTextRenderer {

public Trigger trigger;

public bool orig_Visible;
public TriggerRenderer(RenderMode mode) : base(mode, active: true) { }

public override void Added(Entity entity) {
base.Added(entity);
trigger = entity as Trigger;

text.Position = trigger.Center;
text.content = trigger.GetType().Name;
orig_Visible = Visible;
}

public override void UpdateImpl() {
Visible = orig_Visible && !SimplifiedTrigger.IsUnimportantTrigger(trigger);
}

public override void ClearHistoryData() {
orig_Visible = Visible;
}
}

internal class TriggerFactory : IRendererFactory {
public Type GetTargetType() => typeof(Trigger);


public bool Inherited() => true;
public RenderMode Mode() => Config.Trigger;
public void AddComponent(Entity entity) {
entity.Add(new TriggerRenderer(Mode()).SleepWhenUltraFastforward());
}
}





2 changes: 0 additions & 2 deletions Source/Gameplay/Spinner/SpinnerCalculateHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,7 @@ public static void Initialize() {

// will update this according to https://maddie480.ovh/celeste/custom-entity-catalog

// [Done] IsaGrabBag.DreamSpinner: used in UltraDifficult. have no cycle. static. affected by in view. need to clear sprites and simplify
// [Meaningless] FrostHelper.ArbitraryShapeLightning: have no cycle. its hitbox is ... interesting
// [Done] BrokemiaHelper.CassetteSpinner: brokemia defines a CassetteEntity interface, which is basically same as CassetteBlock? and CassetteSpinner is a crys spinner with CassetteEntity interface, its update is also affected. only need to clear sprites and simplify
// [BANNED] ScuffedHelper.RandomSpinner: same as crys spinner, but will remove self randomly on load level.
// [Irrelavent] LunaticHelper.CustomDust: it's a backdrop, not a dust spinner.
}
Expand Down
11 changes: 11 additions & 0 deletions Source/Maintenance/MaintenanceRoutine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#if Maintenance
using Celeste.Mod.TASHelper.Utils;
using Monocle;

namespace Celeste.Mod.TASHelper.Maintenance;
internal static class MaintenaceRoutine {
Expand All @@ -22,6 +23,16 @@ private static void CheckSimplifiedTriggers() {

private static void CheckTasSync() {
// run tases of the most popular maps
}

private static void CheckSpinners() {
// check if there are new custom spinners
Type spinner = typeof(CrystalStaticSpinner);
foreach (KeyValuePair<Type, List<Type>> pair in Tracker.TrackedEntityTypes) {
if (pair.Value.Contains(spinner)) {
Logger.Log("TAS Helper", pair.Key.FullName);
}
}
}
}
#endif
3 changes: 2 additions & 1 deletion Source/Module/WhatsNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public static void CreateUpdateLog() {
AddLog("2.0.1", "Bugfix: Game crashes when there is simplified spinner / lightning. (thanks @trans_alexa)");
AddLog("2.0.2", "Feature: AutoWatchEntity put into use. (the name comes from @XMinty77)", "Optimization: Now you can enter OptionSubMenu by just pressing down.");
AddLog("2.0.3", "Bugfix: resolve incompatibility with SpeedrunTool", "Addition: Add more options to AutoWatch.");
AddLog("2.0.4", "Bugfix: If Cassette tempo = 0 and there's freeze frame, then game gets stuck (Thanks @trans_alexa)");
AddLog("2.0.4", "Bugfix: If Cassette tempo = 0 and there's freeze frame, then game gets stuck (thanks @trans_alexa)");
AddLog("2.0.5", "Bugfix: Cutscene is auto-watched even if Auto Watch is not enabled. (thanks @socksygen");
UpdateLogs.Sort((x, y) => new Version(y.Item1).CompareTo(new Version(x.Item1)));
}

Expand Down
8 changes: 4 additions & 4 deletions TASHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
<HintPath>..\..\Celeste.dll</HintPath>
</Reference>
<Reference Include="CelesteTAS-EverestInterop">
<HintPath>Libs\CelesteTAS-EverestInterop.dll</HintPath>
<HintPath>Libs\bin\CelesteTAS-EverestInterop.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="StudioCommunication">
<HintPath>Libs\bin\StudioCommunication.dll</HintPath>
</Reference>
<Reference Include="DeepCloner">
<HintPath>Libs\DeepCloner.dll</HintPath>
<Private>False</Private>
Expand All @@ -60,9 +63,6 @@
<Reference Include="SpeedrunTool">
<HintPath>Libs\SpeedrunTool.dll</HintPath>
</Reference>
<Reference Include="StudioCommunication">
<HintPath>Libs\StudioCommunication.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="YamlDotNet">
<HintPath>Libs\YamlDotNet.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion everest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- Name: TASHelper
Version: 2.0.4
Version: 2.0.5
DLL: bin/Release/net7.0/TASHelper.dll
Dependencies:
- Name: EverestCore
Expand Down

0 comments on commit 72b9951

Please sign in to comment.