Skip to content

Conversation

wkdgmr
Copy link
Contributor

@wkdgmr wkdgmr commented Aug 25, 2025

Add Runes to Speedbook Implementation

Summary

The "Add Runes to Speedbook" feature extends the game's spellbook and quick spell selection system to support Rune spells. This allows players to view, select, and assign Rune spells in the Speedbook UI, similar to other spell types. This implementation will help to bridge the gap for controller and mobile players in regards to having a subpar experience with this particular aspect of the game..


Technical Details

Changed Files

  • Source/control.cpp
  • Source/inv.cpp
  • Source/items.cpp
  • Source/panels/spell_icons.cpp
  • Source/panels/spell_list.cpp
  • Source/panels/spell_list.hpp
  • Source/player.cpp
  • Source/player.h
  • Source/spelldat.h
  • Source/spells.cpp

Key Implementation Points

1. Spell Type and ID Extensions

  • spelldat.h:
    • Added Rune to SpellType enum.
    • Added Rune spell IDs (e.g., RuneOfFire, RuneOfLight, etc.) to SpellID.

2. Player Data Structure

  • player.h / player.cpp:
    • Added support for tracking Rune spells in player data (_pRuneSpells).
    • Updated logic for spell assignment and validation to include Rune spells.

3. Spellbook and Speedbook UI

  • panels/spell_list.cpp / panels/spell_list.hpp:
    • Modified spell list logic to include Rune spells in the Speedbook.
    • Added functions to display Rune spell info and count.
    • Updated selection and hotkey assignment logic for Rune spells.

4. Spell Icon Mapping

  • panels/spell_icons.cpp:
    • Mapped new Rune spell IDs to appropriate icons for display in the UI.

5. Spell Validation and Usage

  • spells.cpp:
    • Updated spell validation logic to recognize Rune spells as valid for quick selection and casting.

6. Inventory and Item Handling

  • inv.cpp / items.cpp:
    • Ensured Rune spells are properly handled in inventory and item logic, if applicable.

7. Control Panel Integration

  • control.cpp:
    • Integrated Rune spell selection and display into the main control panel logic.

How It Works

  • Rune spells now appear in the Speedbook UI alongside other spell types.
  • Players can assign Rune spells to quick slots and use them via hotkeys.
  • The UI displays Rune spell icons and counts, and supports selection and toggling.
  • All relevant player, spell, and UI logic has been updated to treat Runes just like Scrolls
image image
2025-08-25.15-30-59.mp4

@AJenbo
Copy link
Member

AJenbo commented Aug 25, 2025

Looks like this is causing some hellfire items to morph

@wkdgmr
Copy link
Contributor Author

wkdgmr commented Aug 26, 2025

Looks like this is causing some hellfire items to morph

Ah, yeah I was worried about that. It might be how I am adding SpellID to the Rune item.

@wkdgmr
Copy link
Contributor Author

wkdgmr commented Aug 26, 2025

Looks like this is causing some hellfire items to morph

Fixed via ecccf70

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.

2 participants