Skip to content

Commit

Permalink
Maintenance update
Browse files Browse the repository at this point in the history
+ made killfeed optional via coop menu
+ some reorganizing
  • Loading branch information
Alienmario committed Nov 22, 2020
1 parent 1435c12 commit 90b0167
Show file tree
Hide file tree
Showing 17 changed files with 3,117 additions and 2,981 deletions.
15 changes: 15 additions & 0 deletions configs/sourcecoop/menu_sorting.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"Menu"
{
"PlayerSettings"
{
}

"SoundSettings"
{
}

"Other"
{
}
}

4 changes: 2 additions & 2 deletions data/srccoop/bm_c1a4b.edt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"delay_output" "OnNewGame"
}
}
// dont close controlroom door
// dont close controlroom door (except when pressed the rocket fire button)
"modify"
{
"targetname" "c1a4c_controlroom_exit_door_button"
"targetname" "/^(c1a4c_controlroom_exit_door_button|c1a4c_controlroom_entry_door_button)$/"
"outputs"
{
"remove"
Expand Down
Binary file modified plugins/srccoop.smx
Binary file not shown.
Binary file modified plugins/srccoop_addon_killsounds.smx
Binary file not shown.
Binary file modified plugins/srccoop_addon_scoring.smx
Binary file not shown.
Binary file modified plugins/srccoop_addon_thirdperson.smx
Binary file not shown.
1 change: 1 addition & 0 deletions scripting/include/srccoop.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <logdebug>

#include <srccoop/typedef.inc>
#include <srccoop/typedef_game.inc>
#include <srccoop/features.inc>
#include <srccoop/classdef.inc>
#include <srccoop/utils.inc>
Expand Down
41 changes: 7 additions & 34 deletions scripting/include/srccoop/classdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

#include <sdktools>

#define STATE_WARMUP "m_StateWarmup"
#define STATE_ROUND "m_StateRound"
#define STATE_INTERMISSION "m_StateIntermission"
Handle g_pGlobalEntityGetIndex;
Handle g_pGlobalEntityGetState;
Handle g_pGameShutdown;
Handle g_pSetCollisionBounds;
Handle g_pUpdateEnemyMemory;
Handle g_pGetSequenceLinearMotion;
Handle g_pShouldPlayerAvoid;

enum struct FireOutputData
{
Expand All @@ -17,32 +21,6 @@ enum struct FireOutputData
float m_flDelay;
}

enum
{
STATE_WARMUP_INDEX = 0,
STATE_INTERMISSION_INDEX,
STATE_ROUND_INDEX
}

enum
{
STATE_ELEMENT_DONE_TIME = 0,
STATE_ELEMENT_NEXT_STATE,
STATE_ELEMENT_IS_IN_INTERMISSION
}

enum GLOBALESTATE
{
GLOBAL_OFF = 0,
GLOBAL_ON = 1,
GLOBAL_DEAD = 2
};

Handle g_pGlobalEntityGetIndex;
Handle g_pGlobalEntityGetState;

Handle g_pGameShutdown;

methodmap Array_t < ArrayList
{
public Array_t(ArrayList pHandle = null)
Expand All @@ -62,11 +40,6 @@ methodmap Array_t < ArrayList
}
}

Handle g_pSetCollisionBounds;
Handle g_pUpdateEnemyMemory;
Handle g_pGetSequenceLinearMotion;
Handle g_pShouldPlayerAvoid;

public int InternalGetBaseEntity(const int iEntIndex)
{
return (iEntIndex > -1) ? EntIndexToEntRef(iEntIndex) : iEntIndex;
Expand Down
24 changes: 20 additions & 4 deletions scripting/include/srccoop/menu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
TopMenu g_pCoopTopMenu;
TopMenuObject g_pCoopPlayerSettingsMenu;
TopMenuObject g_pCoopSoundSettingsMenu;
TopMenuObject g_pCoopOthersMenu;

public any Native_GetCoopTopMenu(Handle plugin, int numParams)
{
Expand All @@ -19,8 +20,19 @@ void InitializeMenus()
RegConsoleCmd("sizeup", Command_CoopMenu, "Displays the coop menu");

g_pCoopTopMenu = new TopMenu(CoopTopMenuHandler);
g_pCoopPlayerSettingsMenu = g_pCoopTopMenu.AddCategory(COOPMENU_CATEGORY_SETTINGS, CoopTopMenuHandler);
g_pCoopSoundSettingsMenu = g_pCoopTopMenu.AddCategory(COOPMENU_CATEGORY_SOUND_SETTINGS, CoopTopMenuHandler);
g_pCoopPlayerSettingsMenu = g_pCoopTopMenu.AddCategory(COOPMENU_CATEGORY_PLAYER, CoopTopMenuHandler);
g_pCoopSoundSettingsMenu = g_pCoopTopMenu.AddCategory(COOPMENU_CATEGORY_SOUNDS, CoopTopMenuHandler);
g_pCoopOthersMenu = g_pCoopTopMenu.AddCategory(COOPMENU_CATEGORY_OTHER, CoopTopMenuHandler);

char path[PLATFORM_MAX_PATH];
char error[256];

BuildPath(Path_SM, path, sizeof(path), "configs/sourcecoop/menu_sorting.txt");

if (!g_pCoopTopMenu.LoadConfig(path, error, sizeof(error)))
{
LogError("Could not load SourceCoop menu config (file \"%s\": %s)", path, error);
}
}

public void CoopTopMenuHandler(TopMenu topmenu, TopMenuAction action, TopMenuObject topobj_id, int param, char[] buffer, int maxlength)
Expand All @@ -33,11 +45,15 @@ public void CoopTopMenuHandler(TopMenu topmenu, TopMenuAction action, TopMenuObj
{
if (topobj_id == g_pCoopPlayerSettingsMenu)
{
Format(buffer, maxlength, COOPMENU_CATEGORY_SETTINGS);
Format(buffer, maxlength, "Player settings");
}
else if (topobj_id == g_pCoopSoundSettingsMenu)
{
Format(buffer, maxlength, COOPMENU_CATEGORY_SOUND_SETTINGS);
Format(buffer, maxlength, "Sound settings");
}
else if (topobj_id == g_pCoopOthersMenu)
{
Format(buffer, maxlength, "Other");
}
}
}
Expand Down
Loading

0 comments on commit 90b0167

Please sign in to comment.