Skip to content

Commit

Permalink
Merge branch 'release/0.15.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
thesupremecommander committed Jul 15, 2014
2 parents 72cec16 + 3312f58 commit 211ba94
Show file tree
Hide file tree
Showing 32 changed files with 1,120 additions and 405 deletions.
20 changes: 12 additions & 8 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ Building StatusSpec plugin

Notice
------
StatusSpec is not yet available for Linux & OS X.
StatusSpec is not yet compatible with Linux & OS X. Due to the advanced features of StatusSpec, no support for platforms other than Windows is planned in the near future.

Requirements
------------
* **[Windows]** Visual Studio or Visual Express C++
* source-sdk-2013 - https://github.com/ValveSoftware/source-sdk-2013
* metamod-source - https://github.com/alliedmodders/metamod-source
* Source SDK 2013 - https://github.com/ValveSoftware/source-sdk-2013
* Metamod:Source - https://github.com/alliedmodders/metamod-source
* MinHook - https://github.com/alliedmodders/metamod-source

Building
--------
1. Clone this repository in `/mp/src/utils` in source-sdk-2013.
1. Clone metamod-source in `/mp/src/utils` in source-sdk-2013.
2. Copy `build_tools/createstatusspec.bat` or `build_tools/createstatusspec` (depending on platform) to `mp/src` in source-sdk-2013.
3. Add the contents of `build_tools/project.vgc` to `mp/src/vpc_scripts/projects.vgc` in source-sdk-2013.
4. Run the script file you copied in step #2 to generate project files.
5. Build the project with the project files that were generated.
2. Clone Metamod:Source in your directory of choice.
3. Clone MinHook in your directory of choice.
4. Adjust the `MMSOURCE_DEV` macro in `statusspec.vpc` to the location of Metamod:Source.
5. Adjust the `MINHOOK` macro in `statusspec.vpc` to the location of MinHook.
6. Copy `build_tools/createstatusspec.bat` or `build_tools/createstatusspec` (depending on platform) to `mp/src` in source-sdk-2013.
7. Add the contents of `build_tools/project.vgc` to `mp/src/vpc_scripts/projects.vgc` in source-sdk-2013.
8. Run the script file you copied in step #2 to generate project files.
9. Build the project with the project files that were generated.
53 changes: 46 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
StatusSpec
==========

a client plugin that aims to add many useful features for TF2 spectating
a Team Fortress 2 client plugin that augments game spectating

![screenshot](http://i.imgur.com/HliUKLk.png)

Changelog
---------

**0.15.0**
* antifreeze
* now supports displaying a message when a freeze is occurring
* killstreaks
* expand killstreak display to the scoreboard
* fix killstreaks causing post-game crashes
* local player
* new module - allows a certain player's actions to be highlighted by the killfeed
* multipanel
* new module - allows the console and scoreboard to be opened on top of the game
* player outlines
* make player outline calculations more efficient
* add option to disable health-based calculations

**0.14.1**
* fix glitches with killstreaks on death
* add command to help stop flickering issues with player outlines
Expand Down Expand Up @@ -80,14 +94,22 @@ Changelog

Usage
-----
This plugin is not signed by Valve, and therefore will not load unless TF2 is loaded with the "-insecure" flag.
To install, place the `StatusSpec` folder within the `custom` folder in the `tf` directory. Because this plugin is not signed by Valve, you must launch TF2 with the `-insecure` option in order for this plugin to be active and will not be able to use this plugin on VAC-secured servers.

### AntiFreeze
*forces spectator GUI to refresh constantly, eliminating many HUD issues after game unpauses*

#### Console Variables
* `statusspec_antifreeze_display` - enables display of an info panel when a freeze is detected
* `statusspec_antifreeze_display_threshold` - the time of a freeze (in seconds) before the info panel is displayed
* `statusspec_antifreeze_enabled` - enable antifreeze (forces the spectator GUI to refresh)

#### Console Commands
* `statusspec_antifreeze_display_reload_settings` - reload settings for the freeze info panel from the resource file

#### UI Resource Files
An example file for the medigun info box is included under `Resource/UI/FreezeInfo.res`. This HUD cannot be refreshed using the normal `hud_reloadscheme` because it isn't natively implemented into TF2, and thus the command `statusspec_antifreeze_display_reload_settings` is provided as a replacement.

### Killstreaks
*enables killstreak tracking for all weapons, all players*

Expand Down Expand Up @@ -137,21 +159,28 @@ To properly support loadout icons, adjust `Resource/UI/SpectatorTournament.res`
}
```

### Local Player
*changes the local player locally to affect certain HUD elements like the killfeed*

#### Console Variables
* `statusspec_localplayer_enabled` - enable local player override
* `statusspec_localplayer_player` - player to set as the local player

#### Console Commands
* `statusspec_localplayer_set_current_target` - set the local player to the current spectator target

### Medigun Info
*displays info about mediguns for both teams*

#### Console Variables
* `statusspec_mediguninfo_charge_advantage_label_text` - text for charge advantage label in medigun info ('%advantage%' is replaced with the current charge advantage percentage number)
* `statusspec_mediguninfo_charge_label_text` - text for charge label in medigun info ('%charge%' is replaced with the current charge percentage number)
* `statusspec_mediguninfo_enabled` - enable medigun info
* `statusspec_mediguninfo_individual_charge_meters` - enable individual charge meters (for Vaccinator)
* `statusspec_mediguninfo_individual_charges_label_text` - text for individual charges label (for Vaccinator) in medigun info ('%charges%' is replaced with the current number of charges)

#### Console Commands
* `statusspec_mediguninfo_reload_settings` - reload settings for the medigun info HUD from the resource file

#### UI Resource Files
An example file for the medigun info box is included under `Resource/UI/MedigunInfo.res`. This HUD cannot be refreshed using the normal `hud_reloadscheme` because it isn't natively implemented into TF2, and thus the command `statusspec_medigun_info_reload_settings` is provided as a replacement.
An example file for the medigun info box is included under `Resource/UI/MedigunInfo.res`. This HUD cannot be refreshed using the normal `hud_reloadscheme` because it isn't natively implemented into TF2, and thus the command `statusspec_mediguninfo_reload_settings` is provided as a replacement.

In addition, the following HUD animations are triggered by this plugin and may be used to show events on the HUD:
* `MedigunInfoBluChargeReady` - triggered when a BLU medigun charge is ready for use
Expand All @@ -161,6 +190,13 @@ In addition, the following HUD animations are triggered by this plugin and may b
* `MedigunInfoRedChargeReleased` - triggered when a RED medigun charge has been released/popped
* `MedigunInfoRedChargeStop` - triggered when the RED medigun charge is no longer ready/released (after a charge is completed/dropped)

### Multipanel
*displays panels on top of the main game*

#### Console Variables
* `statusspec_multipanel_console` - displays a console in the HUD
* `statusspec_multipanel_scoreboard` - displays the scoreboard

### Player Aliases
*substitutes in user-defined aliases for player names*

Expand All @@ -178,6 +214,7 @@ In addition, the following HUD animations are triggered by this plugin and may b
#### Console Variables
* `statusspec_playeroutlines_enabled` - enable player outlines
* `statusspec_playeroutlines_frequent_override_enabled` - enable more frequent player outline overrides (helps stop flickering at cost of performance)
* `statusspec_playeroutlines_health_adjusted_team_colors` - adjusts team colors depending on health of players
* `statusspec_playeroutlines_team_colors` - override default health-based outline colors with team colors

#### Console Commands
Expand Down Expand Up @@ -234,4 +271,6 @@ Thanks
------
**bluee** - for the inspiration to do this project and for a lot of code reused from his [AdvSpec project](https://github.com/MattMcNam/advspec)

**AlliedModders** - for in-depth information about the internals of the Source Engine and for SourceHook
**AlliedModders** - for in-depth information about the internals of the Source Engine and for [SourceHook](https://github.com/alliedmodders/metamod-source/tree/master/core/sourcehook)

**Tsuda Kageyu, RaMMicHaeL, et al.** - for [MinHook](https://github.com/RaMMicHaeL/minhook)
67 changes: 67 additions & 0 deletions resource/ui/freezeinfo.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"Resource/UI/FreezeInfo.res"
{
"FreezeInfo"
{
"ControlName" "Frame"
"fieldName" "FreezeInfo"
"xpos" "c-80"
"ypos" "c-16"
"wide" "160"
"tall" "32"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
}

"FreezeInfoBackground"
{
"ControlName" "ImagePanel"
"fieldName" "FreezeInfoBackground"
"xpos" "0"
"ypos" "0"
"zpos" "0"
"wide" "160"
"tall" "32"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"fillcolor" "NotoDark"
}

"FreezeInfoIcon"
{
"ControlName" "ImagePanel"
"fieldName" "FreezeInfoIcon"
"xpos" "0"
"ypos" "0"
"wide" "32"
"tall" "32"
"visible" "1"
"enabled" "1"
"scaleImage" "1"
"image" "animated/tf2_logo_hourglass"
}

"FreezeInfoLabel"
{
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoRedNameLabel"
"xpos" "32"
"ypos" "0"
"wide" "128"
"tall" "32"
"autoResize" "1"
"visible" "1"
"enabled" "1"
"labelText" "FROZEN FOR %time%"
"tabPosition" "0"
"textAlignment" "center"
"dulltext" "0"
"brighttext" "0"
"font" "Noto16"
"fgcolor" "NotoWhite"
}
}
24 changes: 16 additions & 8 deletions resource/ui/mediguninfo.res
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

"MedigunInfoRedNameLabel"
{
"ControlName" "Label"
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoRedNameLabel"
"xpos" "165"
"ypos" "21"
Expand All @@ -59,6 +59,7 @@
"autoResize" "1"
"visible" "0"
"enabled" "0"
"labelText" "%redname%"
"tabPosition" "0"
"textAlignment" "left"
"dulltext" "0"
Expand All @@ -69,7 +70,7 @@

"MedigunInfoRedChargeLabel"
{
"ControlName" "Label"
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoRedChargeLabel"
"xpos" "147"
"ypos" "21"
Expand All @@ -79,6 +80,7 @@
"autoResize" "1"
"visible" "1"
"enabled" "1"
"labelText" "%redcharge%%"
"tabPosition" "0"
"textAlignment" "center"
"dulltext" "0"
Expand All @@ -89,7 +91,7 @@

"MedigunInfoRedIndividualChargesLabel"
{
"ControlName" "Label"
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoRedIndividualChargesLabel"
"xpos" "147"
"ypos" "21"
Expand All @@ -99,6 +101,7 @@
"autoResize" "1"
"visible" "1"
"enabled" "1"
"labelText" "%redcharges%"
"tabPosition" "0"
"textAlignment" "center"
"dulltext" "0"
Expand All @@ -109,7 +112,7 @@

"MedigunInfoRedChargeAdvantageLabel"
{
"ControlName" "Label"
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoRedChargeAdvantageLabel"
"xpos" "165"
"ypos" "21"
Expand All @@ -119,6 +122,7 @@
"autoResize" "1"
"visible" "1"
"enabled" "1"
"labelText" "+%redadvantage%%"
"tabPosition" "0"
"textAlignment" "center"
"dulltext" "0"
Expand Down Expand Up @@ -269,7 +273,7 @@

"MedigunInfoBluNameLabel"
{
"ControlName" "Label"
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoBluNameLabel"
"xpos" "165"
"ypos" "3"
Expand All @@ -279,6 +283,7 @@
"autoResize" "1"
"visible" "0"
"enabled" "0"
"labelText" "%bluname%"
"tabPosition" "0"
"textAlignment" "left"
"dulltext" "0"
Expand All @@ -289,7 +294,7 @@

"MedigunInfoBluChargeLabel"
{
"ControlName" "Label"
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoBluChargeLabel"
"xpos" "147"
"ypos" "3"
Expand All @@ -299,6 +304,7 @@
"autoResize" "1"
"visible" "1"
"enabled" "1"
"labelText" "%blucharge%%"
"tabPosition" "0"
"textAlignment" "center"
"dulltext" "0"
Expand All @@ -309,7 +315,7 @@

"MedigunInfoBluIndividualChargesLabel"
{
"ControlName" "Label"
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoBluIndividualChargesLabel"
"xpos" "147"
"ypos" "3"
Expand All @@ -319,6 +325,7 @@
"autoResize" "1"
"visible" "1"
"enabled" "1"
"labelText" "%blucharges%"
"tabPosition" "0"
"textAlignment" "center"
"dulltext" "0"
Expand All @@ -329,7 +336,7 @@

"MedigunInfoBluChargeAdvantageLabel"
{
"ControlName" "Label"
"ControlName" "VariableLabel"
"fieldName" "MedigunInfoBluChargeAdvantageLabel"
"xpos" "165"
"ypos" "3"
Expand All @@ -339,6 +346,7 @@
"autoResize" "1"
"visible" "1"
"enabled" "1"
"labelText" "+%bluadvantage%%"
"tabPosition" "0"
"textAlignment" "center"
"dulltext" "0"
Expand Down
2 changes: 2 additions & 0 deletions src/entities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ int Entities::pCTFPlayerResource__m_iMaxBuffedHealth[MAX_PLAYERS + 1] = { 0 };
int Entities::pCTFPlayerResource__m_iKillstreak[MAX_PLAYERS + 1] = { 0 };
int Entities::pCWeaponMedigun__m_bHealing = 0;
int Entities::pCWeaponMedigun__m_hHealingTarget = 0;
int Entities::pCTFPlayer__m_iKillStreak = 0;

bool Entities::PrepareOffsets() {
RETRIEVE_OFFSET(pCTFPlayer__m_bGlowEnabled, GetClassPropOffset("CTFPlayer", pCTFPlayer__m_bGlowEnabled, 1, "m_bGlowEnabled"));
Expand Down Expand Up @@ -78,6 +79,7 @@ bool Entities::PrepareOffsets() {
}
RETRIEVE_OFFSET(pCWeaponMedigun__m_bHealing, GetClassPropOffset("CWeaponMedigun", pCWeaponMedigun__m_bHealing, 1, "m_bHealing"));
RETRIEVE_OFFSET(pCWeaponMedigun__m_hHealingTarget, GetClassPropOffset("CWeaponMedigun", pCWeaponMedigun__m_hHealingTarget, 1, "m_hHealingTarget"));
RETRIEVE_OFFSET(pCTFPlayer__m_iKillStreak, GetClassPropOffset("CTFPlayer", pCTFPlayer__m_iKillStreak, 1, "m_iKillStreak"));

return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/entities.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Entities {
static int pCTFPlayerResource__m_iKillstreak[MAX_PLAYERS + 1];
static int pCWeaponMedigun__m_bHealing;
static int pCWeaponMedigun__m_hHealingTarget;
static int pCTFPlayer__m_iKillStreak;

static bool PrepareOffsets();
static bool GetClassPropOffset(const char *className, int &offset, int depth, ...);
Expand Down
Loading

0 comments on commit 211ba94

Please sign in to comment.