feat: Add ability to toggle skipping of cinematics (#1312)

* Cinematics: Add ability to toggle skipping them

* Add docs

* Move sections
This commit is contained in:
David Markowitz 2023-11-21 18:04:44 -08:00 committed by GitHub
parent 1a199151da
commit 9c5388c70e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 2 deletions

View File

@ -166,7 +166,8 @@ enum ePlayerFlag : int32_t {
NJ_LIGHTNING_SPINJITZU = 2031,
NJ_ICE_SPINJITZU = 2032,
NJ_FIRE_SPINJITZU = 2033,
NJ_WU_SHOW_DAILY_CHEST = 2099
NJ_WU_SHOW_DAILY_CHEST = 2099,
DLU_SKIP_CINEMATICS = 1'000'000,
};
#endif //!__EPLAYERFLAG__H__

View File

@ -34,6 +34,8 @@
#include "eMissionTaskType.h"
#include "eReplicaComponentType.h"
#include "eConnectionType.h"
#include "ePlayerFlag.h"
#include "dConfig.h"
using namespace std;
@ -173,6 +175,13 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
GameMessages::SendPlayerReady(entity, sysAddr);
GameMessages::SendPlayerReady(Game::zoneManager->GetZoneControlObject(), sysAddr);
if (Game::config->GetValue("allow_players_to_skip_cinematics") != "1"
|| !entity->GetCharacter()
|| !entity->GetCharacter()->GetPlayerFlag(ePlayerFlag::DLU_SKIP_CINEMATICS)) return;
entity->AddCallbackTimer(0.5f, [entity, sysAddr]() {
if (!entity) return;
GameMessages::SendEndCinematic(entity->GetObjectID(), u"", sysAddr);
});
break;
}

View File

@ -43,6 +43,7 @@
#include "eControlScheme.h"
#include "eStateChangeType.h"
#include "eConnectionType.h"
#include "ePlayerFlag.h"
#include <sstream>
#include <future>
@ -5161,6 +5162,14 @@ void GameMessages::HandleMissionDialogOK(RakNet::BitStream* inStream, Entity* en
} else if (iMissionState == eMissionState::READY_TO_COMPLETE || iMissionState == eMissionState::COMPLETE_READY_TO_COMPLETE) {
missionComponent->CompleteMission(missionID);
}
if (Game::config->GetValue("allow_players_to_skip_cinematics") != "1"
|| !player->GetCharacter()
|| !player->GetCharacter()->GetPlayerFlag(ePlayerFlag::DLU_SKIP_CINEMATICS)) return;
player->AddCallbackTimer(0.5f, [player]() {
if (!player) return;
GameMessages::SendEndCinematic(player->GetObjectID(), u"", player->GetSystemAddress());
});
}
void GameMessages::HandleRequestLinkedMission(RakNet::BitStream* inStream, Entity* entity) {

View File

@ -85,6 +85,7 @@
#include "CDObjectsTable.h"
#include "CDZoneTableTable.h"
#include "ePlayerFlag.h"
void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) {
auto commandCopy = command;
@ -171,6 +172,21 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
return;
}
if (chatCommand == "toggleskipcinematics" && (Game::config->GetValue("allow_players_to_skip_cinematics") == "1" || entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER)) {
auto* character = entity->GetCharacter();
if (!character) return;
bool current = character->GetPlayerFlag(ePlayerFlag::DLU_SKIP_CINEMATICS);
character->SetPlayerFlag(ePlayerFlag::DLU_SKIP_CINEMATICS, !current);
if (!current) {
ChatPackets::SendSystemMessage(sysAddr, u"You have elected to skip cinematics. Note that not all cinematics can be skipped, but most will be skipped now.");
} else {
ChatPackets::SendSystemMessage(sysAddr, u"Cinematics will no longer be skipped.");
}
return;
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//HANDLE ALL NON GM SLASH COMMANDS RIGHT HERE!
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

View File

@ -14,6 +14,8 @@
|resurrect|`/resurrect`|Resurrects the player.||
|requestmailcount|`/requestmailcount`|Sends notification with number of unread messages in the player's mailbox.||
|who|`/who`|Displays in chat all players on the instance.||
|togglenameplate|`/togglenameplate`|Turns the nameplate above your head that is visible to other players off and on.|8 or if `allow_nameplate_off` is set to exactly `1` in the settings|
|toggleskipcinematics|`/toggleskipcinematics`|Skips mission and world load related cinematics.|8 or if `allow_players_to_skip_cinematics` is set to exactly `1` in the settings then 0|
## Moderation Commands
@ -49,7 +51,6 @@ These commands are primarily for development and testing. The usage of many of t
|Command|Usage|Description|Admin Level Requirement|
|--- |--- |--- |--- |
|togglenameplate|`/togglenameplate`|Turns the nameplate above your head that is visible to other players off and on.|8 or if `allow_nameplate_off` is set to exactly `1` in the settings|
|fix-stats|`/fix-stats`|Resets skills, buffs, and destroyables.||
|join|`/join <password>`|Joins a private zone with given password.||
|leave-zone|`/leave-zone`|If you are in an instanced zone, transfers you to the closest main world. For example, if you are in an instance of Avant Gardens Survival or the Spider Queen Battle, you are sent to Avant Gardens. If you are in the Battle of Nimbus Station, you are sent to Nimbus Station.||

View File

@ -61,6 +61,7 @@ allow_nameplate_off=0
# Turn logging of IP addresses for anti-cheat reporting on (1) or off(0)
log_ip_addresses_for_anti_cheat=1
# These are the 5 items items that are shown in the "Help" menu in-game along with their coresponding descriptions below.
help_0_summary=Got an issue?
help_1_summary=Stuck loading?
help_2_summary=Missing features?
@ -72,3 +73,6 @@ help_1_description=Try switching networks, using a VPN, or using your phone's ho
help_2_description=While DarkflameServer is a mostly complete emulator, there are still some features that aren't implemented. You can track these on the GitHub issues page.<br/><br/>
help_3_description=Skill issue!<br/><br/>
help_4_description=Visit Discussions on the DarkflameServer GitHub page<br/>to ask questions and collaborate with other devs!<br/><br/>
# Toggleable quality of life feature to allow users to skip most cinematics.
allow_players_to_skip_cinematics=0