mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-27 22:42:57 +00:00
- use an FString to handle the new message.
This commit is contained in:
parent
58a6d7df1f
commit
66006a5c14
1 changed files with 3 additions and 12 deletions
|
@ -104,22 +104,13 @@ class FOptionMenuItemSafeCommand : public FOptionMenuItemCommand
|
|||
{
|
||||
// action is a CCMD
|
||||
protected:
|
||||
char *mPrompt;
|
||||
FString mPrompt;
|
||||
|
||||
public:
|
||||
FOptionMenuItemSafeCommand(const char *label, const char *menu, const char *prompt)
|
||||
: FOptionMenuItemCommand(label, menu)
|
||||
, mPrompt(nullptr)
|
||||
, mPrompt(prompt)
|
||||
{
|
||||
if (prompt && *prompt)
|
||||
{
|
||||
mPrompt = copystring(prompt);
|
||||
}
|
||||
}
|
||||
|
||||
~FOptionMenuItemSafeCommand()
|
||||
{
|
||||
if (mPrompt != NULL) delete[] mPrompt;
|
||||
}
|
||||
|
||||
bool MenuEvent (int mkey, bool fromcontroller)
|
||||
|
@ -134,7 +125,7 @@ public:
|
|||
|
||||
bool Activate()
|
||||
{
|
||||
const char *msg = mPrompt ? mPrompt : "$SAFEMESSAGE";
|
||||
const char *msg = mPrompt.IsNotEmpty() ? mPrompt.GetChars() : "$SAFEMESSAGE";
|
||||
if (*msg == '$')
|
||||
{
|
||||
msg = GStrings(msg + 1);
|
||||
|
|
Loading…
Reference in a new issue