Addition of hud_style and cl_labelmaps changed to hud_mapstyle with additional maps

This commit is contained in:
pierow 2018-08-12 22:27:24 -04:00
parent 92812ee05e
commit 06e1017423
7 changed files with 142 additions and 54 deletions

View file

@ -203,15 +203,15 @@ void CHud :: Init( void )
g_bDuckToggled = false;
// :
CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 );
CVAR_CREATE( "zoom_sensitivity_ratio", "1", 0 );
default_fov = CVAR_CREATE( "default_fov", "90", 0 );
m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE );
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );
CVAR_CREATE( "cl_showspeed", "0", 0);
CVAR_CREATE( kvLabelMaps, "1", FCVAR_ARCHIVE);
CVAR_CREATE( kvGammaRamp, "1", FCVAR_ARCHIVE);
CVAR_CREATE( kvLabelMaps, "3", FCVAR_ARCHIVE);
CVAR_CREATE( kvGammaRamp, "0", FCVAR_ARCHIVE);
CVAR_CREATE( kvCustomCrosshair, "1", FCVAR_ARCHIVE);
CVAR_CREATE( kvHudMapZoom, "3", FCVAR_ARCHIVE);
CVAR_CREATE( kvLabelHivesight, "1", FCVAR_ARCHIVE);
@ -316,8 +316,16 @@ void CHud :: VidInit( void )
gHUD.SetViewport(theViewPort);
mFont.Load("sprites/font_arial");
mSmallFont.Load("sprites/font_arialsmall");
if (CVAR_GET_FLOAT("hud_style") == 2.0f)
{
mFont.Load("sprites/nl/font_arial");
mSmallFont.Load("sprites/nl/font_arialsmall");
}
else
{
mFont.Load("sprites/font_arial");
mSmallFont.Load("sprites/font_arialsmall");
}
// ----------
// Load Sprites
@ -336,6 +344,9 @@ void CHud :: VidInit( void )
if ( !m_pSpriteList )
{
// we need to load the hud.txt, and all sprites within
if (CVAR_GET_FLOAT("hud_style") == 2.0f)
m_pSpriteList = SPR_GetList("sprites/hudnl.txt", &m_iSpriteCountAllRes);
else
m_pSpriteList = SPR_GetList("sprites/hud.txt", &m_iSpriteCountAllRes);
if (m_pSpriteList)

View file

@ -140,6 +140,7 @@ cvar_t *cl_particleinfo;
cvar_t *cl_widescreen;
cvar_t *cl_ambientsound;
cvar_t *senslock;
cvar_t *hud_style;
/*
===============================================================================
@ -1550,6 +1551,7 @@ void InitInput (void)
cl_widescreen = gEngfuncs.pfnRegisterVariable ( kvWidescreen, "1", FCVAR_ARCHIVE );
cl_ambientsound = gEngfuncs.pfnRegisterVariable ( kvAmbientSound, "2", FCVAR_ARCHIVE);
senslock = gEngfuncs.pfnRegisterVariable ("senslock", "0", FCVAR_ARCHIVE);
hud_style = gEngfuncs.pfnRegisterVariable ("hud_style", "1", FCVAR_ARCHIVE);
// Initialize third person camera controls.
CAM_Init();

View file

@ -36,7 +36,7 @@ extern cvar_t* cl_musicdir;
// Variables
#define kvAutoHelp "cl_autohelp"
// : 1064 The cl var that controls the display of labelled minimaps
#define kvLabelMaps "cl_labelmaps"
#define kvLabelMaps "hud_mapstyle"
// :
// : 0001070 - enables forced gamma ramp loading
#define kvGammaRamp "cl_gammaramp"

View file

@ -428,6 +428,7 @@ extern const char* getModName(void);
#define kSpriteDirectory "sprites"
#define kMiniMapSpritesDirectory "sprites/minimaps"
#define kTechTreeSpriteDirectory "sprites/techtree"
#define kTechTreeSpriteDirectoryNL "sprites/nl/techtree"
#define kTechTreeSpritePrefix "tech"
#define kScriptsDirectory "scripts"
#define kSoundDirectory "sound"

View file

@ -2192,7 +2192,11 @@ AVHHSPRITE AvHHud::GetTechTreeSprite(AvHMessageID inMessageID)
char theMessageNumberString[16];
sprintf(theMessageNumberString, "%d", (int)theMessageNumber);
//string theSpriteName = kTechTreeSpriteDirectory + string("/") + kTechTreeSpritePrefix + string(theMessageIDString) + string(".spr");
string theSpriteName = kTechTreeSpriteDirectory + string("/") + kTechTreeSpritePrefix + string(theMessageNumberString) + string("s.spr");
string theSpriteName;
if (CVAR_GET_FLOAT("hud_style") == 2.0f)
theSpriteName = kTechTreeSpriteDirectoryNL + string("/") + kTechTreeSpritePrefix + string(theMessageNumberString) + string("s.spr");
else
theSpriteName = kTechTreeSpriteDirectory + string("/") + kTechTreeSpritePrefix + string(theMessageNumberString) + string("s.spr");
AVHHSPRITE theSpriteHandle = SPR_Load(theSpriteName.c_str());
// Sprite handle can be 0, as I don't have sprites for all tech yet
@ -4371,12 +4375,82 @@ void AvHHud::VidInit(void)
// string theSpriteName = "sprites/level1_hud.spr";//UINameToSprite(theBaseName, theScreenWidth, true);
// this->mAlienUILifeforms[i] = SPR_Load(theSpriteName.c_str());
// }
if (CVAR_GET_FLOAT("hud_style") == 2.0f)
{
this->mAlienUIUpgrades = SPR_Load(kAlienUpgradeSpriteNL);
this->mAlienUIEnergySprite = SPR_Load(kAlienEnergySpriteNL);
this->mAlienUICloakSprite = SPR_Load(kAlienCloakSpriteNL);
this->mBackgroundSprite = SPR_Load(kTopDownBGSpriteNL);
this->mTopDownTopSprite = SPR_Load(kTopDownTopHUDSpriteNL);
this->mTopDownBottomSprite = SPR_Load(kTopDownBottomHUDSpriteNL);
this->mMarineTopSprite = SPR_Load(kMarineTopHUDSpriteNL);
this->mLogoutSprite = SPR_Load(kLogoutSpriteNL);
this->mCommandButtonSprite = SPR_Load(kCommandButtonSpriteNL);
this->mCommandStatusSprite = SPR_Load(kCommandStatusSpriteNL);
this->mSelectAllSprite = SPR_Load(kSelectAllSpriteNL);
this->mOrderSprite = SPR_Load(kOrdersSpriteNL);
this->mHiveInfoSprite = SPR_Load(kHiveInfoSpriteNL);
this->mHiveHealthSprite = SPR_Load(kHiveHealthSpriteNL);
this->mMarineOrderIndicator = SPR_Load(kMarineOrderSpriteNL);
this->mMarineUpgradesSprite = SPR_Load(kMarineUpgradesSpriteNL);
}
else if (CVAR_GET_FLOAT("hud_style") == 1.0f)
{
this->mAlienUIUpgrades = SPR_Load(kAlienUpgradeSprite);
this->mAlienUIEnergySprite = SPR_Load(kAlienEnergySprite);
this->mAlienUICloakSprite = SPR_Load(kAlienCloakSprite);
this->mBackgroundSprite = SPR_Load(kTopDownBGSprite);
this->mTopDownTopSprite = SPR_Load(kTopDownTopHUDSpriteMin);
this->mTopDownBottomSprite = SPR_Load(kTopDownBottomHUDSpriteMin);
this->mMarineTopSprite = SPR_Load(kMarineTopHUDSpriteMin);
this->mLogoutSprite = SPR_Load(kLogoutSprite);
this->mCommandButtonSprite = SPR_Load(kCommandButtonSprite);
this->mCommandStatusSprite = SPR_Load(kCommandStatusSpriteMin);
this->mSelectAllSprite = SPR_Load(kSelectAllSpriteMin);
this->mOrderSprite = SPR_Load(kOrdersSprite);
this->mHiveInfoSprite = SPR_Load(kHiveInfoSprite);
this->mHiveHealthSprite = SPR_Load(kHiveHealthSprite);
this->mMarineOrderIndicator = SPR_Load(kMarineOrderSprite);
this->mMarineUpgradesSprite = SPR_Load(kMarineUpgradesSprite);
}
else
{
char theBaseName[128];
sprintf(theBaseName, "%s", kAlienUpgradeSprite);
theSpriteName = UINameToSprite(theBaseName, theScreenWidth);
this->mAlienUIUpgrades = SPR_Load(theSpriteName.c_str());
// Load alien energy sprite
theSpriteName = UINameToSprite(kAlienEnergySprite, theScreenWidth);
this->mAlienUIEnergySprite = SPR_Load(theSpriteName.c_str());
theSpriteName = UINameToSprite(kAlienCloakSprite, theScreenWidth);
this->mAlienUICloakSprite = SPR_Load(theSpriteName.c_str());
// Load background for topdown mode
this->mBackgroundSprite = SPR_Load(kTopDownBGSprite);
// Load HUD
this->mTopDownTopSprite = SPR_Load(kTopDownTopHUDSprite);
this->mTopDownBottomSprite = SPR_Load(kTopDownBottomHUDSprite);
this->mMarineTopSprite = SPR_Load(kMarineTopHUDSprite);
this->mLogoutSprite = SPR_Load(kLogoutSprite);
this->mCommandButtonSprite = SPR_Load(kCommandButtonSprite);
this->mCommandStatusSprite = SPR_Load(kCommandStatusSprite);
this->mSelectAllSprite = SPR_Load(kSelectAllSprite);
// Load order sprite
theSpriteName = UINameToSprite(kOrdersSprite, theScreenWidth);
this->mOrderSprite = SPR_Load(theSpriteName.c_str());
this->mHiveInfoSprite = SPR_Load(kHiveInfoSprite);
this->mHiveHealthSprite = SPR_Load(kHiveHealthSprite);
this->mMarineOrderIndicator = SPR_Load(kMarineOrderSprite);
this->mMarineUpgradesSprite = SPR_Load(kMarineUpgradesSprite);
}
char theBaseName[128];
sprintf(theBaseName, "%s", kAlienUpgradeSprite);
theSpriteName = UINameToSprite(theBaseName, theScreenWidth);
this->mAlienUIUpgrades = SPR_Load(theSpriteName.c_str());
sprintf(theBaseName, "%s", kAlienUpgradeCategory);
theSpriteName = UINameToSprite(theBaseName, theScreenWidth);
this->mAlienUIUpgradeCategories = SPR_Load(theSpriteName.c_str());
@ -4385,25 +4459,6 @@ void AvHHud::VidInit(void)
theSpriteName = UINameToSprite(kJetpackSprite, theScreenWidth);
this->mMarineUIJetpackSprite = SPR_Load(theSpriteName.c_str());
// Load alien energy sprite
theSpriteName = UINameToSprite(kAlienEnergySprite, theScreenWidth);
this->mAlienUIEnergySprite = SPR_Load(theSpriteName.c_str());
theSpriteName = UINameToSprite(kAlienCloakSprite, theScreenWidth);
this->mAlienUICloakSprite = SPR_Load(theSpriteName.c_str());
// Load background for topdown mode
this->mBackgroundSprite = SPR_Load(kTopDownBGSprite);
// Load HUD
this->mTopDownTopSprite = SPR_Load(kTopDownTopHUDSprite);
this->mTopDownBottomSprite = SPR_Load(kTopDownBottomHUDSprite);
this->mMarineTopSprite = SPR_Load(kMarineTopHUDSprite);
this->mLogoutSprite = SPR_Load(kLogoutSprite);
this->mCommandButtonSprite = SPR_Load(kCommandButtonSprite);
this->mCommandStatusSprite = SPR_Load(kCommandStatusSprite);
this->mSelectAllSprite = SPR_Load(kSelectAllSprite);
//this->mTopDownBottomSprite = SPR_Load("sprites/distorttest.spr");
//this->mTopDownBottomSprite = SPR_Load("sprites/ns.spr");
//this->mTopDownBottomSprite = SPR_Load("sprites/distorttest.spr");
@ -4412,17 +4467,9 @@ void AvHHud::VidInit(void)
this->mMembraneSprite = SPR_Load(kMembraneSprite);
this->mDigestingSprite = SPR_Load(kDigestingSprite);
// Load order sprite
theSpriteName = UINameToSprite(kOrdersSprite, theScreenWidth);
this->mOrderSprite = SPR_Load(theSpriteName.c_str());
this->mHiveInfoSprite = SPR_Load(kHiveInfoSprite);
this->mHiveHealthSprite = SPR_Load(kHiveHealthSprite);
// Load cursor sprite
this->mMarineCursor = SPR_Load(kCursorsSprite);
this->mAlienCursor = SPR_Load(kAlienCursorSprite);
this->mMarineOrderIndicator = SPR_Load(kMarineOrderSprite);
this->mMarineUpgradesSprite = SPR_Load(kMarineUpgradesSprite);
//this->mMappingTechSprite = SPR_Load("sprites/ns.spr");
this->mAlienBuildSprite = SPR_Load(kAlienBuildSprite);

View file

@ -224,23 +224,28 @@ string AvHMiniMap::GetSpriteNameFromMap(int inSpriteWidth, const string& inMapNa
sprintf(theWidthString, "%d", inSpriteWidth);
// : 1064
// insert _labelled into the filename before ".spr"
string extraname="";
switch ( useLabels ) {
case 1:
extraname="_1";
break;
case 2:
extraname="_2";
break;
case 3:
extraname="_3";
break;
default:
break;
string extraname = "";
switch (useLabels) {
case 1:
extraname = "_1";
break;
case 2:
extraname = "_2";
break;
case 3:
extraname = "_3";
break;
case 4:
extraname = "_4";
break;
case 5:
extraname = "_5";
break;
default:
break;
}
string theMiniMapName = kMiniMapSpritesDirectory + string("/") /*+ string(theWidthString)*/ + inMapName + extraname + string(".spr");
// :
return theMiniMapName;
string theMiniMapName = kMiniMapSpritesDirectory + string("/") /*+ string(theWidthString)*/ + inMapName + extraname + string(".spr");
return theMiniMapName;
}
void AvHMiniMap::InitializePalette()

