mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 07:41:22 +00:00
- replaced more copystrings with FString.
This commit is contained in:
parent
66006a5c14
commit
759753eadc
4 changed files with 12 additions and 16 deletions
|
@ -418,7 +418,7 @@ public:
|
||||||
|
|
||||||
class FPlayerNameBox : public FListMenuItemSelectable
|
class FPlayerNameBox : public FListMenuItemSelectable
|
||||||
{
|
{
|
||||||
const char *mText;
|
FString mText;
|
||||||
FFont *mFont;
|
FFont *mFont;
|
||||||
EColorRange mFontColor;
|
EColorRange mFontColor;
|
||||||
int mFrameSize;
|
int mFrameSize;
|
||||||
|
@ -447,7 +447,7 @@ public:
|
||||||
class FValueTextItem : public FListMenuItemSelectable
|
class FValueTextItem : public FListMenuItemSelectable
|
||||||
{
|
{
|
||||||
TArray<FString> mSelections;
|
TArray<FString> mSelections;
|
||||||
const char *mText;
|
FString mText;
|
||||||
int mSelection;
|
int mSelection;
|
||||||
FFont *mFont;
|
FFont *mFont;
|
||||||
EColorRange mFontColor;
|
EColorRange mFontColor;
|
||||||
|
@ -472,7 +472,7 @@ public:
|
||||||
|
|
||||||
class FSliderItem : public FListMenuItemSelectable
|
class FSliderItem : public FListMenuItemSelectable
|
||||||
{
|
{
|
||||||
const char *mText;
|
FString mText;
|
||||||
FFont *mFont;
|
FFont *mFont;
|
||||||
EColorRange mFontColor;
|
EColorRange mFontColor;
|
||||||
int mMinrange, mMaxrange;
|
int mMinrange, mMaxrange;
|
||||||
|
@ -539,7 +539,7 @@ public:
|
||||||
class FOptionMenuItem : public FListMenuItem
|
class FOptionMenuItem : public FListMenuItem
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
char *mLabel;
|
FString mLabel;
|
||||||
bool mCentered;
|
bool mCentered;
|
||||||
|
|
||||||
void drawLabel(int indent, int y, EColorRange color, bool grayed = false);
|
void drawLabel(int indent, int y, EColorRange color, bool grayed = false);
|
||||||
|
@ -548,7 +548,7 @@ public:
|
||||||
FOptionMenuItem(const char *text, FName action = NAME_None, bool center = false)
|
FOptionMenuItem(const char *text, FName action = NAME_None, bool center = false)
|
||||||
: FListMenuItem(0, 0, action)
|
: FListMenuItem(0, 0, action)
|
||||||
{
|
{
|
||||||
mLabel = copystring(text);
|
mLabel = text;
|
||||||
mCentered = center;
|
mCentered = center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -479,7 +479,6 @@ void DOptionMenu::Drawer ()
|
||||||
|
|
||||||
FOptionMenuItem::~FOptionMenuItem()
|
FOptionMenuItem::~FOptionMenuItem()
|
||||||
{
|
{
|
||||||
if (mLabel != NULL) delete [] mLabel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int FOptionMenuItem::Draw(FOptionMenuDescriptor *desc, int y, int indent, bool selected)
|
int FOptionMenuItem::Draw(FOptionMenuDescriptor *desc, int y, int indent, bool selected)
|
||||||
|
@ -507,14 +506,14 @@ int FOptionMenuItem::GetIndent()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const char *label = mLabel;
|
const char *label = mLabel.GetChars();
|
||||||
if (*label == '$') label = GStrings(label+1);
|
if (*label == '$') label = GStrings(label+1);
|
||||||
return SmallFont->StringWidth(label);
|
return SmallFont->StringWidth(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FOptionMenuItem::drawLabel(int indent, int y, EColorRange color, bool grayed)
|
void FOptionMenuItem::drawLabel(int indent, int y, EColorRange color, bool grayed)
|
||||||
{
|
{
|
||||||
const char *label = mLabel;
|
const char *label = mLabel.GetChars();
|
||||||
if (*label == '$') label = GStrings(label+1);
|
if (*label == '$') label = GStrings(label+1);
|
||||||
|
|
||||||
int overlay = grayed? MAKEARGB(96,48,0,0) : 0;
|
int overlay = grayed? MAKEARGB(96,48,0,0) : 0;
|
||||||
|
|
|
@ -131,7 +131,7 @@ public:
|
||||||
msg = GStrings(msg + 1);
|
msg = GStrings(msg + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *actionLabel = mLabel;
|
const char *actionLabel = mLabel.GetChars();
|
||||||
if (actionLabel != NULL)
|
if (actionLabel != NULL)
|
||||||
{
|
{
|
||||||
if (*actionLabel == '$')
|
if (*actionLabel == '$')
|
||||||
|
@ -536,7 +536,7 @@ public:
|
||||||
|
|
||||||
int Draw(FOptionMenuDescriptor *desc, int y, int indent, bool selected)
|
int Draw(FOptionMenuDescriptor *desc, int y, int indent, bool selected)
|
||||||
{
|
{
|
||||||
const char *txt = mCurrent? mAltText.GetChars() : mLabel;
|
const char *txt = mCurrent? mAltText.GetChars() : mLabel.GetChars();
|
||||||
if (*txt == '$') txt = GStrings(txt + 1);
|
if (*txt == '$') txt = GStrings(txt + 1);
|
||||||
int w = SmallFont->StringWidth(txt) * CleanXfac_1;
|
int w = SmallFont->StringWidth(txt) * CleanXfac_1;
|
||||||
int x = (screen->GetWidth() - w) / 2;
|
int x = (screen->GetWidth() - w) / 2;
|
||||||
|
|
|
@ -64,7 +64,7 @@ EXTERN_CVAR (Bool, cl_run)
|
||||||
FPlayerNameBox::FPlayerNameBox(int x, int y, int height, int frameofs, const char *text, FFont *font, EColorRange color, FName action)
|
FPlayerNameBox::FPlayerNameBox(int x, int y, int height, int frameofs, const char *text, FFont *font, EColorRange color, FName action)
|
||||||
: FListMenuItemSelectable(x, y, height, action)
|
: FListMenuItemSelectable(x, y, height, action)
|
||||||
{
|
{
|
||||||
mText = copystring(text);
|
mText = text;
|
||||||
mFont = font;
|
mFont = font;
|
||||||
mFontColor = color;
|
mFontColor = color;
|
||||||
mFrameSize = frameofs;
|
mFrameSize = frameofs;
|
||||||
|
@ -74,7 +74,6 @@ FPlayerNameBox::FPlayerNameBox(int x, int y, int height, int frameofs, const cha
|
||||||
|
|
||||||
FPlayerNameBox::~FPlayerNameBox()
|
FPlayerNameBox::~FPlayerNameBox()
|
||||||
{
|
{
|
||||||
if (mText != NULL) delete [] mText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -220,7 +219,7 @@ bool FPlayerNameBox::MenuEvent(int mkey, bool fromcontroller)
|
||||||
FValueTextItem::FValueTextItem(int x, int y, int height, const char *text, FFont *font, EColorRange color, EColorRange valuecolor, FName action, FName values)
|
FValueTextItem::FValueTextItem(int x, int y, int height, const char *text, FFont *font, EColorRange color, EColorRange valuecolor, FName action, FName values)
|
||||||
: FListMenuItemSelectable(x, y, height, action)
|
: FListMenuItemSelectable(x, y, height, action)
|
||||||
{
|
{
|
||||||
mText = copystring(text);
|
mText = text;
|
||||||
mFont = font;
|
mFont = font;
|
||||||
mFontColor = color;
|
mFontColor = color;
|
||||||
mFontColor2 = valuecolor;
|
mFontColor2 = valuecolor;
|
||||||
|
@ -240,7 +239,6 @@ FValueTextItem::FValueTextItem(int x, int y, int height, const char *text, FFont
|
||||||
|
|
||||||
FValueTextItem::~FValueTextItem()
|
FValueTextItem::~FValueTextItem()
|
||||||
{
|
{
|
||||||
if (mText != NULL) delete [] mText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -341,7 +339,7 @@ void FValueTextItem::Drawer(bool selected)
|
||||||
FSliderItem::FSliderItem(int x, int y, int height, const char *text, FFont *font, EColorRange color, FName action, int min, int max, int step)
|
FSliderItem::FSliderItem(int x, int y, int height, const char *text, FFont *font, EColorRange color, FName action, int min, int max, int step)
|
||||||
: FListMenuItemSelectable(x, y, height, action)
|
: FListMenuItemSelectable(x, y, height, action)
|
||||||
{
|
{
|
||||||
mText = copystring(text);
|
mText = text;
|
||||||
mFont = font;
|
mFont = font;
|
||||||
mFontColor = color;
|
mFontColor = color;
|
||||||
mSelection = 0;
|
mSelection = 0;
|
||||||
|
@ -352,7 +350,6 @@ FSliderItem::FSliderItem(int x, int y, int height, const char *text, FFont *font
|
||||||
|
|
||||||
FSliderItem::~FSliderItem()
|
FSliderItem::~FSliderItem()
|
||||||
{
|
{
|
||||||
if (mText != NULL) delete [] mText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
Loading…
Reference in a new issue