Skip to content

Commit

Permalink
Merge branch 'bw_summary_screen_expansion' of https://github.com/rave…
Browse files Browse the repository at this point in the history
…possum/pokeemerald-expansion into bw_summary_screen
  • Loading branch information
ravepossum committed May 8, 2024
2 parents 13c3787 + 880cee9 commit 0afb193
Show file tree
Hide file tree
Showing 59 changed files with 5,457 additions and 23 deletions.
35 changes: 32 additions & 3 deletions gflib/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static u16 FontFunc_ShortCopy2(struct TextPrinter *);
static u16 FontFunc_ShortCopy3(struct TextPrinter *);
static u16 FontFunc_Narrow(struct TextPrinter *);
static u16 FontFunc_SmallNarrow(struct TextPrinter *);
static u16 FontFunc_BW_Summary_Screen(struct TextPrinter *);
static void DecompressGlyph_Small(u16, bool32);
static void DecompressGlyph_Normal(u16, bool32);
static void DecompressGlyph_Short(u16, bool32);
Expand Down Expand Up @@ -89,7 +90,8 @@ static const struct GlyphWidthFunc sGlyphWidthFuncs[] =
{ FONT_SHORT_COPY_3, GetGlyphWidth_Short },
{ FONT_BRAILLE, GetGlyphWidth_Braille },
{ FONT_NARROW, GetGlyphWidth_Narrow },
{ FONT_SMALL_NARROW, GetGlyphWidth_SmallNarrow }
{ FONT_SMALL_NARROW, GetGlyphWidth_SmallNarrow },
{ FONT_BW_SUMMARY_SCREEN, GetGlyphWidth_Short },
};

struct
Expand Down Expand Up @@ -217,7 +219,17 @@ static const struct FontInfo sFontInfos[] =
.fgColor = 1,
.bgColor = 2,
.shadowColor = 15,
}
},
[FONT_BW_SUMMARY_SCREEN] = {
.fontFunction = FontFunc_BW_Summary_Screen,
.maxLetterWidth = 6,
.maxLetterHeight = 14,
.letterSpacing = 0,
.lineSpacing = 0,
.fgColor = 2,
.bgColor = 1,
.shadowColor = 3,
},
};

static const u8 sMenuCursorDimensions[][2] =
Expand All @@ -231,7 +243,8 @@ static const u8 sMenuCursorDimensions[][2] =
[FONT_BRAILLE] = { 8, 16 },
[FONT_NARROW] = { 8, 15 },
[FONT_SMALL_NARROW] = { 8, 8 },
[FONT_BOLD] = {}
[FONT_BOLD] = {},
[FONT_BW_SUMMARY_SCREEN] = { 8, 14 },
};

static const u16 sFontBoldJapaneseGlyphs[] = INCBIN_U16("graphics/fonts/bold.hwjpnfont");
Expand Down Expand Up @@ -813,6 +826,19 @@ static u16 FontFunc_SmallNarrow(struct TextPrinter *textPrinter)
return RenderText(textPrinter);
}

static u16 FontFunc_BW_Summary_Screen(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);

if (subStruct->hasFontIdBeenSet == FALSE)
{
subStruct->fontId = FONT_BW_SUMMARY_SCREEN;
subStruct->hasFontIdBeenSet = TRUE;
}
return RenderText(textPrinter);
}


