Split InspectorPanel into sections (#152) #153
No reviewers
Labels
No labels
assets
bug
duplicate
enhancement
help wanted
invalid
question
testing
ui
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
liamjd/UntitledColonyBuilder!153
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "152-inspector-panel-sections"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Splits the inspector into sections so it can host controls, ahead of #136's worker-slot control. This is a refactor: the panel shows exactly what it showed after #142.
InspectorSection(abstract, extendsVBoxContainer) has two methods:applies_to(entity, ctx)andrefresh(entity, ctx).InspectorPanelkeeps the title and the timing. On each selection change and tick it asks every section under%Sectionswhether it applies, hides the ones that don't, and refreshes the rest. A section is never handed a null entity.DetailsSection, withpawn_rows,building_rows,IDLE_TEXTandNONE_TEXTmoved onto it.InspectorContext(tasks,buildings,task_for()) replacespanel.tasks/panel.buildings.game.gdbuilds it.The spec and the decisions are on #152.
Verification
test_inspector_sections.gd. Its stub section applies only to buildings and is added withadd_child()alone, which shows that adding a section needs no change to the panel's code.test_inspector_panel.gdchanges only to follow what moved, as the amended acceptance criterion allows.tools/screenshot_inspector.gd. The pawn, building and working-pawn shots look the same as after #142.Caveats
136-worker-slot-controlhas commitb4e42f6, which editsinspector_panel.tscnnext to the old%Rowsnode. Expect a conflict when that branch is rebuilt from main.PawnCard/BuildingCardnodes from the entity-list tests. They are unrelated to this change, but nobody has checked whether main reports them too.Closes #152
🤖 Generated with Claude Code