Skip to content

fix: Button code stability refactors#1213

Merged
EttyKitty merged 2 commits into
Adeptus-Dominus:mainfrom
carys-the-weed-cloud:main
Jun 4, 2026
Merged

fix: Button code stability refactors#1213
EttyKitty merged 2 commits into
Adeptus-Dominus:mainfrom
carys-the-weed-cloud:main

Conversation

@carys-the-weed-cloud
Copy link
Copy Markdown
Contributor

@carys-the-weed-cloud carys-the-weed-cloud commented Jun 3, 2026

I can do a proper run down of all the changes tomorrow after work but i need to sleep and dont merge this i technically caused a regression with the "distribute specialists" buttons in character creation.... I think. I haven't actually looked at those buttons specifically yet to see if it's a regression or exposure of patchy code i need time and figured i'd post my progress for eyeballs rn.


Summary by cubic

Refactors core UI/button code for consistent constructors, draw-state handling, and reliable bounds. Fixes hover/click and layout edge cases across buttons, sliders, and text UI.

  • Refactors

    • Unified draw-state save/restore via add_draw_return_values/pop across buttons, text, dropdowns, text bar, and interactive elements.
    • Standardized constructors to data = {} and update(data = {}) with move_data_to_current_scope; many params renamed to *_param; methods made static where appropriate.
    • Consistent sizing and bounds: w/h and x2/y2 computed reliably; standard_loc_data now sets self.*.
    • draw_unit_buttons now respects halign; removed duplicate definition.
    • UnitButtonObject: correct h_gap/v_gap usage in move(); passes halign to draw_unit_buttons; pixel style text position fixed; PurchaseButton requires active to click.
    • SliderBar: update_data -> update; draw no longer returns a value.
    • list_traveler: restored wrap-around with intuitive directions (up → previous, down → next).
    • RadioSet/MultiSelect/ToggleButton/InteractiveButton: normalized hover/click logic with allow_changes; corrected height usage; methods made static where sensible.
  • Migration

    • Replace calls to update_data with update; pass option structs as {} (not false).
    • If you relied on SliderBar.draw() returning a value, use slider.value instead.
    • list_traveler now wraps; if you depended on clamping at ends, adjust callers. Up selects previous; down selects next.
    • SpriteButton hover sprite default is now undefined (not -1); update any checks.
    • Verify character creation flows that depend on list traversal or button gating (e.g., “distribute specialists”).

Written for commit 4863706. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added Size: Big Type: Refactor Rewriting/restructuring code, while keeping general behavior labels Jun 3, 2026
@EttyKitty EttyKitty marked this pull request as draft June 3, 2026 01:29
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.

1 issue found across 1 file

Confidence score: 3/5

  • There is a concrete regression risk in scripts/scr_buttons/scr_buttons.gml: LabeledIcon no longer calls update() in the constructor, so x2/y2/w/h can remain zero and make the hitbox invalid at creation time.
  • Because this is severity 7/10 with high confidence (9/10) and affects input behavior, it could cause user-facing click/hover failures until some external update() happens.
  • This is likely fixable with a small, targeted constructor change, but as-is it carries meaningful runtime behavior risk.
  • Pay close attention to scripts/scr_buttons/scr_buttons.gml - constructor-time bounds initialization may be missing, leading to zero-area hitboxes.

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

Re-trigger cubic

Comment thread scripts/scr_buttons/scr_buttons.gml
@carys-the-weed-cloud carys-the-weed-cloud marked this pull request as ready for review June 3, 2026 23:00
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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would require human review. This is a large refactor of core UI button code (254 additions, 269 deletions) that the author explicitly notes has caused a regression in character creation, so it requires human review to verify that no critical UI flows are broken.

Re-trigger cubic

@EttyKitty EttyKitty changed the title refactor: Button base code stability tweaks. fix: Button code stability refactors Jun 4, 2026
@github-actions github-actions Bot added the Type: Fix This is a fix for a bug label Jun 4, 2026
@EttyKitty EttyKitty merged commit c21ada8 into Adeptus-Dominus:main Jun 4, 2026
8 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 Type: Refactor Rewriting/restructuring code, while keeping general behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants