From 1ed1222e10d4fa26e1d9f5f1b6ee5aaf72eec3d4 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 2 Aug 2021 12:34:15 +1000 Subject: [PATCH] - Extend menu's `ListMenu` ZScript class with `mAnimated` already natively available, and use with Blood where `BloodDripDrawer` is defined. * Finalises the interpolated blood dripping code changes from 9884d5f396a952f992d3e943cb01c45c7f497c05. --- source/common/menu/menu.cpp | 1 + source/common/menu/menudef.cpp | 4 ++++ wadsrc/static/menudef.txt | 4 ++++ wadsrc/static/zscript/engine/ui/menu/listmenu.zs | 2 ++ 4 files changed, 11 insertions(+) diff --git a/source/common/menu/menu.cpp b/source/common/menu/menu.cpp index bf773214d..231fb94a5 100644 --- a/source/common/menu/menu.cpp +++ b/source/common/menu/menu.cpp @@ -1036,6 +1036,7 @@ DEFINE_FIELD(DListMenuDescriptor, mFont) DEFINE_FIELD(DListMenuDescriptor, mFontColor) DEFINE_FIELD(DListMenuDescriptor, mFontColor2) DEFINE_FIELD(DListMenuDescriptor, mAnimatedTransition) +DEFINE_FIELD(DListMenuDescriptor, mAnimated) DEFINE_FIELD(DListMenuDescriptor, mCenter) DEFINE_FIELD(DListMenuDescriptor, mVirtWidth) DEFINE_FIELD(DListMenuDescriptor, mVirtHeight) diff --git a/source/common/menu/menudef.cpp b/source/common/menu/menudef.cpp index da73517b0..c5ce40b2a 100644 --- a/source/common/menu/menudef.cpp +++ b/source/common/menu/menudef.cpp @@ -344,6 +344,10 @@ static void DoParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc, bool &s { desc->mAnimatedTransition = true; } + else if (sc.Compare("animated")) + { + desc->mAnimated = true; + } else if (sc.Compare("MouseWindow")) { sc.MustGetNumber(); diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 16db5aae7..157946458 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -40,6 +40,7 @@ LISTMENU "MainMenu" BloodTextItem "$MNU_CREDITS", "c", "CreditsMenu" BloodTextItem "$MNU_QUITGAME", "q", "QuitMenu" BloodDripDrawer + animated } ifgame(ShadowWarrior) { @@ -112,6 +113,7 @@ LISTMENU "IngameMenu" BloodTextItem "$MNU_ENDGAME", "e", "EndgameMenu" BloodTextItem "$MNU_QUITGAME", "q", "QuitMenu" BloodDripDrawer + animated } ifgame(ShadowWarrior) { @@ -169,6 +171,7 @@ LISTMENU "EpisodeMenu" Linespacing 20 CaptionItem "$MNU_EPISODES" BloodDripDrawer + animated } ifgame(ShadowWarrior) { @@ -194,6 +197,7 @@ LISTMENU "SkillMenu" Linespacing 20 CaptionItem "$MNU_DIFFICULTY" BloodDripDrawer + animated } ifgame(ShadowWarrior) { diff --git a/wadsrc/static/zscript/engine/ui/menu/listmenu.zs b/wadsrc/static/zscript/engine/ui/menu/listmenu.zs index dc12f4129..14cd07569 100644 --- a/wadsrc/static/zscript/engine/ui/menu/listmenu.zs +++ b/wadsrc/static/zscript/engine/ui/menu/listmenu.zs @@ -56,6 +56,7 @@ class ListMenuDescriptor : MenuDescriptor native native int mFontColor2; native bool mCenter; native bool mAnimatedTransition; + native bool mAnimated; native int mVirtWidth, mVirtHeight; native void Reset(); @@ -87,6 +88,7 @@ class ListMenu : Menu Super.Init(parent); mDesc = desc; AnimatedTransition = mDesc.mAnimatedTransition; + Animated = mDesc.mAnimated; if (desc.mCenter) { double center = 160;