Progs update

This commit is contained in:
Marco Cawthorne 2019-01-18 21:09:53 +01:00
parent 3933b256b0
commit 61fcdfcf07
8 changed files with 147 additions and 106 deletions

View file

@ -8,7 +8,7 @@
#include "VGUI.h"
vguiweaponobject_t vguiWeaponTable[ CS_WEAPON_COUNT ] = {
vguiweaponobject_t vguiWeaponTable[CS_WEAPON_COUNT] = {
{ _("WEAPON_NONE"), "" },
{ _("WEAPON_KNIFE"), "" },
{ _("WEAPON_USP"), "gfx/vgui/640_usp" },
@ -35,7 +35,7 @@ vguiweaponobject_t vguiWeaponTable[ CS_WEAPON_COUNT ] = {
{ _("WEAPON_PARA"), "gfx/vgui/640_m249" }
};
vguiequipobject_t vguiEquipmentTable[ 7 ] = {
vguiequipobject_t vguiEquipmentTable[7] = {
{ EQUIPMENT_KEVLAR, _("EQUIPMENT_KEVLAR"), "gfx/vgui/640_kevlar" },
{ EQUIPMENT_HELMET, _("EQUIPMENT_HELMET"), "gfx/vgui/640_kevlar_helmet" },
{ WEAPON_FLASHBANG, _("WEAPON_FLASHBANG"), "gfx/vgui/640_flashbang" },
@ -46,51 +46,51 @@ vguiequipobject_t vguiEquipmentTable[ 7 ] = {
};
// TODO: Clean this up
void VGUI_BuyMenu_Main( vector vPos ) {
static void BuyMenu_Main_1( void ) {
void VGUI_BuyMenu_Main(vector vPos) {
static void BuyMenu_Main_1(void) {
pSeat->fVGUI_Display = VGUI_BM_HANDGUNS;
}
static void BuyMenu_Main_2( void ) {
static void BuyMenu_Main_2(void) {
pSeat->fVGUI_Display = VGUI_BM_SHOTGUNS;
}
static void BuyMenu_Main_3( void ) {
static void BuyMenu_Main_3(void) {
pSeat->fVGUI_Display = VGUI_BM_SMG;
}
static void BuyMenu_Main_4( void ) {
static void BuyMenu_Main_4(void) {
pSeat->fVGUI_Display = VGUI_BM_RIFLES;
}
static void BuyMenu_Main_5( void ) {
static void BuyMenu_Main_5(void) {
pSeat->fVGUI_Display = VGUI_BM_MGS;
}
static void BuyMenu_Main_6( void ) {
sendevent( "GamePlayerBuyAmmo", "f", 0 );
static void BuyMenu_Main_6(void) {
sendevent("GamePlayerBuyAmmo", "f", 0);
pSeat->fVGUI_Display = VGUI_NONE;
}
static void BuyMenu_Main_7( void ) {
sendevent( "GamePlayerBuyAmmo", "f", 1 );
static void BuyMenu_Main_7(void) {
sendevent("GamePlayerBuyAmmo", "f", 1);
pSeat->fVGUI_Display = VGUI_NONE;
}
static void BuyMenu_Main_8( void ) {
static void BuyMenu_Main_8(void) {
pSeat->fVGUI_Display = VGUI_BM_EQUIPMENT;
}
static void BuyMenu_Main_9( void ) {
static void BuyMenu_Main_9(void) {
pSeat->fVGUI_Display = VGUI_NONE;
}
VGUI_Button( _("VGUI_TITLE_HANDGUN"), BuyMenu_Main_1, vPos + '16 116 0', '180 24 0' );
VGUI_Button( _("VGUI_TITLE_SHOTGUN"), BuyMenu_Main_2, vPos + '16 148 0', '180 24 0' );
VGUI_Button( _("VGUI_TITLE_SMG"), BuyMenu_Main_3, vPos + '16 180 0', '180 24 0' );
VGUI_Button( _("VGUI_TITLE_RIFLE"), BuyMenu_Main_4, vPos + '16 212 0', '180 24 0' );
VGUI_Button( _("VGUI_TITLE_MG"), BuyMenu_Main_5, vPos + '16 244 0', '180 24 0' );
VGUI_Button(_("VGUI_TITLE_HANDGUN"), BuyMenu_Main_1, vPos + [16,116], [180,24]);
VGUI_Button(_("VGUI_TITLE_SHOTGUN"), BuyMenu_Main_2, vPos + [16,148], [180,24]);
VGUI_Button(_("VGUI_TITLE_SMG"), BuyMenu_Main_3, vPos + [16,180], [180,24]);
VGUI_Button(_("VGUI_TITLE_RIFLE"), BuyMenu_Main_4, vPos + [16,212], [180,24]);
VGUI_Button(_("VGUI_TITLE_MG"), BuyMenu_Main_5, vPos + [16,244], [180,24]);
VGUI_Button( _("VGUI_TITLE_AMMO1"), BuyMenu_Main_6, vPos + '16 308 0', '180 24 0' );
VGUI_Button( _("VGUI_TITLE_AMMO2"), BuyMenu_Main_7, vPos + '16 340 0', '180 24 0' );
VGUI_Button( _("VGUI_TITLE_EQUIPMENT"), BuyMenu_Main_8, vPos + '16 372 0', '180 24 0' );
VGUI_Button(_("VGUI_TITLE_AMMO1"), BuyMenu_Main_6, vPos + [16,308], [180,24]);
VGUI_Button(_("VGUI_TITLE_AMMO2"), BuyMenu_Main_7, vPos + [16,340], [180,24]);
VGUI_Button(_("VGUI_TITLE_EQUIPMENT"), BuyMenu_Main_8, vPos + [16,372], [180,24]);
VGUI_Button( _("VGUI_EXIT"), BuyMenu_Main_9, vPos + '16 440 0', '180 24 0' );
VGUI_Button(_("VGUI_EXIT"), BuyMenu_Main_9, vPos + [16,440], [180,24]);
}
void VGUI_BuyMenu_Back( void ) {
void VGUI_BuyMenu_Back(void) {
pSeat->fVGUI_Display = VGUI_BM_MAIN;
}
@ -102,9 +102,9 @@ This is kinda ugly, but it will work for now
====================
*/
float iLastSelected;
void VGUI_BuyMenu_BuyWeapon( void ) {
if( iLastSelected ) {
sendevent( "PlayerBuyWeapon", "f", iLastSelected );
void VGUI_BuyMenu_BuyWeapon(void) {
if(iLastSelected) {
sendevent("PlayerBuyWeapon", "f", iLastSelected);
pSeat->fVGUI_Display = VGUI_NONE;
}
}
@ -114,8 +114,8 @@ void VGUI_BuyMenu_BuyWeapon( void ) {
VGUI_BuyMenu_BuyEquipment
====================
*/
void VGUI_BuyMenu_BuyEquipment( void ) {
sendevent( "PlayerBuyEquipment", "f", iLastSelected );
void VGUI_BuyMenu_BuyEquipment(void) {
sendevent("PlayerBuyEquipment", "f", iLastSelected);
pSeat->fVGUI_Display = VGUI_NONE;
}
@ -126,18 +126,18 @@ VGUI_BuyMenu_WeaponButton
Draws a button that displays whether or not you can purchase said weapon etc.
====================
*/
void VGUI_BuyMenu_WeaponButton( float fWeapon ) {
void VGUI_BuyMenu_WeaponButton(float fWeapon) {
iLastSelected = fWeapon;
if ( wptTable[ fWeapon ].iPrice <= getstatf( STAT_MONEY ) ) {
if ( VGUI_Button( vguiWeaponTable[ fWeapon ].sName, VGUI_BuyMenu_BuyWeapon, vVGUIButtonPos, '264 24 0' ) == TRUE ) {
drawpic( vVGUIWindowPos + '328 116', vguiWeaponTable[ fWeapon ].sImage, '256 64', '1 1 1', 1 );
VGUI_Text( sprintf( _("BUY_PRICETAG"), wptTable[ fWeapon ].iPrice ), vVGUIWindowPos + '328 250', '12 12', FONT_CON );
VGUI_Text( sprintf( _("BUY_CALIBER"), wptTable[ fWeapon ].iCaliber ), vVGUIWindowPos + '328 260', '12 12', FONT_CON );
VGUI_Text( sprintf( _("BUY_RPM"), ( wptTable[ fWeapon ].fAttackFinished) * 3600 ), vVGUIWindowPos + '328 270', '12 12', FONT_CON );
if (wptTable[fWeapon].iPrice <= getstatf(STAT_MONEY)) {
if (VGUI_Button(vguiWeaponTable[fWeapon].sName, VGUI_BuyMenu_BuyWeapon, vVGUIButtonPos, [264,24]) == TRUE) {
drawpic(vVGUIWindowPos + [328,116], vguiWeaponTable[fWeapon].sImage, [256,64], [1,1,1], 1);
VGUI_Text(sprintf(_("BUY_PRICETAG"), wptTable[fWeapon].iPrice), vVGUIWindowPos + [328,250], [12,12], FONT_CON);
VGUI_Text(sprintf(_("BUY_CALIBER"), wptTable[fWeapon].iCaliber), vVGUIWindowPos + [328,260], [12,12], FONT_CON);
VGUI_Text(sprintf(_("BUY_RPM"), (wptTable[fWeapon].fAttackFinished) * 3600), vVGUIWindowPos + [328,270], [12,12], FONT_CON);
}
} else {
VGUI_FakeButton( vguiWeaponTable[ fWeapon ].sName, vVGUIButtonPos, '264 24 0' );
VGUI_FakeButton(vguiWeaponTable[fWeapon].sName, vVGUIButtonPos, [264,24]);
}
vVGUIButtonPos_y += 32;
@ -150,16 +150,16 @@ VGUI_BuyMenu_EquipmentButton
Draws a button that displays whether or not you can purchase said equipment
====================
*/
void VGUI_BuyMenu_EquipmentButton( float fID ) {
void VGUI_BuyMenu_EquipmentButton(float fID) {
iLastSelected = fID;
if ( eqptTable[ fID ].iPrice <= getstatf( STAT_MONEY ) ) {
if ( VGUI_Button( vguiEquipmentTable[ fID ].sName, VGUI_BuyMenu_BuyEquipment, vVGUIButtonPos, '180 24 0' ) == TRUE ) {
drawpic( vVGUIWindowPos + '290 116', vguiEquipmentTable[ fID ].sImage, '256 64', '1 1 1', 1 );
VGUI_Text( sprintf( _("BUY_PRICETAG"), eqptTable[ fID ].iPrice ) , vVGUIWindowPos + '256 250', '12 12', FONT_CON );
if (eqptTable[fID].iPrice <= getstatf(STAT_MONEY)) {
if (VGUI_Button(vguiEquipmentTable[fID].sName, VGUI_BuyMenu_BuyEquipment, vVGUIButtonPos, [180,24]) == TRUE) {
drawpic(vVGUIWindowPos + [290,116], vguiEquipmentTable[fID].sImage, [256,64], [1,1,1], 1);
VGUI_Text(sprintf(_("BUY_PRICETAG"), eqptTable[fID].iPrice) , vVGUIWindowPos + [256,250], [12,12], FONT_CON);
}
} else {
VGUI_FakeButton( vguiEquipmentTable[ fID ].sName, vVGUIButtonPos, '180 24 0' );
VGUI_FakeButton(vguiEquipmentTable[fID].sName, vVGUIButtonPos, [180,24]);
}
vVGUIButtonPos_y += 32;
@ -170,23 +170,23 @@ void VGUI_BuyMenu_EquipmentButton( float fID ) {
VGUI_BuyMenu_Handguns
====================
*/
void VGUI_BuyMenu_Handguns( vector vPos ) {
vVGUIButtonPos = vPos + '16 116 0';
void VGUI_BuyMenu_Handguns(vector vPos) {
vVGUIButtonPos = vPos + [16,116];
VGUI_BuyMenu_WeaponButton( WEAPON_USP45 );
VGUI_BuyMenu_WeaponButton( WEAPON_GLOCK18 );
VGUI_BuyMenu_WeaponButton( WEAPON_DEAGLE );
VGUI_BuyMenu_WeaponButton( WEAPON_P228 );
VGUI_BuyMenu_WeaponButton(WEAPON_USP45);
VGUI_BuyMenu_WeaponButton(WEAPON_GLOCK18);
VGUI_BuyMenu_WeaponButton(WEAPON_DEAGLE);
VGUI_BuyMenu_WeaponButton(WEAPON_P228);
vVGUIButtonPos_y += 32;
if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_T ) {
VGUI_BuyMenu_WeaponButton( WEAPON_ELITES );
} else if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_CT ) {
VGUI_BuyMenu_WeaponButton( WEAPON_FIVESEVEN );
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
VGUI_BuyMenu_WeaponButton(WEAPON_ELITES);
} else if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_CT) {
VGUI_BuyMenu_WeaponButton(WEAPON_FIVESEVEN);
}
VGUI_Button( _("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + '16 440 0', '180 24 0' );
VGUI_Button(_("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + [16,440], [180,24]);
}
/*
@ -194,13 +194,13 @@ void VGUI_BuyMenu_Handguns( vector vPos ) {
VGUI_BuyMenu_Shotguns
====================
*/
void VGUI_BuyMenu_Shotguns( vector vPos ) {
vVGUIButtonPos = vPos + '16 116 0';
void VGUI_BuyMenu_Shotguns(vector vPos) {
vVGUIButtonPos = vPos + [16,116];
VGUI_BuyMenu_WeaponButton( WEAPON_M3 );
VGUI_BuyMenu_WeaponButton( WEAPON_XM1014 );
VGUI_BuyMenu_WeaponButton(WEAPON_M3);
VGUI_BuyMenu_WeaponButton(WEAPON_XM1014);
VGUI_Button( _("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + '16 440 0', '180 24 0' );
VGUI_Button(_("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + [16,440], [180,24]);
}
/*
@ -208,23 +208,23 @@ void VGUI_BuyMenu_Shotguns( vector vPos ) {
VGUI_BuyMenu_SMGs
====================
*/
void VGUI_BuyMenu_SMGs( vector vPos ) {
vVGUIButtonPos = vPos + '16 116 0';
void VGUI_BuyMenu_SMGs(vector vPos) {
vVGUIButtonPos = vPos + [16,116];
VGUI_BuyMenu_WeaponButton( WEAPON_MP5 );
VGUI_BuyMenu_WeaponButton( WEAPON_P90 );
VGUI_BuyMenu_WeaponButton( WEAPON_UMP45 );
VGUI_BuyMenu_WeaponButton(WEAPON_MP5);
VGUI_BuyMenu_WeaponButton(WEAPON_P90);
VGUI_BuyMenu_WeaponButton(WEAPON_UMP45);
vVGUIButtonPos_y += 32;
if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_T ) {
VGUI_BuyMenu_WeaponButton( WEAPON_MAC10 );
} else if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_CT ) {
VGUI_BuyMenu_WeaponButton( WEAPON_TMP );
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
VGUI_BuyMenu_WeaponButton(WEAPON_MAC10);
} else if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_CT) {
VGUI_BuyMenu_WeaponButton(WEAPON_TMP);
}
VGUI_Button( _("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + '16 440 0', '180 24 0' );
VGUI_Button(_("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + [16,440], [180,24]);
}
/*
@ -232,30 +232,30 @@ void VGUI_BuyMenu_SMGs( vector vPos ) {
VGUI_BuyMenu_Rifles
====================
*/
void VGUI_BuyMenu_Rifles( vector vPos ) {
vVGUIButtonPos = vPos + '16 116 0';
void VGUI_BuyMenu_Rifles(vector vPos) {
vVGUIButtonPos = vPos + [16,116];
if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_T ) {
VGUI_BuyMenu_WeaponButton( WEAPON_AK47 );
VGUI_BuyMenu_WeaponButton( WEAPON_SG552 );
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_T) {
VGUI_BuyMenu_WeaponButton(WEAPON_AK47);
VGUI_BuyMenu_WeaponButton(WEAPON_SG552);
VGUI_BuyMenu_WeaponButton( WEAPON_SCOUT );
VGUI_BuyMenu_WeaponButton( WEAPON_AWP );
VGUI_BuyMenu_WeaponButton(WEAPON_SCOUT);
VGUI_BuyMenu_WeaponButton(WEAPON_AWP);
VGUI_BuyMenu_WeaponButton( WEAPON_G3SG1 );
VGUI_BuyMenu_WeaponButton(WEAPON_G3SG1);
}
if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_CT ) {
VGUI_BuyMenu_WeaponButton( WEAPON_M4A1 );
VGUI_BuyMenu_WeaponButton( WEAPON_AUG );
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_CT) {
VGUI_BuyMenu_WeaponButton(WEAPON_M4A1);
VGUI_BuyMenu_WeaponButton(WEAPON_AUG);
VGUI_BuyMenu_WeaponButton( WEAPON_SCOUT );
VGUI_BuyMenu_WeaponButton( WEAPON_AWP );
VGUI_BuyMenu_WeaponButton(WEAPON_SCOUT);
VGUI_BuyMenu_WeaponButton(WEAPON_AWP);
VGUI_BuyMenu_WeaponButton( WEAPON_SG550 );
VGUI_BuyMenu_WeaponButton(WEAPON_SG550);
}
VGUI_Button( _("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + '16 440 0', '180 24 0' );
VGUI_Button(_("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + [16,440], [180,24]);
}
/*
@ -263,12 +263,12 @@ void VGUI_BuyMenu_Rifles( vector vPos ) {
VGUI_BuyMenu_Machineguns
====================
*/
void VGUI_BuyMenu_Machineguns( vector vPos ) {
vVGUIButtonPos = vPos + '16 116 0';
void VGUI_BuyMenu_Machineguns(vector vPos) {
vVGUIButtonPos = vPos + [16,116];
VGUI_BuyMenu_WeaponButton( WEAPON_PARA );
VGUI_BuyMenu_WeaponButton(WEAPON_PARA);
VGUI_Button( _("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + '16 440 0', '180 24 0' );
VGUI_Button(_("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + [16,440], [180,24]);
}
/*
@ -276,20 +276,20 @@ void VGUI_BuyMenu_Machineguns( vector vPos ) {
VGUI_BuyMenu_Equipment
====================
*/
void VGUI_BuyMenu_Equipment( vector vPos ) {
vVGUIButtonPos = vPos + '16 116 0';
void VGUI_BuyMenu_Equipment(vector vPos) {
vVGUIButtonPos = vPos + [16,116];
VGUI_BuyMenu_EquipmentButton( 0 );
VGUI_BuyMenu_EquipmentButton( 1 );
VGUI_BuyMenu_EquipmentButton( 2 );
VGUI_BuyMenu_EquipmentButton( 3 );
VGUI_BuyMenu_EquipmentButton( 4 );
VGUI_BuyMenu_EquipmentButton(0);
VGUI_BuyMenu_EquipmentButton(1);
VGUI_BuyMenu_EquipmentButton(2);
VGUI_BuyMenu_EquipmentButton(3);
VGUI_BuyMenu_EquipmentButton(4);
if ( stof( getplayerkeyvalue( player_localnum, "*team" ) ) == TEAM_CT ) {
VGUI_BuyMenu_EquipmentButton( 5 );
if (stof(getplayerkeyvalue(player_localnum, "*team")) == TEAM_CT) {
VGUI_BuyMenu_EquipmentButton(5);
}
VGUI_BuyMenu_EquipmentButton( 6 );
VGUI_BuyMenu_EquipmentButton(6);
VGUI_Button( _("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + '16 440 0', '180 24 0' );
VGUI_Button(_("VGUI_BACK"), VGUI_BuyMenu_Back, vPos + [16,440], [180,24]);
}

View file

@ -4,15 +4,19 @@ HALF-LIFE WON MENU - QUAKEC VERSION
This menu logic is part of the FreeCS project.
It's a close recreation of the Half-Life main-menu (pre-Steam), also known as
the Half-Life WON menu (or just WON Menu - you get the idea).
It was used between 1998 and 2004.
It attempts to parse string-data and bitmaps from the original paths
whenever it can. It's a full replacement of Half-Life's original menu.
whenever it can.
The original data is required for it to work.
It's created from scratch and is not C++ - it's QuakeC and meant to be used
within FTE QuakeWorld. The file extensions are only changed in order to help
with the syntax highlighting choice of your favorite editor.
This codebase is to be compiled with FTEQCC, no other compiler is supported.
No engine other than FTE QuakeWorld is supported. I won't support anything else.
The code has a LICENSE attached to it, I'd encourage you to read it.
If you don't want to comply with the LICENSE, you either don't use the software
@ -21,8 +25,24 @@ or we could still negotiate a separate license agreement (for $$$).
A few warnings to the uneducated:
If you're planning on merging or using any of this code in combination with the
original Half-Life SDK, you're violating the Half-Life SDK License Agreement.
This includes using it in combination with the original Half-Life binaries and
libraries. Valve has spoken out against such projects for the reason above.
They might not take action against you, but I certainly might.
I hope this all does not discourage you from using it in your own project.
As long as you comply with the license, you'll be fine!
I hope this all does not discourage you from using it for your own project.
Over the past decade enough Half-Life projects have sprung up that have violated
and abused the GPL, as well as other licenses, thus discouraging entities from
releasing their sources in fear of such behaviour.
In the hopes of making the community a better place, I WILL take action against
any violation of our license. I hope that is clear.
If anyone was to willingly distribute content created with the Half-Life SDK
with this component, it'd violate the Half-Life SDK.
I recommend that you use this menu without relying on Half-Life file formats.
FreeCS gets around this by not actually shipping the CS content as part of the
project.
Thanks to Spike for FTEQCC's advanced features and his engine, FTEQW, that makes
FreeCS and other projects even possible.

View file

@ -1,10 +1,8 @@
FTEMANIFEST 1
game cstrike
name "FreeCS"
protocolname "FREECS"
game fn
name "FTEQW"
protocolname "FTEQW"
basegame logos
basegame valve
basegame cstrike
basegame fn
basegame *freecs
disablehomedir 1

Binary file not shown.

10
fn/modinfo.txt Normal file
View file

@ -0,0 +1,10 @@
game "Half-Life"
url_info "www.icculus.org/~marco/freecs"
version "1.0"
size "396800000"
svonly "0"
cldll "1"
hlversion "1104"
nomodels "0"
nohimodel "0"
mpentity "info_player_deathmatch"

Binary file not shown.

13
freecs/modinfo.txt Normal file
View file

@ -0,0 +1,13 @@
game "FreeCS"
gamedir "cstrike;freecs"
url_info "www.icculus.org/~marco/freecs"
version "1.5"
size "184000000"
svonly "0"
cldll "1"
hlversion "1104"
nomodels "1"
nohimodel "1"
mpentity "info_player_start"
type "multiplayer_only"
trainmap "tr_1"

Binary file not shown.