void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
Expand Down Expand Up @@ -1058,6 +1084,8 @@ static u16 RenderText(struct TextPrinter *textPrinter)
case CHAR_NEWLINE:
textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x;
textPrinter->printerTemplate.currentY += (gFonts[textPrinter->printerTemplate.fontId].maxLetterHeight + textPrinter->printerTemplate.lineSpacing);
if (subStruct->fontId == FONT_BW_SUMMARY_SCREEN)
textPrinter->printerTemplate.currentY -= 2;
return RENDER_REPEAT;
case PLACEHOLDER_BEGIN:
textPrinter->printerTemplate.currentChar++;
Expand Down Expand Up @@ -1262,6 +1290,7 @@ static u16 RenderText(struct TextPrinter *textPrinter)
case FONT_SHORT_COPY_1:
case FONT_SHORT_COPY_2:
case FONT_SHORT_COPY_3:
case FONT_BW_SUMMARY_SCREEN:
DecompressGlyph_Short(currChar, textPrinter->japanese);
break;
case FONT_NARROW:
Expand Down
1 change: 1 addition & 0 deletions gflib/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enum {
FONT_NARROW,
FONT_SMALL_NARROW, // Very similar to FONT_SMALL, some glyphs are narrower
FONT_BOLD, // JP glyph set only
FONT_BW_SUMMARY_SCREEN,
};

// Return values for font functions
Expand Down
Binary file added graphics/summary_screen/bw/a_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/summary_screen/bw/b_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/summary_screen/bw/category_icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/summary_screen/bw/effect_battle.bin
Binary file not shown.
Binary file added graphics/summary_screen/bw/effect_contest.bin
Binary file not shown.
Binary file added graphics/summary_screen/bw/heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions graphics/summary_screen/bw/markings.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
117 244 190
164 148 222
172 156 238
255 255 255
205 205 205
251 56 56
240 128 168
168 48 104
248 168 208
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
19 changes: 19 additions & 0 deletions graphics/summary_screen/bw/move_select.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
128 120 160
16 148 132
41 222 189
156 156 156
206 206 206
198 255 247
255 255 255
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
Binary file added graphics/summary_screen/bw/move_select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added graphics/summary_screen/bw/page_info.bin
Binary file not shown.
Binary file added graphics/summary_screen/bw/page_info_egg.bin
Binary file not shown.
Binary file added graphics/summary_screen/bw/page_skills.bin
Binary file not shown.
Binary file added graphics/summary_screen/bw/pokerus_cured_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/summary_screen/bw/shiny_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/summary_screen/bw/stat_grades.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions graphics/summary_screen/bw/text_pp.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
255 238 23
121 117 69
255 145 28
126 93 60
255 73 52
107 78 69
222 222 222
74 74 74
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
Binary file added graphics/summary_screen/bw/tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/bug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/contest_beauty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/contest_cool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/contest_cute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/contest_smart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/contest_tough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/dragon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/electric.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/fairy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/fight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/fire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/flying.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/ghost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/grass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/ground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added graphics/types_bw/ice.png
19 changes: 19 additions & 0 deletions graphics/types_bw/move_types_bw_1.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 213 49
246 131 49
197 49 41
230 197 106
189 164 57
139 106 49
255 255 123
172 172 123
222 222 197
115 90 74
74 65 57
189 189 213
0 0 0
74 74 74
255 255 255
19 changes: 19 additions & 0 deletions graphics/types_bw/move_types_bw_2.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
205 197 255
172 148 246
115 90 156
106 148 246
156 222 222
213 255 238
74 57 82
255 90 139
255 197 180
148 98 98
164 65 164
222 131 189
148 148 164
74 74 74
255 255 255
19 changes: 19 additions & 0 deletions graphics/types_bw/move_types_bw_3.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
197 255 98
123 205 82
90 131 65
115 57 255
74 57 148
189 164 255
172 189 32
222 230 49
123 148 16
106 164 148
115 205 180
32 106 98
0 0 0
74 74 74
255 255 255
Binary file added graphics/types_bw/mystery.png
Binary file added graphics/types_bw/normal.png
Binary file added graphics/types_bw/poison.png
Binary file added graphics/types_bw/psychic.png
Binary file added graphics/types_bw/rock.png
Binary file added graphics/types_bw/steel.png
Binary file added graphics/types_bw/water.png
9 changes: 9 additions & 0 deletions graphics_file_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BATINTGFXDIR := graphics/battle_interface
MASKSGFXDIR := graphics/battle_anims/masks
BATTRANSGFXDIR := graphics/battle_transitions
TYPESGFXDIR := graphics/types
TYPESBWGFXDIR := graphics/types_bw
RAYQUAZAGFXDIR := graphics/rayquaza_scene
ROULETTEGFXDIR := graphics/roulette
SLOTMACHINEGFXDIR := graphics/slot_machine
Expand Down Expand Up @@ -372,6 +373,14 @@ $(TYPESGFXDIR)/move_types.gbapal: $(TYPESGFXDIR)/move_types_1.gbapal \
$(TYPESGFXDIR)/move_types_3.gbapal
@cat $^ >$@

