Skip to content

fix: improve tables and table use#1174

Merged
OH296 merged 7 commits into
Adeptus-Dominus:mainfrom
OH296:use_of_tables
May 14, 2026
Merged

fix: improve tables and table use#1174
OH296 merged 7 commits into
Adeptus-Dominus:mainfrom
OH296:use_of_tables

Conversation

@OH296
Copy link
Copy Markdown
Collaborator

@OH296 OH296 commented May 14, 2026

Purpose and Description

  • Self-descriptive.

Testing done

  • None, and I understand the risks.

Related things and/or additional context


Summary by cubic

Rebuilt the Fleets and Missions panels to use the shared Table with row hover/clicks, hover highlight, and per-cell text scaling. Lists are consistent, clickable, and readable; fleets initialize at game start and auto-refresh.

  • New Features

    • Table: centralized row hover/left/right click via row_method, hover highlight, per-cell text scaling, min row height, colour/font, and row_count().
    • Fleets: update_fleet_table()/draw_fleet_area() render via Table; left-click pans to fleet; hover shows forge/apothecary breakdown on a detail slate; auto-refresh when fleet count changes.
    • Missions: mission_table renders via Table; left-click pans to system; integrates obj_en_fleet.events (Deliver Trophy Guard) with hover tooltip; right-click selects the trophy-bearing marine.
  • Refactors

    • Replaced manual draw loops with Table; update tables when tabs open; wrapped panel draw in a try-catch.
    • Initialize at game start with location_viewer.update_fleet_table(); added events to obj_en_fleet for mission UI data.

Written for commit 04edfd8. Summary will update on new commits.

@github-actions github-actions Bot added Size: Big Type: Fix This is a fix for a bug labels May 14, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

6 issues found across 4 files

Confidence score: 2/5

  • I’m scoring this as high risk because several medium-high severity findings are concrete runtime risks, not just style/perf concerns (sev 6–7 with strong confidence).
  • The most severe functional issue is in scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml: the right-click mission path can call group_selection with undefined _unit_l, which can trigger immediate errors when a target unit is missing.
  • scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml also has an empty catch in draw() (exceptions get silently swallowed) and refresh logic keyed only to fleet count, increasing the chance of hidden failures and stale UI state.
  • Pay close attention to scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml and scripts/scr_Table/scr_Table.gml - undefined variable flow, unsafe row_method/struct handling, and heavy draw-path work are the main stability and performance risks.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scripts/scr_Table/scr_Table.gml">

<violation number="1" location="scripts/scr_Table/scr_Table.gml:127">
P2: Custom agent: **Code Quality Review**

Heavy per-cell text scaling logic added inside Draw function</violation>

<violation number="2" location="scripts/scr_Table/scr_Table.gml:139">
P1: Guard `row_method` call to struct rows only. Current call path can pass array rows into `struct_exists`, which expects struct.</violation>
</file>

<file name="scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml">

<violation number="1" location="scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml:160">
P1: Custom agent: **Code Quality Review**

Heavy logic (loop, struct allocations, method bindings) inside draw path: `update_fleet_table()` rebuilds row structs and binds methods from `draw_fleet_area()`, which is called by `inside_method` during `main_panel.draw()`. Move to a Step event or data-change callback.</violation>

<violation number="2" location="scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml:233">
P2: Fleet table refresh tied only to fleet count. Data goes stale when fleet state changes but count stays same.</violation>

<violation number="3" location="scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml:342">
P1: Right-click mission action can call `group_selection` with undefined `_unit_l` when target unit missing.</violation>

<violation number="4" location="scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml:554">
P1: Custom agent: **Code Quality Review**

Empty catch block in `draw()` silently swallows all exceptions without fail-loud logging or rethrowing, violating the codebase's established `handle_exception` pattern.</violation>
</file>

Shadow auto-approve: would not auto-approve because issues were found.

Comment thread scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml
Comment thread scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml
Comment thread scripts/scr_Table/scr_Table.gml Outdated
Comment thread scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml Outdated
Comment thread scripts/scr_Table/scr_Table.gml
Comment thread scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.gml
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Shadow auto-approve: would not auto-approve. Auto-approval blocked by 4 unresolved issues from previous reviews.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Shadow auto-approve: would require human review. This is a substantial refactor of the fleet/mission panels and the underlying Table component, affecting multiple game objects and UI interactions, which warrants manual review to ensure no regressions or logic errors.

@OH296 OH296 merged commit 34d1fdb into Adeptus-Dominus:main May 14, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Big Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant