This commit is contained in:
Rachael Alexanderson 2017-03-28 22:40:40 -04:00
commit 9f38b2b107
20 changed files with 140 additions and 126 deletions

View file

@ -262,5 +262,9 @@ DEFINE_SPECIAL(Stairs_BuildUpDoomCrush, 273, 5, 5, 5)
DEFINE_SPECIAL(Door_AnimatedClose, 274, 4, 4, 4)
DEFINE_SPECIAL(Floor_Stop, 275, 1, 1, 1)
DEFINE_SPECIAL(Ceiling_Stop, 276, 1, 1, 1)
DEFINE_SPECIAL(Sector_SetFloorGlow, 277, 5, 5, 5)
DEFINE_SPECIAL(Sector_SetCeilingGlow, 278, 5, 5, 5)
DEFINE_SPECIAL(Floor_MoveToValueAndCrush, 279, 4, 5, 5)
DEFINE_SPECIAL(Ceiling_MoveToValueAndCrush, 290, 4, 5, 5)
#undef DEFINE_SPECIAL

View file

@ -402,6 +402,7 @@ public:
void BeginStatusBar(int resW, int resH, int relTop, bool completeborder = false, bool forceScaled = false);
void BeginHUD(int resW, int resH, double Alpha, bool forceScaled = false);
void ForceHUDScale(bool on) { ForcedScale = on; } // This is for SBARINFO which should not use BeginStatusBar or BeginHUD.
void StatusbarToRealCoords(double &x, double &y, double &w, double &h) const;
//protected:
void DrawPowerups ();
@ -410,6 +411,7 @@ public:
void RefreshBackground () const;
public:
AInventory *ValidateInvFirst (int numVisible) const;
void DrawCrosshair ();

View file

@ -1003,11 +1003,6 @@ public:
Images.Uninit();
}
void _SetScaled(bool scaled)
{
Scaled = scaled;
}
void _AttachToPlayer(player_t *player)
{
CPlayer = player;
@ -1039,7 +1034,7 @@ public:
{
if(script->huds[hud]->FullScreenOffsets())
wrapper->ForceHUDScale(true);
else if(!Scaled)
else if(!wrapper->Scaled)
{
scalingWasForced = true;
wrapper->SetScaled(true, true);
@ -1205,10 +1200,6 @@ public:
if(!fullScreenOffsets)
{
double tmp = 0;
int barW = wrapper->HorizontalResolution, barH = wrapper->VerticalResolution;
dx += wrapper->ST_X;
dy += wrapper->ST_Y - (Scaled ? barH : 200) + script->height;
w = forceWidth < 0 ? texture->GetScaledWidthDouble() : forceWidth;
h = forceHeight < 0 ? texture->GetScaledHeightDouble() : forceHeight;
double dcx = clip[0] == 0 ? 0 : dx + clip[0] - texture->GetScaledLeftOffsetDouble();
@ -1216,24 +1207,17 @@ public:
double dcr = clip[2] == 0 ? INT_MAX : dx + w - clip[2] - texture->GetScaledLeftOffsetDouble();
double dcb = clip[3] == 0 ? INT_MAX : dy + h - clip[3] - texture->GetScaledTopOffsetDouble();
if(Scaled)
{
if(clip[0] != 0 || clip[1] != 0)
{
screen->VirtualToRealCoords(dcx, dcy, tmp, tmp, barW, barH, true);
wrapper->StatusbarToRealCoords(dcx, dcy, tmp, tmp);
if (clip[0] == 0) dcx = 0;
if (clip[1] == 0) dcy = 0;
}
if(clip[2] != 0 || clip[3] != 0 || clearDontDraw)
screen->VirtualToRealCoords(dcr, dcb, tmp, tmp, barW, barH, true);
screen->VirtualToRealCoords(dx, dy, w, h, barW, barH, true);
}
else
if (clip[2] != 0 || clip[3] != 0 || clearDontDraw)
{
dy += 200 - barH;
dcy += 200 - barH;
dcb += 200 - barH;
wrapper->StatusbarToRealCoords(dcr, dcb, tmp, tmp);
}
wrapper->StatusbarToRealCoords(dx, dy, w, h);
if(clearDontDraw)
screen->Clear(static_cast<int>(MAX<double>(dx, dcx)), static_cast<int>(MAX<double>(dy, dcy)), static_cast<int>(MIN<double>(dcr,w+MAX<double>(dx, dcx))), static_cast<int>(MIN<double>(dcb,MAX<double>(dy, dcy)+h)), GPalette.BlackIndex, 0);
@ -1429,16 +1413,7 @@ public:
if(!fullScreenOffsets)
{
int barW = wrapper->HorizontalResolution, barH = wrapper->VerticalResolution;
rx += wrapper->ST_X;
ry += wrapper->ST_Y - (Scaled ? barH : 200) + script->height;
if(Scaled)
screen->VirtualToRealCoords(rx, ry, rw, rh, barW, barH, true);
else
{
ry += (200 - barH);
}
wrapper->StatusbarToRealCoords(rx, ry, rw, rh);
}
else
{
@ -1497,7 +1472,6 @@ public:
unsigned int invBarOffset;
player_t *CPlayer = nullptr;
DBaseStatusBar *wrapper;
bool Scaled;
private:
SBarInfo *script;
@ -1521,7 +1495,7 @@ void SBarInfoMainBlock::DrawAux(const SBarInfoMainBlock *block, DSBarInfo *statu
rescale = true;
statusBar->wrapper->ForceHUDScale(true);
}
else if(!statusBar->Scaled)
else if(!statusBar->wrapper->Scaled)
{
rescale = true;
statusBar->wrapper->SetScaled(true, true);
@ -1556,14 +1530,6 @@ DEFINE_ACTION_FUNCTION(DSBarInfo, Destroy)
return 0;
}
DEFINE_ACTION_FUNCTION(DSBarInfo, SetScaled)
{
PARAM_SELF_STRUCT_PROLOGUE(DSBarInfo);
PARAM_BOOL(scale);
self->_SetScaled(scale);
return 0;
}
DEFINE_ACTION_FUNCTION(DSBarInfo, AttachToPlayer)
{
PARAM_SELF_STRUCT_PROLOGUE(DSBarInfo);
@ -1620,7 +1586,7 @@ DBaseStatusBar *CreateCustomStatusBar(int scriptno)
auto core = new DSBarInfo(sbar, script);
sbar->PointerVar<DSBarInfo>("core") = core;
sbar->SetSize(script->height, script->_resW, script->_resH);
core->_SetScaled(sbar->Scaled);
sbar->SetScaled(sbar->Scaled);
sbar->CompleteBorder = script->completeBorder;
return sbar;
}

View file

@ -84,7 +84,7 @@ EXTERN_CVAR (Bool, am_showtotaltime)
EXTERN_CVAR (Bool, noisedebug)
EXTERN_CVAR (Int, con_scaletext)
EXTERN_CVAR(Bool, vid_fps)
CVAR(Int, hud_scale, -1, CVAR_ARCHIVE);
CVAR(Int, hud_scale, 0, CVAR_ARCHIVE);
int active_con_scaletext();
@ -1564,6 +1564,25 @@ uint32_t DBaseStatusBar::GetTranslation() const
//
//============================================================================
void DBaseStatusBar::StatusbarToRealCoords(double &x, double &y, double &w, double &h) const
{
if (Scaled)
{
screen->VirtualToRealCoords(x, y, w, h, HorizontalResolution, VerticalResolution, true, true);
}
else
{
x += ST_X;
y += screen->GetHeight() - VerticalResolution;
}
}
//============================================================================
//
// draw stuff
//
//============================================================================
void DBaseStatusBar::DrawGraphic(FTextureID texture, double x, double y, int flags, double Alpha, double boxwidth, double boxheight, double scaleX, double scaleY)
{
if (!texture.isValid())
@ -1636,14 +1655,7 @@ void DBaseStatusBar::DrawGraphic(FTextureID texture, double x, double y, int fla
if (!fullscreenOffsets)
{
x += ST_X;
//y += ST_Y;
// Todo: Allow other scaling values, too.
if (Scaled)
{
screen->VirtualToRealCoords(x, y, boxwidth, boxheight, HorizontalResolution, VerticalResolution, true, true);
}
StatusbarToRealCoords(x, y, boxwidth, boxheight);
}
else
{
@ -1700,7 +1712,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, DrawTexture)
PARAM_FLOAT_DEF(h);
PARAM_FLOAT_DEF(scaleX);
PARAM_FLOAT_DEF(scaleY);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->DrawGraphic(FSetTextureID(texid), x, y, flags, alpha, w, h, scaleX, scaleY);
return 0;
}
@ -1717,7 +1729,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, DrawImage)
PARAM_FLOAT_DEF(h);
PARAM_FLOAT_DEF(scaleX);
PARAM_FLOAT_DEF(scaleY);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->DrawGraphic(TexMan.CheckForTexture(texid, FTexture::TEX_Any), x, y, flags, alpha, w, h, scaleX, scaleY);
return 0;
}
@ -1853,14 +1865,7 @@ void DBaseStatusBar::DrawString(FFont *font, const FString &cstring, double x, d
if (!fullscreenOffsets)
{
rx += ST_X;
//ry += ST_Y;
// Todo: Allow other scaling values, too.
if (Scaled)
{
screen->VirtualToRealCoords(rx, ry, rw, rh, HorizontalResolution, VerticalResolution, true);
}
StatusbarToRealCoords(rx, ry, rw, rh);
}
else
{
@ -1910,7 +1915,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, DrawString)
PARAM_INT_DEF(wrapwidth);
PARAM_INT_DEF(linespacing);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
// resolve auto-alignment before making any adjustments to the position values.
if (!(flags & DI_SCREEN_MANUAL_ALIGN))
@ -1963,14 +1968,7 @@ void DBaseStatusBar::Fill(PalEntry color, double x, double y, double w, double h
if (!fullscreenOffsets)
{
x += ST_X;
//y += ST_Y;
// Todo: Allow other scaling values, too.
if (Scaled)
{
screen->VirtualToRealCoords(x, y, w, h, HorizontalResolution, VerticalResolution, true, true);
}
StatusbarToRealCoords(x, y, w, h);
}
else
{
@ -2002,7 +2000,12 @@ void DBaseStatusBar::Fill(PalEntry color, double x, double y, double w, double h
x += orgx;
y += orgy;
}
screen->Dim(color, float(Alpha), int(x), int(y), int(w), int(h));
int x1 = int(x);
int y1 = int(y);
int ww = int(x + w - x1); // account for scaling to non-integers. Truncating the values separately would fail for cases like
int hh = int(y + h - y1); // y=3.5, height = 5.5 where adding both values gives a larger integer than adding the two integers.
screen->Dim(color, float(Alpha), x1, y1, ww, hh);
}
@ -2015,7 +2018,7 @@ DEFINE_ACTION_FUNCTION(DBaseStatusBar, Fill)
PARAM_FLOAT(w);
PARAM_FLOAT(h);
PARAM_INT_DEF(flags);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
self->Fill(color, x, y, w, h);
return 0;
}

View file

@ -354,7 +354,7 @@ void FGameConfigFile::DoGlobalSetup ()
SetValueForKey ("5", "use ArtiInvulnerability2");
}
}
if (last < 212)
if (last < 213)
{
FBaseCVar *var = FindCVar("hud_scale", NULL);
if (var != NULL)

View file

@ -371,6 +371,7 @@ void GLWall::RenderTextured(int rflags)
int thisll = (*lightlist)[i].caster != NULL ? gl_ClampLight(*(*lightlist)[i].p_lightlevel) : lightlevel;
FColormap thiscm;
thiscm.FadeColor = Colormap.FadeColor;
thiscm.FogDensity = Colormap.FogDensity;
thiscm.CopyFrom3DLight(&(*lightlist)[i]);
mDrawer->SetColor(thisll, rel, thiscm, absalpha);
if (type != RENDERWALL_M2SNF) mDrawer->SetFog(thisll, rel, &thiscm, RenderStyle == STYLE_Add);

View file

@ -33,7 +33,7 @@ public:
OpenGLSWFrameBuffer(void *hMonitor, int width, int height, int bits, int refreshHz, bool fullscreen, bool bgra);
~OpenGLSWFrameBuffer();
bool HasBegun2D() override { return In2D || IsLocked(); }
bool IsValid() override;
bool Lock(bool buffered) override;
void Unlock() override;

View file

@ -4964,6 +4964,10 @@ enum EACSFunctions
ACSF_ScriptCall,
ACSF_StartSlideshow,
// Eternity's
ACSF_GetLineX = 300,
ACSF_GetLineY,
// OpenGL stuff
ACSF_SetSectorGlow = 400,
@ -5345,7 +5349,7 @@ static int SwapActorTeleFog(AActor *activator, int tid)
return count;
}
static int ScriptCall(unsigned argc, int32_t *args)
static int ScriptCall(AActor *activator, unsigned argc, int32_t *args)
{
int retval = 0;
if (argc >= 2)
@ -5372,13 +5376,19 @@ static int ScriptCall(unsigned argc, int32_t *args)
// Note that this array may not be reallocated so its initial size must be the maximum possible elements.
TArray<FString> strings(argc);
TArray<VMValue> params;
int p = 1;
if (func->Proto->ArgumentTypes.Size() > 0 && func->Proto->ArgumentTypes[0] == NewPointer(RUNTIME_CLASS(AActor)))
{
params.Push(activator);
p = 0;
}
for (unsigned i = 2; i < argc; i++)
{
if (func->Proto->ArgumentTypes.Size() < i - 1)
if (func->Proto->ArgumentTypes.Size() < i - p)
{
I_Error("Too many parameters in call to %s.%s", clsname, funcname);
}
auto argtype = func->Proto->ArgumentTypes[i - 2];
auto argtype = func->Proto->ArgumentTypes[i - p - 1];
// The only types allowed are int, bool, double, Name, Sound, Color and String
if (argtype == TypeSInt32 || argtype == TypeColor)
{
@ -6810,17 +6820,30 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
return (args[0] + 32768) & ~0xffff;
case ACSF_ScriptCall:
return ScriptCall(argCount, args);
return ScriptCall(activator, argCount, args);
case ACSF_StartSlideshow:
G_StartSlideshow(FName(FBehavior::StaticLookupString(args[0])));
break;
case ACSF_GetLineX:
case ACSF_GetLineY:
{
FLineIdIterator it(args[0]);
int lineno = it.Next();
if (lineno < 0) return 0;
DVector2 delta = level.lines[lineno].Delta();
double result = delta[funcIndex - ACSF_GetLineX] * ACSToDouble(args[1]);
if (args[2])
{
DVector2 normal = DVector2(delta.Y, -delta.X).Unit();
result += normal[funcIndex - ACSF_GetLineX] * ACSToDouble(args[2]);
}
return DoubleToACS(result);
}
default:
break;
}
return 0;
}

View file

@ -451,6 +451,13 @@ FUNC(LS_Floor_MoveToValue)
arg2*(arg3?-1:1), -1, CHANGE(arg4), false);
}
FUNC(LS_Floor_MoveToValueAndCrush)
// Floor_MoveToValueAndCrush (tag, speed, height, crush, crushmode)
{
return EV_DoFloor(DFloor::floorMoveToValue, ln, arg0, SPEED(arg1),
arg2, CRUSH(arg3) -1, 0, CRUSHTYPE(arg4), false);
}
FUNC(LS_Floor_RaiseToLowestCeiling)
// Floor_RaiseToLowestCeiling (tag, speed, change, crush)
{
@ -744,6 +751,13 @@ FUNC(LS_Ceiling_MoveToValue)
arg2*((arg3) ? -1 : 1), -1, 0, CHANGE(arg4));
}
FUNC(LS_Ceiling_MoveToValueAndCrush)
// Ceiling_MoveToValueAndCrush (tag, speed, height, crush, crushmode)
{
return EV_DoCeiling (DCeiling::ceilMoveToValue, ln, arg0, SPEED(arg1), 0,
arg2, CRUSH(arg3), 0, 0, CRUSHTYPE(arg4, arg1 == 8));
}
FUNC(LS_Ceiling_LowerToHighestFloor)
// Ceiling_LowerToHighestFloor (tag, speed, change, crush, gap)
{
@ -855,13 +869,13 @@ FUNC(LS_Ceiling_ToFloorInstant)
FUNC(LS_Ceiling_LowerToFloor)
// Ceiling_LowerToFloor (tag, speed, change, crush, gap)
{
return EV_DoCeiling (DCeiling::ceilLowerToFloor, ln, arg0, SPEED(arg1), 0, arg4, CRUSH(arg3), 0, CHANGE(arg4));
return EV_DoCeiling (DCeiling::ceilLowerToFloor, ln, arg0, SPEED(arg1), 0, arg4, CRUSH(arg3), 0, CHANGE(arg2));
}
FUNC(LS_Ceiling_LowerByTexture)
// Ceiling_LowerByTexture (tag, speed, change, crush)
{
return EV_DoCeiling (DCeiling::ceilLowerByTexture, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg4));
return EV_DoCeiling (DCeiling::ceilLowerByTexture, ln, arg0, SPEED(arg1), 0, 0, CRUSH(arg3), 0, CHANGE(arg2));
}
FUNC(LS_Ceiling_Stop)
@ -3702,6 +3716,8 @@ static lnSpecFunc LineSpecials[] =
/* 276 */ LS_Ceiling_Stop,
/* 277 */ LS_Sector_SetFloorGlow,
/* 278 */ LS_Sector_SetCeilingGlow,
/* 279 */ LS_Floor_MoveToValueAndCrush,
/* 280 */ LS_Ceiling_MoveToValueAndCrush,
};

View file

@ -8815,9 +8815,17 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
bool writable;
ArgList[i] = ArgList[i]->Resolve(ctx); // nust be resolved before the address is requested.
if (ArgList[i] != nullptr && ArgList[i]->ValueType != TypeNullPtr)
{
if (type == ArgList[i]->ValueType && type->IsA(RUNTIME_CLASS(PPointer)) && static_cast<PPointer*>(type)->IsA(RUNTIME_CLASS(PStruct)))
{
// trying to pass a struct reference as a struct refg
}
else
{
ArgList[i]->RequestAddress(ctx, &writable);
if (flag & VARF_Ref) ArgList[i]->ValueType = NewPointer(ArgList[i]->ValueType);
if (flag & VARF_Ref)ArgList[i]->ValueType = NewPointer(ArgList[i]->ValueType);
}
// For a reference argument the types must match 100%.
if (type != ArgList[i]->ValueType)
{

View file

@ -137,7 +137,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawTexture)
PARAM_FLOAT(x);
PARAM_FLOAT(y);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
FTexture *tex = animate ? TexMan(FSetTextureID(texid)) : TexMan[FSetTextureID(texid)];
VMVa_List args = { param + 4, 0, numparam - 4 };
@ -961,7 +961,7 @@ DEFINE_ACTION_FUNCTION(_Screen, Clear)
PARAM_INT(y2);
PARAM_INT(color);
PARAM_INT_DEF(palcol);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
screen->Clear(x1, y1, x2, y2, palcol, color);
return 0;
}
@ -1013,7 +1013,7 @@ DEFINE_ACTION_FUNCTION(_Screen, Dim)
PARAM_INT(y1);
PARAM_INT(w);
PARAM_INT(h);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
screen->Dim(color, float(amount), x1, y1, w, h);
return 0;
}

View file

@ -116,7 +116,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawChar)
PARAM_FLOAT(y);
PARAM_INT(chr);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
VMVa_List args = { param + 5, 0, numparam - 5 };
screen->DrawChar(font, cr, x, y, chr, args);
return 0;
@ -242,7 +242,7 @@ DEFINE_ACTION_FUNCTION(_Screen, DrawText)
PARAM_FLOAT(y);
PARAM_STRING(chr);
if (!screen->IsLocked()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function");
VMVa_List args = { param + 5, 0, numparam - 5 };
const char *txt = chr[0] == '$' ? GStrings(&chr[1]) : chr.GetChars();
screen->DrawText(font, cr, x, y, txt, args);

View file

@ -410,6 +410,9 @@ public:
// Returns true if hardware-accelerated 2D has been entered, false if not.
virtual bool Begin2D(bool copy3d);
// Returns true if Begin2D has been called and 2D drawing is now active
virtual bool HasBegun2D() { return IsLocked(); }
// DrawTexture calls after Begin2D use native textures.
// Draws the blending rectangle over the viewwindow if in hardware-

View file

@ -66,7 +66,7 @@ const char *GetVersionString();
// Version stored in the ini's [LastRun] section.
// Bump it if you made some configuration change that you want to
// be able to migrate in FGameConfigFile::DoGlobalSetup().
#define LASTRUNVERSION "212"
#define LASTRUNVERSION "213"
// Protocol version used in demos.
// Bump it if you change existing DEM_ commands or add new ones.

View file

@ -105,6 +105,7 @@ public:
D3DFB (UINT adapter, int width, int height, bool bgra, bool fullscreen);
~D3DFB ();
bool HasBegun2D() override { return In2D || IsLocked(); }
bool IsValid ();
bool Lock (bool buffered);
void Unlock ();

View file

@ -94,7 +94,7 @@ class Menu : Object native ui version("2.4")
native static int MenuTime();
native static void SetVideoMode();
native static Menu GetCurrentMenu();
native static void SetMenu(Name mnu, int param = 0);
native static clearscope void SetMenu(Name mnu, int param = 0); // This is not 100% safe but needs to be available - but always make sure to check that only the desired player opens it!
native static void StartMessage(String msg, int mode = 0, Name command = 'none');
native static void SetMouseCapture(bool on);
native void Close();

View file

@ -132,11 +132,14 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
override bool Activate()
{
// This needs to perform a few checks to prevent abuse by malicious modders.
if (GetClass() != "OptionMenuItemSafeCommand")
{
let m = OptionMenu(Menu.GetCurrentMenu());
// don't execute if no menu is active
if (m == null) return false;
// don't execute if this item cannot be found in the current menu.
if (m.GetItem(mAction) != self) return false;
}
Menu.MenuSound("menu/choose");
DoCommand(mAction);
return true;

View file

@ -110,7 +110,7 @@ class DoomStatusBar : BaseStatusBar
if (CPlayer.mo.InvSel != null && !level.NoInventoryBar)
{
DrawInventoryIcon(CPlayer.mo.InvSel, (160, 198));
if (CPlayer.mo.InvSel.Amount > 0)
if (CPlayer.mo.InvSel.Amount > 1)
{
DrawString(mAmountFont, FormatNumber(CPlayer.mo.InvSel.Amount), (175, 198-mIndexFont.mFont.GetHeight()), DI_TEXT_ALIGN_RIGHT, Font.CR_GOLD);
}

View file

@ -1,7 +1,6 @@
struct SBarInfo native ui
{
native void SetScaled(bool scaled);
native void Destroy();
native void AttachToPlayer(PlayerInfo player);
native void Draw(int state);
@ -25,12 +24,6 @@ class SBarInfoWrapper : BaseStatusBar
Super.OnDestroy();
}
override void SetScaled(bool scale, bool force)
{
Super.SetScaled(scale, force);
core.SetScaled(Scaled);
}
override void AttachToPlayer(PlayerInfo player)
{
Super.AttachToPlayer(player);

View file

@ -202,32 +202,23 @@ class StrifeStatusBar : BaseStatusBar
private void FillBar(double x, double y, double start, double stopp, Color color1, Color color2)
{
Vector2 virt = Scaled? (320., 200.) : (screen.GetWidth(), screen.GetHeight());
Vector2 pos, sizev;
start *=2;
stopp *=2;
[pos, sizev] = screen.VirtualToRealCoords((ST_X + x + start, ST_Y + y), (stopp - start, 1), virt, true, Scaled);
screen.Dim(color1, 1.0, pos.X + 0.5, pos.Y + 0.5, sizev.X + 0.5, sizev.Y + 0.5);
[pos, sizev] = screen.VirtualToRealCoords((ST_X + x + start, ST_Y + y + 1), (stopp - start, 1), virt, true, Scaled);
screen.Dim(color2, 1.0, pos.X + 0.5, pos.Y + 0.5, sizev.X + 0.5, sizev.Y + 0.5);
Fill(color1, x, y, (stopp-start)*2, 1);
Fill(color2, x, y+1, (stopp-start)*2, 1);
}
protected void DrawHealthBar(int health, int x, int y)
{
Color green1 = Color(180, 228, 128); // light green
Color green2 = Color(128, 180, 80); // dark green
Color green1 = Color(255, 180, 228, 128); // light green
Color green2 = Color(255, 128, 180, 80); // dark green
Color blue1 = Color(196, 204, 252); // light blue
Color blue2 = Color(148, 152, 200); // dark blue
Color blue1 = Color(255, 196, 204, 252); // light blue
Color blue2 = Color(255, 148, 152, 200); // dark blue
Color gold1 = Color(224, 188, 0); // light gold
Color gold2 = Color(208, 128, 0); // dark gold
Color gold1 = Color(255, 224, 188, 0); // light gold
Color gold2 = Color(255, 208, 128, 0); // dark gold
Color red1 = Color(216, 44, 44); // light red
Color red2 = Color(172, 28, 28); // dark red
Color red1 = Color(255, 216, 44, 44); // light red
Color red2 = Color(255, 172, 28, 28); // dark red
if (health == 999)
{