forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fly from Pokenav #5679
Open
khbsd
wants to merge
11
commits into
rh-hideout:upcoming
Choose a base branch
from
khbsd:pokenav-fly-v2
base: upcoming
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+169
−42
Open
Fly from Pokenav #5679
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0f71be0
clean copy from fly-from-pokenav
khbsd 2616150
code comment edited to describe function better
khbsd c1c6904
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
khbsd f9f99ba
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
khbsd 558b07a
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
khbsd 6ccc803
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
khbsd eac320f
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
khbsd 1556540
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
khbsd e0ba3a3
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
khbsd 991aeff
addressed hedara's comments
khbsd 9c1eed3
added fly prompt in the town map and cleaned up some formatting in po…
khbsd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,8 +2,11 @@ | |||||
#include "bg.h" | ||||||
#include "decompress.h" | ||||||
#include "landmark.h" | ||||||
#include "event_data.h" | ||||||
#include "field_effect.h" | ||||||
#include "main.h" | ||||||
#include "menu.h" | ||||||
#include "overworld.h" | ||||||
#include "palette.h" | ||||||
#include "pokenav.h" | ||||||
#include "region_map.h" | ||||||
|
@@ -73,6 +76,7 @@ static u32 LoopedTask_UpdateInfoAfterCursorMove(s32); | |||||
static u32 LoopedTask_RegionMapZoomOut(s32); | ||||||
static u32 LoopedTask_RegionMapZoomIn(s32); | ||||||
static u32 LoopedTask_ExitRegionMap(s32); | ||||||
static u32 LoopedTask_TreatAsPokeNavFlyMap(s32); | ||||||
|
||||||
extern const u16 gRegionMapCityZoomTiles_Pal[]; | ||||||
extern const u32 gRegionMapCityZoomText_Gfx[]; | ||||||
|
@@ -119,7 +123,8 @@ static const LoopedTask sRegionMapLoopTaskFuncs[] = | |||||
[POKENAV_MAP_FUNC_CURSOR_MOVED] = LoopedTask_UpdateInfoAfterCursorMove, | ||||||
[POKENAV_MAP_FUNC_ZOOM_OUT] = LoopedTask_RegionMapZoomOut, | ||||||
[POKENAV_MAP_FUNC_ZOOM_IN] = LoopedTask_RegionMapZoomIn, | ||||||
[POKENAV_MAP_FUNC_EXIT] = LoopedTask_ExitRegionMap | ||||||
[POKENAV_MAP_FUNC_EXIT] = LoopedTask_ExitRegionMap, | ||||||
[POKENAV_MAP_FUNC_FLY] = LoopedTask_TreatAsPokeNavFlyMap, | ||||||
}; | ||||||
|
||||||
static const struct CompressedSpriteSheet sCityZoomTextSpriteSheet[1] = | ||||||
|
@@ -204,6 +209,8 @@ u32 GetRegionMapCallback(void) | |||||
|
||||||
static u32 HandleRegionMapInput(struct Pokenav_RegionMapMenu *state) | ||||||
{ | ||||||
struct RegionMap* regionMap = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP); | ||||||
|
||||||
switch (DoRegionMapInputCallback()) | ||||||
{ | ||||||
case MAP_INPUT_MOVE_END: | ||||||
|
@@ -215,6 +222,9 @@ static u32 HandleRegionMapInput(struct Pokenav_RegionMapMenu *state) | |||||
case MAP_INPUT_B_BUTTON: | ||||||
state->callback = GetExitRegionMapMenuId; | ||||||
return POKENAV_MAP_FUNC_EXIT; | ||||||
case MAP_INPUT_R_BUTTON: | ||||||
if (regionMap->mapSecType == MAPSECTYPE_CITY_CANFLY && OW_FLAG_POKE_RIDER) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return POKENAV_MAP_FUNC_FLY; | ||||||
} | ||||||
|
||||||
return POKENAV_MAP_FUNC_NONE; | ||||||
|
@@ -365,6 +375,7 @@ static u32 LoopedTask_OpenRegionMap(s32 taskState) | |||||
else | ||||||
menuGfxId = POKENAV_GFX_MAP_MENU_ZOOMED_IN; | ||||||
|
||||||
UpdateRegionMapHelpBarText(); | ||||||
LoadLeftHeaderGfxForIndex(menuGfxId); | ||||||
ShowLeftHeaderGfx(menuGfxId, TRUE, TRUE); | ||||||
PokenavFadeScreen(POKENAV_FADE_FROM_BLACK); | ||||||
|
@@ -385,6 +396,7 @@ static u32 LoopedTask_UpdateInfoAfterCursorMove(s32 taskState) | |||||
{ | ||||||
case 0: | ||||||
UpdateMapSecInfoWindow(state); | ||||||
UpdateRegionMapHelpBarText(); | ||||||
return LT_INC_AND_PAUSE; | ||||||
case 1: | ||||||
if (IsDma3ManagerBusyWithBgCopy_(state)) | ||||||
|
@@ -408,7 +420,7 @@ static u32 LoopedTask_RegionMapZoomOut(s32 taskState) | |||||
if (UpdateRegionMapZoom() || IsChangeBgYForZoomActive()) | ||||||
return LT_PAUSE; | ||||||
|
||||||
PrintHelpBarText(HELPBAR_MAP_ZOOMED_OUT); | ||||||
UpdateRegionMapHelpBarText(); | ||||||
return LT_INC_AND_PAUSE; | ||||||
case 2: | ||||||
if (WaitForHelpBar()) | ||||||
|
@@ -441,7 +453,7 @@ static u32 LoopedTask_RegionMapZoomIn(s32 taskState) | |||||
if (UpdateRegionMapZoom() || IsChangeBgYForZoomActive()) | ||||||
return LT_PAUSE; | ||||||
|
||||||
PrintHelpBarText(HELPBAR_MAP_ZOOMED_IN); | ||||||
UpdateRegionMapHelpBarText(); | ||||||
return LT_INC_AND_PAUSE; | ||||||
case 3: | ||||||
if (WaitForHelpBar()) | ||||||
|
@@ -482,6 +494,23 @@ static u32 LoopedTask_ExitRegionMap(s32 taskState) | |||||
return LT_FINISH; | ||||||
} | ||||||
|
||||||
static u32 LoopedTask_TreatAsPokeNavFlyMap(s32 taskState) | ||||||
{ | ||||||
switch (taskState) | ||||||
{ | ||||||
case 0: | ||||||
PlaySE(SE_SELECT); | ||||||
struct RegionMap* regionMap = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP); | ||||||
SetFlyDestination(regionMap); | ||||||
gSkipShowMonAnim = TRUE; | ||||||
ReturnToFieldFromFlyMapSelect(); | ||||||
|
||||||
return LT_FINISH; | ||||||
} | ||||||
|
||||||
return LT_FINISH; | ||||||
} | ||||||
|
||||||
static void LoadCityZoomViewGfx(void) | ||||||
{ | ||||||
int i; | ||||||
|
@@ -740,3 +769,23 @@ static void SetCityZoomTextInvisibility(bool32 invisible) | |||||
for (i = 0; i < (int)ARRAY_COUNT(state->cityZoomTextSprites); i++) | ||||||
state->cityZoomTextSprites[i]->invisible = invisible; | ||||||
} | ||||||
|
||||||
void UpdateRegionMapHelpBarText(void) | ||||||
{ | ||||||
struct RegionMap* regionMap = GetSubstructPtr(POKENAV_SUBSTRUCT_REGION_MAP); | ||||||
|
||||||
if (regionMap->mapSecType == MAPSECTYPE_CITY_CANFLY && OW_FLAG_POKE_RIDER) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Handling for prevention of flying indoors etc. |
||||||
{ | ||||||
if (IsRegionMapZoomed()) | ||||||
PrintHelpBarText(HELPBAR_MAP_ZOOMED_IN_CANFLY); | ||||||
else | ||||||
PrintHelpBarText(HELPBAR_MAP_ZOOMED_OUT_CANFLY); | ||||||
} | ||||||
else | ||||||
{ | ||||||
if (IsRegionMapZoomed()) | ||||||
PrintHelpBarText(HELPBAR_MAP_ZOOMED_IN); | ||||||
else | ||||||
PrintHelpBarText(HELPBAR_MAP_ZOOMED_OUT); | ||||||
} | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Match previous alignment