$(TYPESBWGFXDIR)/move_types_bw.4bpp: $(types:%=$(TYPESBWGFXDIR)/%.4bpp) $(contest_types:%=$(TYPESBWGFXDIR)/contest_%.4bpp)
@cat $^ >$@

$(TYPESBWGFXDIR)/move_types_bw.gbapal: $(TYPESBWGFXDIR)/move_types_bw_1.gbapal \
$(TYPESBWGFXDIR)/move_types_bw_2.gbapal \
$(TYPESBWGFXDIR)/move_types_bw_3.gbapal
@cat $^ >$@

graphics/bag/menu.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 53 -Wnum_tiles

Expand Down
47 changes: 47 additions & 0 deletions include/bw_summary_screen.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#ifndef GUARD_BW_SUMMARY_SCREEN_H
#define GUARD_BW_SUMMARY_SCREEN_H

#include "main.h"

// turn on and off the bw summary screen
#define BW_SUMMARY_SCREEN TRUE

// constants
#define BW_MAX_MOVE_DESCRIPTION_LENGTH 60 // this only needs to be updated if you use auto-formatting
#define BW_IV_EV_HIDDEN 0 // don't show IVs and EVs
#define BW_IV_EV_GRADED 1 // show graded values for IVs and EVs
#define BW_IV_EV_PRECISE 2 // show precise values for IVs and EVs

// configs
#define BW_SUMMARY_AUTO_FORMAT_MOVE_DESCRIPTIONS TRUE // automatically formats move descriptions to fit the new box size. disable if you want to format them manually
#define BW_SUMMARY_NATURE_COLORS FALSE // color stats increased or reduced by nature, red = boosted, blue = reduced
#define BW_SUMMARY_NATURE_ARROWS TRUE // arrows to show stats increased or reduced by nature
#define BW_SUMMARY_CATEGORY_ICONS TRUE // determines whether category (split) icons are shown or not
#define BW_SUMMARY_IV_EV_DISPLAY BW_IV_EV_GRADED // determines how to show IVs and EVs
#define BW_SUMMARY_DECAP TRUE // indicates if summary screen-specific strings should be decapitalized
#define BW_SUMMARY_SHOW_FRIENDSHIP TRUE // show a heart that fills up to indicate friendship value
#define BW_SUMMARY_BW_TYPE_ICONS TRUE // use Gen 5 style type icons instead of the default ones.
// out of the box the vanilla icons don't fit well, this is mostly a compatibility
// option for people who already use custom icons everywhere else

//ravetodo
// - hidden power
// - extended move desc window

void ShowPokemonSummaryScreen_BW(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void));
void ShowSelectMovePokemonSummaryScreen_BW(struct Pokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void), u16 newMove);
void ShowPokemonSummaryScreenHandleDeoxys_BW(u8 mode, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void));
u8 GetMoveSlotToReplace_BW(void);
void SummaryScreen_SetAnimDelayTaskId_BW(u8 taskId);

// The Pokémon Summary Screen can operate in different modes. Certain features,
// such as move re-ordering, are available in the different modes.
enum PokemonSummaryScreenMode_BW
{
BW_SUMMARY_MODE_NORMAL,
BW_SUMMARY_MODE_LOCK_MOVES,
BW_SUMMARY_MODE_BOX,
BW_SUMMARY_MODE_SELECT_MOVE,
};

