mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-05 14:58:27 +00:00
feat: add saving behaviors to the inventory (#1822)
* change behavior id to LWOOBJID Convert behavior ID to LWOOBJID length missed header fix sqlite field names sqlite brother * feat: add saving behaviors to the inventory consolidate copied code consolidate copied code Update ModelComponent.cpp remove ability to save loot behaviors
This commit is contained in:
@@ -10,6 +10,7 @@ namespace tinyxml2 {
|
||||
enum class BehaviorState : uint32_t;
|
||||
|
||||
class AMFArrayValue;
|
||||
class BehaviorMessageBase;
|
||||
class ModelComponent;
|
||||
|
||||
/**
|
||||
@@ -17,7 +18,7 @@ class ModelComponent;
|
||||
*/
|
||||
class PropertyBehavior {
|
||||
public:
|
||||
PropertyBehavior();
|
||||
PropertyBehavior(bool _isTemplated = false);
|
||||
|
||||
template <typename Msg>
|
||||
void HandleMsg(Msg& msg);
|
||||
@@ -26,10 +27,16 @@ public:
|
||||
void VerifyLastEditedState();
|
||||
void SendBehaviorListToClient(AMFArrayValue& args) const;
|
||||
void SendBehaviorBlocksToClient(AMFArrayValue& args) const;
|
||||
void CheckModifyState(BehaviorMessageBase& msg);
|
||||
|
||||
[[nodiscard]] LWOOBJID GetBehaviorId() const noexcept { return m_BehaviorId; }
|
||||
void SetBehaviorId(LWOOBJID id) noexcept { m_BehaviorId = id; }
|
||||
|
||||
bool GetIsLoot() const noexcept { return isLoot; }
|
||||
void SetIsLoot(const bool val) noexcept { isLoot = val; }
|
||||
|
||||
const std::string& GetName() const noexcept { return m_Name; }
|
||||
|
||||
void Serialize(tinyxml2::XMLElement& behavior) const;
|
||||
void Deserialize(const tinyxml2::XMLElement& behavior);
|
||||
|
||||
@@ -52,6 +59,9 @@ private:
|
||||
// Whether this behavior is custom or pre-fab.
|
||||
bool isLoot = false;
|
||||
|
||||
// Whether or not the behavior has been modified from its original state.
|
||||
bool isTemplated;
|
||||
|
||||
// The last state that was edited. This is used so when the client re-opens the behavior editor, it will open to the last edited state.
|
||||
// If the last edited state has no strips, it will open to the first state that has strips.
|
||||
BehaviorState m_LastEditedState;
|
||||
|
Reference in New Issue
Block a user