mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-24 07:05:34 -07:00
Port Quit Fishing At Door and clean up unused stuff
This commit is contained in:
parent
23d6610139
commit
d28cb70984
4 changed files with 26 additions and 23 deletions
26
soh/soh/Enhancements/TimeSavers/QuitFishingAtDoor.cpp
Normal file
26
soh/soh/Enhancements/TimeSavers/QuitFishingAtDoor.cpp
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#include <soh/OTRGlobals.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include <variables.h>
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Port the rest of the behavior for this enhancement here.
|
||||||
|
|
||||||
|
void BuildQuitFishingMessage(uint16_t* textId, bool* loadFromMessageTable) {
|
||||||
|
// TODO: See about loading the vanilla message and manipulating that instead of
|
||||||
|
// a brand new one. Might not be worth it.
|
||||||
|
CustomMessage msg = CustomMessage(
|
||||||
|
"Hey! Hey!&You can't take the rod out of here!&I'm serious!^Do you want to quit?&\x1B&%gYes&No%w",
|
||||||
|
"Hey! Hey!&Du kannst die Angel doch nicht&einfach mitnehmen!&Ganz im Ernst!^Möchtest Du aufhören?&\x1B&%gJa&Nein%w",
|
||||||
|
"Holà! Holà!&Les cannes ne sortent pas d'ici!&Je suis sérieux!^Voulez-vous arrêter?&\x1B&%gOui&Non%w"
|
||||||
|
);
|
||||||
|
msg.AutoFormat();
|
||||||
|
msg.LoadIntoFont();
|
||||||
|
*loadFromMessageTable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QuitFishingAtDoor_Register() {
|
||||||
|
COND_ID_HOOK(OnOpenText, TEXT_FISHERMAN_LEAVE, CVarGetInteger(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 0), BuildQuitFishingMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
RegisterShipInitFunc initFunc(QuitFishingAtDoor_Register, { CVAR_ENHANCEMENT("QuitFishingAtDoor") });
|
|
@ -2130,20 +2130,6 @@ extern "C" void Randomizer_ShowRandomizerMenu() {
|
||||||
SohGui::ShowRandomizerSettingsMenu();
|
SohGui::ShowRandomizerSettingsMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) {
|
|
||||||
MessageContext* msgCtx = &play->msgCtx;
|
|
||||||
uint16_t textId = msgCtx->textId;
|
|
||||||
Font* font = &msgCtx->font;
|
|
||||||
char* buffer = font->msgBuf;
|
|
||||||
const int maxBufferSize = sizeof(font->msgBuf);
|
|
||||||
CustomMessage messageEntry;
|
|
||||||
s16 actorParams = 0;
|
|
||||||
if (textId == TEXT_FISHERMAN_LEAVE && CVarGetInteger(CVAR_ENHANCEMENT("QuitFishingAtDoor"), 0)) {
|
|
||||||
messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, TEXT_FISHERMAN_LEAVE, MF_FORMATTED);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" void Overlay_DisplayText(float duration, const char* text) {
|
extern "C" void Overlay_DisplayText(float duration, const char* text) {
|
||||||
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text);
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->TextDrawNotification(duration, true, text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,6 @@ struct ExtensionEntry {
|
||||||
extern std::unordered_map<std::string, ExtensionEntry> ExtensionCache;
|
extern std::unordered_map<std::string, ExtensionEntry> ExtensionCache;
|
||||||
#include "Enhancements/randomizer/settings.h"
|
#include "Enhancements/randomizer/settings.h"
|
||||||
|
|
||||||
const std::string customMessageTableID = "BaseGameOverrides";
|
|
||||||
const std::string appShortName = "soh";
|
const std::string appShortName = "soh";
|
||||||
|
|
||||||
#ifdef __WIIU__
|
#ifdef __WIIU__
|
||||||
|
@ -149,7 +148,6 @@ uint8_t Randomizer_IsSpoilerLoaded();
|
||||||
void Randomizer_SetSpoilerLoaded(bool spoilerLoaded);
|
void Randomizer_SetSpoilerLoaded(bool spoilerLoaded);
|
||||||
uint8_t Randomizer_GenerateRandomizer();
|
uint8_t Randomizer_GenerateRandomizer();
|
||||||
void Randomizer_ShowRandomizerMenu();
|
void Randomizer_ShowRandomizerMenu();
|
||||||
int CustomMessage_RetrieveIfExists(PlayState* play);
|
|
||||||
void Overlay_DisplayText(float duration, const char* text);
|
void Overlay_DisplayText(float duration, const char* text);
|
||||||
void Overlay_DisplayText_Seconds(int seconds, const char* text);
|
void Overlay_DisplayText_Seconds(int seconds, const char* text);
|
||||||
GetItemEntry ItemTable_Retrieve(int16_t getItemID);
|
GetItemEntry ItemTable_Retrieve(int16_t getItemID);
|
||||||
|
|
|
@ -111,11 +111,4 @@ extern "C" void OTRMessage_Init() {
|
||||||
// Assert staff credits start at the first credits ID
|
// Assert staff credits start at the first credits ID
|
||||||
assert(sStaffMessageEntryTablePtr[0].textId == 0x0500);
|
assert(sStaffMessageEntryTablePtr[0].textId == 0x0500);
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomMessageManager::Instance->AddCustomMessageTable(customMessageTableID);
|
|
||||||
CustomMessageManager::Instance->CreateMessage(
|
|
||||||
customMessageTableID, TEXT_FISHERMAN_LEAVE,
|
|
||||||
CustomMessage("Hey! Hey!&You can't take the rod out of here!&I'm serious!^Do you want to quit?&\x1B&%gYes&No%w",
|
|
||||||
"Hey! Hey!&Du kannst die Angel doch nicht&einfach mitnehmen!&Ganz im Ernst!^Möchtest Du aufhören?&\x1B&%gJa&Nein%w",
|
|
||||||
"Holà! Holà!&Les cannes ne sortent pas d'ici!&Je suis sérieux!^Voulez-vous arrêter?&\x1B&%gOui&Non%w")); //TODO Used AI translation as placeholder
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue