All pastes #1764858 Raw Edit

clueless

public text v1 · immutable
#1764858 ·published 2010-01-25 06:25 UTC
rendered paste body
Index: src/common/paws/pawslistbox.cpp===================================================================--- src/common/paws/pawslistbox.cpp	(revision 5388)+++ src/common/paws/pawslistbox.cpp	(working copy)@@ -21,6 +21,7 @@ #include <ivideo/fontserv.h> #include <iutil/document.h> #include <csutil/xmltiny.h>+#include <csutil/documenthelper.h>  #include <iutil/virtclk.h> #include <iutil/event.h> #include "pawslistbox.h"@@ -366,6 +367,7 @@         {             pawsListBoxRow* zombie = rows[x];             Remove(zombie);+            delete zombie;             return;         }     }@@ -1157,6 +1159,8 @@         return;     if (columnDef[sortColNum].sortFunc == NULL)         return;+    if (GetRowCount() == 0)+        return;      sortedRows = new pawsListBoxRow*[rows.GetSize()];     for ( i=0; i < rows.GetSize(); i++)@@ -1346,7 +1350,13 @@     }      widget->SetParent( this );-    widget->Load( def[column].widgetNode );+    //widget->Load( def[column].widgetNode );+    csRef<iDocumentSystem> xml = csPtr<iDocumentSystem>(new csTinyDocumentSystem);+    csRef<iDocument> doc = xml->CreateDocument();+    csRef<iDocumentNode> node = doc->CreateRoot();+    node = node->CreateNodeBefore(CS_NODE_ELEMENT);+    CS::DocSystem::CloneNode(def[column].widgetNode, node);+    widget->Load(node);      int borderW = 0;     int borderH = 0;Index: src/client/gui/pawsskillwindow.h===================================================================--- src/client/gui/pawsskillwindow.h	(revision 5388)+++ src/client/gui/pawsskillwindow.h	(working copy)@@ -32,7 +32,6 @@ class pawsMultiLineTextBox; class pawsProgressBar; class pawsObjectView;-class psCharAppearance;  /** Describes a skill description inside the GUI system.  */@@ -156,9 +155,6 @@     /// Flag if we have sent our initial request for faction information. Only sent     /// once and everything else is an update.     bool factRequest;---    psCharAppearance* charApp; };  CREATE_PAWS_FACTORY( pawsSkillWindow );Index: src/client/gui/pawsskillwindow.cpp===================================================================--- src/client/gui/pawsskillwindow.cpp	(revision 5388)+++ src/client/gui/pawsskillwindow.cpp	(working copy)@@ -23,7 +23,6 @@ #include "globals.h" #include "pscelclient.h" #include "clientvitals.h"-#include "../charapp.h" #include "net/messages.h" #include "net/clientmsghandler.h" #include "util/skillcache.h"@@ -68,7 +67,6 @@     menStaminaMax = 0;      factRequest = false;-    charApp = new psCharAppearance(PawsManager::GetSingleton().GetObjectRegistry()); }  pawsSkillWindow::~pawsSkillWindow()@@ -80,17 +78,10 @@         delete i.Next();     }     skillDescriptions.DeleteAll();-    delete charApp; }  bool pawsSkillWindow::PostSetup() {-    // Setup the Doll-    if ( !SetupDoll() )-    {-        return false;-    }-     if (!psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_GUISKILL))     {         return false;@@ -150,48 +141,6 @@     return true; } -bool pawsSkillWindow::SetupDoll()-{-    pawsObjectView* widget = dynamic_cast<pawsObjectView*>(FindWidget("Doll"));-    GEMClientActor* actor = psengine->GetCelClient()->GetMainPlayer();-    if (!widget || !actor)-    {-        return true; // doll not wanted, not an error-    }--    csRef<iMeshWrapper> mesh = actor->GetMesh();-    if (!mesh)-    {-        return false; // doll wanted, but mesh not found -> error-    }--    // Set the doll view-    widget->View( mesh );--    // Set the charApp.-    widget->SetCharApp(charApp);--    // Register this doll for updates-    widget->SetID(actor->GetEID().Unbox());--    csRef<iSpriteCal3DState> spstate = scfQueryInterface<iSpriteCal3DState> (widget->GetObject()->GetMeshObject());-    if (spstate)-    {-        // Setup cal3d to select random 0 velocity anims-        spstate->SetVelocity(0.0,&psengine->GetRandomGen());-    }--    charApp->SetMesh(widget->GetObject());--    charApp->ApplyTraits(actor->traits);-    charApp->ApplyEquipment(actor->equipment);--    widget->EnableMouseControl(true);--    //return (a && e);-    return true;-}- void pawsSkillWindow::HandleFactionMsg(MsgEntry* me) {     psFactionMessage factMsg(me);@@ -336,6 +285,7 @@     variousSkillList->Clear();     skillString.Clear();     selectedSkill.Clear();+    unsortedSkills.DeleteAll(); }  bool pawsSkillWindow::OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget )@@ -427,10 +377,10 @@     if (skills->hasRemoved())         flush = true; +    selectedSkill.Clear();+     if (flush)     {-        selectedSkill.Clear();-         // Clear descriptions         statsSkillDescription->SetText("");         combatSkillDescription->SetText("");@@ -452,7 +402,6 @@      int idx = 0; // Row index counter     psSkillCacheIter p = skills->iterBegin();-    bool stats = false, combat = false, magic = false, jobs = false, various = false;     while (p.HasNext())     {         psSkillCacheItem *skill = p.Next();@@ -468,31 +417,26 @@             {                 case 0://Stats                 {-                    stats = true;                     HandleSkillCategory(statsSkillList, "StatsIndicator", "Stats Button", skill, idx, flush);                     break;                 }                 case 1://Combat skills                 {-                    combat = true;                     HandleSkillCategory(combatSkillList, "CombatIndicator", "Combat Button", skill, idx, flush);                     break;                 }                 case 2://Magic skills                 {-                    magic = true;                     HandleSkillCategory(magicSkillList, "MagicIndicator", "Magic Button", skill, idx, flush);                     break;                 }                 case 3://Jobs skills                 {-                    jobs = true;                     HandleSkillCategory(jobsSkillList, "JobsIndicator", "Jobs Button", skill, idx, flush);                     break;                 }                 case 4://Various skills                 {-                    various = true;                     HandleSkillCategory(variousSkillList, "VariousIndicator", "Various Button", skill, idx, flush);                     break;                 }@@ -505,35 +449,19 @@         }     }     -    if (stats)+    if (flush)     {-    statsSkillList->SetSortedColumn(0);-    statsSkillList->SortRows();+        statsSkillList->SetSortedColumn(0);+        statsSkillList->SortRows();+        combatSkillList->SetSortedColumn(0);+        combatSkillList->SortRows();+        magicSkillList->SetSortedColumn(0);+        magicSkillList->SortRows();+        jobsSkillList->SetSortedColumn(0);+        jobsSkillList->SortRows();+        variousSkillList->SetSortedColumn(0);+        variousSkillList->SortRows();     }-    -    if (combat)-    {-    combatSkillList->SetSortedColumn(0);-    combatSkillList->SortRows();-    }-    -    if (magic)-    {-    magicSkillList->SetSortedColumn(0);-    magicSkillList->SortRows();-    }-    -    if (jobs)-    {-    jobsSkillList->SetSortedColumn(0);-    jobsSkillList->SortRows();-    }-    -    if (various)-    {-    variousSkillList->SetSortedColumn(0);-    variousSkillList->SortRows();-    }      if (!foundSelected)     {