View file

@ -50,7 +50,9 @@
#define kJetpackSprite "jetpack"
#define kAlienEnergySprite "a-energy"
#define kAlienEnergySpriteNL "sprites/nl/640a-energy.spr"
#define kAlienCloakSprite "a-cloak"
#define kAlienCloakSpriteNL "sprites/nl/640a-cloak.spr"
#define kAlienResourceSprite "a-resources"
#define kCombatExperienceSprite "experience"
@ -60,27 +62,46 @@
//#define kHiveSprite "hive"
//#define kLifeformSprite "alien"
#define kAlienUpgradeSprite "alienupgrades"
#define kAlienUpgradeSpriteNL "sprites/nl/640alienupgrades.spr"
#define kAlienUpgradeCategory "alienupgradecategories"
#define kOrdersSprite "order"
#define kOrdersSpriteNL "sprites/nl/640order.spr"
#define kAlienCursorSprite "sprites/aliencursor.spr"
#define kTopDownBGSprite "sprites/topdownbg.spr"
#define kTopDownBGSpriteNL "sprites/nl/topdownbg.spr"
#define kTopDownTopHUDSprite "sprites/topdowntop.spr"
#define kTopDownTopHUDSpriteNL "sprites/nl/topdowntop.spr"
#define kTopDownTopHUDSpriteMin "sprites/minimal/topdowntop.spr"
#define kTopDownBottomHUDSprite "sprites/topdownbottom.spr"
#define kTopDownBottomHUDSpriteNL "sprites/nl/topdownbottom.spr"
#define kTopDownBottomHUDSpriteMin "sprites/minimal/topdownbottom.spr"
#define kMarineTopHUDSprite "sprites/mainhud.spr"
#define kMarineTopHUDSpriteNL "sprites/nl/mainhud.spr"
#define kMarineTopHUDSpriteMin "sprites/minimal/mainhud.spr"
#define kLogoutSprite "sprites/logout.spr"
#define kLogoutSpriteNL "sprites/nl/logout.spr"
#define kHiveInfoSprite "sprites/hiveinfo.spr"
#define kHiveInfoSpriteNL "sprites/nl/hiveinfo.spr"
#define kHiveHealthSprite "sprites/hivehealth.spr"
#define kHiveHealthSpriteNL "sprites/nl/hivehealth.spr"
#define kCursorsSprite "sprites/cursors.spr"
#define kCommandButtonSprite "sprites/commandbutton.spr"
#define kCommandButtonSpriteNL "sprites/nl/commandbutton.spr"
#define kCommandStatusSprite "sprites/commandstatus.spr"
#define kCommandStatusSprite "sprites/commandstatus.spr"
#define kCommandStatusSpriteNL "sprites/nl/commandstatus.spr"
#define kCommandStatusSpriteMin "sprites/minimal/commandstatus.spr"
#define kSelectAllSprite "sprites/selectall.spr"
#define kSelectAllSpriteNL "sprites/nl/selectall.spr"
#define kSelectAllSpriteMin "sprites/minimal/selectall.spr"
#define kMarineOrderSprite "sprites/hudorder.spr"
#define kMarineOrderSpriteNL "sprites/nl/hudorder.spr"
#define kMarineUpgradesSprite "sprites/upgrades.spr"
#define kMarineUpgradesSpriteNL "sprites/nl/upgrades.spr"
#define kAlienBuildSprite "sprites/ba-build.spr"
#define kMarineBuildSprite "sprites/b-build.spr"
@ -116,6 +137,7 @@
#define kOverwatchCenterSprite "sprites/overwatch-center.spr"
#define kReticleSprite "sprites/reticle.spr"
#define kReticleSpriteNL "sprites/nl/reticle.spr"
#define kMarinePlayersSprite "sprites/iplayerm.spr"
#define kAlienPlayersSprite "sprites/iplayera.spr"
#define kStructuresSprite "sprites/itech.spr"