Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,37 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] - 2026-10-02
## [1.1.1-dev-alpha] - 2026-10-02

### Added

* `SceneLoadWaiter.GetPlayer()` — extracted helper that resolves the player `GameObject` from `Deadshot.GameManager`.
* `SceneLoadWaiter.DisableAllCameras()` — extracted helper that disables all cameras except the player's `Head/MainCamera`.
* `SceneLoadWaiter.DisableMenuAndSceneRenderers()` — extracted helper that hides `MainMenu` canvases and `C1L2` scene renderers, excluding the player.
* `SceneLoadWaiter.GetCustomScene()` — extracted helper that scans loaded scenes by name and returns the matching `Scene`.
* `SceneLoadWaiter.FindCustomPlayerSpawn(Scene)` — updated to accept the already-resolved `Scene` instead of re-scanning for it.
* Added null guards and restored deep recursive traversal in `FindChildRecursive` to support nested hierarchy spawn points.
* Player `CharacterController` is now restored in a `finally` block, ensuring it is re-enabled even if player placement throws.
* `SceneManager.BaseGameplaySceneName` constant to avoid hardcoded scene name strings.
* `AsyncOperation` tracking for asynchronous scene unloads to prevent reload race conditions.

### Changed

* `SceneLoadWaiter.InitializePlayer()` refactored to delegate player, camera, and renderer setup to dedicated helper methods.
* Corrected the renderer-filtering scene name from `C1L1` to `C1L2`.
* `SceneManager.LoadScene()` cleans up existing waiters and passes any pending unload operation to the new waiter.
* `SceneLoadWaiter` destroys its `GameObject` upon placement completion or spawn search timeout.
* `EventManager.Update()` converted from a static method to an instance lifecycle method on `MonoBehaviour`.

### Fixed

* Resolved persistent `SceneLoadWaiter` memory leak and CPU overhead after scene load.
* Fixed broken child traversal in `FindChildRecursive` failing on nested spawn points.
* Fixed race condition where reloading an already loaded scene attempted placement before unloader completed.
* Fixed `EventManager.Update()` not being invoked by Unity's engine loop.
* Removed stray blank lines from `EventManager.LevelPlaytimeEvent()`.

## [1.1.0-dev-alpha] - 2026-10-02

### Added
- `SceneLoadWaiter` MonoBehaviour for additive custom-scene loading while preserving the existing gameplay scene and player.
Expand Down
11 changes: 2 additions & 9 deletions Events/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,17 @@ namespace DeadshotModAPI;

public class EventManager : MonoBehaviour
{
public static void Update()
internal void Update()
{
LevelEvent.Update();
LevelEvent.LevelPlaytimeEvent();
}

public static class LevelEvent
{
private static float _lastLevelTime;

public static event Action<float> LevelTimeChanged;

public static event Action<LevelCompleteScreen> LevelCompleted;

internal static void Update()
{
LevelPlaytimeEvent();
}

internal static void LevelPlaytimeEvent()
{
try
Expand Down
3 changes: 1 addition & 2 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace DeadshotModAPI;

[BepInPlugin("com.subaka.deadshotmodapi", "Deadshot Mod API", "v1.0.0-dev-alpha")]
[BepInPlugin("com.subaka.deadshotmodapi", "Deadshot Mod API", "v1.1.1-dev-alpha")]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The plugin metadata no longer matches the repository’s contract tests, which require Deadshot Mod Api and version 0.0.1; the metadata test now fails.

Assessment: 🟠 Major · 🔁 Occurrence: Often · 🏷️ Api mismatch

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** Plugin.cs
**Line:** 7:7
**Comment:**
	*Api Mismatch: The plugin metadata no longer matches the repository’s contract tests, which require `Deadshot Mod Api` and version `0.0.1`; the metadata test now fails.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

public class Plugin : BasePlugin
{

Expand All @@ -15,6 +15,5 @@ public override void Load()
harmony.PatchAll();
AddComponent<ModLoader>();
AddComponent<EventManager>();
AddComponent<SceneLoadWaiter>();
}
}
Loading