persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
IwatodaiDormView.cpp
Go to the documentation of this file.
2#include "events/UIEvents.hpp"
4
5#include "data/audioDb.hpp"
8#include "maps/iwatodai_dorm_floor_1.hpp"
9
13
15{
17 camConfig.initialAngle = ae::q20_12_t{-1.6};
18 camConfig.distance = ae::q20_12_t{0.8};
19 camConfig.height = height + ae::q20_12_t{0.6};
20 camConfig.lookAhead = ae::q20_12_t{0.2};
21 camConfig.angleIncrement = ae::q20_12_t{0.07};
22 camConfig.isRotationLocked = true;
23}
24
30{
31 //first flight, including its initial bend
32 static const StairSegment stairs[] = {{ae::q20_12_t{0},
33 ae::q20_12_t{-2.872},
34 ae::q20_12_t{-0.897},
35 ae::q20_12_t{-3.051},
36 ae::q20_12_t{0.24},
37 ae::q20_12_t{0},
38 ae::q20_12_t{0.157}},
39
40 {ae::q20_12_t{-0.897},
41 ae::q20_12_t{-3.051},
42 ae::q20_12_t{-1.526},
43 ae::q20_12_t{-3.051},
44 ae::q20_12_t{0.27},
45 ae::q20_12_t{0.157},
46 ae::q20_12_t{0.503}},
47
48 //second flight, after the landing
49 {ae::q20_12_t{-1.840},
50 ae::q20_12_t{-2.782},
51 ae::q20_12_t{-1.840},
52 ae::q20_12_t{-1.885},
53 ae::q20_12_t{0.28},
54 ae::q20_12_t{0.503},
55 ae::q20_12_t{1.041}}};
56 //landing between the two flights
57 static const HeightRegion landings[] = {
58
59 {ae::q20_12_t{-2.154}, ae::q20_12_t{-1.526}, ae::q20_12_t{-3.410}, ae::q20_12_t{-2.782}, ae::q20_12_t{0.503}}};
60 MovementConfig cfg(IWATODAI_DORM_FLOOR_1_MAP_WIDTH,
61 IWATODAI_DORM_FLOOR_1_MAP_HEIGHT,
62 &iwatodai_dorm_floor_1_map[0][0],
64 dbEntry->worldOffsetX,
65 dbEntry->worldOffsetZ,
67 speed,
68 height,
71
72 cfg.stairs = stairs;
73 cfg.stairCount = 3;
74
75 cfg.landings = landings;
76 cfg.landingCount = 1;
77
78 movement->configureMovement(cfg);
79}
80
82{
83 switch (tile)
84 {
86 {
88 }
89
91 {
93 }
94
95 case TileType::C_AK:
96 {
97 // start dialogue
98 if (!promptDrawn)
99 {
100 menuHUDScreen->setTextContent("\xFF\x02\x01Talk", TextColor::DualGreen);
101 promptDrawn = true;
102 }
103 if (pressed & KEY_A)
104 {
105 prevEnvironmentState = false;
107 }
108 break;
109 }
110
111 default:
112 {
113 if (promptDrawn)
114 {
115 menuHUDScreen->setTextContent("Dorm", TextColor::White);
116 promptDrawn = false;
117 }
118 break;
119 }
120 }
122}
123
129
136
138{
140 setupMenuHUD("Dorm");
141
143
144 std::array<UIScreen*, 5> screens = {menuHUDScreen, dialogueScreen, pauseMenuScreen};
145 std::array<UIMenu*, 10> menus = {pauseMenuCmpt};
146
147 ae::broadcastEvent(Event::ConfigureUIScreen{bgSub, bgMain, &oamSub, &oamMain, screens});
148 ae::broadcastEvent(Event::ConfigureUIMenu{textSub, menus});
149}
TileType
ViewState
Definition StateTypes.hpp:4
@ DualGreen
Definition TextTypes.hpp:15
@ White
Definition TextTypes.hpp:14
Events for UISystem.
static DialogueScreen * getInstance()
std::array< int, 2 > bgMain
TextComponent * textSubAlt
MenuHUDScreen * menuHUDScreen
MusicComponent * musicCmpt
const EnvironmentDbEntry * dbEntry
MovementComponent * movement
Event::ConfigureCamera camConfig
Dialogue * dialogueFirstLine
uint16_t * textVideoBuffer
std::array< int, 3 > bgSub
const ae::q20_12_t tileSize
void setupPauseMenu()
Sets up the pause menu.
uint16_t * textVideoBufferSub
DialogueScreen * dialogueScreen
PauseMenu * pauseMenuCmpt
TextComponent * text
void setupMenuHUD(const std::string &location)
Sets up the menu HUD.
TextComponent * textSub
PauseMenuScreen * pauseMenuScreen
DialogueComponent * dialogue
const ae::q20_12_t height
const Point2D< ae::q20_12_t > characterSize
const Point2D< ae::q20_12_t > characterTranslate
void setupText() override
const ae::q20_12_t characterFacingAngle
void setupCamera() override
const ae::q20_12_t speed
ViewState onTileCheck(TileType tile, u32 pressed) override
void setupDialogue() override
void setupMusic() override
void setupMovement() override
void setupUI() override
Dialogue * demo_dialogue_init()
etl::array< etl::span< SpritePayload >, 10 > demo_dialogue_spritePayloads
A struct that holds initial config values for the DialogueComponent.
All parameters needed to configure UIMenus.
Definition UIEvents.hpp:52
All parameters needed to configure UIScreens.
Definition UIEvents.hpp:22
A struct that holds initial config values for the MovementComponent.
const HeightRegion * landings
const StairSegment * stairs
A struct that holds initial config values for the TextComponent.