Fix some compiler warnings and add update docs #89

Merged
ManlyMarco merged 2 commits from fix-warns into master 2025-09-17 11:28:33 +00:00
ManlyMarco commented 2025-09-17 11:21:13 +00:00 (Migrated from github.com)
No description provided.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-09-17 11:22:08 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR focuses on fixing compiler warnings and adding missing documentation throughout the KKAPI codebase. The changes primarily address namespace inconsistencies, obsolete API usage warnings, and missing XML documentation comments for public APIs.

  • Standardize namespace configuration across all project files to use KKAPI as the root namespace
  • Replace deprecated GameObject.FindObjectOfType calls with UnityEngine.Object.FindObjectOfType
  • Add comprehensive XML documentation to utility classes and their members

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Multiple .projitems files Updated Import_RootNamespace from various names to "KKAPI" for consistency
Tablet.cs Added XML documentation for structs and removed unused constructor
TabletManager.cs Added XML documentation for delegate
SmartRect.cs Added comprehensive XML documentation for all public members and removed unused import
Multiple maker files Added pragma directives to suppress obsolete member warnings
Multiple API files Replaced deprecated GameObject.FindObjectOfType with UnityEngine.Object.FindObjectOfType
GameApi.cs files Added XML documentation for event args classes
Documentation files Updated generated documentation to reflect new XML comments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

## Pull Request Overview This PR focuses on fixing compiler warnings and adding missing documentation throughout the KKAPI codebase. The changes primarily address namespace inconsistencies, obsolete API usage warnings, and missing XML documentation comments for public APIs. - Standardize namespace configuration across all project files to use `KKAPI` as the root namespace - Replace deprecated `GameObject.FindObjectOfType` calls with `UnityEngine.Object.FindObjectOfType` - Add comprehensive XML documentation to utility classes and their members ### Reviewed Changes Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | Multiple .projitems files | Updated Import_RootNamespace from various names to "KKAPI" for consistency | | Tablet.cs | Added XML documentation for structs and removed unused constructor | | TabletManager.cs | Added XML documentation for delegate | | SmartRect.cs | Added comprehensive XML documentation for all public members and removed unused import | | Multiple maker files | Added pragma directives to suppress obsolete member warnings | | Multiple API files | Replaced deprecated GameObject.FindObjectOfType with UnityEngine.Object.FindObjectOfType | | GameApi.cs files | Added XML documentation for event args classes | | Documentation files | Updated generated documentation to reflect new XML comments | </details> --- <sub>**Tip:** Customize your code reviews with copilot-instructions.md. <a href="/IllusionMods/IllusionModdingAPI/new/master/.github?filename=copilot-instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Create the file</a> or <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">learn how to get started</a>.</sub>
@ -166,3 +166,3 @@
/// <inheritdoc cref="AddActionIcon(int,Vector3,Sprite,Sprite,Action,Action{TriggerEnterExitEvent},bool,bool)"/>
[Obsolete]
[Obsolete("Use another overload", true)]
public static void AddActionIcon(int mapNo, Vector3 position, Sprite iconOn, Sprite iconOff, Action onOpen, Action<TriggerEnterExitEvent> onCreated)
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-09-17 11:22:08 +00:00

Adding true as the second parameter makes this a compile-time error instead of just a warning. This is a breaking change that could prevent existing code from compiling. Consider using false if backwards compatibility is needed.

        [Obsolete("Use another overload", false)]
Adding `true` as the second parameter makes this a compile-time error instead of just a warning. This is a breaking change that could prevent existing code from compiling. Consider using `false` if backwards compatibility is needed. ```suggestion [Obsolete("Use another overload", false)] ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-09-17 11:22:07 +00:00

The cast to (int) was removed but the variable res is still declared as int type. Either change the variable type to match Hooks._modeSex type or restore the cast.

            var res = (int)Hooks._modeSex;
The cast to `(int)` was removed but the variable `res` is still declared as `int` type. Either change the variable type to match `Hooks._modeSex` type or restore the cast. ```suggestion var res = (int)Hooks._modeSex; ```
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-09-17 11:22:07 +00:00

This change introduces a potential null reference exception. The original GameObject.FindObjectOfType would return null if no object is found, but UnityEngine.Object.FindObjectOfType behavior may differ. Consider adding a null check before accessing the checkWindow property.

            {
                var ccsm = UnityEngine.Object.FindObjectOfType<CustomChangeSystemMenu>();
                if (ccsm != null && ccsm.checkWindow != null)
                    ccwGo = ccsm.checkWindow.gameObject;
            }
This change introduces a potential null reference exception. The original `GameObject.FindObjectOfType` would return null if no object is found, but `UnityEngine.Object.FindObjectOfType` behavior may differ. Consider adding a null check before accessing the checkWindow property. ```suggestion { var ccsm = UnityEngine.Object.FindObjectOfType<CustomChangeSystemMenu>(); if (ccsm != null && ccsm.checkWindow != null) ccwGo = ccsm.checkWindow.gameObject; } ```
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IllusionMods/IllusionModdingAPI!89
No description provided.