Implement some more trigger event calls and command handlers (#989)

* Implement some trigger event calls
and command handlers

* add zone summary dimissed GM

* break and remove log

* some cleanup in Gather Targets
and blocking out

* fix default value of unlock for play cinematic

* Log on errors
add enum for physics effect type
simplify nipoint3 logic
check arg count
add enum for End behavior

* tryparse for nipoint3

* totally didn't forget to include it

* bleh c++ is blah

* ???

* address feedback

* Fix for #1028
This commit is contained in:
Aaron Kimbrell
2023-03-25 05:26:39 -05:00
committed by GitHub
parent 72ca0f13ff
commit c415d0520a
32 changed files with 461 additions and 152 deletions

View File

@@ -319,3 +319,7 @@ std::vector<std::string> GeneralUtils::GetSqlFileNamesFromFolder(const std::stri
return sortedFiles;
}
bool GeneralUtils::TryParse(const std::string& x, const std::string& y, const std::string& z, NiPoint3& dst) {
return TryParse<float>(x.c_str(), dst.x) && TryParse<float>(y.c_str(), dst.y) && TryParse<float>(z.c_str(), dst.z);
}

View File

@@ -10,6 +10,7 @@
#include <type_traits>
#include <stdexcept>
#include <BitStream.h>
#include "NiPoint3.h"
#include "Game.h"
#include "dLogger.h"
@@ -208,6 +209,8 @@ namespace GeneralUtils {
return TryParse<T>(value.c_str(), dst);
}
bool TryParse(const std::string& x, const std::string& y, const std::string& z, NiPoint3& dst);
template<typename T>
std::u16string to_u16string(T value) {
return GeneralUtils::ASCIIToUTF16(std::to_string(value));

View File

@@ -128,6 +128,12 @@ NiPoint3 NiPoint3::operator+(const NiPoint3& point) const {
return NiPoint3(this->x + point.x, this->y + point.y, this->z + point.z);
}
//! Operator for addition of vectors
NiPoint3 NiPoint3::operator+=(const NiPoint3& point) const {
return NiPoint3(this->x + point.x, this->y + point.y, this->z + point.z);
}
//! Operator for subtraction of vectors
NiPoint3 NiPoint3::operator-(const NiPoint3& point) const {
return NiPoint3(this->x - point.x, this->y - point.y, this->z - point.z);

View File

@@ -135,6 +135,9 @@ public:
//! Operator for addition of vectors
NiPoint3 operator+(const NiPoint3& point) const;
//! Operator for addition of vectors
NiPoint3 operator+=(const NiPoint3& point) const;
//! Operator for subtraction of vectors
NiPoint3 operator-(const NiPoint3& point) const;

View File

@@ -445,6 +445,7 @@ enum GAME_MSG : unsigned short {
GAME_MSG_BBB_SAVE_RESPONSE = 1006,
GAME_MSG_NOTIFY_CLIENT_OBJECT = 1042,
GAME_MSG_DISPLAY_ZONE_SUMMARY = 1043,
GAME_MSG_ZONE_SUMMARY_DISMISSED = 1044,
GAME_MSG_ACTIVITY_STATE_CHANGE_REQUEST = 1053,
GAME_MSG_MODIFY_PLAYER_ZONE_STATISTIC = 1046,
GAME_MSG_START_BUILDING_WITH_ITEM = 1057,

View File

@@ -0,0 +1,11 @@
#ifndef __EENDBEHAVIOR__H__
#define __EENDBEHAVIOR__H__
#include <cstdint>
enum class eEndBehavior : uint32_t {
RETURN,
WAIT
};
#endif //!__EENDBEHAVIOR__H__

View File

@@ -0,0 +1,15 @@
#ifndef __EPHYSICSEFFECTTYPE__H__
#define __EPHYSICSEFFECTTYPE__H__
#include <cstdint>
enum class ePhysicsEffectType : uint32_t {
PUSH,
ATTRACT,
REPULSE,
GRAVITY_SCALE,
FRICTION
};
#endif //!__EPHYSICSEFFECTTYPE__H__

View File

@@ -35,7 +35,7 @@ public:
{"OnTimerDone", eTriggerEventType::TIMER_DONE},
{"OnRebuildComplete", eTriggerEventType::REBUILD_COMPLETE},
{"OnActivated", eTriggerEventType::ACTIVATED},
{"OnDeactivated", eTriggerEventType::DEACTIVATED},
{"OnDectivated", eTriggerEventType::DEACTIVATED}, // Dectivated vs Deactivated
{"OnArrived", eTriggerEventType::ARRIVED},
{"OnArrivedAtEndOfPath", eTriggerEventType::ARRIVED_AT_END_OF_PATH},
{"OnZoneSummaryDismissed", eTriggerEventType::ZONE_SUMMARY_DISMISSED},