- game compiles and starts again (without menu, of course)

Now it's time to rebuild the menu.
This commit is contained in:
Christoph Oelckers 2020-10-04 20:53:37 +02:00
parent 9cc318da93
commit 5d76cbcbdb
7 changed files with 47 additions and 33 deletions

View file

@ -659,3 +659,4 @@ DEFINE_FIELD_X(MusPlayingInfo, MusPlayingInfo, loop);
DEFINE_GLOBAL_NAMED(PClass::AllClasses, AllClasses)
DEFINE_GLOBAL(Bindings)
DEFINE_GLOBAL(AutomapBindings)

View file

@ -1011,6 +1011,7 @@ CCMD(undocolorpic)
DEFINE_GLOBAL(menuactive)
DEFINE_GLOBAL(BackbuttonTime)
DEFINE_GLOBAL(BackbuttonAlpha)
DEFINE_GLOBAL(GameTicRate)
DEFINE_FIELD(DMenu, mParentMenu)
DEFINE_FIELD(DMenu, mMouseCapture);

View file

@ -73,9 +73,9 @@ DEFINE_ACTION_FUNCTION(DPlayerMenu, ColorChanged)
//
//=============================================================================
#if 0
DEFINE_ACTION_FUNCTION(DPlayerMenu, PlayerNameChanged)
{
#if 0
PARAM_PROLOGUE;
PARAM_STRING(s);
const char *pp = s;
@ -95,7 +95,6 @@ DEFINE_ACTION_FUNCTION(DPlayerMenu, PlayerNameChanged)
command << '"';
C_DoCommand(command);
}
#endif
return 0;
}
@ -104,7 +103,6 @@ DEFINE_ACTION_FUNCTION(DPlayerMenu, PlayerNameChanged)
//
//
//=============================================================================
#if 0
DEFINE_ACTION_FUNCTION(DPlayerMenu, ColorSetChanged)
{
PARAM_PROLOGUE;
@ -201,6 +199,7 @@ DEFINE_ACTION_FUNCTION(DPlayerMenu, TeamChanged)
//
//=============================================================================
#if 0
DEFINE_ACTION_FUNCTION(DPlayerMenu, GenderChanged)
{
PARAM_PROLOGUE;
@ -218,6 +217,7 @@ DEFINE_ACTION_FUNCTION(DPlayerMenu, GenderChanged)
}
return 0;
}
#endif
//=============================================================================
//

View file

@ -24,6 +24,13 @@ struct _ native // These are the global variables, the struct is only here to av
native readonly int CleanWidth_1;
native readonly int CleanHeight_1;
native readonly @MusPlayingInfo musplaying;
native ui int BackbuttonTime;
native ui float BackbuttonAlpha;
native readonly int GameTicRate;
native readonly @FOptionMenuSettings OptionMenuSettings;
native int menuactive;
native @KeyBindings Bindings;
native @KeyBindings AutomapBindings;
}
@ -86,6 +93,30 @@ struct TexMan
native static bool OkForLocalization(TextureID patch, String textSubstitute);
}
enum EScaleMode
{
FSMode_None = 0,
FSMode_ScaleToFit = 1,
FSMode_ScaleToFill = 2,
FSMode_ScaleToFit43 = 3,
FSMode_ScaleToScreen = 4,
FSMode_ScaleToFit43Top = 5,
FSMode_ScaleToFit43Bottom = 6,
FSMode_ScaleToHeight = 7,
FSMode_Max,
// These all use ScaleToFit43, their purpose is to cut down on verbosity because they imply the virtual screen size.
FSMode_Predefined = 1000,
FSMode_Fit320x200 = 1000,
FSMode_Fit320x240,
FSMode_Fit640x400,
FSMode_Fit640x480,
FSMode_Fit320x200Top,
FSMode_Predefined_Max,
};
enum DrawTextureTags
{
TAG_USER = (1<<30),

View file

@ -167,6 +167,11 @@ class LoadSaveMenu : ListMenu
//
//=============================================================================
virtual void DrawFrame(int left, int top, int width, int height)
{
// Todo: Define this in subclasses
}
override void Drawer ()
{
Super.Drawer();
@ -177,12 +182,14 @@ class LoadSaveMenu : ListMenu
bool didSeeSelected = false;
// Draw picture area
/* (todo: move to subclass)
if (gameaction == ga_loadgame || gameaction == ga_loadgamehidecon || gameaction == ga_savegame)
{
return;
}
*/
Screen.DrawFrame (savepicLeft, savepicTop, savepicWidth, savepicHeight);
DrawFrame (savepicLeft, savepicTop, savepicWidth, savepicHeight);
if (!manager.DrawSavePic(savepicLeft, savepicTop, savepicWidth, savepicHeight))
{
screen.Clear (savepicLeft, savepicTop, savepicLeft+savepicWidth, savepicTop+savepicHeight, 0, 0);
@ -198,7 +205,7 @@ class LoadSaveMenu : ListMenu
}
// Draw comment area
Screen.DrawFrame (commentLeft, commentTop, commentWidth, commentHeight);
DrawFrame (commentLeft, commentTop, commentWidth, commentHeight);
screen.Clear (commentLeft, commentTop, commentRight, commentBottom, 0, 0);
int numlinestoprint = min(commentRows, BrokenSaveComment? BrokenSaveComment.Count() : 0);
@ -210,7 +217,7 @@ class LoadSaveMenu : ListMenu
// Draw file area
Screen.DrawFrame (listboxLeft, listboxTop, listboxWidth, listboxHeight);
DrawFrame (listboxLeft, listboxTop, listboxWidth, listboxHeight);
screen.Clear (listboxLeft, listboxTop, listboxRight, listboxBottom, 0, 0);
if (manager.SavegameCount() == 0)

View file

@ -191,7 +191,7 @@ class Menu : Object native ui version("2.4")
}
else if (ev.type == UIEvent.Type_MouseMove)
{
BackbuttonTime = 4*Thinker.TICRATE;
BackbuttonTime = 4*GameTicRate;
if (mMouseCapture || m_use_mouse == 1)
{
res = MouseEventBack(MOUSE_Move, ev.MouseX, y);

View file

@ -518,32 +518,6 @@ class OptionMenu : Menu
}
class GameplayMenu : OptionMenu
{
override void Drawer ()
{
Super.Drawer();
String s = String.Format("dmflags = %d dmflags2 = %d", dmflags, dmflags2);
screen.DrawText (OptionFont(), OptionMenuSettings.mFontColorValue,
(screen.GetWidth() - OptionWidth (s) * CleanXfac_1) / 2, 35 * CleanXfac_1, s,
DTA_CleanNoMove_1, true);
}
}
class CompatibilityMenu : OptionMenu
{
override void Drawer ()
{
Super.Drawer();
String s = String.Format("compatflags = %d compatflags2 = %d", compatflags, compatflags2);
screen.DrawText (OptionFont(), OptionMenuSettings.mFontColorValue,
(screen.GetWidth() - OptionWidth (s) * CleanXfac_1) / 2, 35 * CleanXfac_1, s,
DTA_CleanNoMove_1, true);
}
}
class GLTextureGLOptions : OptionMenu
{
private int mWarningIndex;