#endif // GUARD_BW_SUMMARY_SCREEN_H
12 changes: 10 additions & 2 deletions src/battle_factory_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "battle.h"
#include "battle_factory_screen.h"
#include "battle_factory.h"
#include "bw_summary_screen.h"
#include "sprite.h"
#include "event_data.h"
#include "overworld.h"
Expand Down Expand Up @@ -1487,7 +1488,11 @@ static void Select_Task_OpenSummaryScreen(u8 taskId)
sFactorySelectMons = AllocZeroed(sizeof(struct Pokemon) * SELECTABLE_MONS_COUNT);
for (i = 0; i < SELECTABLE_MONS_COUNT; i++)
sFactorySelectMons[i] = sFactorySelectScreen->mons[i].monData;
ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, sFactorySelectMons, currMonId, SELECTABLE_MONS_COUNT - 1, CB2_InitSelectScreen);

if (BW_SUMMARY_SCREEN)
ShowPokemonSummaryScreen_BW(SUMMARY_MODE_LOCK_MOVES, sFactorySelectMons, currMonId, SELECTABLE_MONS_COUNT - 1, CB2_InitSelectScreen);
else
ShowPokemonSummaryScreen(SUMMARY_MODE_LOCK_MOVES, sFactorySelectMons, currMonId, SELECTABLE_MONS_COUNT - 1, CB2_InitSelectScreen);
break;
}
}
Expand Down Expand Up @@ -2402,7 +2407,10 @@ static void Swap_Task_OpenSummaryScreen(u8 taskId)
DestroyTask(taskId);
sFactorySwapScreen->fromSummaryScreen = TRUE;
sFactorySwapScreen->speciesNameColorBackup = gPlttBufferUnfaded[BG_PLTT_ID(PALNUM_TEXT) + 4];
ShowPokemonSummaryScreen(SUMMARY_MODE_NORMAL, gPlayerParty, sFactorySwapScreen->cursorPos, FRONTIER_PARTY_SIZE - 1, CB2_InitSwapScreen);
if (BW_SUMMARY_SCREEN)
ShowPokemonSummaryScreen_BW(SUMMARY_MODE_NORMAL, gPlayerParty, sFactorySwapScreen->cursorPos, FRONTIER_PARTY_SIZE - 1, CB2_InitSwapScreen);
else
ShowPokemonSummaryScreen(SUMMARY_MODE_NORMAL, gPlayerParty, sFactorySwapScreen->cursorPos, FRONTIER_PARTY_SIZE - 1, CB2_InitSwapScreen);
break;
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "battle_ai_util.h"
#include "battle_scripts.h"
#include "battle_z_move.h"
#include "bw_summary_screen.h"
#include "constants/moves.h"
#include "constants/abilities.h"
#include "item.h"
Expand Down Expand Up @@ -7450,7 +7451,11 @@ static void Cmd_yesnoboxlearnmove(void)
if (!gPaletteFade.active)
{
FreeAllWindowBuffers();
ShowSelectMovePokemonSummaryScreen(gPlayerParty, gBattleStruct->expGetterMonId, gPlayerPartyCount - 1, ReshowBattleScreenAfterMenu, gMoveToLearn);
if (BW_SUMMARY_SCREEN)
ShowSelectMovePokemonSummaryScreen_BW(gPlayerParty, gBattleStruct->expGetterMonId, gPlayerPartyCount - 1, ReshowBattleScreenAfterMenu, gMoveToLearn);
else
ShowSelectMovePokemonSummaryScreen(gPlayerParty, gBattleStruct->expGetterMonId, gPlayerPartyCount - 1, ReshowBattleScreenAfterMenu, gMoveToLearn);

gBattleScripting.learnMoveState++;
}
break;
Expand Down
Loading

0 comments on commit 0afb193

Please sign in to comment.