Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug Menus #13810

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

Debug Menus #13810

wants to merge 15 commits into from

Conversation

Jade-Harleyy
Copy link

@Jade-Harleyy Jade-Harleyy commented Apr 23, 2024

Adds entity lists and inspectors for easier debugging and mod-making.
In addition to what's layed out below, I also plan to add more features such as an item spawner window and individual toggles for certain debug overlays.

Console Commands

  • debugmenu: Opens an entity explorer window.
    • close|closeall: Closes all open windows, and disables the inspector.
    • entities|entityexplorer: Opens an entity explorer window.
    • gui|guiexplorer|guiheirarchy: Opens a GUI explorer window.
    • spawnitems|spawnitem|itemspawner: Opens the entity spawner window.
    • inspect: Enables the entity inspector.
      • entities: Enables the entity inspector.
      • gui: Enables the GUI inspector.

Windows

All windows can be dragged, and closed with either their respective Close button, or with the close|closeall commands.

Entity Explorers

A list of every loaded entity if opened with the console, or a list of entities under the cursor if opened with the entity inspector.

On the left of an entry is its name (if available), its class, and its location. On the right is its ID, and a button to destroy the entity.
Entries can be clicked to open an entity editor window.

Entity Editors

A list of serializable entity editors; same as what would be seen in the submarine and character editors.

GUI Explorers

A heirarchy of GUI elements, with parents above the focused element, and children below.
Opening one of these windows from the console focuses Screen.Selected.Frame, while opening one from the GUI inspector focuses GUI.MouseOn.

On the left of an entry is its class, and its style. On the right is its update order, a visibility toggle, and a button to orphan the element. Elements whose parents are the GUI canvas cannot be orphaned.
Hovering over an entry will outline its rect, holding Ctrl will outline each element in its parent heirarchy, and holding Alt will fill in the outlines at half opacity.
Clicking on an entry will open a new GUI Explorer window focused on that element.

Entity Spawner

A categorized list of entities, same as in the Submarine Editor but with only items.

The quality of selected items can be changed with the buttons at the bottom of the window.
Left-clicking an entity in the list will add one to the cursor, while right-clicking will remove one.
Selecting/deselecting items is split based on the selected quality. For example, if "Good" is selected, only "Good" quality items will be added/removed.

When the cursor is off of the window, left clicking in the world will spawn the entities at that location, while clicking on the controlled character's inventory slots will spawn them in the character's inventory.
Holding shift while clicking will preserve the entities in the cursor, allowing them to be spawned multiple times without having to be reselected.

Similar to the inspector modes, clicking the right mouse button or pressing escape outside the window will clear the selected items.
All inspectors override this mode.

Inspector Modes

Regardless of its current mode, clicking the right mouse button or pressing escape will disable the inspector.

Entities

Displays the cursor's current position in the world, and a list of entities under the cursor.
Each entry on the list displays the entity's name (if applicable), and its class.

Clicking the left mouse button will create an Entity Explorer window with a list of each entity under the cursor, as well as any items contained in selected items' or characters' inventories (if applicable).

GUI

Displays the cursor's current position on the screen, and the selected GUI element's class and style.

Hovering over an element will outline its rect, holding Ctrl will outline each element in its parent heirarchy, and holding Alt will fill in the outlines at half opacity.

Clicking the left mouse button will create a GUI Explorer window focused on the currently selected element.

New Content

GUI Styles

  <GUITickBoxNoMinimum color="White" hovercolor="White" selectedcolor="White" disabledcolor="Gray">
    <Sprite name="GUITickBox.None" texture="Content/UI/UIAtlasGeneral.png" state="None" sourcerect="6,112,36,36" tile="false"/>
    <Sprite name="GUITickBox.Pressed" texture="Content/UI/UIAtlasGeneral.png" state="Pressed" sourcerect="109,112,36,36" tile="false"/>
    <Sprite name="GUITickBox.Hover" texture="Content/UI/UIAtlasGeneral.png" state="Hover" sourcerect="160,112,36,36" tile="false"/>
    <Sprite name="GUITickBox.Selected" texture="Content/UI/UIAtlasGeneral.png" state="Selected" sourcerect="57,112,36,36" tile="false"/>
    <Sprite name="GUITickBox.HoverSelected" texture="Content/UI/UIAtlasGeneral.png" state="HoverSelected" sourcerect="211,112,36,36" tile="false"/>
    <GUITextBlock textcolor="GUI.TextColorNormal" hovertextcolor="White" disabledtextcolor="Gray" selectedcolor="255,153,0,76" padding="10,0,10,0"/>
  </GUITickBoxNoMinimum>

English Localization

<qualityname0>Normal</qualityname0>
<qualityname1>Good</qualityname1>
<qualityname2>Excellent</qualityname2>
<qualityname3>Masterwork</qualityname3>

Media

GUI Explorer
image
Entity Inspector
image
Entity Explorer and Entity Editors
image
Item Spawner
image

- Entity explorers
- Entity inspector
@Jade-Harleyy Jade-Harleyy marked this pull request as draft April 23, 2024 20:46
Jade-Harleyy and others added 6 commits April 24, 2024 09:11
- Characters can now be selected.
- Contained items only appear in the explorer.
- Rename DebugUI -> DebugMenus
- GUI inspector mode & explorers
- UI cleanup
- Code cleanup
- Add all entities to the general entity explorer
- Fix entity inspector mode character detection (again)
- Add submarine detection to the entity inspector
- Entity inspector tooltip creation optimization
- GUI debug overlay also for DebugDraw mode
@Jade-Harleyy Jade-Harleyy changed the title Debug Menu Debug Menus May 1, 2024
Jade-Harleyy and others added 7 commits May 1, 2024 03:09
- Allow opening an editor for any entity, even if its blank.
- Submarine infos support in editors
- Fix GUI update order
- Check for permissions.
- Improved detection of wires under cursor.
- Code organization.
- Open new GUI explorer windows by clicking on an entry.
- Item spawner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant