Skip to content

Refactor EditGUI value handling - #296

Merged
BenCodez merged 8 commits into
masterfrom
refactor/edit-gui-values
Aug 24, 2026
Merged

BenCodez merged 8 commits into
masterfrom
refactor/edit-gui-values

Conversation

@BenCodez

Copy link
Copy Markdown
Owner

Summary

Clean up the EditGUI/value-type subsystem while preserving the existing abstract editor classes and downstream setValue(...) extension pattern.

Shared value behavior

  • centralize common editor construction in EditGUIValue
  • centralize ValueRequest creation and input-method fallback
  • centralize value apply/current-value/message behavior
  • centralize string, numeric, and string-list normalization
  • make lore/options helpers null-safe
  • make containsKey(...) null-safe
  • expose default editor button name/lore metadata from the value type

Built-in value editors

  • simplify Boolean, Number, and String editors to use the shared request/apply helpers
  • make number parsing consistently fall back instead of duplicating parsing logic
  • make list values accept generic collections instead of unchecked ArrayList<String> casts
  • keep list editor metadata synchronized after add/remove operations
  • handle empty/missing remove-list metadata safely
  • preserve BOOK -> CHAT fallback for list removal

EditGUI / EditGUIButton

  • simplify EditGUIButton rendering by using editor-provided display metadata for ordinary/list editors
  • retain the existing specialized inventory-editor presentation for compatibility
  • simplify EditGUI sorting
  • retain duplicate editor keys instead of collapsing them through a temporary key map
  • sort editor keys case-insensitively with null keys last

Tests

Adds focused value behavior tests for:

  • null/default string and number handling
  • numeric string parsing and invalid-number fallback
  • collection-to-string-list normalization
  • shared apply/persist/current-value behavior
  • input-method fallback
  • default/list button display metadata
  • null-safe edit-data checks

@BenCodez
BenCodez marked this pull request as ready for review August 24, 2026 01:23
@BenCodez
BenCodez merged commit d97f05e into master Aug 24, 2026
4 checks passed
@BenCodez
BenCodez deleted the refactor/edit-gui-values branch August 24, 2026 22:48
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.

1 participant