Ring editor: Add "All Equipment" checkbox for NPC customization#788
Draft
Ring editor: Add "All Equipment" checkbox for NPC customization#788
Conversation
…t across all races - Add checkbox UI element in the equipment section of the NPC editor (r2ed.xml) - Build a merged 'all equipment' palette combining outfit items from all race/type palettes - When enabled, outfit combo boxes (helmet, chest, legs, boots, gloves, arms) show all items - Weapons (hands) remain filtered by NPC type since melee/range/magic need different profiles - Reset checkbox state when selecting a new NPC - Add fallback lookups for item index-to-text mapping Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
… array iteration Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add checkbox to enable selecting any equipment on NPC
Add checkbox to enable selecting any equipment on NPC in Ring editor
Feb 17, 2026
…tion per combat category 1. Add UseAllEquipment property to NpcCustom class for persistence 2. Save/restore checkbox state via r2:setNpcAttribute (follows LinkColor pattern) 3. Handle UseAllEquipment in onAttrModified for undo/redo support 4. Build merged weapon palettes per combat category (melee/magic/healer/guard/civil) 5. When "all equipment" enabled, weapons combo shows all weapons for same combat type 6. Update weapon lookups (updateWeapons, updateAllPrivate, onAttrModified) to use effective equipment ID with fallback Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
…up pass - Remove incorrect _equipment substring check that blocked all equipment IDs - Extract weaponDedupKey helper function to avoid key construction duplication - Remove redundant first-pass weapon category collection (was only storing booleans) - Simplify to single-pass category discovery + single-pass weapon palette building Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Add checkbox to enable selecting any equipment on NPC in Ring editor
Add "All Equipment" checkbox to Ring editor NPC with persistence and expanded weapon selection
Feb 17, 2026
In Lua 5.2+, 'unpack' was moved from global scope to 'table.unpack'. This caused an 'attempt to call a nil value (global unpack)' error when opening the customize look panel or selecting another NPC. Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
…all equipment enabled
1. Skip empty itemFile entries ("None") in buildAllEquipmentPalette to avoid
getSheetId("") error (No matching overload found)
2. Protect updatePieceEquipment from calling getSheetId with empty string
3. Add getColorSliderMax() helper that returns 7 (8 choices) when either
LevelDesignEnabled is set or all equipment mode is enabled
4. Update all color slider max consumers: initNpcEditor, toggleAllEquipment,
updateAllPrivate, onAttrModified, randomColor, randomNPCEquipment
Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Add "All Equipment" checkbox to Ring editor NPC with persistence and expanded weapon selection
Ring editor: Add "All Equipment" toggle for NPCs with expanded outfit/weapon/color selection
Feb 18, 2026
…n all equipment mode 1. Guard against nil value in setter's table.insert to prevent "Inserting nil in table" warning when Properties panel is open and a different NPC is selected 2. Add "None" entry at the beginning of each merged outfit slot in buildAllEquipmentPalette so users can unequip items when "All Equipment" mode is enabled Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Ring editor: Add "All Equipment" toggle for NPCs with expanded outfit/weapon/color selection
Ring editor: Add "All Equipment" toggle for NPC customization
Feb 18, 2026
Copilot stopped work on behalf of
kaetemi due to an error
February 18, 2026 14:57
The toggle was calling r2:setNpcAttribute which creates undo actions via r2.requestSetNode. This trashed the undo stack every time the checkbox was toggled. Fix: Make the toggle purely UI-side state that only repopulates the equipment combo boxes without modifying the NPC object tree. - Remove UseAllEquipment property from NpcCustom class - Remove r2:setNpcAttribute call from toggleAllEquipment - Remove onAttrModified handler for UseAllEquipment - Reset toggle to off when selecting a new NPC Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Ring editor: Add "All Equipment" toggle for NPC customization
Ring editor: Add "All Equipment" checkbox for NPC customization
Feb 18, 2026
The toggle was previously either: - Creating no undo entry (UI-only), or - Creating multiple undo entries (one per equipment piece via linkColor reset) Fix: toggleAllEquipment now calls requestNewAction once, then setNpcAttribute for UseAllEquipment, then updateEquipment with skipLinkColor=true to prevent linkColor() from creating additional undo entries. Also restores UseAllEquipment property on NpcCustom class and onAttrModified handler for undo/redo support. Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Ring editor: Add "All Equipment" checkbox for NPC customization
Add "All Equipment" checkbox to Ring editor NPC customization
Feb 18, 2026
When toggling off All Equipment, non-standard equipment is reverted to allowed values. Previously this created separate undo entries for each equipment piece change. Now all changes (UseAllEquipment toggle + equipment reversions) are grouped into a single undo action using requestNewAction/requestEndAction with selectEquipmentSet flag, following the same pattern as randomEquipment(). Co-authored-by: kaetemi <1581053+kaetemi@users.noreply.github.com>
Copilot
AI
changed the title
Add "All Equipment" checkbox to Ring editor NPC customization
Ring editor: Add "All Equipment" checkbox for NPC customization
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NPCs in the Ring editor are restricted to narrow race/type-specific equipment subsets. This adds a toggle to unlock all outfits across races, expanded weapon selection within combat category, and all 8 color slots.
Equipment expansion
r2_all_equipment) built at init from all equipment palettes, deduped byitemFile, with explicit "None" entry per slotr2_all_weapons_melee,r2_all_weapons_magic, etc.) — weapons can't be fully merged since melee/range/magic driveSheetModelselectiongetEffectiveEquipmentId(instance, slotName)routes lookups to the appropriate merged palette when toggle is activePersistence & undo
UseAllEquipmentproperty onNpcCustomclass, persisted to object treerequestNewAction/requestEndActionwithselectEquipmentSetflag, same pattern asrandomEquipment():updateEquipmentgainsskipLinkColorparam to preventlinkColor()from creating additional undo entries when called from the toggle pathColor range
getColorSliderMax()returns max index 7 (8 colors) when toggle is active orLevelDesignEnabledis set, consolidating three inline checksBug fixes
unpack→table.unpackinr2_ui_property_sheet.lua:1700(Lua 5.2+)getSheetId("")inupdatePieceEquipment— "None" entries have emptyitemFiletable.insert(eventArgs, nil)in property sheetsetterOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.