mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 04:00:42 +00:00
- Extend menu's ImageScroller
ZScript class with mAnimated
and use with Blood for the help and credits menu.
This commit is contained in:
parent
1ed1222e10
commit
0d9afc1aaf
5 changed files with 12 additions and 1 deletions
|
@ -1067,6 +1067,7 @@ DEFINE_FIELD(DImageScrollerDescriptor, textBackgroundBrightness)
|
||||||
DEFINE_FIELD(DImageScrollerDescriptor,textFont)
|
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, virtWidth)
|
DEFINE_FIELD(DImageScrollerDescriptor, virtWidth)
|
||||||
DEFINE_FIELD(DImageScrollerDescriptor, virtHeight)
|
DEFINE_FIELD(DImageScrollerDescriptor, virtHeight)
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,7 @@ public:
|
||||||
FFont *textFont;
|
FFont *textFont;
|
||||||
double textScale;
|
double textScale;
|
||||||
bool mAnimatedTransition;
|
bool mAnimatedTransition;
|
||||||
|
bool mAnimated;
|
||||||
int virtWidth, virtHeight;
|
int virtWidth, virtHeight;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1216,6 +1216,10 @@ static void ParseImageScrollerBody(FScanner& sc, DImageScrollerDescriptor* desc)
|
||||||
{
|
{
|
||||||
desc->mAnimatedTransition = true;
|
desc->mAnimatedTransition = true;
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("animated"))
|
||||||
|
{
|
||||||
|
desc->mAnimated = true;
|
||||||
|
}
|
||||||
else if (sc.Compare("textBackground"))
|
else if (sc.Compare("textBackground"))
|
||||||
{
|
{
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
|
|
|
@ -236,6 +236,7 @@ ImageScroller "HelpMenu"
|
||||||
QAVDrawer "Help4.qav"
|
QAVDrawer "Help4.qav"
|
||||||
QAVDrawer "Help5.qav"
|
QAVDrawer "Help5.qav"
|
||||||
QAVDrawer "Help3b.qav"
|
QAVDrawer "Help3b.qav"
|
||||||
|
animated
|
||||||
}
|
}
|
||||||
ifgame(ShadowWarrior)
|
ifgame(ShadowWarrior)
|
||||||
{
|
{
|
||||||
|
@ -356,6 +357,7 @@ ImageScroller "CreditsMenu"
|
||||||
ifgame(blood)
|
ifgame(blood)
|
||||||
{
|
{
|
||||||
QAVDrawer "Credits.qav"
|
QAVDrawer "Credits.qav"
|
||||||
|
animated
|
||||||
}
|
}
|
||||||
ifgame(ShadowWarrior)
|
ifgame(ShadowWarrior)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,7 @@ class ImageScrollerDescriptor : MenuDescriptor native
|
||||||
native Color textBackgroundBrightness;
|
native Color textBackgroundBrightness;
|
||||||
native double textScale;
|
native double textScale;
|
||||||
native bool mAnimatedTransition;
|
native bool mAnimatedTransition;
|
||||||
|
native bool mAnimated;
|
||||||
native int virtWidth, virtHeight;
|
native int virtWidth, virtHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +169,7 @@ class ImageScrollerMenu : Menu
|
||||||
index = 0;
|
index = 0;
|
||||||
mDesc = desc;
|
mDesc = desc;
|
||||||
AnimatedTransition = desc.mAnimatedTransition;
|
AnimatedTransition = desc.mAnimatedTransition;
|
||||||
|
Animated = desc.mAnimated;
|
||||||
current = mDesc.mItems[0];
|
current = mDesc.mItems[0];
|
||||||
current.onStartPage();
|
current.onStartPage();
|
||||||
previous = null;
|
previous = null;
|
||||||
|
@ -273,11 +275,12 @@ class ImageScrollerMenu : Menu
|
||||||
{
|
{
|
||||||
if (previous != null)
|
if (previous != null)
|
||||||
{
|
{
|
||||||
|
bool wasAnimated = Animated;
|
||||||
Animated = true;
|
Animated = true;
|
||||||
if (DrawTransition()) return;
|
if (DrawTransition()) return;
|
||||||
previous = null;
|
previous = null;
|
||||||
|
Animated = wasAnimated;
|
||||||
}
|
}
|
||||||
current.Drawer(false);
|
current.Drawer(false);
|
||||||
Animated = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue