mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
plMultistageStage => plString
This commit is contained in:
@ -306,7 +306,7 @@ void plMultistageBehComponent::IInitDlg()
|
||||
for (int i = 0; i < fStages.size(); i++)
|
||||
{
|
||||
plBaseStage* stage = fStages[i];
|
||||
ListView_AddString(hList, stage->GetName());
|
||||
ListView_AddString(hList, stage->GetName().c_str());
|
||||
}
|
||||
|
||||
// Make sure the column is wide enough
|
||||
@ -323,19 +323,17 @@ void plMultistageBehComponent::IInitDlg()
|
||||
// rename them all to start with zero instead.
|
||||
void plMultistageBehComponent::FixStageNames()
|
||||
{
|
||||
if(fStages.size() > 0)
|
||||
if (fStages.size() > 0)
|
||||
{
|
||||
plBaseStage* stage = fStages[0];
|
||||
const char * stageName = stage->GetName();
|
||||
plString stageName = stage->GetName();
|
||||
|
||||
if(strcmp(stageName, "Stage 1") == 0)
|
||||
if (stageName == "Stage 1")
|
||||
{
|
||||
for (int i = 0; i < fStages.size(); i++)
|
||||
{
|
||||
plBaseStage* stage = fStages[i];
|
||||
char buf[64];
|
||||
sprintf(buf, "Stage %d", i);
|
||||
stage->SetName(buf);
|
||||
stage->SetName(plString::Format("Stage %d", i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -362,7 +360,7 @@ BOOL plMultistageBehComponent::IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR
|
||||
|
||||
// Add the new stage to the list and make sure the list is wide enough
|
||||
HWND hList = GetDlgItem(fDlg, IDC_STAGE_LIST);
|
||||
int idx = ListView_AddString(hList, stage->GetName());
|
||||
int idx = ListView_AddString(hList, stage->GetName().c_str());
|
||||
ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE);
|
||||
ListView_SetItemState(hList, idx, LVIS_SELECTED, LVIS_SELECTED);
|
||||
|
||||
|
@ -53,16 +53,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plMultistageStage.h"
|
||||
#include "plAvatar/plAnimStage.h"
|
||||
|
||||
plBaseStage::plBaseStage()
|
||||
{
|
||||
fName = nil;
|
||||
}
|
||||
|
||||
plBaseStage::~plBaseStage()
|
||||
{
|
||||
delete [] fName;
|
||||
}
|
||||
|
||||
BOOL plBaseStage::IStaticDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (msg == WM_INITDIALOG)
|
||||
@ -96,24 +86,17 @@ void plBaseStage::IDestroyDlg(HWND hDlg)
|
||||
GetCOREInterface()->DeleteRollupPage(hDlg);
|
||||
}
|
||||
|
||||
const char* plBaseStage::GetName()
|
||||
plString plBaseStage::GetName()
|
||||
{
|
||||
if (!fName)
|
||||
fName = hsStrcpy("DefaultName");
|
||||
if (fName.IsEmpty())
|
||||
fName = "DefaultName";
|
||||
return fName;
|
||||
}
|
||||
|
||||
void plBaseStage::SetName(const char* name)
|
||||
{
|
||||
delete [] fName;
|
||||
fName = hsStrcpy(name);
|
||||
}
|
||||
|
||||
void plBaseStage::Read(hsStream *stream)
|
||||
{
|
||||
stream->ReadLE16();
|
||||
delete [] fName;
|
||||
fName = stream->ReadSafeString();
|
||||
fName = stream->ReadSafeString_TEMP();
|
||||
}
|
||||
|
||||
void plBaseStage::Write(hsStream *stream)
|
||||
@ -124,7 +107,7 @@ void plBaseStage::Write(hsStream *stream)
|
||||
|
||||
void plBaseStage::IBaseClone(plBaseStage* clone)
|
||||
{
|
||||
clone->fName = hsStrcpy(fName);
|
||||
clone->fName = fName;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -134,7 +117,6 @@ HWND plStandardStage::fDlg = NULL;
|
||||
|
||||
plStandardStage::plStandardStage()
|
||||
{
|
||||
fAnimName = nil;
|
||||
fNumLoops = 0;
|
||||
fLoopForever = false;
|
||||
fForward = 0;
|
||||
@ -149,19 +131,13 @@ plStandardStage::plStandardStage()
|
||||
fRegressTo = 0;
|
||||
}
|
||||
|
||||
plStandardStage::~plStandardStage()
|
||||
{
|
||||
delete [] fAnimName;
|
||||
}
|
||||
|
||||
void plStandardStage::Read(hsStream *stream)
|
||||
{
|
||||
plBaseStage::Read(stream);
|
||||
|
||||
uint16_t version = stream->ReadLE16();
|
||||
|
||||
delete [] fAnimName;
|
||||
fAnimName = stream->ReadSafeString();
|
||||
fAnimName = stream->ReadSafeString_TEMP();
|
||||
fNumLoops = stream->ReadLE32();
|
||||
fLoopForever = stream->ReadBool();
|
||||
fForward = stream->ReadByte();
|
||||
@ -329,10 +305,9 @@ void plStandardStage::IGetAnimName()
|
||||
char buf[256];
|
||||
edit->GetText(buf, sizeof(buf));
|
||||
|
||||
if (strcmp(buf, fAnimName) != 0)
|
||||
if (fAnimName != buf)
|
||||
{
|
||||
delete [] fAnimName;
|
||||
fAnimName = hsStrcpy(buf);
|
||||
fAnimName = buf;
|
||||
|
||||
SetSaveRequiredFlag();
|
||||
}
|
||||
@ -387,7 +362,7 @@ static void LoadCombo(HWND hCombo, NameType* nameInt, int size, int curVal)
|
||||
void plStandardStage::IInitDlg()
|
||||
{
|
||||
ICustEdit* edit = GetICustEdit(GetDlgItem(fDlg, IDC_ANIM_NAME));
|
||||
edit->SetText(fAnimName);
|
||||
edit->SetText(fAnimName.c_str());
|
||||
|
||||
HWND hForward = GetDlgItem(fDlg, IDC_FORWARD_COMBO);
|
||||
LoadCombo(hForward, gForward, sizeof(gForward), fForward);
|
||||
@ -446,7 +421,7 @@ plAnimStage* plStandardStage::CreateStage()
|
||||
plBaseStage* plStandardStage::Clone()
|
||||
{
|
||||
plStandardStage* clone = new plStandardStage;
|
||||
clone->fAnimName = hsStrcpy(fAnimName);
|
||||
clone->fAnimName = fAnimName;
|
||||
clone->fNumLoops = fNumLoops;
|
||||
clone->fLoopForever = fLoopForever;
|
||||
clone->fForward = fForward;
|
||||
|
@ -40,6 +40,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "plString.h"
|
||||
|
||||
class plAnimStage;
|
||||
class plBaseStage;
|
||||
class hsStream;
|
||||
@ -56,7 +58,7 @@ enum StageTypes
|
||||
class plBaseStage
|
||||
{
|
||||
protected:
|
||||
char* fName;
|
||||
plString fName;
|
||||
|
||||
static BOOL CALLBACK IStaticDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
virtual BOOL IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
@ -67,8 +69,8 @@ protected:
|
||||
void IBaseClone(plBaseStage* clone);
|
||||
|
||||
public:
|
||||
plBaseStage();
|
||||
virtual ~plBaseStage();
|
||||
plBaseStage() { }
|
||||
virtual ~plBaseStage() { }
|
||||
|
||||
// From StageTypes
|
||||
virtual int GetType()=0;
|
||||
@ -84,8 +86,8 @@ public:
|
||||
|
||||
virtual plBaseStage* Clone()=0;
|
||||
|
||||
const char* GetName();
|
||||
void SetName(const char* name);
|
||||
plString GetName(); // NOT const (this could change fName)
|
||||
void SetName(const plString& name) { fName = name; }
|
||||
};
|
||||
|
||||
class plStandardStage : public plBaseStage
|
||||
@ -93,7 +95,7 @@ class plStandardStage : public plBaseStage
|
||||
protected:
|
||||
static HWND fDlg;
|
||||
|
||||
char *fAnimName;
|
||||
plString fAnimName;
|
||||
uint32_t fNumLoops;
|
||||
bool fLoopForever;
|
||||
uint8_t fForward;
|
||||
@ -114,7 +116,7 @@ protected:
|
||||
|
||||
public:
|
||||
plStandardStage();
|
||||
~plStandardStage();
|
||||
~plStandardStage() { }
|
||||
|
||||
int GetType() { return kStandard; }
|
||||
|
||||
|
Reference in New Issue
Block a user