|
From: <xer...@us...> - 2026-07-24 02:40:59
|
Revision: 1679
http://sourceforge.net/p/seq/svn/1679
Author: xerxes00
Date: 2026-07-24 02:40:56 +0000 (Fri, 24 Jul 2026)
Log Message:
-----------
Spell list: honor the NPC display-name option
- Caster/target columns now render through the NPC display-name option
(transformed/cleaned/unstripped), matching the spawn windows; refreshed
in place when the option changes.
- These are strings captured at cast time, so the transform still works
after the spawn despawns.
- Store the raw target name from the buff-list decode instead of
pre-stripping its digits, so the option can control it (default still
shows the clean name).
Depends on the buff-window commit (OP_BuffList/OP_PetBuffList decode);
merge after r1671/r1672.
Modified Paths:
--------------
showeq/branches/xerxes-trunk-dev/src/interface.cpp
showeq/branches/xerxes-trunk-dev/src/spelllist.cpp
showeq/branches/xerxes-trunk-dev/src/spelllist.h
showeq/branches/xerxes-trunk-dev/src/spellshell.cpp
Modified: showeq/branches/xerxes-trunk-dev/src/interface.cpp
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/interface.cpp 2026-07-24 02:39:26 UTC (rev 1678)
+++ showeq/branches/xerxes-trunk-dev/src/interface.cpp 2026-07-24 02:40:56 UTC (rev 1679)
@@ -4088,6 +4088,8 @@
m_spawnList2->refreshItemNames();
if (m_spawnPointList != 0)
m_spawnPointList->spawnPointList()->refresh();
+ if (m_spellList != 0)
+ m_spellList->spellList()->refreshItemNames();
}
void
Modified: showeq/branches/xerxes-trunk-dev/src/spelllist.cpp
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/spelllist.cpp 2026-07-24 02:39:26 UTC (rev 1678)
+++ showeq/branches/xerxes-trunk-dev/src/spelllist.cpp 2026-07-24 02:40:56 UTC (rev 1679)
@@ -30,9 +30,11 @@
#include <QLayout>
#include <QList>
#include <QMenu>
+#include <QScrollBar>
#include "spelllist.h"
#include "main.h"
+#include "spawn.h"
SpellListItem::SpellListItem(SEQListViewItem *parent) : SEQListViewItem(parent)
{
@@ -92,9 +94,14 @@
setText(SPELLCOL_SPELLID, QString("%1").arg(m_item->spellId()));
setText(SPELLCOL_SPELLNAME, m_item->spellName());
setText(SPELLCOL_CASTERID, QString("%1").arg(m_item->casterId()));
- setText(SPELLCOL_CASTERNAME, m_item->casterName());
+ // caster/target were captured as raw names at cast time; honor the NPC
+ // display-name option at render (still works after the spawn is gone,
+ // since these are stored strings, not live spawn lookups)
+ setText(SPELLCOL_CASTERNAME,
+ npcDisplayName(m_item->casterName(), showeq_params->npcNameDisplay));
setText(SPELLCOL_TARGETID, QString("%1").arg(m_item->targetId()));
- setText(SPELLCOL_TARGETNAME, m_item->targetName());
+ setText(SPELLCOL_TARGETNAME,
+ npcDisplayName(m_item->targetName(), showeq_params->npcNameDisplay));
setText(SPELLCOL_CASTTIME, m_item->castTimeStr());
setText(SPELLCOL_DURATION, m_item->durationStr());
}
@@ -308,6 +315,25 @@
}
}
+// Re-render every spell row so the caster/target columns pick up the current
+// NPC display-name option. In place (no rebuild), so selection is preserved.
+void SpellList::refreshItemNames()
+{
+ bool wasSorting = isSortingEnabled();
+ setSortingEnabled(false);
+ int scrollPos = verticalScrollBar()->value();
+
+ SEQListViewItemIterator it(this);
+ while (*it)
+ {
+ ((SpellListItem*)*it)->update();
+ ++it;
+ }
+
+ setSortingEnabled(wasSorting);
+ verticalScrollBar()->setValue(scrollPos);
+}
+
void SpellList::clear()
{
SEQListView::clear();
Modified: showeq/branches/xerxes-trunk-dev/src/spelllist.h
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/spelllist.h 2026-07-24 02:39:26 UTC (rev 1678)
+++ showeq/branches/xerxes-trunk-dev/src/spelllist.h 2026-07-24 02:40:56 UTC (rev 1679)
@@ -77,6 +77,7 @@
SpellListItem* Selected();
SpellListItem* InsertSpell(const SpellItem *item);
void DeleteItem(const SpellItem *item);
+ void refreshItemNames();
//SpellItem* AddCategory(QString& name, QColor color = Qt::black);
//void RemCategory(SpellListItem *);
//void clearCategories();
Modified: showeq/branches/xerxes-trunk-dev/src/spellshell.cpp
===================================================================
--- showeq/branches/xerxes-trunk-dev/src/spellshell.cpp 2026-07-24 02:39:26 UTC (rev 1678)
+++ showeq/branches/xerxes-trunk-dev/src/spellshell.cpp 2026-07-24 02:40:56 UTC (rev 1679)
@@ -383,11 +383,9 @@
const Item* tgt = m_spawnShell->findID(tSpawn, spawnId);
if (!tgt)
return;
+ // store the raw name; the spell list applies the NPC display-name option
+ // (strip/transform) at render time
targetName = tgt->name();
- // Spawn names carry a numeric instance suffix (e.g. a trailing "00"); show
- // the clean name in the spell list.
- while (!targetName.isEmpty() && targetName.at(targetName.length() - 1).isDigit())
- targetName.chop(1);
}
size_t pos = 15;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|