mirror of
https://github.com/pret/pokeemerald.git
synced 2026-09-28 04:46:53 -05:00
add auto read signposts
This commit is contained in:
35
src/script.c
35
src/script.c
@@ -3,6 +3,7 @@
|
||||
#include "event_data.h"
|
||||
#include "mevent.h"
|
||||
#include "util.h"
|
||||
#include "field_message_box.h"
|
||||
#include "constants/map_scripts.h"
|
||||
|
||||
#define RAM_SCRIPT_MAGIC 51
|
||||
@@ -19,6 +20,8 @@ static u8 sScriptContext1Status;
|
||||
static struct ScriptContext sScriptContext1;
|
||||
static struct ScriptContext sScriptContext2;
|
||||
static bool8 sScriptContext2Enabled;
|
||||
static u8 sMsgIsSignPost;
|
||||
static u8 sMsgBoxIsCancelable;
|
||||
|
||||
extern ScrCmdFunc gScriptCmdTable[];
|
||||
extern ScrCmdFunc gScriptCmdTableEnd[];
|
||||
@@ -444,3 +447,35 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize)
|
||||
scriptSize = sizeof(gSaveBlock1Ptr->ramScript.data.script);
|
||||
InitRamScript(script, scriptSize, 0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
|
||||
// auto read signposts
|
||||
void SetWalkingIntoSignVars(void)
|
||||
{
|
||||
gWalkAwayFromSignInhibitTimer = 6;
|
||||
sMsgBoxIsCancelable = TRUE;
|
||||
}
|
||||
|
||||
bool32 IsMsgSignPost(void)
|
||||
{
|
||||
return sMsgIsSignPost;
|
||||
}
|
||||
|
||||
void ResetFacingNpcOrSignPostVars(void)
|
||||
{
|
||||
sMsgIsSignPost = FALSE;
|
||||
}
|
||||
|
||||
void MsgSetSignPost(void)
|
||||
{
|
||||
sMsgIsSignPost = TRUE;
|
||||
}
|
||||
|
||||
void ClearMsgBoxCancelableState(void)
|
||||
{
|
||||
sMsgBoxIsCancelable = FALSE;
|
||||
}
|
||||
|
||||
bool32 CanWalkAwayToCancelMsgBox(void)
|
||||
{
|
||||
return sMsgBoxIsCancelable;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user