persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
IwatodaiStreetsView.cpp
Go to the documentation of this file.
2#include "data/audioDb.hpp"
5#include "events/UIEvents.hpp"
7
17
23
25{
26 // start battle
27 musicCmpt->stopMusic();
28 BattleSystem::getInstance().setMusicComponent(musicCmpt);
30 ae::broadcastEvent(msg);
31}
32
34{
36 camConfig.initialAngle = ae::q20_12_t{1.5708 * 2};
37 camConfig.distance = ae::q20_12_t{1};
38 camConfig.height = height + ae::q20_12_t{0.6};
39 camConfig.lookAhead = ae::q20_12_t{0.2};
40 camConfig.angleIncrement = ae::q20_12_t{0.05};
41 camConfig.isRotationLocked = true;
42}
43
45{
46 movement->configureMovement(MovementConfig(IWATODAI_STREETS_MAP_WIDTH,
47 IWATODAI_STREETS_MAP_HEIGHT,
48 &iwatodai_streets_map[0][0],
50 dbEntry->worldOffsetX,
51 dbEntry->worldOffsetZ,
53 speed,
54 height,
57}
58
63
65{
66 switch (tile)
67 {
69 {
70 musicCmpt->pauseMusic();
72 }
73
75 {
76 musicCmpt->pauseMusic();
78 }
79
81 {
82 musicCmpt->pauseMusic();
83 return ViewState::STATION;
84 }
85
86 case TileType::SHD_W:
87 {
88 if (!promptDrawn)
89 {
90 menuHUDScreen->setTextContent("\xFF\x02\x01 Battle Zone", TextColor::DualGreen);
91 promptDrawn = true;
92 }
93 if (pressed & KEY_A)
94 {
97 }
98
99 break;
100 }
101
102 default:
103 {
104 if (promptDrawn)
105 {
106 menuHUDScreen->setTextContent("Streets", TextColor::White);
107 promptDrawn = false;
108 }
109 break;
110 }
111 }
112
114}
115
121
123{
125
128 setupMenuHUD("Streets");
129
130 std::array<UIScreen*, 5> screens = {menuHUDScreen, pauseMenuScreen};
131 std::array<UIMenu*, 10> menus = {pauseMenuCmpt, battleMenuCmpt};
132
133 ae::broadcastEvent(Event::ConfigureUIScreen{bgSub, bgMain, &oamSub, &oamMain, screens});
134 ae::broadcastEvent(Event::ConfigureUIMenu{textSub, menus});
135}
Events for BattleSystem.
System for managing battle logic & states.
Generic events used across multiple systems.
TileType
ViewState
Definition StateTypes.hpp:4
@ DualGreen
Definition TextTypes.hpp:15
@ White
Definition TextTypes.hpp:14
Events for UISystem.
static BattleMenu * getInstance()
std::array< int, 2 > bgMain
MenuHUDScreen * menuHUDScreen
MusicComponent * musicCmpt
const EnvironmentDbEntry * dbEntry
MovementComponent * movement
Event::ConfigureCamera camConfig
uint16_t * textVideoBuffer
std::array< int, 3 > bgSub
const ae::q20_12_t tileSize
void setupPauseMenu()
Sets up the pause menu.
uint16_t * textVideoBufferSub
PauseMenu * pauseMenuCmpt
TextComponent * text
void setupMenuHUD(const std::string &location)
Sets up the menu HUD.
BattleMenu * battleMenuCmpt
TextComponent * textSub
PauseMenuScreen * pauseMenuScreen
const ae::q20_12_t speed
const Point2D< ae::q20_12_t > characterSize
const ae::q20_12_t characterFacingAngle
void setupMovement() override
const ae::q20_12_t height
etl::vector< CharacterProfile, 4 > characterProfiles
BattleStartCondition battleStartCondition
const Point2D< ae::q20_12_t > characterTranslate
etl::vector< EnemyProfile, 8 > enemyProfiles
ViewState onTileCheck(TileType tile, u32 pressed) override
static CharacterProfile player
static CharacterProfile junpei
static CharacterProfile yukari
static EnemyProfile cowardlyMaya
static EnemyProfile mercilessMaya
All parameters needed to configure UIMenus.
Definition UIEvents.hpp:52
All parameters needed to configure UIScreens.
Definition UIEvents.hpp:22
Event payload to start the BattleSystem.
A struct that holds initial config values for the MovementComponent.
A struct that holds initial config values for the TextComponent.