mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
- use the new console font for the options menu to gain space and better character support.
So far this is just an experiment, this needs a bit of work to become viable.
This commit is contained in:
parent
b59b092c49
commit
2e260c6367
7 changed files with 36 additions and 30 deletions
|
@ -551,9 +551,13 @@ void V_UpdateModeSize (int width, int height)
|
||||||
else if (w >= 1600 && w < 1920) factor = 3;
|
else if (w >= 1600 && w < 1920) factor = 3;
|
||||||
else factor = w / 640;
|
else factor = w / 640;
|
||||||
|
|
||||||
CleanXfac = CleanYfac = CleanXfac_1 = CleanYfac_1 = factor;
|
CleanXfac = CleanYfac = factor;
|
||||||
CleanWidth = CleanWidth_1 = width / CleanXfac_1;
|
CleanWidth = width / CleanXfac;
|
||||||
CleanHeight = CleanHeight_1 = height / CleanYfac_1;
|
CleanHeight = height / CleanYfac;
|
||||||
|
|
||||||
|
CleanYfac_1 = CleanXfac_1 = MAX(1, int (CleanXfac * 0.7));
|
||||||
|
CleanWidth_1 = width / CleanXfac_1;
|
||||||
|
CleanHeight_1 = height / CleanYfac_1;
|
||||||
|
|
||||||
DisplayWidth = width;
|
DisplayWidth = width;
|
||||||
DisplayHeight = height;
|
DisplayHeight = height;
|
||||||
|
|
|
@ -344,11 +344,13 @@ OptionValue AutoOffOn
|
||||||
OptionMenuSettings
|
OptionMenuSettings
|
||||||
{
|
{
|
||||||
// These can be overridden if a different menu fonts requires it.
|
// These can be overridden if a different menu fonts requires it.
|
||||||
Linespacing 8
|
Linespacing 17
|
||||||
|
/*
|
||||||
IfGame(Heretic, Hexen)
|
IfGame(Heretic, Hexen)
|
||||||
{
|
{
|
||||||
Linespacing 9
|
Linespacing 9
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultOptionMenu
|
DefaultOptionMenu
|
||||||
|
|
|
@ -285,7 +285,7 @@ class Menu : Object native ui version("2.4")
|
||||||
|
|
||||||
static void DrawConText (int color, int x, int y, String str)
|
static void DrawConText (int color, int x, int y, String str)
|
||||||
{
|
{
|
||||||
screen.DrawText (ConFont, color, x, y, str, DTA_CellX, 8 * CleanXfac_1, DTA_CellY, 8 * CleanYfac_1);
|
screen.DrawText (NewConsoleFont, color, x, y, str, DTA_CellX, 9 * CleanXfac_1/2, DTA_CellY, 8 * CleanYfac_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -451,7 +451,7 @@ class OptionMenu : Menu
|
||||||
}
|
}
|
||||||
|
|
||||||
int ytop = y + mDesc.mScrollTop * 8 * CleanYfac_1;
|
int ytop = y + mDesc.mScrollTop * 8 * CleanYfac_1;
|
||||||
int lastrow = screen.GetHeight() - SmallFont.GetHeight() * CleanYfac_1;
|
int lastrow = screen.GetHeight() - NewConsoleFont.GetHeight() * CleanYfac_1;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < mDesc.mItems.Size() && y <= lastrow; i++)
|
for (i = 0; i < mDesc.mItems.Size() && y <= lastrow; i++)
|
||||||
|
@ -519,8 +519,8 @@ class GameplayMenu : OptionMenu
|
||||||
Super.Drawer();
|
Super.Drawer();
|
||||||
|
|
||||||
String s = String.Format("dmflags = %d dmflags2 = %d", dmflags, dmflags2);
|
String s = String.Format("dmflags = %d dmflags2 = %d", dmflags, dmflags2);
|
||||||
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue,
|
screen.DrawText (NewConsoleFont, OptionMenuSettings.mFontColorValue,
|
||||||
(screen.GetWidth() - SmallFont.StringWidth (s) * CleanXfac_1) / 2, 0, s,
|
(screen.GetWidth() - NewConsoleFont.StringWidth (s) * CleanXfac_1) / 2, 0, s,
|
||||||
DTA_CleanNoMove_1, true);
|
DTA_CleanNoMove_1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -532,8 +532,8 @@ class CompatibilityMenu : OptionMenu
|
||||||
Super.Drawer();
|
Super.Drawer();
|
||||||
|
|
||||||
String s = String.Format("compatflags = %d compatflags2 = %d", compatflags, compatflags2);
|
String s = String.Format("compatflags = %d compatflags2 = %d", compatflags, compatflags2);
|
||||||
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue,
|
screen.DrawText (NewConsoleFont, OptionMenuSettings.mFontColorValue,
|
||||||
(screen.GetWidth() - SmallFont.StringWidth (s) * CleanXfac_1) / 2, 0, s,
|
(screen.GetWidth() - NewConsoleFont.StringWidth (s) * CleanXfac_1) / 2, 0, s,
|
||||||
DTA_CleanNoMove_1, true);
|
DTA_CleanNoMove_1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,10 +51,10 @@ class OptionMenuItem : MenuItemBase
|
||||||
int overlay = grayed? Color(96,48,0,0) : 0;
|
int overlay = grayed? Color(96,48,0,0) : 0;
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int w = SmallFont.StringWidth(label) * CleanXfac_1;
|
int w = NewConsoleFont.StringWidth(label) * CleanXfac_1;
|
||||||
if (!mCentered) x = indent - w;
|
if (!mCentered) x = indent - w;
|
||||||
else x = (screen.GetWidth() - w) / 2;
|
else x = (screen.GetWidth() - w) / 2;
|
||||||
screen.DrawText (SmallFont, color, x, y, label, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay);
|
screen.DrawText (NewConsoleFont, color, x, y, label, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay);
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class OptionMenuItem : MenuItemBase
|
||||||
override int GetIndent()
|
override int GetIndent()
|
||||||
{
|
{
|
||||||
if (mCentered) return 0;
|
if (mCentered) return 0;
|
||||||
return SmallFont.StringWidth(Stringtable.Localize(mLabel));
|
return NewConsoleFont.StringWidth(Stringtable.Localize(mLabel));
|
||||||
}
|
}
|
||||||
|
|
||||||
override bool MouseEvent(int type, int x, int y)
|
override bool MouseEvent(int type, int x, int y)
|
||||||
|
@ -140,7 +140,7 @@ class OptionMenuItemLabeledSubmenu : OptionMenuItemSubmenu
|
||||||
|
|
||||||
String text = mLabelCVar.GetString();
|
String text = mLabelCVar.GetString();
|
||||||
if (text.Length() == 0) text = Stringtable.Localize("$notset");
|
if (text.Length() == 0) text = Stringtable.Localize("$notset");
|
||||||
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true);
|
screen.DrawText (NewConsoleFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true);
|
||||||
|
|
||||||
return indent;
|
return indent;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ class OptionMenuItemOptionBase : OptionMenuItem
|
||||||
int Selection = GetSelection();
|
int Selection = GetSelection();
|
||||||
String text = StringTable.Localize(OptionValues.GetText(mValues, Selection));
|
String text = StringTable.Localize(OptionValues.GetText(mValues, Selection));
|
||||||
if (text.Length() == 0) text = "Unknown";
|
if (text.Length() == 0) text = "Unknown";
|
||||||
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay);
|
screen.DrawText (NewConsoleFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay);
|
||||||
return indent;
|
return indent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,7 +506,7 @@ class OptionMenuItemControlBase : OptionMenuItem
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
screen.DrawText(SmallFont, Font.CR_BLACK, indent + CursorSpace(), y + (OptionMenuSettings.mLinespacing-8)*CleanYfac_1, "---", DTA_CleanNoMove_1, true);
|
screen.DrawText(NewConsoleFont, Font.CR_BLACK, indent + CursorSpace(), y + (OptionMenuSettings.mLinespacing-8)*CleanYfac_1, "---", DTA_CleanNoMove_1, true);
|
||||||
}
|
}
|
||||||
return indent;
|
return indent;
|
||||||
}
|
}
|
||||||
|
@ -644,9 +644,9 @@ class OptionMenuItemStaticTextSwitchable : OptionMenuItem
|
||||||
override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected)
|
override int Draw(OptionMenuDescriptor desc, int y, int indent, bool selected)
|
||||||
{
|
{
|
||||||
String txt = StringTable.Localize(mCurrent? mAltText : mLabel);
|
String txt = StringTable.Localize(mCurrent? mAltText : mLabel);
|
||||||
int w = SmallFont.StringWidth(txt) * CleanXfac_1;
|
int w = NewConsoleFont.StringWidth(txt) * CleanXfac_1;
|
||||||
int x = (screen.GetWidth() - w) / 2;
|
int x = (screen.GetWidth() - w) / 2;
|
||||||
screen.DrawText (SmallFont, mColor, x, y, txt, DTA_CleanNoMove_1, true);
|
screen.DrawText (NewConsoleFont, mColor, x, y, txt, DTA_CleanNoMove_1, true);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -731,7 +731,7 @@ class OptionMenuSliderBase : OptionMenuItem
|
||||||
if (fracdigits >= 0)
|
if (fracdigits >= 0)
|
||||||
{
|
{
|
||||||
textbuf = String.format(formater, max);
|
textbuf = String.format(formater, max);
|
||||||
maxlen = SmallFont.StringWidth(textbuf) * CleanXfac_1;
|
maxlen = NewConsoleFont.StringWidth(textbuf) * CleanXfac_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
mSliderShort = right + maxlen > screen.GetWidth();
|
mSliderShort = right + maxlen > screen.GetWidth();
|
||||||
|
@ -752,7 +752,7 @@ class OptionMenuSliderBase : OptionMenuItem
|
||||||
if (fracdigits >= 0 && right + maxlen <= screen.GetWidth())
|
if (fracdigits >= 0 && right + maxlen <= screen.GetWidth())
|
||||||
{
|
{
|
||||||
textbuf = String.format(formater, cur);
|
textbuf = String.format(formater, cur);
|
||||||
screen.DrawText(SmallFont, Font.CR_DARKGRAY, right, y, textbuf, DTA_CleanNoMove_1, true);
|
screen.DrawText(NewConsoleFont, Font.CR_DARKGRAY, right, y, textbuf, DTA_CleanNoMove_1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -973,7 +973,7 @@ class OptionMenuFieldBase : OptionMenuItem
|
||||||
drawLabel(indent, y, selected ? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, grayed);
|
drawLabel(indent, y, selected ? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor, grayed);
|
||||||
int overlay = grayed? Color(96, 48, 0, 0) : 0;
|
int overlay = grayed? Color(96, 48, 0, 0) : 0;
|
||||||
|
|
||||||
screen.DrawText(SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, Represent(), DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay);
|
screen.DrawText(NewConsoleFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, Represent(), DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay);
|
||||||
return indent;
|
return indent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1022,7 +1022,7 @@ class OptionMenuItemTextField : OptionMenuFieldBase
|
||||||
|
|
||||||
override String Represent()
|
override String Represent()
|
||||||
{
|
{
|
||||||
if (mEnter) return mEnter.GetText() .. SmallFont.GetCursor();
|
if (mEnter) return mEnter.GetText() .. NewConsoleFont.GetCursor();
|
||||||
else return GetCVarString();
|
else return GetCVarString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1032,7 +1032,7 @@ class OptionMenuItemTextField : OptionMenuFieldBase
|
||||||
{
|
{
|
||||||
// reposition the text so that the cursor is visible when in entering mode.
|
// reposition the text so that the cursor is visible when in entering mode.
|
||||||
String text = Represent();
|
String text = Represent();
|
||||||
int tlen = SmallFont.StringWidth(text) * CleanXfac_1;
|
int tlen = NewConsoleFont.StringWidth(text) * CleanXfac_1;
|
||||||
int newindent = screen.GetWidth() - tlen - CursorSpace();
|
int newindent = screen.GetWidth() - tlen - CursorSpace();
|
||||||
if (newindent < indent) indent = newindent;
|
if (newindent < indent) indent = newindent;
|
||||||
}
|
}
|
||||||
|
@ -1044,7 +1044,7 @@ class OptionMenuItemTextField : OptionMenuFieldBase
|
||||||
if (mkey == Menu.MKEY_Enter)
|
if (mkey == Menu.MKEY_Enter)
|
||||||
{
|
{
|
||||||
Menu.MenuSound("menu/choose");
|
Menu.MenuSound("menu/choose");
|
||||||
mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), SmallFont, GetCVarString(), -1, fromcontroller);
|
mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), NewConsoleFont, GetCVarString(), -1, fromcontroller);
|
||||||
mEnter.ActivateMenu();
|
mEnter.ActivateMenu();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1156,7 +1156,7 @@ class OptionMenuItemScaleSlider : OptionMenuItemSlider
|
||||||
if ((Selection == 0 || Selection == -1) && mClickVal <= 0)
|
if ((Selection == 0 || Selection == -1) && mClickVal <= 0)
|
||||||
{
|
{
|
||||||
String text = Selection == 0? TextZero : Selection == -1? TextNegOne : "";
|
String text = Selection == 0? TextZero : Selection == -1? TextNegOne : "";
|
||||||
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true);
|
screen.DrawText (NewConsoleFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -132,7 +132,7 @@ class OptionMenuItemReverbSelect : OptionMenuItemSubMenu
|
||||||
int x = drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor);
|
int x = drawLabel(indent, y, selected? OptionMenuSettings.mFontColorSelection : OptionMenuSettings.mFontColor);
|
||||||
|
|
||||||
String text = ReverbEdit.GetSelectedEnvironment();
|
String text = ReverbEdit.GetSelectedEnvironment();
|
||||||
screen.DrawText (SmallFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true);
|
screen.DrawText (NewConsoleFont, OptionMenuSettings.mFontColorValue, indent + CursorSpace(), y, text, DTA_CleanNoMove_1, true);
|
||||||
|
|
||||||
return indent;
|
return indent;
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ class OptionMenuItemSliderReverbEditOption : OptionMenuSliderBase
|
||||||
|
|
||||||
virtual String Represent()
|
virtual String Represent()
|
||||||
{
|
{
|
||||||
return mEnter.GetText() .. SmallFont.GetCursor();
|
return mEnter.GetText() .. NewConsoleFont.GetCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -221,7 +221,7 @@ class OptionMenuItemSliderReverbEditOption : OptionMenuSliderBase
|
||||||
mDrawX = indent + CursorSpace();
|
mDrawX = indent + CursorSpace();
|
||||||
if (mEnter)
|
if (mEnter)
|
||||||
{
|
{
|
||||||
screen.DrawText(SmallFont, OptionMenuSettings.mFontColorValue, mDrawX, y, Represent(), DTA_CleanNoMove_1, true);
|
screen.DrawText(NewConsoleFont, OptionMenuSettings.mFontColorValue, mDrawX, y, Represent(), DTA_CleanNoMove_1, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -235,7 +235,7 @@ class OptionMenuItemSliderReverbEditOption : OptionMenuSliderBase
|
||||||
if (mkey == Menu.MKEY_Enter)
|
if (mkey == Menu.MKEY_Enter)
|
||||||
{
|
{
|
||||||
Menu.MenuSound("menu/choose");
|
Menu.MenuSound("menu/choose");
|
||||||
mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), SmallFont, String.Format("%.3f", GetSliderValue()), -1, fromcontroller);
|
mEnter = TextEnterMenu.OpenTextEnter(Menu.GetCurrentMenu(), NewConsoleFont, String.Format("%.3f", GetSliderValue()), -1, fromcontroller);
|
||||||
mEnter.ActivateMenu();
|
mEnter.ActivateMenu();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ class TextEnterMenu : Menu
|
||||||
deprecated("3.8") static TextEnterMenu Open(Menu parent, String textbuffer, int maxlen, int sizemode, bool showgrid = false, bool allowcolors = false)
|
deprecated("3.8") static TextEnterMenu Open(Menu parent, String textbuffer, int maxlen, int sizemode, bool showgrid = false, bool allowcolors = false)
|
||||||
{
|
{
|
||||||
let me = new("TextEnterMenu");
|
let me = new("TextEnterMenu");
|
||||||
me.Init(parent, SmallFont, textbuffer, maxlen*8, showgrid, allowcolors);
|
me.Init(parent, NewConsoleFont, textbuffer, maxlen*8, showgrid, allowcolors);
|
||||||
return me;
|
return me;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue