Cleanup, removing unused cruft, moved menu into its own basedir.

This commit is contained in:
Marco Cawthorne 2019-01-16 00:10:21 +01:00
parent 95b60757e7
commit a4c77d7a95
16 changed files with 5 additions and 468 deletions

View file

@ -1,5 +1,5 @@
#pragma target fte
#pragma progs_dat "../../freecs/menu.dat"
#pragma progs_dat "../../fn/menu.dat"
#define MENU

View file

@ -1,71 +0,0 @@
/*
Copyright 2016-2018 Marco "eukara" Hladik
MIT LICENSE
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
/*
=================
light
Only thing this ent does, is allow the change of lightstyles.
You can use custom patterns, too.
=================
*/
void light( void ) {
static void light_toggle( void ) {
if ( self.health == TRUE ) {
lightstyle( self.style, "a" );
self.health = FALSE;
} else {
lightstyle( self.style, self.pattern );
self.health = TRUE;
}
}
if ( !self.pattern ) {
self.pattern = getlightstyle( self.style );
}
if ( self.spawnflags & 1 ) {
lightstyle( self.style, "a" );
self.health = FALSE;
} else {
lightstyle( self.style, self.pattern );
self.health = TRUE;
}
self.vUse = light_toggle;
}
/*
=================
light_environment
This is just a dummy to prevent the engine from complaining.
Don't get too excited.
=================
*/
void light_environment( void ) {
remove( self );
}

View file

@ -1,280 +0,0 @@
/*
Copyright 2016-2018 Marco "eukara" Hladik
MIT LICENSE
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
// This is what they use...
.string killtarget;
.float wait;
.float delay;
.float dmg;
/*
=================
trigger_multiple
This entity triggers a specified target every time its area is entered by players, monsters or pushables.
Attributes:
Target (target) - When an entity is activated, it triggers the entity with the name specified by Target.
Name (targetname) - Property used to identify entities.
Master (master) - The name of a multisource (or game_team_master) entity. A master must usually be active in order for the entity to work. Thus they act almost like an on/off switch, in their simplest form, and like an AND gate in the case of the multisource.
Delay before trigger (delay) - Usually the time in seconds before an entity should trigger its target (after being triggered itself). Under other SmartEdit names, delay might also be the time to wait before performing some other action.
Kill target (killtarget) - Remove this entity from the game when triggered
Target Path (netname)
Sound style (sounds)
Message (message)
Delay before reset (wait) - Time in seconds before the entity is ready to be re-triggered.
Flags:
Monsters (1) - Allow monsters to activate this entity.
No Clients (2) - Players cannot activate this entity.
Pushables (4) - Allow pushable objects to activate this entity.
=================
*/
void trigger_multiple( void ) {
static void trigger_multiple_trigger( void ) {
Entities_UseTargets();
if ( self.killtarget ) {
entity eFind = findchain( killtarget, self.target );
entity eOld = self;
while ( eFind ) {
entity eRemoveMe = eFind;
self = eRemoveMe;
Entities_Remove();
eFind = eFind.chain;
}
self = eOld;
}
}
static void trigger_multiple_use( void ) {
if ( self.delay ) {
self.think = trigger_multiple_trigger;
self.nextthink = self.ltime + self.delay;
} else {
trigger_multiple_trigger();
}
}
static void trigger_multiple_touch( void ) {
if ( self.fAttackFinished > self.ltime ) {
return;
}
if ( other.classname == "player" ) {
trigger_multiple_use();
self.fAttackFinished = self.ltime + self.wait;
}
}
self.angles = '0 0 0';
self.solid = SOLID_TRIGGER;
setmodel( self, self.model );
self.model = 0;
self.vUse = trigger_multiple_use;
self.touch = trigger_multiple_touch;
}
/*
=================
trigger_camera
=================
*/
void trigger_camera( void ) {
static void trigger_camera_use( void ) {
if ( self.target ) {
entity eTarget = find( world, targetname, self.target );
if ( eTarget ) {
self.angles = vectoangles( eTarget.origin - self.origin );
self.angles_x *= -1;
}
}
Client_TriggerCamera( eActivator, self.origin, self.angles, self.wait );
}
self.vUse = trigger_camera_use;
}
/*
=================
trigger_hurt
Brush that damages things, especially players
=================
*/
#define SF_HURT_ONCE 1 // Turn off once it fired the first time
#define SF_HURT_OFF 2 // Needs to be triggered in order to work again
#define SF_HURT_NOPLAYERS 8 // Don't hurt players
#define SF_HURT_FIREONPLAYER 16 // Only call UseTarget functions when it's a player
#define SF_HURT_TOUCHPLAYER 32 // Only hurt players
void trigger_hurt( void ) {
static void trigger_hurt_use( void ) {
if ( self.solid == SOLID_NOT ) {
self.solid = SOLID_TRIGGER;
} else {
self.solid = SOLID_NOT;
}
}
static void trigger_hurt_touch( void ) {
if ( self.fAttackFinished > self.ltime ) {
return;
} else if ( other.takedamage == DAMAGE_NO ) {
return;
} else if ( ( self.spawnflags & SF_HURT_TOUCHPLAYER ) && !( other.flags & FL_CLIENT ) ) {
return;
} else if ( ( self.spawnflags & SF_HURT_NOPLAYERS ) && ( other.flags & FL_CLIENT ) ) {
return;
}
if ( self.spawnflags & SF_HURT_FIREONPLAYER ) {
if ( other.flags & FL_CLIENT ) {
Entities_UseTargets();
}
} else {
Entities_UseTargets();
}
Damage_Apply( other, self, self.dmg, other.origin, FALSE );
// Shut it down if used once
if ( self.spawnflags & SF_HURT_ONCE ) {
self.solid = SOLID_NOT;
}
self.fAttackFinished = self.ltime + 0.5;
}
static void trigger_hurt_respawn( void ) {
self.angles = '0 0 0';
self.solid = SOLID_TRIGGER;
setmodel( self, self.model );
self.model = 0;
if ( self.spawnflags & SF_HURT_OFF ) {
self.solid = SOLID_NOT;
}
self.vUse = trigger_hurt_use;
self.touch = trigger_hurt_touch;
}
trigger_hurt_respawn();
Entities_InitRespawnable( trigger_hurt_respawn );
}
/*
=================
trigger_relay
This entity acts as a relay between an event and its target.
Its main advantage is that it can send a specific trigger state
to its target (only turn it on, or only turn it off, as opposed
to the toggling experienced with typical triggering).
Attributes:
Name (targetname)
Target (target)
Delay before trigger (delay)
Trigger State (triggerstate) - Off (0), On (1), or Toggle (2)
Flags:
Remove On fire (1)
=================
*/
void trigger_relay( void ) {
}
/*
=================
multi_manager
This entity can activate several different events (including itself) at specific times.
Attributes:
Name (targetname) - Property used to identify entities.
Flags:
Multithreaded (1)
Notes:
There were better ways to do this, but someone thought it was viable to use custom, user defined fields
which cannot normally be read by something like QC for targetnames. FTE allows us to read the fields
via the __fullspawndata global at least.
TODO: Try to find out what garbled mess __fullspawndata is trying to give us
=================
*/
void multi_manager( void ) {
static void multi_manager_enttrigger( void ) {
Entities_UseTargets();
remove( self );
}
static void multi_manager_use( void ) {
int iFields = tokenize( self.message );
for ( int i = 1; i < ( iFields - 1 ); i += 2 ) {
// Sigh, let's attempt to sanitize this
if ( ( argv( i ) != "classname" ) && ( argv( i ) != "origin" ) && ( argv( i ) != "targetname" ) ) {
entity eTemp = spawn();
eTemp.think = multi_manager_enttrigger;
eTemp.nextthink = time + stof( argv( i + 1 ) );
// sigh, because you obviously don't want to tokenize inside a tokenized loop
if ( substring( argv( i ), strlen( argv( i ) ) - 3, 1 ) == "#" ) {
eTemp.target = substring( argv( i ), 0, strlen( argv( i ) ) - 3 );
} else if ( substring( argv( i ), strlen( argv( i ) ) - 2, 1 ) == "#" ) {
eTemp.target = substring( argv( i ), 0, strlen( argv( i ) ) - 2 );
} else {
eTemp.target = argv( i );
}
}
}
}
self.message = __fullspawndata;
self.vUse = multi_manager_use;
}
/*
=================
multisource
TODO: State crap
=================
*/
void multisource( void ) {
static void multisource_use( void ) {
Entities_UseTargets();
}
self.vUse = multisource_use;
}

View file

@ -8,9 +8,9 @@
class light:CBaseTrigger
{
string m_strPattern;
int m_iEnabled;
float m_flStyle;
string m_strPattern;
void() light;
virtual void() Trigger;

View file

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

BIN
freecs/menu.dat → fn/menu.dat Executable file → Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -21,7 +21,7 @@ varying vec2 lm_c;
{
vec4 diffuse_f = texture2D(s_diffuse, tex_c);
vec3 light = texture2D(s_lightmap, lm_c).rgb;
if (light.r > 1.0f) {
light.r = 1.0f;
}

View file

@ -1,54 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-21 15:30+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "FREECS_QUITMSG"
msgstr "Wollen sie das Spiel verlassen?"
msgid "MP_MAPS"
msgstr "Karten:"
msgid "MP_GAME"
msgstr "Name"
msgid "MP_MAP"
msgstr "Karte"
msgid "MP_PLAYERS"
msgstr "Spieler"
msgid "MP_PING"
msgstr "Ping"
msgid "AUDIO_MASTER"
msgstr "Lautstaerke:"
msgid "VIDEO_RES"
msgstr "Aufloesung:"
msgid "PLAYER_CROSSCOLOR"
msgstr "Fadenkreuz Farbe:"
msgid "PLAYER_GUICOLOR"
msgstr "UI Farbe:"
msgid "PLAYER_HUDCOLOR"
msgstr "Heads-Up-Display Farbe:"
msgid "SERVER_NAME"
msgstr "Servername:"

View file

@ -1,60 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-21 15:30+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "FREECS_QUITMSG"
msgstr "Are you sure you want to quit?"
msgid "MP_MAPS"
msgstr "Maps:"
msgid "MP_GAME"
msgstr "Game"
msgid "MP_MAP"
msgstr "Map"
msgid "MP_PLAYERS"
msgstr "Players"
msgid "MP_PING"
msgstr "Ping"
msgid "AUDIO_MASTER"
msgstr "Master Volume"
msgid "VIDEO_RES"
msgstr "Resolution:"
msgid "VIDEO_RESTARTMSG"
msgstr "Some settings will require you to REFRESH your renderer. Please do so with the option on the left. "
msgid "PLAYER_NICK"
msgstr "Nickname:"
msgid "PLAYER_CROSSCOLOR"
msgstr "Crosshair Color:"
msgid "PLAYER_GUICOLOR"
msgstr "UI Color:"
msgid "PLAYER_HUDCOLOR"
msgstr "Heads-Up-Display Color:"
msgid "SERVER_NAME"
msgstr "Hostname:"

Binary file not shown.