Skip to content
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

Refactor messaging system #1876

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f8dce45
add subcommand_path set/get methods
mateofio Apr 6, 2019
7ac1be5
Add SkipToNextConditional()
mateofio Apr 7, 2019
7dd7d5e
ConditionalBranch - use subcommand_path
mateofio Apr 6, 2019
13c36eb
Branch battle - use subcommand path
mateofio Apr 7, 2019
d99eb4a
CommandShowChoices - use subcommand_path
mateofio Apr 6, 2019
2f20f1b
Shop Command - use subcommand_path
mateofio Apr 7, 2019
af3cec2
Refactor Inn command
mateofio Apr 7, 2019
cacd710
Refactor CommandEnemyEncounter
mateofio Apr 7, 2019
f60f808
Refactor BreakLoop
mateofio Apr 7, 2019
8040146
Remove unused Game_Interpreter::SkipTo()
mateofio Apr 7, 2019
4ae8a49
CommandEndLoop: Fix index
mateofio Aug 17, 2019
12f6767
Continuation - don't reset event loop
mateofio Aug 17, 2019
a01c12a
Cleanup ShowMessages command
mateofio Aug 18, 2019
195aeec
Fix Message update timing in main loop
mateofio Aug 23, 2019
718d044
Message: Don't display text until animation finishes
mateofio Aug 24, 2019
76f7cac
Refactor Message Rendering
mateofio Aug 25, 2019
a9505e9
Reorder Window_Message::Update routine
mateofio Aug 25, 2019
adcd03c
Window_Message: Don't animate embedded number window
mateofio Aug 25, 2019
780108c
Use LSD show_message chunk
mateofio Aug 25, 2019
6a772be
Refactor Game_Message interaction to use Game_Message::PendingMessage
mateofio Aug 25, 2019
62a9752
Use Game_Message::ClearFace()
mateofio Aug 25, 2019
4bc708b
Add ChoicesContinuation
mateofio Aug 26, 2019
59d1132
Remove Game_Temp::inn_calling
mateofio Aug 26, 2019
e573d86
Filter ASCII control chars from Game_Message
mateofio Aug 26, 2019
3812111
Add UTF8Next() + unit tests
mateofio Aug 26, 2019
44ab76e
Add Player::escape_char
mateofio Aug 26, 2019
cfbbbcb
Add new param parsing methods to Game_Message
mateofio Aug 26, 2019
49eb796
Do Name and Var substitution in Game_Message.
mateofio Aug 26, 2019
870f75c
Game_Message: Store text as flat string
mateofio Aug 26, 2019
e082ea3
Remove Window_Message::end
mateofio Aug 26, 2019
59d9406
Add Game_Message::CanShowMessage()
mateofio Aug 26, 2019
1c4859e
Fix message and scene interaction
mateofio Aug 26, 2019
6e2ec3e
Fixes for Messages and Teleports
mateofio Aug 26, 2019
7091031
Fix interpreter message blocking behavior.
mateofio Aug 27, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/game_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,9 +812,12 @@ void Game_Actor::ChangeLevel(int new_level, bool level_up_message) {
SetLevel(new_level);
new_level = GetLevel(); // Level adjusted to max

auto pm = Game_Message::PendingMessage();

if (new_level > old_level) {
if (level_up_message) {
Game_Message::texts.push_back(GetLevelUpMessage(new_level));
//FIXME: If message box already active??
pm.PushLine(GetLevelUpMessage(new_level));
level_up = true;
}

Expand All @@ -824,15 +827,14 @@ void Game_Actor::ChangeLevel(int new_level, bool level_up_message) {
if (learn.level > old_level && learn.level <= new_level) {
LearnSkill(learn.skill_id);
if (level_up_message) {
Game_Message::texts.push_back(GetLearningMessage(learn));
pm.PushLine(GetLearningMessage(learn));
level_up = true;
}
}
}

if (level_up) {
Game_Message::texts.back().append("\f");
Game_Message::message_waiting = true;
pm.PushPageEnd();
}

// Experience adjustment:
Expand All @@ -845,6 +847,10 @@ void Game_Actor::ChangeLevel(int new_level, bool level_up_message) {
SetExp(GetBaseExp());
}
}

if (pm.NumLines()) {
Game_Message::SetPendingMessage(std::move(pm));
}
}

bool Game_Actor::IsEquippable(int item_id) const {
Expand Down
Loading