-
Notifications
You must be signed in to change notification settings - Fork 192
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
Add DynText Plugin #2369
Add DynText Plugin #2369
Conversation
src/dynrpg_textplugin.cpp
Outdated
} else if (ch == 'V' || ch == 'v') { | ||
return PendingMessage::DefaultCommandInserter('v', iter, end, escape_char); | ||
} else if (ch == 'I' || ch == 'i') { | ||
auto parse_ret = Game_Message::ParseParamImpl('I', 'i', *iter, end, escape_char, true); |
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.
@fmatthew5876
Would be nice to have ParseParamImpl
exported. This provides a very simple way to extract values. But maybe use a different name (no Impl?).
return true; | ||
|
||
PendingMessage pm; | ||
pm.PushLine(id, DynRpgText::CommandCodeInserter); |
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.
Pending Message with a custom Command code parser :)
graphics.clear(); | ||
} | ||
|
||
void DynRpg::TextPlugin::Load(const std::vector<uint8_t>& in_buffer) { |
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.
FIXME: Load is broken
src/game_message.cpp
Outdated
@@ -250,6 +249,72 @@ static Game_Message::ParseParamResult ParseParamImpl( | |||
return { iter, value }; | |||
} | |||
|
|||
Game_Message::ParseParamStringResult Game_Message::ParseStringParamImpl( |
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.
Ignore ParseStringParam for now. This is just like ParseParam but it extracts a string, not a number. I need this for \x of the TextPlugin (the stuff in x is interpreted as a text identifier and inserted)
(needs testing)
src/pending_message.cpp
Outdated
|
||
start_copy = iter; | ||
} | ||
output.append(cmd_fn(ch, &iter, end, escape_char)); |
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.
Instead of hardcoding n and v a callback function is used. This allows easy extending with new command codes
741d8a8
to
337ac23
Compare
PendingMessage has no unit tests? Because this breaks \C[1] without being noticed. |
This is mostly for discussion right now. I don't want this to be merged yet there are still bugs. This code is very old and didn't properly rebase.
https://www.multimediaxis.de/threads/135210-DynRPG-Plugin-Text-Plugin
Download with sample game: https://rpgmaker.net/engines/rt2k3/utilities/12/
[please wait for my review comments]