mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- scriptified SW's status bar.
Not tested yet. This just compiles without errors.
This commit is contained in:
parent
a346c141eb
commit
8d8b3cda46
11 changed files with 1467 additions and 17 deletions
|
@ -829,10 +829,10 @@ void CreateStatusBar()
|
||||||
StatusBar->SetSize(0, 320, 200);
|
StatusBar->SetSize(0, 320, 200);
|
||||||
InitStatusBar();
|
InitStatusBar();
|
||||||
// this is for comparing the scriptification with the C++ versions
|
// this is for comparing the scriptification with the C++ versions
|
||||||
//stbarclass = PClass::FindClass("NativeExhumedStatusBar");
|
stbarclass = PClass::FindClass("NativeSWStatusBar");
|
||||||
//StatusBar2 = static_cast<DBaseStatusBar*>(stbarclass->CreateNew());
|
StatusBar2 = static_cast<DBaseStatusBar*>(stbarclass->CreateNew());
|
||||||
//StatusBar2->SetSize(0, 320, 200);
|
StatusBar2->SetSize(0, 320, 200);
|
||||||
//StatusBar2->Release();
|
StatusBar2->Release();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -976,7 +976,7 @@ struct PLAYERstruct
|
||||||
char cookieQuote[256]; // Should be an FString but must be POD for now so that PLAYER remains POD.
|
char cookieQuote[256]; // Should be an FString but must be POD for now so that PLAYER remains POD.
|
||||||
int cookieTime;
|
int cookieTime;
|
||||||
|
|
||||||
char WpnReloadState;
|
uint8_t WpnReloadState;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];
|
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];
|
||||||
|
|
|
@ -49,9 +49,12 @@ typedef struct
|
||||||
|
|
||||||
extern INVENTORY_DATA InventoryData[MAX_INVENTORY+1];
|
extern INVENTORY_DATA InventoryData[MAX_INVENTORY+1];
|
||||||
|
|
||||||
#define INVF_AUTO_USE (BIT(0))
|
enum EInvFlags
|
||||||
#define INVF_TIMED (BIT(1))
|
{
|
||||||
#define INVF_COUNT (BIT(2))
|
INVF_AUTO_USE = 1,
|
||||||
|
INVF_TIMED = 2,
|
||||||
|
INVF_COUNT = 4
|
||||||
|
};
|
||||||
|
|
||||||
void PlayerUpdateInventory(PLAYERp pp,short InventoryNum);
|
void PlayerUpdateInventory(PLAYERp pp,short InventoryNum);
|
||||||
void InventoryKeys(PLAYERp pp);
|
void InventoryKeys(PLAYERp pp);
|
||||||
|
|
|
@ -216,3 +216,85 @@ x(BONUS_GRAB08, 5159)
|
||||||
x(BONUS_GRAB09, 5160)
|
x(BONUS_GRAB09, 5160)
|
||||||
|
|
||||||
x(TITLE_PIC, 2324)
|
x(TITLE_PIC, 2324)
|
||||||
|
|
||||||
|
x(PanelMedkit, 2396)
|
||||||
|
x(PanelRepairKit, 2399)
|
||||||
|
x(PanelCloak, 2397)
|
||||||
|
x(PanelNightVision, 2398)
|
||||||
|
x(PanelChemBomb, 2407)
|
||||||
|
x(PanelFlashBomb, 2408)
|
||||||
|
x(PanelCaltrops, 2409)
|
||||||
|
|
||||||
|
x(PANEL_FONT_G0, 3636)
|
||||||
|
x(PANEL_FONT_G1, 3637)
|
||||||
|
x(PANEL_FONT_G2, 3638)
|
||||||
|
x(PANEL_FONT_G3, 3639)
|
||||||
|
x(PANEL_FONT_G4, 3640)
|
||||||
|
x(PANEL_FONT_G5, 3641)
|
||||||
|
x(PANEL_FONT_G6, 3642)
|
||||||
|
x(PANEL_FONT_G7, 3643)
|
||||||
|
x(PANEL_FONT_G8, 3644)
|
||||||
|
x(PANEL_FONT_G9, 3645)
|
||||||
|
x(PANEL_SM_FONT_G0, 3601)
|
||||||
|
x(PANEL_SM_FONT_G1, 3602)
|
||||||
|
x(PANEL_SM_FONT_G2, 3603)
|
||||||
|
x(PANEL_SM_FONT_G3, 3604)
|
||||||
|
x(PANEL_SM_FONT_G4, 3605)
|
||||||
|
x(PANEL_SM_FONT_G5, 3606)
|
||||||
|
x(PANEL_SM_FONT_G6, 3607)
|
||||||
|
x(PANEL_SM_FONT_G7, 3608)
|
||||||
|
x(PANEL_SM_FONT_G8, 3609)
|
||||||
|
x(PANEL_SM_FONT_G9, 3610)
|
||||||
|
x(PANEL_SM_FONT_G10, 3611)
|
||||||
|
x(PANEL_SM_FONT_G11, 3612)
|
||||||
|
x(PANEL_SM_FONT_Y0, 3613)
|
||||||
|
x(PANEL_SM_FONT_Y1, 3614)
|
||||||
|
x(PANEL_SM_FONT_Y2, 3615)
|
||||||
|
x(PANEL_SM_FONT_Y3, 3616)
|
||||||
|
x(PANEL_SM_FONT_Y4, 3617)
|
||||||
|
x(PANEL_SM_FONT_Y5, 3618)
|
||||||
|
x(PANEL_SM_FONT_Y6, 3619)
|
||||||
|
x(PANEL_SM_FONT_Y7, 3620)
|
||||||
|
x(PANEL_SM_FONT_Y8, 3621)
|
||||||
|
x(PANEL_SM_FONT_Y9, 3622)
|
||||||
|
x(PANEL_SM_FONT_Y10, 3623)
|
||||||
|
x(PANEL_SM_FONT_Y11, 3624)
|
||||||
|
x(PANEL_SM_FONT_R0, 3625)
|
||||||
|
x(PANEL_SM_FONT_R1, 3626)
|
||||||
|
x(PANEL_SM_FONT_R2, 3627)
|
||||||
|
x(PANEL_SM_FONT_R3, 3628)
|
||||||
|
x(PANEL_SM_FONT_R4, 3629)
|
||||||
|
x(PANEL_SM_FONT_R5, 3630)
|
||||||
|
x(PANEL_SM_FONT_R6, 3631)
|
||||||
|
x(PANEL_SM_FONT_R7, 3632)
|
||||||
|
x(PANEL_SM_FONT_R8, 3633)
|
||||||
|
x(PANEL_SM_FONT_R9, 3634)
|
||||||
|
x(PANEL_SM_FONT_R10, 3635)
|
||||||
|
x(PANEL_SM_FONT_R11, 3636)
|
||||||
|
x(PANEL_KEY_RED, 2392)
|
||||||
|
x(PANEL_KEY_GREEN, 2393)
|
||||||
|
x(PANEL_KEY_BLUE, 2394)
|
||||||
|
x(PANEL_KEY_YELLOW, 2395)
|
||||||
|
x(PANEL_SKELKEY_GOLD, 2448)
|
||||||
|
x(PANEL_SKELKEY_SILVER, 2449)
|
||||||
|
x(PANEL_SKELKEY_BRONZE, 2458)
|
||||||
|
x(PANEL_SKELKEY_RED, 2459)
|
||||||
|
x(MINI_BAR_HEALTH_BOX_PIC, 2437)
|
||||||
|
x(MINI_BAR_AMMO_BOX_PIC, 2437)
|
||||||
|
x(MINI_BAR_INVENTORY_BOX_PIC, 2438)
|
||||||
|
x(SelectionBox, 2435)
|
||||||
|
x(FRAG_BAR, 2920)
|
||||||
|
|
||||||
|
x(COMPASS_TIC, 2380)
|
||||||
|
x(COMPASS_TIC2, 2381)
|
||||||
|
x(COMPASS_NORTH, 2382)
|
||||||
|
x(COMPASS_NORTH2, 2383)
|
||||||
|
x(COMPASS_SOUTH, 2384)
|
||||||
|
x(COMPASS_SOUTH2, 2385)
|
||||||
|
x(COMPASS_EAST, 2386)
|
||||||
|
x(COMPASS_EAST2, 2387)
|
||||||
|
x(COMPASS_WEST, 2388)
|
||||||
|
x(COMPASS_WEST2, 2389)
|
||||||
|
x(COMPASS_MID_TIC, 2390)
|
||||||
|
x(COMPASS_MID_TIC2, 2391)
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
|
|
||||||
BEGIN_SW_NS
|
BEGIN_SW_NS
|
||||||
|
|
||||||
#define FRAG_BAR 2920
|
|
||||||
|
|
||||||
#define PRI_FRONT_MAX 250
|
#define PRI_FRONT_MAX 250
|
||||||
#define PRI_FRONT 192
|
#define PRI_FRONT 192
|
||||||
#define PRI_MID 128
|
#define PRI_MID 128
|
||||||
|
|
|
@ -55,6 +55,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
#include "raze_music.h"
|
#include "raze_music.h"
|
||||||
#include "v_draw.h"
|
#include "v_draw.h"
|
||||||
#include "gamestate.h"
|
#include "gamestate.h"
|
||||||
|
#include "vm.h"
|
||||||
|
|
||||||
BEGIN_SW_NS
|
BEGIN_SW_NS
|
||||||
|
|
||||||
|
@ -7597,4 +7598,174 @@ saveable_module saveable_player =
|
||||||
saveable_player_data,
|
saveable_player_data,
|
||||||
SIZ(saveable_player_data)
|
SIZ(saveable_player_data)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, sop_remote)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, jump_count)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, jump_speed)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, down_speed)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, up_speed)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, z_speed)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oz_speed)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, climb_ndx)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, hiz)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, loz)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, ceiling_dist)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, floor_dist)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, circle_camera_dist)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, six)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siy)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siz)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, siang)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, xvect)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, yvect)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oxvect)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oyvect)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, friction)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_xvect)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_yvect)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_ang)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, slide_dec)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, drive_avel)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, view_outside_dang)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, circle_camera_ang)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, camera_check_time_delay)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, cursectnum)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, lastcursectnum)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, turn180_target)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, hvel)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, tilt)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, tilt_dest)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_amt)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_speed)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_ndx)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, recoil_horizoff)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposx)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposy)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, oldposz)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveX)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveY)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveDeltaAng)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, pnum)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, LadderSector)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, lx)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, ly)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, JumpDuration)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WadeDepth)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, bob_amt)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, bob_ndx)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, bcnt)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, bob_z)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, obob_z)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, playerreadyflag)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Flags)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Flags2)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, HasKey)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, SwordAng)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnGotOnceFlags)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnFlags)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnAmmo)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnNum)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnRocketType)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnRocketHeat)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnRocketNuke)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnFlameType)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnFirstType)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WeaponType)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, FirePause)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, InventoryNum)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, InventoryBarTics)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, InventoryTics)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, InventoryPercent)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, InventoryAmount)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, InventoryActive)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, DiveTics)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, DiveDamageTics)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, DeathType)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Kills)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, SecretsFound)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Armor)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, MaxHealth)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, UziShellLeftAlt)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, UziShellRightAlt)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, TeamColor)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, FadeTics)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, FadeAmt)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, NightVision)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, StartColor)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, IsAI)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, fta)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, ftq)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, NumFootPrints)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnUziType)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnShotgunType)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnShotgunAuto)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnShotgunLastShell)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnRailType)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Bloody)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, InitingNuke)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, TestNukeInit)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, NukeInitialized)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, FistAng)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnKungFuMove)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, HitBy)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Reverb)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, Heads)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, PlayerVersion)
|
||||||
|
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WpnReloadState)
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_SWPlayer, WeaponNum)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(PLAYERstruct);
|
||||||
|
USERp uu = User[self->PlayerSprite].Data();
|
||||||
|
ACTION_RETURN_INT(uu->WeaponNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_SWPlayer, Health)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(PLAYERstruct);
|
||||||
|
USERp uu = User[self->PlayerSprite].Data();
|
||||||
|
ACTION_RETURN_INT(uu->Health);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_SWPlayer, MaxUserHealth)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(PLAYERstruct);
|
||||||
|
USERp uu = User[self->PlayerSprite].Data();
|
||||||
|
ACTION_RETURN_INT(uu->MaxHealth);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_SWPlayer, GetBuildAngle)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(PLAYERstruct);
|
||||||
|
ACTION_RETURN_INT(self->angle.ang.asbuild());
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_SW, WeaponMaxAmmo)
|
||||||
|
{
|
||||||
|
PARAM_PROLOGUE;
|
||||||
|
PARAM_INT(wp);
|
||||||
|
ACTION_RETURN_INT(DamageData[wp].max_ammo);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_SW, InventoryFlags)
|
||||||
|
{
|
||||||
|
PARAM_PROLOGUE;
|
||||||
|
PARAM_INT(inv);
|
||||||
|
INVENTORY_DATAp id = &InventoryData[inv];
|
||||||
|
ACTION_RETURN_INT(id->Flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_SW, GetViewPlayer)
|
||||||
|
{
|
||||||
|
PARAM_PROLOGUE;
|
||||||
|
ACTION_RETURN_POINTER(&Player[screenpeek]);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION(_SW, RealWeapon)
|
||||||
|
{
|
||||||
|
PARAM_PROLOGUE;
|
||||||
|
PARAM_INT(inv);
|
||||||
|
ACTION_RETURN_INT(DamageData[inv].with_weapon);
|
||||||
|
}
|
||||||
|
|
||||||
END_SW_NS
|
END_SW_NS
|
||||||
|
|
|
@ -67,9 +67,9 @@ static const short icons[] = {
|
||||||
ID_PanelCaltrops,
|
ID_PanelCaltrops,
|
||||||
};
|
};
|
||||||
|
|
||||||
class DSWStatusBar : public DBaseStatusBar
|
class DNativeSWStatusBar : public DBaseStatusBar
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(DSWStatusBar, DBaseStatusBar)
|
DECLARE_CLASS(DNativeSWStatusBar, DBaseStatusBar)
|
||||||
HAS_OBJECT_POINTERS
|
HAS_OBJECT_POINTERS
|
||||||
|
|
||||||
TObjPtr<DHUDFont*> miniFont, numberFont;
|
TObjPtr<DHUDFont*> miniFont, numberFont;
|
||||||
|
@ -148,7 +148,7 @@ class DSWStatusBar : public DBaseStatusBar
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DSWStatusBar()
|
DNativeSWStatusBar()
|
||||||
{
|
{
|
||||||
numberFont = Create<DHUDFont>( BigFont, 0, Off, 1, 1 );
|
numberFont = Create<DHUDFont>( BigFont, 0, Off, 1, 1 );
|
||||||
miniFont = Create<DHUDFont>(SmallFont2, 0, Off, 1, 1 );
|
miniFont = Create<DHUDFont>(SmallFont2, 0, Off, 1, 1 );
|
||||||
|
@ -716,7 +716,7 @@ private:
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
bool DoReloadStatus(char *reloadstate, int ammo)
|
bool DoReloadStatus(uint8_t *reloadstate, int ammo)
|
||||||
{
|
{
|
||||||
bool reloading = ammo == 0 && *reloadstate != 2;
|
bool reloading = ammo == 0 && *reloadstate != 2;
|
||||||
|
|
||||||
|
@ -1038,8 +1038,8 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IMPLEMENT_CLASS(DSWStatusBar, false, true)
|
IMPLEMENT_CLASS(DNativeSWStatusBar, false, true)
|
||||||
IMPLEMENT_POINTERS_START(DSWStatusBar)
|
IMPLEMENT_POINTERS_START(DNativeSWStatusBar)
|
||||||
IMPLEMENT_POINTER(miniFont)
|
IMPLEMENT_POINTER(miniFont)
|
||||||
IMPLEMENT_POINTER(numberFont)
|
IMPLEMENT_POINTER(numberFont)
|
||||||
IMPLEMENT_POINTERS_END
|
IMPLEMENT_POINTERS_END
|
||||||
|
|
|
@ -43,6 +43,7 @@ version "4.3"
|
||||||
#include "zscript/games/blood/ui/screens.zs"
|
#include "zscript/games/blood/ui/screens.zs"
|
||||||
#include "zscript/games/sw/swgame.zs"
|
#include "zscript/games/sw/swgame.zs"
|
||||||
#include "zscript/games/sw/ui/menu.zs"
|
#include "zscript/games/sw/ui/menu.zs"
|
||||||
|
#include "zscript/games/sw/ui/sbar.zs"
|
||||||
#include "zscript/games/sw/ui/screens.zs"
|
#include "zscript/games/sw/ui/screens.zs"
|
||||||
#include "zscript/games/exhumed/exhumedgame.zs"
|
#include "zscript/games/exhumed/exhumedgame.zs"
|
||||||
#include "zscript/games/exhumed/ui/menu.zs"
|
#include "zscript/games/exhumed/ui/menu.zs"
|
||||||
|
|
|
@ -27,6 +27,9 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
|
|
||||||
struct SW native
|
struct SW native
|
||||||
{
|
{
|
||||||
|
const MAX_INVENTORY = 7;
|
||||||
|
const MAX_WEAPONS = 14;
|
||||||
|
|
||||||
enum ESWSoundFlag
|
enum ESWSoundFlag
|
||||||
{
|
{
|
||||||
v3df_none = 0, // Default, take no action, use all defaults
|
v3df_none = 0, // Default, take no action, use all defaults
|
||||||
|
@ -42,10 +45,86 @@ struct SW native
|
||||||
v3df_nolookup = 128, // don't use ambient table lookup
|
v3df_nolookup = 128, // don't use ambient table lookup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum EWeaponAndDamage
|
||||||
|
{
|
||||||
|
WPN_FIST,
|
||||||
|
WPN_STAR,
|
||||||
|
WPN_SHOTGUN,
|
||||||
|
WPN_UZI,
|
||||||
|
WPN_MICRO,
|
||||||
|
WPN_GRENADE,
|
||||||
|
WPN_MINE,
|
||||||
|
WPN_RAIL,
|
||||||
|
WPN_HOTHEAD,
|
||||||
|
WPN_HEART,
|
||||||
|
|
||||||
|
WPN_NAPALM,
|
||||||
|
WPN_RING,
|
||||||
|
WPN_ROCKET,
|
||||||
|
WPN_SWORD,
|
||||||
|
|
||||||
|
// extra weapons connected to other
|
||||||
|
|
||||||
|
// spell
|
||||||
|
DMG_NAPALM,
|
||||||
|
DMG_MIRV_METEOR,
|
||||||
|
DMG_SERP_METEOR,
|
||||||
|
|
||||||
|
// radius damage
|
||||||
|
DMG_ELECTRO_SHARD,
|
||||||
|
DMG_SECTOR_EXP,
|
||||||
|
DMG_BOLT_EXP,
|
||||||
|
DMG_TANK_SHELL_EXP,
|
||||||
|
DMG_FIREBALL_EXP,
|
||||||
|
DMG_NAPALM_EXP,
|
||||||
|
DMG_SKULL_EXP,
|
||||||
|
DMG_BASIC_EXP,
|
||||||
|
DMG_GRENADE_EXP,
|
||||||
|
DMG_MINE_EXP,
|
||||||
|
DMG_MINE_SHRAP,
|
||||||
|
DMG_MICRO_EXP,
|
||||||
|
DMG_NUCLEAR_EXP,
|
||||||
|
DMG_RADIATION_CLOUD,
|
||||||
|
DMG_FLASHBOMB,
|
||||||
|
|
||||||
|
DMG_FIREBALL_FLAMES,
|
||||||
|
|
||||||
|
// actor
|
||||||
|
DMG_RIPPER_SLASH,
|
||||||
|
DMG_SKEL_SLASH,
|
||||||
|
DMG_COOLG_BASH,
|
||||||
|
DMG_COOLG_FIRE,
|
||||||
|
DMG_GORO_CHOP,
|
||||||
|
DMG_GORO_FIREBALL,
|
||||||
|
DMG_SERP_SLASH,
|
||||||
|
DMG_LAVA_BOULDER,
|
||||||
|
DMG_LAVA_SHARD,
|
||||||
|
DMG_HORNET_STING,
|
||||||
|
DMG_EEL_ELECTRO,
|
||||||
|
|
||||||
|
// misc
|
||||||
|
DMG_SPEAR_TRAP,
|
||||||
|
DMG_VOMIT,
|
||||||
|
|
||||||
|
// inanimate objects
|
||||||
|
DMG_BLADE,
|
||||||
|
}
|
||||||
|
|
||||||
|
enum EInvFlags
|
||||||
|
{
|
||||||
|
INVF_AUTO_USE = 1,
|
||||||
|
INVF_TIMED = 2,
|
||||||
|
INVF_COUNT = 4
|
||||||
|
}
|
||||||
|
|
||||||
native static void PlaySound(int sound, int flags, int channel = CHAN_AUTO, int cflags = 0);
|
native static void PlaySound(int sound, int flags, int channel = CHAN_AUTO, int cflags = 0);
|
||||||
native static void StopSound();
|
native static void StopSound();
|
||||||
native static bool IsSoundPlaying(int channel); // soundEngine.IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE))
|
native static bool IsSoundPlaying(int channel); // soundEngine.IsSourcePlayingSomething(SOURCE_None, nullptr, CHAN_VOICE))
|
||||||
native static void PlaySong(int trackid);
|
native static void PlaySong(int trackid);
|
||||||
|
native static int WeaponMaxAmmo(int weap);
|
||||||
|
native static int InventoryFlags(int inv);
|
||||||
|
native static SWPlayer GetViewPlayer();
|
||||||
|
native static int RealWeapon(int wp);
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -76,6 +155,188 @@ struct SW native
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct SWPlayer native
|
||||||
|
{
|
||||||
|
// variable that fit in the sprite or user structure
|
||||||
|
/*
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct { int32_t posx, posy, posz; };
|
||||||
|
vec3_t pos;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
// interpolation
|
||||||
|
//int oposx, oposy, oposz;
|
||||||
|
|
||||||
|
// holds last valid move position
|
||||||
|
//int16 lv_sectnum;
|
||||||
|
//int lv_x,lv_y,lv_z;
|
||||||
|
|
||||||
|
// can't do the pointers yet.
|
||||||
|
/*
|
||||||
|
SPRITEp remote_sprite;
|
||||||
|
REMOTE_CONTROL remote;
|
||||||
|
SECTOR_OBJECTp sop_remote;
|
||||||
|
SECTOR_OBJECTp sop; // will either be sop_remote or sop_control
|
||||||
|
SECTORp hi_sectp, lo_sectp;
|
||||||
|
SPRITEp hi_sp, lo_sp;
|
||||||
|
SPRITEp last_camera_sp;
|
||||||
|
PlayerHorizon horizon;
|
||||||
|
PlayerAngle angle;
|
||||||
|
binangle RevolveAng;
|
||||||
|
// under vars are for wading and swimming
|
||||||
|
//int16 PlayerSprite, PlayerUnderSprite;
|
||||||
|
SPRITEp SpriteP, UnderSpriteP;
|
||||||
|
PLAYER_ACTION_FUNCp DoPlayerAction;
|
||||||
|
ESyncBits KeyPressBits;
|
||||||
|
|
||||||
|
SECTOR_OBJECTp sop_control; // sector object pointer
|
||||||
|
SECTOR_OBJECTp sop_riding; // sector object pointer
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
PANEL_SPRITEp Next, Prev;
|
||||||
|
} PanelSpriteList;
|
||||||
|
PANEL_SPRITEp CurWpn;
|
||||||
|
PANEL_SPRITEp Wpn[SW.MAX_WEAPONS];
|
||||||
|
PANEL_SPRITEp Chops;
|
||||||
|
*/
|
||||||
|
native voidptr sop_remote; // the status bar needs to check this - remove once the underlying type can be supported.
|
||||||
|
|
||||||
|
native int jump_count, jump_speed; // jumping
|
||||||
|
native int16 down_speed, up_speed; // diving
|
||||||
|
native int z_speed,oz_speed; // used for diving and flying instead of down_speed, up_speed
|
||||||
|
native int climb_ndx;
|
||||||
|
native int hiz,loz;
|
||||||
|
native int ceiling_dist,floor_dist;
|
||||||
|
native int circle_camera_dist;
|
||||||
|
native int six,siy,siz; // save player interp position for PlayerSprite
|
||||||
|
native int16 siang;
|
||||||
|
|
||||||
|
native int xvect, yvect;
|
||||||
|
native int oxvect, oyvect;
|
||||||
|
native int friction;
|
||||||
|
native int slide_xvect, slide_yvect;
|
||||||
|
native int16 slide_ang;
|
||||||
|
native int slide_dec;
|
||||||
|
native float drive_avel;
|
||||||
|
|
||||||
|
native int16 view_outside_dang; // outside view delta ang
|
||||||
|
native int16 circle_camera_ang;
|
||||||
|
native int16 camera_check_time_delay;
|
||||||
|
|
||||||
|
native int16 cursectnum,lastcursectnum;
|
||||||
|
native int turn180_target; // 180 degree turn
|
||||||
|
|
||||||
|
// variables that do not fit into sprite structure
|
||||||
|
native int hvel,tilt,tilt_dest;
|
||||||
|
native int16 recoil_amt;
|
||||||
|
native int16 recoil_speed;
|
||||||
|
native int16 recoil_ndx;
|
||||||
|
native int recoil_horizoff;
|
||||||
|
|
||||||
|
native int oldposx,oldposy,oldposz;
|
||||||
|
native int RevolveX, RevolveY;
|
||||||
|
native int16 RevolveDeltaAng;
|
||||||
|
|
||||||
|
native int16 pnum; // carry along the player number
|
||||||
|
|
||||||
|
native int16 LadderSector;
|
||||||
|
native int lx,ly; // ladder x and y
|
||||||
|
native int16 JumpDuration;
|
||||||
|
native int16 WadeDepth;
|
||||||
|
native int16 bob_amt;
|
||||||
|
native int16 bob_ndx;
|
||||||
|
native int16 bcnt; // bob count
|
||||||
|
native int bob_z, obob_z;
|
||||||
|
|
||||||
|
// must start out as 0
|
||||||
|
native int playerreadyflag;
|
||||||
|
|
||||||
|
native int Flags, Flags2;
|
||||||
|
|
||||||
|
// Key stuff
|
||||||
|
native uint8 HasKey[8];
|
||||||
|
|
||||||
|
// Weapon stuff
|
||||||
|
native int16 SwordAng;
|
||||||
|
native int WpnGotOnceFlags; // for no respawn mode where weapons are allowed grabbed only once
|
||||||
|
native int WpnFlags;
|
||||||
|
native int16 WpnAmmo[SW.MAX_WEAPONS];
|
||||||
|
native int16 WpnNum;
|
||||||
|
native uint8 WpnRocketType; // rocket type
|
||||||
|
native uint8 WpnRocketHeat; // 5 to 0 range
|
||||||
|
native uint8 WpnRocketNuke; // 1, you have it, or you don't
|
||||||
|
native uint8 WpnFlameType; // Guardian weapons fire
|
||||||
|
native uint8 WpnFirstType; // First weapon type - Sword/Shuriken
|
||||||
|
native uint8 WeaponType; // for weapons with secondary functions
|
||||||
|
native int16 FirePause; // for sector objects - limits rapid firing
|
||||||
|
//
|
||||||
|
// Inventory Vars
|
||||||
|
//
|
||||||
|
native int16 InventoryNum;
|
||||||
|
native int16 InventoryBarTics;
|
||||||
|
native int16 InventoryTics[SW.MAX_INVENTORY];
|
||||||
|
native int16 InventoryPercent[SW.MAX_INVENTORY];
|
||||||
|
native int8 InventoryAmount[SW.MAX_INVENTORY];
|
||||||
|
native bool InventoryActive[SW.MAX_INVENTORY];
|
||||||
|
|
||||||
|
native int16 DiveTics;
|
||||||
|
native int16 DiveDamageTics;
|
||||||
|
|
||||||
|
// Death stuff
|
||||||
|
native uint16 DeathType;
|
||||||
|
native int16 Kills;
|
||||||
|
//native int16 Killer; //who killed me
|
||||||
|
//native int16 KilledPlayer[MAX_SW_PLAYERS_REG];
|
||||||
|
native int16 SecretsFound;
|
||||||
|
|
||||||
|
// Health
|
||||||
|
native int16 Armor;
|
||||||
|
native int16 MaxHealth;
|
||||||
|
|
||||||
|
//char RocketBarrel;
|
||||||
|
|
||||||
|
native uint8 UziShellLeftAlt;
|
||||||
|
native uint8 UziShellRightAlt;
|
||||||
|
native uint8 TeamColor; // used in team play and also used in regular mulit-play for show
|
||||||
|
|
||||||
|
// palette fading up and down for player hit and get items
|
||||||
|
native int16 FadeTics; // Tics between each fade cycle
|
||||||
|
native int16 FadeAmt; // Current intensity of fade
|
||||||
|
native bool NightVision; // Is player's night vision active?
|
||||||
|
native uint8 StartColor; // Darkest color in color range being used
|
||||||
|
//native int16 electro[64];
|
||||||
|
native bool IsAI; // Is this and AI character?
|
||||||
|
native int16 fta,ftq; // First time active and first time quote, for talking in multiplayer games
|
||||||
|
native int16 NumFootPrints; // Number of foot prints left to lay down
|
||||||
|
native uint8 WpnUziType; // Toggle between single or double uzi's if you own 2.
|
||||||
|
native uint8 WpnShotgunType; // Shotgun has normal or fully automatic fire
|
||||||
|
native uint8 WpnShotgunAuto; // 50-0 automatic shotgun rounds
|
||||||
|
native uint8 WpnShotgunLastShell; // Number of last shell fired
|
||||||
|
native uint8 WpnRailType; // Normal Rail Gun or EMP Burst Mode
|
||||||
|
native bool Bloody; // Is player gooey from the slaughter?
|
||||||
|
native bool InitingNuke;
|
||||||
|
native bool TestNukeInit;
|
||||||
|
native bool NukeInitialized; // Nuke already has counted down
|
||||||
|
native int16 FistAng; // KungFu attack angle
|
||||||
|
native uint8 WpnKungFuMove; // KungFu special moves
|
||||||
|
native int16 HitBy; // SpriteNum of whatever player was last hit by
|
||||||
|
native int16 Reverb; // Player's current reverb setting
|
||||||
|
native int16 Heads; // Number of Accursed Heads orbiting player
|
||||||
|
native int PlayerVersion;
|
||||||
|
native uint8 WpnReloadState;
|
||||||
|
|
||||||
|
native int WeaponNum();
|
||||||
|
native int GetBuildAngle();
|
||||||
|
native int Health();
|
||||||
|
native int MaxUserHealth();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct SWSnd native
|
struct SWSnd native
|
||||||
{
|
{
|
||||||
enum ESounds
|
enum ESounds
|
||||||
|
|
934
wadsrc/static/zscript/games/sw/ui/sbar.zs
Normal file
934
wadsrc/static/zscript/games/sw/ui/sbar.zs
Normal file
|
@ -0,0 +1,934 @@
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
/*
|
||||||
|
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
||||||
|
|
||||||
|
This file is part of Shadow Warrior version 1.2
|
||||||
|
|
||||||
|
Shadow Warrior is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
||||||
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
|
*/
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class SWStatusBar : RazeStatusBar
|
||||||
|
{
|
||||||
|
static const String icons[] = {
|
||||||
|
"PanelMedkit",
|
||||||
|
"PanelRepairKit",
|
||||||
|
"PanelCloak",
|
||||||
|
"PanelNightVision",
|
||||||
|
"PanelChemBomb",
|
||||||
|
"PanelFlashBomb",
|
||||||
|
"PanelCaltrops"
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EConstants
|
||||||
|
{
|
||||||
|
PANEL_HEALTH_BOX_X = 20,
|
||||||
|
PANEL_BOX_Y = (174 - 6),
|
||||||
|
PANEL_HEALTH_XOFF = 2,
|
||||||
|
PANEL_HEALTH_YOFF = 4,
|
||||||
|
|
||||||
|
PANEL_AMMO_BOX_X = 197,
|
||||||
|
PANEL_AMMO_XOFF = 1,
|
||||||
|
PANEL_AMMO_YOFF = 4,
|
||||||
|
|
||||||
|
WSUM_X = 93,
|
||||||
|
WSUM_Y = PANEL_BOX_Y + 1,
|
||||||
|
WSUM_XOFF = 25,
|
||||||
|
WSUM_YOFF = 6,
|
||||||
|
|
||||||
|
PANEL_KEYS_BOX_X = 276,
|
||||||
|
PANEL_KEYS_XOFF = 0,
|
||||||
|
PANEL_KEYS_YOFF = 2,
|
||||||
|
|
||||||
|
PANEL_ARMOR_BOX_X = 56,
|
||||||
|
PANEL_ARMOR_XOFF = 2,
|
||||||
|
PANEL_ARMOR_YOFF = 4,
|
||||||
|
|
||||||
|
FRAG_YOFF = 2,
|
||||||
|
|
||||||
|
INVENTORY_BOX_X = 231,
|
||||||
|
INVENTORY_BOX_Y = (176 - 8),
|
||||||
|
|
||||||
|
INVENTORY_PIC_XOFF = 1,
|
||||||
|
INVENTORY_PIC_YOFF = 1,
|
||||||
|
|
||||||
|
INVENTORY_PERCENT_XOFF = 19,
|
||||||
|
INVENTORY_PERCENT_YOFF = 13,
|
||||||
|
|
||||||
|
INVENTORY_STATE_XOFF = 19,
|
||||||
|
INVENTORY_STATE_YOFF = 1,
|
||||||
|
|
||||||
|
MINI_BAR_Y = 174,
|
||||||
|
MINI_BAR_HEALTH_BOX_X = 4,
|
||||||
|
MINI_BAR_AMMO_BOX_X = 32,
|
||||||
|
MINI_BAR_INVENTORY_BOX_X = 64,
|
||||||
|
MINI_BAR_INVENTORY_BOX_Y = MINI_BAR_Y,
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
TextureID PanelFont[10];
|
||||||
|
TextureID SmallSBFont[3][12];
|
||||||
|
HUDFont numberFont, miniFont;
|
||||||
|
|
||||||
|
override void Init()
|
||||||
|
{
|
||||||
|
numberFont = HudFont.Create(BigFont, 0, Mono_Off, 1, 1);
|
||||||
|
miniFont = HudFont.Create(SmallFont2, 0, Mono_Off, 1, 1);
|
||||||
|
for (int i = 0; i < 10; i++) PanelFont[i] = TexMan.CheckForTexture(String.Format("PANEL_FONT_G%d", i), TexMan.Type_Any);
|
||||||
|
for (int i = 0; i < 12; i++)
|
||||||
|
{
|
||||||
|
SmallSBFont[0][i] = TexMan.CheckForTexture(String.Format("PANEL_SM_FONT_G%d", i), TexMan.Type_Any);
|
||||||
|
SmallSBFont[1][i] = TexMan.CheckForTexture(String.Format("PANEL_SM_FONT_Y%d", i), TexMan.Type_Any);
|
||||||
|
SmallSBFont[2][i] = TexMan.CheckForTexture(String.Format("PANEL_SM_FONT_R%d", i), TexMan.Type_Any);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int tileHeight(String tex)
|
||||||
|
{
|
||||||
|
let img = TexMan.CheckForTexture(tex, TexMan.TYPE_Any);
|
||||||
|
let siz = TexMan.GetScaledSize(img);
|
||||||
|
return int(siz.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
int tileWidth(String tex)
|
||||||
|
{
|
||||||
|
let img = TexMan.CheckForTexture(tex, TexMan.TYPE_Any);
|
||||||
|
let siz = TexMan.GetScaledSize(img);
|
||||||
|
return int(siz.X);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayPanelNumber(double x, double y, int number)
|
||||||
|
{
|
||||||
|
String buffer;
|
||||||
|
|
||||||
|
buffer = String.Format("%03d", number);
|
||||||
|
|
||||||
|
for (int i = 0; i < buffer.length(); i++)
|
||||||
|
{
|
||||||
|
let c = buffer.ByteAt(i);
|
||||||
|
if (c < "0" || c > "9")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
let tex = PanelFont[c - 48];
|
||||||
|
DrawTexture(tex, (x, y), DI_ITEM_LEFT_TOP);
|
||||||
|
let siz = TexMan.GetScaledSize(tex);
|
||||||
|
x += siz.X + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplaySummaryString(double x, double y, int color, int shade, String buffer)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < buffer.length(); i++)
|
||||||
|
{
|
||||||
|
let ch = buffer.ByteAt(i);
|
||||||
|
|
||||||
|
if (ch == " ")
|
||||||
|
{
|
||||||
|
x += 4;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (ch == 0x5c) ch = 0;
|
||||||
|
else if (ch == ":") ch = 11;
|
||||||
|
else ch -= 47;
|
||||||
|
|
||||||
|
let font_pic = SmallSBFont[color][ch];
|
||||||
|
DrawTexture(font_pic, (x, y), DI_ITEM_LEFT_TOP, col:Raze.shadeToLight(shade));
|
||||||
|
let siz = TexMan.GetScaledSize(font_pic);
|
||||||
|
x += siz.X + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayTimeLimit(SWPlayer pp)
|
||||||
|
{
|
||||||
|
int seconds = 0;// gNet.TimeLimitClock / 120;
|
||||||
|
let ds = String.Format("%03d:%02d", seconds / 60, seconds % 60);
|
||||||
|
DisplaySummaryString(PANEL_KEYS_BOX_X + 1, PANEL_BOX_Y + 6, 0, 0, ds);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// todo: migrate to FFont to support localization
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayTinyString(double xs, double ys, String buffer, int pal)
|
||||||
|
{
|
||||||
|
DrawString(miniFont, buffer, (xs, ys), DI_ITEM_LEFT_TOP);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DisplayFragString(SWPlayer pp, double xs, double ys, String buffer)
|
||||||
|
{
|
||||||
|
DisplayTinyString(xs, ys, buffer, 0/*pp.DisplayColor()*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayFragNumbers()
|
||||||
|
{
|
||||||
|
for (int pnum = 0; pnum < 4; pnum++)
|
||||||
|
{
|
||||||
|
String buffer;
|
||||||
|
int xs, ys;
|
||||||
|
int frag_bar;
|
||||||
|
|
||||||
|
static const int xoffs[] =
|
||||||
|
{
|
||||||
|
69, 147, 225, 303
|
||||||
|
};
|
||||||
|
|
||||||
|
ys = FRAG_YOFF;
|
||||||
|
|
||||||
|
// frag bar 0 or 1
|
||||||
|
frag_bar = ((pnum) / 4);
|
||||||
|
// move y down according to frag bar number
|
||||||
|
ys = ys + (tileHeight("FRAG_BAR") - 2) * frag_bar;
|
||||||
|
|
||||||
|
// move x over according to the number of players
|
||||||
|
xs = xoffs[pnum];
|
||||||
|
|
||||||
|
buffer.Format("%03d", Raze.PlayerFrags(pnum, -1));
|
||||||
|
DisplayFragString(null/*&Player[pnum]*/, xs, ys, buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayFragNames()
|
||||||
|
{
|
||||||
|
for (int pnum = 0; pnum < 4; pnum++)
|
||||||
|
{
|
||||||
|
int xs, ys;
|
||||||
|
int frag_bar;
|
||||||
|
|
||||||
|
static const int xoffs[] =
|
||||||
|
{
|
||||||
|
7, 85, 163, 241
|
||||||
|
};
|
||||||
|
|
||||||
|
ys = FRAG_YOFF;
|
||||||
|
|
||||||
|
// frag bar 0 or 1
|
||||||
|
frag_bar = ((pnum) / 4);
|
||||||
|
// move y down according to frag bar number
|
||||||
|
ys = ys + (tileHeight("FRAG_BAR") - 2) * frag_bar;
|
||||||
|
|
||||||
|
// move x over according to the number of players
|
||||||
|
xs = xoffs[pnum];
|
||||||
|
|
||||||
|
DisplayFragString(null/*&Player[pnum]*/, xs, ys, Raze.PlayerName(pnum));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// This cannot remain as it is.
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayFragBar(SWPlayer pp)
|
||||||
|
{
|
||||||
|
// must draw this in HUD mode and align to the top center
|
||||||
|
int i, num_frag_bars;
|
||||||
|
int y;
|
||||||
|
|
||||||
|
int numplayers = 1;
|
||||||
|
|
||||||
|
if (numplayers <= 1) return;
|
||||||
|
//if (gNet.MultiGameType == MULTI_GAME_COOPERATIVE) return;
|
||||||
|
|
||||||
|
num_frag_bars = ((numplayers-1)/4)+1;
|
||||||
|
|
||||||
|
for (i = 0, y = 0; i < num_frag_bars; i++)
|
||||||
|
{
|
||||||
|
DrawImage("FRAG_BAR", (0, y), DI_ITEM_LEFT_TOP);
|
||||||
|
y += tileHeight("FRAG_BAR") - 2;
|
||||||
|
}
|
||||||
|
DisplayFragNames();
|
||||||
|
DisplayFragNumbers();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void PlayerUpdateWeaponSummary(SWPlayer pp, int UpdateWeaponNum)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
int pos;
|
||||||
|
int column;
|
||||||
|
int WeaponNum, wpntmp;
|
||||||
|
int colr, shade;
|
||||||
|
String ds;
|
||||||
|
|
||||||
|
WeaponNum = SW.RealWeapon(UpdateWeaponNum);
|
||||||
|
|
||||||
|
static const int wsum_xoff[] = { 0,36,66 };
|
||||||
|
static const String wsum_fmt2[] = { "%3d/%-3d", "%2d/%-2d", "%2d/%-2d" };
|
||||||
|
|
||||||
|
pos = WeaponNum - 1;
|
||||||
|
column = pos / 3;
|
||||||
|
if (column > 2) column = 2;
|
||||||
|
x = WSUM_X + wsum_xoff[column];
|
||||||
|
y = WSUM_Y + (WSUM_YOFF * (pos % 3));
|
||||||
|
|
||||||
|
if (UpdateWeaponNum == pp.WeaponNum())
|
||||||
|
{
|
||||||
|
shade = 0;
|
||||||
|
colr = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shade = 11;
|
||||||
|
colr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wpntmp = WeaponNum + 1;
|
||||||
|
if (wpntmp > 9)
|
||||||
|
wpntmp = 0;
|
||||||
|
ds = String.Format("%d:", wpntmp);
|
||||||
|
|
||||||
|
if (pp.WpnFlags & (1 << WeaponNum))
|
||||||
|
DisplaySummaryString(x, y, 1, shade, ds);
|
||||||
|
else
|
||||||
|
DisplaySummaryString(x, y, 2, shade + 6, ds);
|
||||||
|
|
||||||
|
ds = String.Format(wsum_fmt2[column], pp.WpnAmmo[WeaponNum], SW.WeaponMaxAmmo(WeaponNum));
|
||||||
|
DisplaySummaryString(x + 6, y, colr, shade, ds);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayerUpdateWeaponSummaryAll(SWPlayer pp)
|
||||||
|
{
|
||||||
|
for (int i = SW.WPN_STAR; i <= SW.WPN_HEART; i++)
|
||||||
|
{
|
||||||
|
PlayerUpdateWeaponSummary(pp, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayKeys(SWPlayer pp, double xs, double ys, double scalex = 1, double scaley = 1)
|
||||||
|
{
|
||||||
|
double x, y;
|
||||||
|
int row, col;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
static const String StatusKeyPics[] =
|
||||||
|
{
|
||||||
|
"PANEL_KEY_RED",
|
||||||
|
"PANEL_KEY_BLUE",
|
||||||
|
"PANEL_KEY_GREEN",
|
||||||
|
"PANEL_KEY_YELLOW",
|
||||||
|
"PANEL_SKELKEY_GOLD",
|
||||||
|
"PANEL_SKELKEY_SILVER",
|
||||||
|
"PANEL_SKELKEY_BRONZE",
|
||||||
|
"PANEL_SKELKEY_RED"
|
||||||
|
};
|
||||||
|
let tex = TexMan.CheckForTexture("PANEL_KEY_RED", TexMan.Type_Any);
|
||||||
|
let size = TexMan.GetScaledSize(tex);
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
for (row = 0; row < 2; row++)
|
||||||
|
{
|
||||||
|
for (col = 0; col < 2; col++)
|
||||||
|
{
|
||||||
|
if (pp.HasKey[i])
|
||||||
|
{
|
||||||
|
x = xs + PANEL_KEYS_XOFF + (row * size.X);
|
||||||
|
y = ys + PANEL_KEYS_YOFF + (col * size.Y);
|
||||||
|
DrawImage(StatusKeyPics[i], (x, y), DI_ITEM_LEFT_TOP, scale:(scalex, scaley));
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for skeleton keys
|
||||||
|
i = 0;
|
||||||
|
for (row = 0; row < 2; row++)
|
||||||
|
{
|
||||||
|
for (col = 0; col < 2; col++)
|
||||||
|
{
|
||||||
|
if (pp.HasKey[i + 4])
|
||||||
|
{
|
||||||
|
x = xs + PANEL_KEYS_XOFF + (row * size.X);
|
||||||
|
y = ys + PANEL_KEYS_YOFF + (col * size.Y);
|
||||||
|
DrawImage(StatusKeyPics[i + 4], (x, y), DI_ITEM_LEFT_TOP, scale:(scalex, scaley));
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void PlayerUpdateInventoryPercent(SWPlayer pp, int InventoryBoxX, int InventoryBoxY, int InventoryXoff, int InventoryYoff)
|
||||||
|
{
|
||||||
|
String ds;
|
||||||
|
|
||||||
|
int x = InventoryBoxX + INVENTORY_PERCENT_XOFF + InventoryXoff;
|
||||||
|
int y = InventoryBoxY + INVENTORY_PERCENT_YOFF + InventoryYoff;
|
||||||
|
|
||||||
|
if (SW.InventoryFlags(pp.InventoryNum) & SW.INVF_COUNT)
|
||||||
|
{
|
||||||
|
ds = String.Format("%d", pp.InventoryAmount[pp.InventoryNum]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ds = String.Format("%d%%", pp.InventoryPercent[pp.InventoryNum]);
|
||||||
|
}
|
||||||
|
DisplayTinyString(x, y, ds, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void PlayerUpdateInventoryPic(SWPlayer pp, int InventoryBoxX, int InventoryBoxY, int InventoryXoff, int InventoryYoff)
|
||||||
|
{
|
||||||
|
int x = InventoryBoxX + INVENTORY_PIC_XOFF + InventoryXoff;
|
||||||
|
int y = InventoryBoxY + INVENTORY_PIC_YOFF + InventoryYoff;
|
||||||
|
DrawImage(icons[pp.InventoryNum], (x, y), DI_ITEM_LEFT_TOP);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void PlayerUpdateInventoryState(SWPlayer pp, double InventoryBoxX, double InventoryBoxY, int InventoryXoff, int InventoryYoff)
|
||||||
|
{
|
||||||
|
double x = InventoryBoxX + INVENTORY_STATE_XOFF + InventoryXoff;
|
||||||
|
double y = InventoryBoxY + INVENTORY_STATE_YOFF + InventoryYoff;
|
||||||
|
|
||||||
|
let flags = SW.InventoryFlags(pp.InventoryNum);
|
||||||
|
|
||||||
|
if (flags & SW.INVF_AUTO_USE)
|
||||||
|
{
|
||||||
|
DisplayTinyString(x, y, "AUTO", 0);
|
||||||
|
}
|
||||||
|
else if (flags & SW.INVF_TIMED)
|
||||||
|
{
|
||||||
|
DisplayTinyString(x, y, pp.InventoryActive[pp.InventoryNum] ? "ON" : "OFF", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayBarInventory(SWPlayer pp)
|
||||||
|
{
|
||||||
|
int InventoryBoxX = INVENTORY_BOX_X;
|
||||||
|
int InventoryBoxY = INVENTORY_BOX_Y;
|
||||||
|
|
||||||
|
int InventoryXoff = -1;
|
||||||
|
int InventoryYoff = 0;
|
||||||
|
|
||||||
|
// put pic
|
||||||
|
if (pp.InventoryAmount[pp.InventoryNum])
|
||||||
|
{
|
||||||
|
PlayerUpdateInventoryPic(pp, InventoryBoxX, InventoryBoxY, 0, InventoryYoff);
|
||||||
|
// Auto/On/Off
|
||||||
|
PlayerUpdateInventoryState(pp, InventoryBoxX, InventoryBoxY, InventoryXoff, InventoryYoff);
|
||||||
|
// Percent count/Item count
|
||||||
|
PlayerUpdateInventoryPercent(pp, InventoryBoxX, InventoryBoxY, InventoryXoff, InventoryYoff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
int NORM_CANG(int ang)
|
||||||
|
{
|
||||||
|
return (((ang)+32) & 31);
|
||||||
|
}
|
||||||
|
|
||||||
|
enum EXY
|
||||||
|
{
|
||||||
|
COMPASS_X = 140,
|
||||||
|
COMPASS_Y = (162 - 5),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void DrawCompass(SWPlayer pp)
|
||||||
|
{
|
||||||
|
int start_ang, ang;
|
||||||
|
int x_size = tileWidth("COMPASS_NORTH");
|
||||||
|
int x;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
static const String CompassPic[] =
|
||||||
|
{
|
||||||
|
"COMPASS_EAST", "COMPASS_EAST2",
|
||||||
|
"COMPASS_TIC", "COMPASS_TIC2",
|
||||||
|
"COMPASS_MID_TIC", "COMPASS_MID_TIC2",
|
||||||
|
"COMPASS_TIC", "COMPASS_TIC2",
|
||||||
|
|
||||||
|
"COMPASS_SOUTH", "COMPASS_SOUTH2",
|
||||||
|
"COMPASS_TIC", "COMPASS_TIC2",
|
||||||
|
"COMPASS_MID_TIC", "COMPASS_MID_TIC2",
|
||||||
|
"COMPASS_TIC", "COMPASS_TIC2",
|
||||||
|
|
||||||
|
"COMPASS_WEST", "COMPASS_WEST2",
|
||||||
|
"COMPASS_TIC", "COMPASS_TIC2",
|
||||||
|
"COMPASS_MID_TIC", "COMPASS_MID_TIC2",
|
||||||
|
"COMPASS_TIC", "COMPASS_TIC2",
|
||||||
|
|
||||||
|
"COMPASS_NORTH", "COMPASS_NORTH2",
|
||||||
|
"COMPASS_TIC", "COMPASS_TIC2",
|
||||||
|
"COMPASS_MID_TIC", "COMPASS_MID_TIC2",
|
||||||
|
"COMPASS_TIC", "COMPASS_TIC2"
|
||||||
|
};
|
||||||
|
|
||||||
|
static const int CompassShade[] =
|
||||||
|
{
|
||||||
|
//20, 16, 11, 6, 1, 1, 6, 11, 16, 20
|
||||||
|
25, 19, 15, 9, 1, 1, 9, 15, 19, 25
|
||||||
|
};
|
||||||
|
|
||||||
|
ang = pp.GetBuildAngle();
|
||||||
|
|
||||||
|
if (pp.sop_remote)
|
||||||
|
ang = 0;
|
||||||
|
|
||||||
|
start_ang = (ang + 32) >> 6;
|
||||||
|
|
||||||
|
start_ang = NORM_CANG(start_ang - 4);
|
||||||
|
|
||||||
|
for (i = 0, x = COMPASS_X; i < 10; i++)
|
||||||
|
{
|
||||||
|
DrawImage(CompassPic[NORM_CANG(start_ang + i)], (x, COMPASS_Y), DI_ITEM_LEFT_TOP, col:Raze.shadeToLight(CompassShade[i]));
|
||||||
|
x += x_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DrawStatusBar(SWPlayer pp)
|
||||||
|
{
|
||||||
|
let wnum = pp.WeaponNum();
|
||||||
|
BeginStatusBar(false, 320, 200, tileHeight("STATUS_BAR"));
|
||||||
|
|
||||||
|
if (hud_size == Hud_StbarOverlay) Set43ClipRect();
|
||||||
|
DrawImage("STATUS_BAR", (160, 200), DI_ITEM_CENTER_BOTTOM);
|
||||||
|
screen.ClearClipRect();
|
||||||
|
DisplayPanelNumber(PANEL_HEALTH_BOX_X + PANEL_HEALTH_XOFF, PANEL_BOX_Y + PANEL_HEALTH_YOFF, pp.Health());
|
||||||
|
DisplayPanelNumber(PANEL_ARMOR_BOX_X + PANEL_ARMOR_XOFF, PANEL_BOX_Y + PANEL_ARMOR_YOFF, pp.Armor);
|
||||||
|
if (wnum != SW.WPN_FIST && wnum != SW.WPN_SWORD) DisplayPanelNumber(PANEL_AMMO_BOX_X + PANEL_AMMO_XOFF, PANEL_BOX_Y + PANEL_AMMO_YOFF, pp.WpnAmmo[wnum]);
|
||||||
|
PlayerUpdateWeaponSummaryAll(pp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (gNet.MultiGameType != MULTI_GAME_COMMBAT)
|
||||||
|
DisplayKeys(pp, PANEL_KEYS_BOX_X, PANEL_BOX_Y);
|
||||||
|
else if (gNet.TimeLimit)
|
||||||
|
DisplayTimeLimit(pp);
|
||||||
|
*/
|
||||||
|
DisplayKeys(pp, PANEL_KEYS_BOX_X, PANEL_BOX_Y);
|
||||||
|
|
||||||
|
DisplayBarInventory(pp);
|
||||||
|
DrawCompass(pp);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DisplayMinibarInventory(SWPlayer pp)
|
||||||
|
{
|
||||||
|
int InventoryBoxX = MINI_BAR_INVENTORY_BOX_X;
|
||||||
|
int InventoryBoxY = MINI_BAR_INVENTORY_BOX_Y - 200;
|
||||||
|
|
||||||
|
int InventoryXoff = 0;
|
||||||
|
int InventoryYoff = 1;
|
||||||
|
|
||||||
|
if (pp.InventoryAmount[pp.InventoryNum])
|
||||||
|
{
|
||||||
|
PlayerUpdateInventoryPic(pp, InventoryBoxX, InventoryBoxY, InventoryXoff + 1, InventoryYoff);
|
||||||
|
// Auto/On/Off
|
||||||
|
PlayerUpdateInventoryState(pp, InventoryBoxX, InventoryBoxY, InventoryXoff, InventoryYoff);
|
||||||
|
// Percent count/Item count
|
||||||
|
PlayerUpdateInventoryPercent(pp, InventoryBoxX, InventoryBoxY, InventoryXoff, InventoryYoff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Used in DrawHUD2() for determining whether a reloadable weapon is reloading.
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
bool, int DoReloadStatus(int reloadstate, int ammo)
|
||||||
|
{
|
||||||
|
bool reloading = ammo == 0 && reloadstate != 2;
|
||||||
|
|
||||||
|
if (ammo == 0 && reloadstate == 0)
|
||||||
|
{
|
||||||
|
reloadstate = 1;
|
||||||
|
}
|
||||||
|
else if (ammo)
|
||||||
|
{
|
||||||
|
reloadstate = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return reloading, reloadstate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DrawHUD1(SWPlayer pp)
|
||||||
|
{
|
||||||
|
BeginHUD(1, false, 320, 200);
|
||||||
|
|
||||||
|
int x = MINI_BAR_HEALTH_BOX_X;
|
||||||
|
int y = -26;
|
||||||
|
|
||||||
|
DrawImage("MINI_BAR_HEALTH_BOX_PIC", (x, y), DI_ITEM_LEFT_TOP);
|
||||||
|
|
||||||
|
x = MINI_BAR_HEALTH_BOX_X + 3;
|
||||||
|
DisplayPanelNumber(x, y + 5, pp.Health());
|
||||||
|
|
||||||
|
let wnum = pp.WeaponNum();
|
||||||
|
if (wnum != SW.WPN_SWORD && wnum != SW.WPN_FIST)
|
||||||
|
{
|
||||||
|
x = MINI_BAR_AMMO_BOX_X;
|
||||||
|
DrawImage("MINI_BAR_AMMO_BOX_PIC", (x, y), DI_ITEM_LEFT_TOP);
|
||||||
|
|
||||||
|
x = MINI_BAR_AMMO_BOX_X + 3;
|
||||||
|
DisplayPanelNumber(x, y + 5, pp.WpnAmmo[wnum]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pp.InventoryAmount[pp.InventoryNum])
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Inventory Box
|
||||||
|
x = MINI_BAR_INVENTORY_BOX_X;
|
||||||
|
|
||||||
|
DrawImage("MINI_BAR_INVENTORY_BOX_PIC", (x, y), DI_ITEM_LEFT_TOP);
|
||||||
|
DisplayMinibarInventory(pp);
|
||||||
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// Fullscreen HUD variant #1
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
void DrawHUD2(SWPlayer pp, SummaryInfo info)
|
||||||
|
{
|
||||||
|
BeginHUD(1, false, 320, 200);
|
||||||
|
|
||||||
|
String format;
|
||||||
|
double imgScale;
|
||||||
|
double baseScale = numberFont.mFont.GetHeight() * 0.83125;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Health
|
||||||
|
//
|
||||||
|
let img = TexMan.CheckForTexture("ICON_SM_MEDKIT", TexMan.Type_Any);
|
||||||
|
let siz = TexMan.GetScaledSize(img);
|
||||||
|
imgScale = baseScale / siz.Y;
|
||||||
|
DrawTexture(img, (1.5, -1), DI_ITEM_LEFT_BOTTOM, scale:(imgScale, imgScale));
|
||||||
|
|
||||||
|
let Health = pp.Health();
|
||||||
|
let MaxHealth = pp.MaxUserHealth();
|
||||||
|
if (!hud_flashing || Health > (MaxHealth >> 2) || (PlayClock & 32))
|
||||||
|
{
|
||||||
|
int s = -8;
|
||||||
|
if (hud_flashing && Health > MaxHealth)
|
||||||
|
s += Raze.bsin(PlayClock << 5, -10);
|
||||||
|
int intens = clamp(255 - 4 * s, 0, 255);
|
||||||
|
let pe = Color(255, intens, intens, intens);
|
||||||
|
format = String.Format("%d", Health);
|
||||||
|
DrawString(numberFont, format, (24.25, -numberFont.mFont.GetHeight() + 2), DI_TEXT_ALIGN_LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Armor
|
||||||
|
//
|
||||||
|
img = TexMan.CheckForTexture("ICON_ARMOR", TexMan.Type_Any);
|
||||||
|
siz = TexMan.GetScaledSize(img);
|
||||||
|
imgScale = baseScale / siz.Y;
|
||||||
|
DrawTexture(img, (80.75, -1), DI_ITEM_LEFT_BOTTOM, scale:(imgScale, imgScale));
|
||||||
|
|
||||||
|
format = String.Format("%d", pp.Armor);
|
||||||
|
DrawString(numberFont, format, (108.5, -numberFont.mFont.GetHeight() + 2), DI_TEXT_ALIGN_LEFT);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Weapon
|
||||||
|
//
|
||||||
|
static const String ammo_sprites[] = { "", "ICON_STAR", "ICON_LG_SHOTSHELL", "ICON_LG_UZI_AMMO", "ICON_MICRO_BATTERY", "ICON_LG_GRENADE", "ICON_LG_MINE", "ICON_RAIL_AMMO",
|
||||||
|
"ICON_FIREBALL_LG_AMMO", "ICON_HEART_LG_AMMO", "ICON_FIREBALL_LG_AMMO", "ICON_FIREBALL_LG_AMMO", "ICON_MICRO_BATTERY", "" };
|
||||||
|
|
||||||
|
int weapon = pp.WeaponNum();
|
||||||
|
String wicon = ammo_sprites[weapon];
|
||||||
|
if (wicon.length() > 0)
|
||||||
|
{
|
||||||
|
int ammo = pp.WpnAmmo[weapon];
|
||||||
|
bool reloadableWeapon = weapon == SW.WPN_SHOTGUN || weapon == SW.WPN_UZI;
|
||||||
|
if (!reloadableWeapon || (reloadableWeapon && !cl_showmagamt))
|
||||||
|
{
|
||||||
|
format = String.Format("%d", ammo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int capacity;
|
||||||
|
switch (weapon)
|
||||||
|
{
|
||||||
|
case SW.WPN_SHOTGUN:
|
||||||
|
capacity = 4;
|
||||||
|
break;
|
||||||
|
case SW.WPN_UZI:
|
||||||
|
capacity = pp.WpnUziType ? 50 : 100;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
bool reload;
|
||||||
|
[reload, pp.WpnReloadState] = DoReloadStatus(pp.WpnReloadState, ammo % capacity);
|
||||||
|
int clip = CalcMagazineAmount(ammo, capacity, reload);
|
||||||
|
format = String.Format("%d/%d", clip, ammo - clip);
|
||||||
|
}
|
||||||
|
img = TexMan.CheckForTexture(wicon, TexMan.Type_Any);
|
||||||
|
siz = TexMan.GetScaledSize(img);
|
||||||
|
imgScale = baseScale / siz.Y;
|
||||||
|
let imgX = 21.125;
|
||||||
|
let strlen = format.Length();
|
||||||
|
|
||||||
|
if (strlen > 1)
|
||||||
|
{
|
||||||
|
imgX += (imgX * 0.855) * (strlen - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!hud_flashing || PlayClock & 32 || ammo > (SW.WeaponMaxAmmo(weapon) / 10)))
|
||||||
|
{
|
||||||
|
DrawString(numberFont, format, (-1.5, -numberFont.mFont.GetHeight() + 2), DI_TEXT_ALIGN_RIGHT);
|
||||||
|
}
|
||||||
|
|
||||||
|
DrawTexture(img, (-imgX, -1), DI_ITEM_RIGHT_BOTTOM, scale:(imgScale, imgScale));
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Selected inventory item
|
||||||
|
//
|
||||||
|
img = TexMan.CheckForTexture(icons[pp.InventoryNum], TexMan.Type_Any);
|
||||||
|
siz = TexMan.GetScaledSize(img);
|
||||||
|
imgScale = baseScale / siz.Y;
|
||||||
|
int x = 165;
|
||||||
|
DrawTexture(img, (x, -1), DI_ITEM_LEFT_BOTTOM, scale:(imgScale, imgScale));
|
||||||
|
|
||||||
|
PlayerUpdateInventoryState(pp, x + 3.0, -18.0, 1, 1);
|
||||||
|
//PlayerUpdateInventoryPercent(pp, x + 3.5, -20.5, 1, 1); // function takes integer coordinates.
|
||||||
|
PlayerUpdateInventoryPercent(pp, x + 3, -20, 1, 1);
|
||||||
|
|
||||||
|
//
|
||||||
|
// keys
|
||||||
|
//
|
||||||
|
DisplayKeys(pp, -25, -38, 0.8625, 0.8625);
|
||||||
|
DoLevelStats(int(baseScale + 4), info);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void DrawInventoryIcon(double xs, double ys, int align, int InventoryNum, int amount, bool selected)
|
||||||
|
{
|
||||||
|
double x, y;
|
||||||
|
int INVENTORY_ICON_WIDTH = 28;
|
||||||
|
|
||||||
|
|
||||||
|
x = xs + (InventoryNum * INVENTORY_ICON_WIDTH);
|
||||||
|
y = ys;
|
||||||
|
let tex = icons[InventoryNum];
|
||||||
|
DrawImage(tex, (x, y), align | DI_ITEM_LEFT_TOP, amount ? 1. : 0.333);
|
||||||
|
if (selected)
|
||||||
|
{
|
||||||
|
DrawImage("SelectionBox", (x - 5, y - 5), align | DI_ITEM_LEFT_TOP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// INVENTORY BAR
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void DrawInventory(SWPlayer pp, double xs, double ys, int align)
|
||||||
|
{
|
||||||
|
if (!pp.InventoryBarTics)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < pp.InventoryAmount.size(); i++)
|
||||||
|
{
|
||||||
|
DrawInventoryIcon(xs, ys, align, i, pp.InventoryAmount[i], i == pp.InventoryNum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// Statistics output
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
void DoLevelStats(int bottomy, SummaryInfo info)
|
||||||
|
{
|
||||||
|
StatsPrintInfo stats;
|
||||||
|
stats.fontscale = 1;
|
||||||
|
stats.spacing = 7;
|
||||||
|
stats.screenbottomspace = bottomy;
|
||||||
|
stats.statfont = SmallFont;
|
||||||
|
|
||||||
|
if (automapMode == am_full)
|
||||||
|
{
|
||||||
|
stats.letterColor = Font.TEXTCOLOR_SAPPHIRE;
|
||||||
|
stats.standardColor = Font.TEXTCOLOR_UNTRANSLATED;
|
||||||
|
|
||||||
|
bool textfont = am_textfont;
|
||||||
|
if (!am_textfont)
|
||||||
|
{
|
||||||
|
// For non-English languages force use of the text font. The tiny one is simply too small to ever add localized characters to it.
|
||||||
|
let p = StringTable.Localize("$REQUIRED_CHARACTERS");
|
||||||
|
if (p.length() > 0) textfont = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!textfont)
|
||||||
|
{
|
||||||
|
stats.statfont = SmallFont2;
|
||||||
|
stats.spacing = 6;
|
||||||
|
}
|
||||||
|
else stats.spacing = SmallFont.GetHeight() + 1;
|
||||||
|
PrintAutomapInfo(stats, textfont);
|
||||||
|
}
|
||||||
|
// JBF 20040124: display level stats in screen corner
|
||||||
|
else if (hud_stats && !(netgame /*|| numplayers > 1*/))
|
||||||
|
{
|
||||||
|
stats.letterColor = Font.TEXTCOLOR_RED;
|
||||||
|
stats.standardColor = Font.TEXTCOLOR_TAN;
|
||||||
|
stats.completeColor = Font.TEXTCOLOR_FIRE;
|
||||||
|
PrintLevelStats(stats, info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
override void UpdateStatusBar(SummaryInfo info)
|
||||||
|
{
|
||||||
|
let pp = SW.GetViewPlayer();
|
||||||
|
int nPalette = 0;
|
||||||
|
double inv_x, inv_y;
|
||||||
|
int align;
|
||||||
|
|
||||||
|
if (hud_size == Hud_Nothing)
|
||||||
|
{
|
||||||
|
align = DI_SCREEN_RIGHT_BOTTOM;
|
||||||
|
inv_x = -210;
|
||||||
|
inv_y = -28;
|
||||||
|
DoLevelStats(2, info);
|
||||||
|
}
|
||||||
|
else if (hud_size == Hud_full)
|
||||||
|
{
|
||||||
|
align = DI_SCREEN_CENTER_BOTTOM;
|
||||||
|
inv_x = -80;
|
||||||
|
inv_y = -40;
|
||||||
|
DrawHUD2(pp, info);
|
||||||
|
}
|
||||||
|
else if (hud_size == Hud_Mini)
|
||||||
|
{
|
||||||
|
align = DI_SCREEN_RIGHT_BOTTOM;
|
||||||
|
inv_x = -210;
|
||||||
|
inv_y = -28;
|
||||||
|
DrawHUD1(pp);
|
||||||
|
DoLevelStats(30, info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
align = 0;
|
||||||
|
inv_x = 80;
|
||||||
|
inv_y = 130;
|
||||||
|
DrawStatusBar(pp);
|
||||||
|
DoLevelStats(-3, info);
|
||||||
|
}
|
||||||
|
DrawInventory(pp, inv_x, inv_y, align);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -250,5 +250,5 @@ class BaseStatusBar : StatusBarCore native
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
class SWStatusBar : BaseStatusBar native
|
class NativeSWStatusBar : BaseStatusBar native
|
||||||
{}
|
{}
|
||||||
|
|
Loading…
Reference in a new issue