From aafc9d8e84fce2f633e725e2ab607c48374e832e Mon Sep 17 00:00:00 2001 From: OnlyRealNubs <91900600+OnlyRealNubs@users.noreply.github.com> Date: Tue, 31 May 2022 09:28:56 -0400 Subject: [PATCH] Added "Please Wait" effect Shows a busy spinner with a random message and enables script thread block. --- ChaosMod/ChaosMod.vcxproj | 1 + ChaosMod/Effects/db/Misc/MiscPleaseWait.cpp | 50 +++++++++++++++++++++ ConfigApp/Effects.cs | 1 + 3 files changed, 52 insertions(+) create mode 100644 ChaosMod/Effects/db/Misc/MiscPleaseWait.cpp diff --git a/ChaosMod/ChaosMod.vcxproj b/ChaosMod/ChaosMod.vcxproj index c6cc7cdf9..2c79ed986 100644 --- a/ChaosMod/ChaosMod.vcxproj +++ b/ChaosMod/ChaosMod.vcxproj @@ -108,6 +108,7 @@ + diff --git a/ChaosMod/Effects/db/Misc/MiscPleaseWait.cpp b/ChaosMod/Effects/db/Misc/MiscPleaseWait.cpp new file mode 100644 index 000000000..bd3660be7 --- /dev/null +++ b/ChaosMod/Effects/db/Misc/MiscPleaseWait.cpp @@ -0,0 +1,50 @@ +/* + Effect By OnlyRealNubs +*/ + +#include "stdafx.h" + +#include "Memory/Hooks/ScriptThreadRunHook.h" + +// clang-format off +std::vector msgs = +{ + "Gnidaol", + "Loading", + "Please wait...", + "Time Remaining: 6 years", + "Doing Something", + "Be Patient Bro", + "How are you still here?", + "Everyday I'm Buffering", + "Loading Online", + "Redownloading Game", + "Just f**king around", + "Killing you, 1 second at a time" +}; + +static void OnStart() +{ + const char* msg = msgs.at(g_Random.GetRandomInt(0, msgs.size()-1)).c_str(); + BEGIN_TEXT_COMMAND_BUSYSPINNER_ON("STRING"); + ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(msg); + END_TEXT_COMMAND_BUSYSPINNER_ON(g_Random.GetRandomInt(0, 4)); + + Hooks::EnableScriptThreadBlock(); +} + +static void OnStop() +{ + BUSYSPINNER_OFF(); + + Hooks::DisableScriptThreadBlock(); +} + +REGISTER_EFFECT(OnStart, OnStop, nullptr, EffectInfo + { + .Name = "Please Wait", + .Id = "misc_pleasewait", + .IsTimed = true, + .IsShortDuration = true + } +); \ No newline at end of file diff --git a/ConfigApp/Effects.cs b/ConfigApp/Effects.cs index e045e76e7..584b83af3 100644 --- a/ConfigApp/Effects.cs +++ b/ConfigApp/Effects.cs @@ -372,6 +372,7 @@ public enum EffectTimedType { "screen_colorfulworld", new EffectInfo("Colorful World", EffectCategory.Screen, true) }, { "screen_arc", new EffectInfo("Arced Screen", EffectCategory.Screen, true, true) }, { "world_blackhole", new EffectInfo("Black Hole", EffectCategory.Misc, true, true) }, + { "misc_pleasewait", new EffectInfo("Please Wait", EffectCategory.Misc, true, true) }, }; } }