Skip to content

Commit

Permalink
show spell components again in the new imGui spell
Browse files Browse the repository at this point in the history
list. Remove broken color tags in spells
Currently the new ui does not display spell
components, and there are colors tags in spell data that are ignored

resolves CleverRaven#75669 and CleverRaven#76137
  • Loading branch information
ThePotatomancer committed Sep 2, 2024
1 parent 9c09701 commit 4de2bb0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2543,7 +2543,7 @@ void spellcasting_callback::display_spell_info( size_t index )
sp.spell_class()->name().c_str() );
ImGui::TextWrapped( "%s", sp.description().c_str() );
ImGui::NewLine();
ImGui::TextWrapped( "%s", sp.enumerate_spell_data( pc ).c_str() );
ImGui::TextWrapped( "%s", remove_color_tags(sp.enumerate_spell_data( pc )).c_str() );
ImGui::NewLine();

// Calculates temp_level_adjust from EoC, saves it to the spell for later use, and prepares to display the result
Expand Down Expand Up @@ -2742,13 +2742,15 @@ void spellcasting_callback::display_spell_info( size_t index )
if( !sp.components().get_components().empty() ) {
for( const std::string &line : sp.components().get_folded_components_list(
width - 2, c_light_gray, pc.crafting_inventory( pc.pos(), 0, false ), return_true<item> ) ) {
info_txt.emplace_back( line );
ImGui::TextWrapped("%s", remove_color_tags(line).c_str());
ImGui::NewLine();
}
}
if( !( sp.components().get_tools().empty() && sp.components().get_qualities().empty() ) ) {
for( const std::string &line : sp.components().get_folded_tools_list(
width - 2, c_light_gray, pc.crafting_inventory( pc.pos(), 0, false ) ) ) {
info_txt.emplace_back( line );
ImGui::TextWrapped("%s", remove_color_tags(line).c_str());
ImGui::NewLine();
}
}
}
Expand Down

0 comments on commit 4de2bb0

Please sign in to comment.