feat(HUD): Added transition info in loading screens (#97)

This commit is contained in:
Yimura 2022-03-08 23:05:31 +01:00 committed by GitHub
parent 63dbd6d13f
commit 2bd0c1f4bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 185 additions and 0 deletions

View File

@ -26,6 +26,11 @@ namespace big
});
}
QUEUE_JOB_BEGIN_CLAUSE()
{
looped::hud_transition_state();
}QUEUE_JOB_END_CLAUSE
QUEUE_JOB_BEGIN_CLAUSE()
{
looped::tunables_disable_phone();

View File

@ -0,0 +1,104 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "script_global.hpp"
// Credits: QuickNET
namespace big
{
constexpr char transition_states[][48] = {
"TRANSITION_STATE_EMPTY",
"Singleplayer Swoop Up",
"Multiplayer Swoop Up",
"Creator Swoop Up",
"Pre-HUD Checks",
"Wait HUD Exit",
"Wait For Summon",
"Singleplayer Swoop Down",
"Multiplayer Swoop Down",
"Cancel Joining",
"Retry Loading",
"Retry Loading Slot 1",
"Retry Loading Slot 2",
"Retry Loading Slot 3",
"Retry Loading Slot 4",
"Wait On Invite",
"Prejoining Freemode Session Checks",
"Look For Fresh Join Freemode",
"Look To Join Another Session Freemode",
"Confirm Freemode Session Joining",
"Wait Join Freemode Session",
"Creation Enter Session",
"Pre-Freemode Launch Script",
"Freemode Teamfull Check",
"Start Freemode Launch Script",
"Freemode Transition Create Player",
"Is Freemode And Transition Ready",
"Freemode Swoop Down",
"Post Bink Video Warp",
"Freemode Final Setup Player",
"Move Freemode To Running State",
"Freemode How To Terminate",
"Start Creator Pre-Launch Script Check",
"Start Creator Launch Script",
"Creator Transition Create Player",
"Is Creator And Transition Ready",
"Creator Swoop Down",
"Creator Final Setup Player",
"Move Creator To Running State",
"Prejoining Testbed Session Checks",
"Look For Fresh Join Testbed",
"Look For Fresh Host Testbed",
"Look To Join Another Session Testbed",
"Look To Host Session Testbed",
"Confirm Testbed Session Joining",
"Wait Join Testbed Session",
"Start Testbed Launch Script",
"Testbed Transition Create Player",
"Is Testbed And Transition Ready",
"Testbed Swoop Down",
"Testbed Final Setup Player",
"Move Testbed To Running State",
"Testbed How To Terminate",
"Quit Current Session Prompt",
"Wait For Transition Session To Setup",
"Terminate Singleplayer",
"Wait Terminate Singleplayer",
"Kick Terminate Session",
"Terminate Session",
"Wait Terminate Session",
"Terminate Session And Hold",
"Terminate Session And Move Into Holding State",
"Team Swapping Checks",
"Return To Singleplayer",
"Wait For Singleplayer To Start",
"Waiting For External Termination Call",
"Terminate Maintransition",
"Wait For Dirty Load Confirm",
"DLC Intro Bink",
};
auto transition_state = script_global(1574980);
eTransitionState last_state = eTransitionState::TRANSITION_STATE_MAX;
void looped::hud_transition_state()
{
const auto state = *transition_state.as<eTransitionState*>();
if (last_state == eTransitionState::TRANSITION_STATE_MAX)
last_state = state;
if (state == eTransitionState::TRANSITION_STATE_EMPTY || state > eTransitionState::TRANSITION_STATE_DLC_INTRO_BINK)
return;
if (last_state == state)
return;
if (HUD::BUSYSPINNER_IS_ON())
HUD::BUSYSPINNER_OFF();
HUD::BEGIN_TEXT_COMMAND_BUSYSPINNER_ON("STRING");
HUD::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(
fmt::format("{} | {}", transition_states[(int)state], state).c_str()
);
HUD::END_TEXT_COMMAND_BUSYSPINNER_ON(5);
last_state = state;
}
}

View File

@ -7,6 +7,8 @@ namespace big
public:
static void api_login_session();
static void hud_transition_state();
static void tunables_disable_phone();
static void tunables_no_idle_kick();

View File

@ -13,6 +13,80 @@ namespace big
VEHICLE_GUN
};
enum class eTransitionState
{
TRANSITION_STATE_EMPTY,
TRANSITION_STATE_SP_SWOOP_UP,
TRANSITION_STATE_MP_SWOOP_UP,
TRANSITION_STATE_CREATOR_SWOOP_UP,
TRANSITION_STATE_PRE_HUD_CHECKS,
TRANSITION_STATE_WAIT_HUD_EXIT,
TRANSITION_STATE_WAIT_FOR_SUMMON,
TRANSITION_STATE_SP_SWOOP_DOWN,
TRANSITION_STATE_MP_SWOOP_DOWN,
TRANSITION_STATE_CANCEL_JOINING,
TRANSITION_STATE_RETRY_LOADING,
TRANSITION_STATE_RETRY_LOADING_SLOT_1,
TRANSITION_STATE_RETRY_LOADING_SLOT_2,
TRANSITION_STATE_RETRY_LOADING_SLOT_3,
TRANSITION_STATE_RETRY_LOADING_SLOT_4,
TRANSITION_STATE_WAIT_ON_INVITE,
TRANSITION_STATE_PREJOINING_FM_SESSION_CHECKS,
TRANSITION_STATE_LOOK_FOR_FRESH_JOIN_FM,
TRANSITION_STATE_LOOK_TO_JOIN_ANOTHER_SESSION_FM,
TRANSITION_STATE_CONFIRM_FM_SESSION_JOINING,
TRANSITION_STATE_WAIT_JOIN_FM_SESSION,
TRANSITION_STATE_CREATION_ENTER_SESSION,
TRANSITION_STATE_PRE_FM_LAUNCH_SCRIPT,
TRANSITION_STATE_FM_TEAMFULL_CHECK,
TRANSITION_STATE_START_FM_LAUNCH_SCRIPT,
TRANSITION_STATE_FM_TRANSITION_CREATE_PLAYER,
TRANSITION_STATE_IS_FM_AND_TRANSITION_READY,
TRANSITION_STATE_FM_SWOOP_DOWN,
TRANSITION_STATE_POST_BINK_VIDEO_WARP,
TRANSITION_STATE_FM_FINAL_SETUP_PLAYER,
TRANSITION_STATE_MOVE_FM_TO_RUNNING_STATE,
TRANSITION_STATE_FM_HOW_TO_TERMINATE,
TRANSITION_STATE_START_CREATOR_PRE_LAUNCH_SCRIPT_CHECK,
TRANSITION_STATE_START_CREATOR_LAUNCH_SCRIPT,
TRANSITION_STATE_CREATOR_TRANSITION_CREATE_PLAYER,
TRANSITION_STATE_IS_CREATOR_AND_TRANSITION_READY,
TRANSITION_STATE_CREATOR_SWOOP_DOWN,
TRANSITION_STATE_CREATOR_FINAL_SETUP_PLAYER,
TRANSITION_STATE_MOVE_CREATOR_TO_RUNNING_STATE,
TRANSITION_STATE_PREJOINING_TESTBED_SESSION_CHECKS,
TRANSITION_STATE_LOOK_FOR_FRESH_JOIN_TESTBED,
TRANSITION_STATE_LOOK_FOR_FRESH_HOST_TESTBED,
TRANSITION_STATE_LOOK_TO_JOIN_ANOTHER_SESSION_TESTBED,
TRANSITION_STATE_LOOK_TO_HOST_SESSION_TESTBED,
TRANSITION_STATE_CONFIRM_TESTBED_SESSION_JOINING,
TRANSITION_STATE_WAIT_JOIN_TESTBED_SESSION,
TRANSITION_STATE_START_TESTBED_LAUNCH_SCRIPT,
TRANSITION_STATE_TESTBED_TRANSITION_CREATE_PLAYER,
TRANSITION_STATE_IS_TESTBED_AND_TRANSITION_READY,
TRANSITION_STATE_TESTBED_SWOOP_DOWN,
TRANSITION_STATE_TESTBED_FINAL_SETUP_PLAYER,
TRANSITION_STATE_MOVE_TESTBED_TO_RUNNING_STATE,
TRANSITION_STATE_TESTBED_HOW_TO_TERMINATE,
TRANSITION_STATE_QUIT_CURRENT_SESSION_PROMPT,
TRANSITION_STATE_WAIT_FOR_TRANSITION_SESSION_TO_SETUP,
TRANSITION_STATE_TERMINATE_SP,
TRANSITION_STATE_WAIT_TERMINATE_SP,
TRANSITION_STATE_KICK_TERMINATE_SESSION,
TRANSITION_STATE_TERMINATE_SESSION,
TRANSITION_STATE_WAIT_TERMINATE_SESSION,
TRANSITION_STATE_TERMINATE_SESSION_AND_HOLD,
TRANSITION_STATE_TERMINATE_SESSION_AND_MOVE_INTO_HOLDING_STATE,
TRANSITION_STATE_TEAM_SWAPPING_CHECKS,
TRANSITION_STATE_RETURN_TO_SINGLEPLAYER,
TRANSITION_STATE_WAIT_FOR_SINGLEPLAYER_TO_START,
TRANSITION_STATE_WAITING_FOR_EXTERNAL_TERMINATION_CALL,
TRANSITION_STATE_TERMINATE_MAINTRANSITION,
TRANSITION_STATE_WAIT_FOR_DIRTY_LOAD_CONFIRM,
TRANSITION_STATE_DLC_INTRO_BINK,
TRANSITION_STATE_MAX = INT_MAX
};
enum eVehicleFlags
{
TRIGGER_SPAWN_TOGGLE = 1 << 0,