From 9716e1aea78a4f5b34f0cb87b689f53a18ff2c74 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Sun, 30 May 2010 18:34:59 +0000 Subject: [PATCH] - Changed DrawSelectedInventory's alternateonempty flag to draw the subblock before itself. This allows an else statement to be more useful in practice. - Fixed: Added offsets to the wrong variable in SBarInfo. SVN r2348 (trunk) --- src/g_shared/sbarinfo.cpp | 8 ++++---- src/g_shared/sbarinfo_commands.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/g_shared/sbarinfo.cpp b/src/g_shared/sbarinfo.cpp index 72389c628..1808308be 100644 --- a/src/g_shared/sbarinfo.cpp +++ b/src/g_shared/sbarinfo.cpp @@ -1115,12 +1115,12 @@ public: if((offsetflags & SBarInfoCommand::CENTER) == SBarInfoCommand::CENTER) { - x -= (texture->GetScaledWidthDouble()/2.0)-texture->LeftOffset; - y -= (texture->GetScaledHeightDouble()/2.0)-texture->TopOffset; + dx -= (texture->GetScaledWidthDouble()/2.0)-texture->LeftOffset; + dy -= (texture->GetScaledHeightDouble()/2.0)-texture->TopOffset; } - x += xOffset; - y += yOffset; + dx += xOffset; + dy += yOffset; double w, h; if(!fullScreenOffsets) { diff --git a/src/g_shared/sbarinfo_commands.cpp b/src/g_shared/sbarinfo_commands.cpp index f5dcf198e..c107de090 100644 --- a/src/g_shared/sbarinfo_commands.cpp +++ b/src/g_shared/sbarinfo_commands.cpp @@ -1202,6 +1202,9 @@ class CommandDrawSelectedInventory : public SBarInfoCommandFlowControl, private void Draw(const SBarInfoMainBlock *block, const DSBarInfo *statusBar) { + if(alternateOnEmpty) + SBarInfoCommandFlowControl::Draw(block, statusBar); + if(statusBar->CPlayer->mo->InvSel != NULL && !(level.flags & LEVEL_NOINVENTORYBAR)) { if(artiflash && artiflashTick) @@ -1214,9 +1217,6 @@ class CommandDrawSelectedInventory : public SBarInfoCommandFlowControl, private if(alwaysShowCounter || statusBar->CPlayer->mo->InvSel->Amount != 1) CommandDrawNumber::Draw(block, statusBar); } - - if(alternateOnEmpty) - SBarInfoCommandFlowControl::Draw(block, statusBar); } void Parse(FScanner &sc, bool fullScreenOffsets) {