mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-16 08:27:01 +00:00
Added "add/edit link" dialog to the modify tab
This commit is contained in:
@@ -57,43 +57,43 @@ CScriptTemplate* CMasterTemplate::TemplateByIndex(u32 Index)
|
||||
return (std::next(it, Index))->second;
|
||||
}
|
||||
|
||||
TString CMasterTemplate::StateByID(u32 StateID)
|
||||
SState CMasterTemplate::StateByID(u32 StateID)
|
||||
{
|
||||
auto it = mStates.find(StateID);
|
||||
|
||||
if (it != mStates.end())
|
||||
return it->second;
|
||||
else
|
||||
return "Invalid";
|
||||
return SState(-1, "Invalid");
|
||||
}
|
||||
|
||||
TString CMasterTemplate::StateByID(const CFourCC& State)
|
||||
SState CMasterTemplate::StateByID(const CFourCC& State)
|
||||
{
|
||||
return StateByID(State.ToLong());
|
||||
}
|
||||
|
||||
TString CMasterTemplate::StateByIndex(u32 Index)
|
||||
SState CMasterTemplate::StateByIndex(u32 Index)
|
||||
{
|
||||
auto it = mStates.begin();
|
||||
return (std::next(it, Index))->second;
|
||||
}
|
||||
|
||||
TString CMasterTemplate::MessageByID(u32 MessageID)
|
||||
SMessage CMasterTemplate::MessageByID(u32 MessageID)
|
||||
{
|
||||
auto it = mMessages.find(MessageID);
|
||||
|
||||
if (it != mMessages.end())
|
||||
return it->second;
|
||||
else
|
||||
return "Invalid";
|
||||
return SMessage(-1, "Invalid");
|
||||
}
|
||||
|
||||
TString CMasterTemplate::MessageByID(const CFourCC& MessageID)
|
||||
SMessage CMasterTemplate::MessageByID(const CFourCC& MessageID)
|
||||
{
|
||||
return MessageByID(MessageID.ToLong());
|
||||
}
|
||||
|
||||
TString CMasterTemplate::MessageByIndex(u32 Index)
|
||||
SMessage CMasterTemplate::MessageByIndex(u32 Index)
|
||||
{
|
||||
auto it = mMessages.begin();
|
||||
return (std::next(it, Index))->second;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define CMASTERTEMPLATE_H
|
||||
|
||||
#include "CScriptTemplate.h"
|
||||
#include "SLink.h"
|
||||
#include "Core/Resource/EGame.h"
|
||||
#include <Common/types.h>
|
||||
#include <map>
|
||||
@@ -21,8 +22,8 @@ class CMasterTemplate
|
||||
std::map<TString, CStructTemplate*> mStructTemplates;
|
||||
|
||||
std::map<u32, CScriptTemplate*> mTemplates;
|
||||
std::map<u32, TString> mStates;
|
||||
std::map<u32, TString> mMessages;
|
||||
std::map<u32, SState> mStates;
|
||||
std::map<u32, SMessage> mMessages;
|
||||
|
||||
struct SPropIDInfo
|
||||
{
|
||||
@@ -46,12 +47,12 @@ public:
|
||||
CScriptTemplate* TemplateByID(u32 ObjectID);
|
||||
CScriptTemplate* TemplateByID(const CFourCC& ObjectID);
|
||||
CScriptTemplate* TemplateByIndex(u32 Index);
|
||||
TString StateByID(u32 StateID);
|
||||
TString StateByID(const CFourCC& StateID);
|
||||
TString StateByIndex(u32 Index);
|
||||
TString MessageByID(u32 MessageID);
|
||||
TString MessageByID(const CFourCC& MessageID);
|
||||
TString MessageByIndex(u32 Index);
|
||||
SState StateByID(u32 StateID);
|
||||
SState StateByID(const CFourCC& StateID);
|
||||
SState StateByIndex(u32 Index);
|
||||
SMessage MessageByID(u32 MessageID);
|
||||
SMessage MessageByID(const CFourCC& MessageID);
|
||||
SMessage MessageByIndex(u32 Index);
|
||||
TString GetDirectory() const;
|
||||
CStructTemplate* GetStructAtSource(const TString& rkSource);
|
||||
bool IsLoadedSuccessfully();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef CSCRIPTOBJECT_H
|
||||
#define CSCRIPTOBJECT_H
|
||||
|
||||
#include "SConnection.h"
|
||||
#include "SLink.h"
|
||||
#include "IProperty.h"
|
||||
#include "IPropertyTemplate.h"
|
||||
#include "CScriptTemplate.h"
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef SCONNECTION_H
|
||||
#define SCONNECTION_H
|
||||
|
||||
#include <Common/types.h>
|
||||
|
||||
struct SLink
|
||||
{
|
||||
u32 State;
|
||||
u32 Message;
|
||||
u32 ObjectID; // not a pointer because it can refer to objects outside the current area
|
||||
};
|
||||
|
||||
#endif // SCONNECTION_H
|
||||
32
src/Core/Resource/Script/SLink.h
Normal file
32
src/Core/Resource/Script/SLink.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef SLINK_H
|
||||
#define SLINK_H
|
||||
|
||||
#include <Common/TString.h>
|
||||
#include <Common/types.h>
|
||||
|
||||
struct SState
|
||||
{
|
||||
u32 ID;
|
||||
TString Name;
|
||||
|
||||
SState() {}
|
||||
SState(u32 _ID, const TString& rkName) : ID(_ID), Name(rkName) {}
|
||||
};
|
||||
|
||||
struct SMessage
|
||||
{
|
||||
u32 ID;
|
||||
TString Name;
|
||||
|
||||
SMessage() {}
|
||||
SMessage(u32 _ID, const TString& rkName) : ID(_ID), Name(rkName) {}
|
||||
};
|
||||
|
||||
struct SLink
|
||||
{
|
||||
u32 State;
|
||||
u32 Message;
|
||||
u32 ObjectID; // not a pointer because it can refer to objects outside the current area
|
||||
};
|
||||
|
||||
#endif // SLINK_H
|
||||
Reference in New Issue
Block a user