mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-11-19 08:32:26 +00:00
add resetting
This commit is contained in:
@@ -93,6 +93,12 @@ void PropertyBehavior::HandleMsg(GameMessages::RequestUse& msg) {
|
||||
m_States[m_ActiveState].HandleMsg(msg);
|
||||
}
|
||||
|
||||
template<>
|
||||
void PropertyBehavior::HandleMsg(GameMessages::ResetModelToDefaults& msg) {
|
||||
m_ActiveState = BehaviorState::HOME_STATE;
|
||||
for (auto& state : m_States | std::views::values) state.HandleMsg(msg);
|
||||
}
|
||||
|
||||
void PropertyBehavior::SendBehaviorListToClient(AMFArrayValue& args) const {
|
||||
args.Insert("id", std::to_string(m_BehaviorId));
|
||||
args.Insert("name", m_Name);
|
||||
|
||||
@@ -122,6 +122,11 @@ void State::HandleMsg(GameMessages::RequestUse& msg) {
|
||||
for (auto& strip : m_Strips) strip.HandleMsg(msg);
|
||||
}
|
||||
|
||||
template<>
|
||||
void State::HandleMsg(GameMessages::ResetModelToDefaults& msg) {
|
||||
for (auto& strip : m_Strips) strip.HandleMsg(msg);
|
||||
}
|
||||
|
||||
bool State::IsEmpty() const {
|
||||
for (const auto& strip : m_Strips) {
|
||||
if (!strip.IsEmpty()) return false;
|
||||
|
||||
@@ -88,6 +88,13 @@ void Strip::HandleMsg(GameMessages::RequestUse& msg) {
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
void Strip::HandleMsg(GameMessages::ResetModelToDefaults& msg) {
|
||||
m_WaitingForAction = false;
|
||||
m_PausedTime = 0.0f;
|
||||
m_NextActionIndex = 0;
|
||||
}
|
||||
|
||||
void Strip::IncrementAction() {
|
||||
if (m_Actions.empty()) return;
|
||||
m_NextActionIndex++;
|
||||
|
||||
Reference in New Issue
Block a user