mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-08 16:52:01 +00:00
Added animation support for OptionMenus
Adds Animated and AnimatedTransition MENUDEF instructions for OptionMenus. Added DontDim and DontBlur MENUDEF instructions for all menus.
This commit is contained in:
parent
b002d5b8ec
commit
f322792783
7 changed files with 82 additions and 3 deletions
|
@ -1033,6 +1033,8 @@ DEFINE_FIELD(DListMenuDescriptor, mFontColor2)
|
||||||
DEFINE_FIELD(DListMenuDescriptor, mAnimatedTransition)
|
DEFINE_FIELD(DListMenuDescriptor, mAnimatedTransition)
|
||||||
DEFINE_FIELD(DListMenuDescriptor, mAnimated)
|
DEFINE_FIELD(DListMenuDescriptor, mAnimated)
|
||||||
DEFINE_FIELD(DListMenuDescriptor, mCenter)
|
DEFINE_FIELD(DListMenuDescriptor, mCenter)
|
||||||
|
DEFINE_FIELD(DListMenuDescriptor, mDontDim)
|
||||||
|
DEFINE_FIELD(DListMenuDescriptor, mDontBlur)
|
||||||
DEFINE_FIELD(DListMenuDescriptor, mVirtWidth)
|
DEFINE_FIELD(DListMenuDescriptor, mVirtWidth)
|
||||||
DEFINE_FIELD(DListMenuDescriptor, mVirtHeight)
|
DEFINE_FIELD(DListMenuDescriptor, mVirtHeight)
|
||||||
|
|
||||||
|
@ -1045,6 +1047,9 @@ DEFINE_FIELD(DOptionMenuDescriptor, mScrollPos)
|
||||||
DEFINE_FIELD(DOptionMenuDescriptor, mIndent)
|
DEFINE_FIELD(DOptionMenuDescriptor, mIndent)
|
||||||
DEFINE_FIELD(DOptionMenuDescriptor, mPosition)
|
DEFINE_FIELD(DOptionMenuDescriptor, mPosition)
|
||||||
DEFINE_FIELD(DOptionMenuDescriptor, mDontDim)
|
DEFINE_FIELD(DOptionMenuDescriptor, mDontDim)
|
||||||
|
DEFINE_FIELD(DOptionMenuDescriptor, mDontBlur)
|
||||||
|
DEFINE_FIELD(DOptionMenuDescriptor, mAnimatedTransition)
|
||||||
|
DEFINE_FIELD(DOptionMenuDescriptor, mAnimated)
|
||||||
DEFINE_FIELD(DOptionMenuDescriptor, mFont)
|
DEFINE_FIELD(DOptionMenuDescriptor, mFont)
|
||||||
|
|
||||||
DEFINE_FIELD(FOptionMenuSettings, mTitleColor)
|
DEFINE_FIELD(FOptionMenuSettings, mTitleColor)
|
||||||
|
@ -1063,6 +1068,8 @@ DEFINE_FIELD(DImageScrollerDescriptor,textFont)
|
||||||
DEFINE_FIELD(DImageScrollerDescriptor, textScale)
|
DEFINE_FIELD(DImageScrollerDescriptor, textScale)
|
||||||
DEFINE_FIELD(DImageScrollerDescriptor, mAnimatedTransition)
|
DEFINE_FIELD(DImageScrollerDescriptor, mAnimatedTransition)
|
||||||
DEFINE_FIELD(DImageScrollerDescriptor, mAnimated)
|
DEFINE_FIELD(DImageScrollerDescriptor, mAnimated)
|
||||||
|
DEFINE_FIELD(DImageScrollerDescriptor, mDontDim)
|
||||||
|
DEFINE_FIELD(DImageScrollerDescriptor, mDontBlur)
|
||||||
DEFINE_FIELD(DImageScrollerDescriptor, virtWidth)
|
DEFINE_FIELD(DImageScrollerDescriptor, virtWidth)
|
||||||
DEFINE_FIELD(DImageScrollerDescriptor, virtHeight)
|
DEFINE_FIELD(DImageScrollerDescriptor, virtHeight)
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,8 @@ public:
|
||||||
bool mFromEngine;
|
bool mFromEngine;
|
||||||
bool mAnimated;
|
bool mAnimated;
|
||||||
bool mAnimatedTransition;
|
bool mAnimatedTransition;
|
||||||
|
bool mDontDim;
|
||||||
|
bool mDontBlur;
|
||||||
int mVirtWidth;
|
int mVirtWidth;
|
||||||
int mVirtHeight;
|
int mVirtHeight;
|
||||||
bool mCustomSizeSet;
|
bool mCustomSizeSet;
|
||||||
|
@ -124,6 +126,9 @@ public:
|
||||||
int mIndent;
|
int mIndent;
|
||||||
int mPosition;
|
int mPosition;
|
||||||
bool mDontDim;
|
bool mDontDim;
|
||||||
|
bool mDontBlur;
|
||||||
|
bool mAnimatedTransition;
|
||||||
|
bool mAnimated;
|
||||||
FFont *mFont;
|
FFont *mFont;
|
||||||
|
|
||||||
void CalcIndent();
|
void CalcIndent();
|
||||||
|
@ -143,6 +148,8 @@ public:
|
||||||
double textScale;
|
double textScale;
|
||||||
bool mAnimatedTransition;
|
bool mAnimatedTransition;
|
||||||
bool mAnimated;
|
bool mAnimated;
|
||||||
|
bool mDontDim;
|
||||||
|
bool mDontBlur;
|
||||||
int virtWidth, virtHeight;
|
int virtWidth, virtHeight;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -358,6 +358,14 @@ static void DoParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc, bool &s
|
||||||
{
|
{
|
||||||
desc->mAnimated = true;
|
desc->mAnimated = true;
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("DontDim"))
|
||||||
|
{
|
||||||
|
desc->mDontDim = true;
|
||||||
|
}
|
||||||
|
else if (sc.Compare("DontBlur"))
|
||||||
|
{
|
||||||
|
desc->mDontBlur = true;
|
||||||
|
}
|
||||||
else if (sc.Compare("MouseWindow"))
|
else if (sc.Compare("MouseWindow"))
|
||||||
{
|
{
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
|
@ -763,6 +771,10 @@ static void ParseListMenu(FScanner &sc)
|
||||||
desc->mFromEngine = fileSystem.GetFileContainer(sc.LumpNum) == 0; // flags menu if the definition is from the IWAD.
|
desc->mFromEngine = fileSystem.GetFileContainer(sc.LumpNum) == 0; // flags menu if the definition is from the IWAD.
|
||||||
desc->mVirtWidth = -2;
|
desc->mVirtWidth = -2;
|
||||||
desc->mCustomSizeSet = false;
|
desc->mCustomSizeSet = false;
|
||||||
|
desc->mAnimatedTransition = false;
|
||||||
|
desc->mAnimated = false;
|
||||||
|
desc->mDontDim = false;
|
||||||
|
desc->mDontBlur = false;
|
||||||
desc->mForceList = false;
|
desc->mForceList = false;
|
||||||
if (DefaultListMenuSettings->mCustomSizeSet)
|
if (DefaultListMenuSettings->mCustomSizeSet)
|
||||||
{
|
{
|
||||||
|
@ -1020,6 +1032,22 @@ static void ParseOptionMenuBody(FScanner &sc, DOptionMenuDescriptor *desc, int i
|
||||||
sc.MustGetNumber();
|
sc.MustGetNumber();
|
||||||
desc->mIndent = sc.Number;
|
desc->mIndent = sc.Number;
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("AnimatedTransition"))
|
||||||
|
{
|
||||||
|
desc->mAnimatedTransition = true;
|
||||||
|
}
|
||||||
|
else if (sc.Compare("Animated"))
|
||||||
|
{
|
||||||
|
desc->mAnimated = true;
|
||||||
|
}
|
||||||
|
else if (sc.Compare("DontDim"))
|
||||||
|
{
|
||||||
|
desc->mDontDim = true;
|
||||||
|
}
|
||||||
|
else if (sc.Compare("DontBlur"))
|
||||||
|
{
|
||||||
|
desc->mDontBlur = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
@ -1189,7 +1217,10 @@ static void ParseOptionMenu(FScanner &sc)
|
||||||
desc->mPosition = DefaultOptionMenuSettings->mPosition;
|
desc->mPosition = DefaultOptionMenuSettings->mPosition;
|
||||||
desc->mScrollTop = DefaultOptionMenuSettings->mScrollTop;
|
desc->mScrollTop = DefaultOptionMenuSettings->mScrollTop;
|
||||||
desc->mIndent = DefaultOptionMenuSettings->mIndent;
|
desc->mIndent = DefaultOptionMenuSettings->mIndent;
|
||||||
desc->mDontDim = DefaultOptionMenuSettings->mDontDim;
|
desc->mDontDim = false;
|
||||||
|
desc->mDontBlur = false;
|
||||||
|
desc->mAnimatedTransition = false;
|
||||||
|
desc->mAnimated = false;
|
||||||
desc->mProtected = sc.CheckString("protected");
|
desc->mProtected = sc.CheckString("protected");
|
||||||
|
|
||||||
ParseOptionMenuBody(sc, desc, -1);
|
ParseOptionMenuBody(sc, desc, -1);
|
||||||
|
@ -1275,6 +1306,14 @@ static void ParseImageScrollerBody(FScanner& sc, DImageScrollerDescriptor* desc)
|
||||||
{
|
{
|
||||||
desc->mAnimated = true;
|
desc->mAnimated = true;
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("DontDim"))
|
||||||
|
{
|
||||||
|
desc->mDontDim = true;
|
||||||
|
}
|
||||||
|
else if (sc.Compare("DontBlur"))
|
||||||
|
{
|
||||||
|
desc->mDontBlur = true;
|
||||||
|
}
|
||||||
else if (sc.Compare("textBackground"))
|
else if (sc.Compare("textBackground"))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
|
@ -1450,7 +1489,10 @@ static void ParseImageScroller(FScanner& sc)
|
||||||
desc->textBackgroundBrightness = 0xffffffff;
|
desc->textBackgroundBrightness = 0xffffffff;
|
||||||
desc->textFont = SmallFont;
|
desc->textFont = SmallFont;
|
||||||
desc->textScale = 1;
|
desc->textScale = 1;
|
||||||
|
desc->mDontDim = false;
|
||||||
|
desc->mDontBlur = false;
|
||||||
desc->mAnimatedTransition = false;
|
desc->mAnimatedTransition = false;
|
||||||
|
desc->mAnimated = false;
|
||||||
desc->virtWidth = 320;
|
desc->virtWidth = 320;
|
||||||
desc->virtHeight = 200;
|
desc->virtHeight = 200;
|
||||||
|
|
||||||
|
|
|
@ -694,6 +694,9 @@ void M_StartupEpisodeMenu(FNewGameStartup *gs)
|
||||||
od->mScrollTop = 0;
|
od->mScrollTop = 0;
|
||||||
od->mIndent = 160;
|
od->mIndent = 160;
|
||||||
od->mDontDim = false;
|
od->mDontDim = false;
|
||||||
|
od->mDontBlur = false;
|
||||||
|
od->mAnimatedTransition = false;
|
||||||
|
od->mAnimated = false;
|
||||||
GC::WriteBarrier(od);
|
GC::WriteBarrier(od);
|
||||||
for(unsigned i = 0; i < AllEpisodes.Size(); i++)
|
for(unsigned i = 0; i < AllEpisodes.Size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -829,6 +832,9 @@ static void BuildPlayerclassMenu()
|
||||||
od->mScrollTop = 0;
|
od->mScrollTop = 0;
|
||||||
od->mIndent = 160;
|
od->mIndent = 160;
|
||||||
od->mDontDim = false;
|
od->mDontDim = false;
|
||||||
|
od->mDontBlur = false;
|
||||||
|
od->mAnimatedTransition = false;
|
||||||
|
od->mAnimated = false;
|
||||||
od->mNetgameMessage = "$NEWGAME";
|
od->mNetgameMessage = "$NEWGAME";
|
||||||
GC::WriteBarrier(od);
|
GC::WriteBarrier(od);
|
||||||
for (unsigned i = 0; i < PlayerClasses.Size (); i++)
|
for (unsigned i = 0; i < PlayerClasses.Size (); i++)
|
||||||
|
@ -1252,6 +1258,9 @@ fail:
|
||||||
od->mScrollTop = 0;
|
od->mScrollTop = 0;
|
||||||
od->mIndent = 160;
|
od->mIndent = 160;
|
||||||
od->mDontDim = false;
|
od->mDontDim = false;
|
||||||
|
od->mDontBlur = false;
|
||||||
|
od->mAnimatedTransition = false;
|
||||||
|
od->mAnimated = false;
|
||||||
GC::WriteBarrier(od);
|
GC::WriteBarrier(od);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -41,6 +41,8 @@ class ImageScrollerDescriptor : MenuDescriptor native
|
||||||
native double textScale;
|
native double textScale;
|
||||||
native bool mAnimatedTransition;
|
native bool mAnimatedTransition;
|
||||||
native bool mAnimated;
|
native bool mAnimated;
|
||||||
|
native bool mDontBlur;
|
||||||
|
native bool mDontDim;
|
||||||
native int virtWidth, virtHeight;
|
native int virtWidth, virtHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,8 +170,10 @@ class ImageScrollerMenu : Menu
|
||||||
mParentMenu = parent;
|
mParentMenu = parent;
|
||||||
index = 0;
|
index = 0;
|
||||||
mDesc = desc;
|
mDesc = desc;
|
||||||
AnimatedTransition = desc.mAnimatedTransition;
|
AnimatedTransition = mDesc.mAnimatedTransition;
|
||||||
Animated = desc.mAnimated;
|
Animated = mDesc.mAnimated;
|
||||||
|
DontBlur = mDesc.mDontBlur;
|
||||||
|
DontDim = mDesc.mDontDim;
|
||||||
current = mDesc.mItems[0];
|
current = mDesc.mItems[0];
|
||||||
current.onStartPage();
|
current.onStartPage();
|
||||||
previous = null;
|
previous = null;
|
||||||
|
|
|
@ -57,6 +57,8 @@ class ListMenuDescriptor : MenuDescriptor native
|
||||||
native bool mCenter;
|
native bool mCenter;
|
||||||
native bool mAnimatedTransition;
|
native bool mAnimatedTransition;
|
||||||
native bool mAnimated;
|
native bool mAnimated;
|
||||||
|
native bool mDontBlur;
|
||||||
|
native bool mDontDim;
|
||||||
native int mVirtWidth, mVirtHeight;
|
native int mVirtWidth, mVirtHeight;
|
||||||
|
|
||||||
native void Reset();
|
native void Reset();
|
||||||
|
@ -89,6 +91,8 @@ class ListMenu : Menu
|
||||||
mDesc = desc;
|
mDesc = desc;
|
||||||
AnimatedTransition = mDesc.mAnimatedTransition;
|
AnimatedTransition = mDesc.mAnimatedTransition;
|
||||||
Animated = mDesc.mAnimated;
|
Animated = mDesc.mAnimated;
|
||||||
|
DontBlur = mDesc.mDontBlur;
|
||||||
|
DontDim = mDesc.mDontDim;
|
||||||
if (desc.mCenter)
|
if (desc.mCenter)
|
||||||
{
|
{
|
||||||
double center = 160;
|
double center = 160;
|
||||||
|
|
|
@ -55,6 +55,9 @@ class OptionMenuDescriptor : MenuDescriptor native
|
||||||
native int mIndent;
|
native int mIndent;
|
||||||
native int mPosition;
|
native int mPosition;
|
||||||
native bool mDontDim;
|
native bool mDontDim;
|
||||||
|
native bool mDontBlur;
|
||||||
|
native bool mAnimatedTransition;
|
||||||
|
native bool mAnimated;
|
||||||
native Font mFont;
|
native Font mFont;
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
|
@ -106,6 +109,9 @@ class OptionMenu : Menu
|
||||||
mParentMenu = parent;
|
mParentMenu = parent;
|
||||||
mDesc = desc;
|
mDesc = desc;
|
||||||
DontDim = desc.mDontDim;
|
DontDim = desc.mDontDim;
|
||||||
|
DontBlur = desc.mDontBlur;
|
||||||
|
AnimatedTransition = desc.mAnimatedTransition;
|
||||||
|
Animated = desc.mAnimated;
|
||||||
|
|
||||||
let itemCount = mDesc.mItems.size();
|
let itemCount = mDesc.mItems.size();
|
||||||
if (itemCount > 0)
|
if (itemCount > 0)
|
||||||
|
|
Loading…
Reference in a new issue