Commit 53e57829 authored by Mikleo's avatar Mikleo
Browse files

Added custom draft overlay feature. Could be useful for server branding,...

Added custom draft overlay feature. Could be useful for server branding, rules, seasonal themes, events and extra information that you want to display to the player. More info in readme.
parent 58053102
Pipeline #7411 passed with stages
in 19 seconds
......@@ -4,4 +4,12 @@
Forums thread: https://forums.empiresmod.com/index.php?threads/sm-plugin-draft-pick.20937/
Requires EmpUtils Plugin
https://git.empiresmod.com/sourcemod/EmpUtils
\ No newline at end of file
https://git.empiresmod.com/sourcemod/EmpUtils
Custom Overlay
I Recommend the settings in the images folder and to use the base overlay as a template with VTFEdit.
By default this is a high resolution greyscale image, color overlays will be an enourmous download burden.
You also need to copy and edit the default vmt file alongside the vtf.
Set dp_overlay cvar to the filepath without the .vmt/.vtf extension.
\ No newline at end of file
......@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "0.98"
#define PluginVersion "1.00"
#define UPDATE_URL "https://sourcemod.docs.empiresmod.com/DraftPick/dist/updater.txt"
......@@ -51,7 +51,7 @@ int stage = STAGE_DISABLED;
#define TEAM_BE 1;
ConVar mp_autoteambalance,mp_autoteambalance_skilldifference,cv_autoassign,cv_allowspectators,dp_default_draftmode, dp_default_draftmode_min_players,dp_captain_vote_time,dp_pick_wait_time,dp_pick_initial_multiplier,dp_time_increment,dp_in_draft,dp_maxpick,dp_squadlimitdefault,dp_autopick_randomizer,dp_autodraft_display_pick,dp_forceauto_max_imbalance;
ConVar mp_autoteambalance,mp_autoteambalance_skilldifference,cv_autoassign,cv_allowspectators,dp_default_draftmode, dp_default_draftmode_min_players,dp_captain_vote_time,dp_pick_wait_time,dp_pick_initial_multiplier,dp_time_increment,dp_in_draft,dp_maxpick,dp_squadlimitdefault,dp_autopick_randomizer,dp_autodraft_display_pick,dp_forceauto_max_imbalance,dp_overlay;
int mp_autoteambalance_default = 1;
int cv_autoassign_default = 0;
......@@ -247,6 +247,8 @@ public void OnPluginStart()
dp_time_increment = CreateConVar("dp_time_increment", "3", "The time increment given to each captain per player in the pick phase");
dp_in_draft = CreateConVar("dp_in_draft", "0", "Notification of drafting. ignore");
dp_maxpick = CreateConVar("dp_maxpick", "40", "maximum number of picks before autopick");
dp_overlay = CreateConVar("dp_overlay", "draftpick/draft_background", "The overlay for draft mode.");
dp_autodraft_display_pick = CreateConVar("dp_autodraft_display_pick", "0", "Should autodraft pick be displayed in chat");
......@@ -1841,7 +1843,9 @@ int SetupMode(mode)
startStage = STAGE_AUTOPICKWAIT;
}
ShowOverlay("draftpick/draft_background");
char overlayPath[64];
dp_overlay.GetString(overlayPath,sizeof(overlayPath));
ShowOverlay(overlayPath);
if(mode == MODE_RANKEDMATCH && LibraryExists("empstats"))
{
......@@ -2041,9 +2045,16 @@ public OnConfigsExecuted()
AddFileToDownloadsTable("materials/draftpick/draft_background.vtf");
AddFileToDownloadsTable("materials/draftpick/draft_background.vmt");
PrecacheDecal("materials/draftpick/background2.vtf", true);
char overlayPath[64];
dp_overlay.GetString(overlayPath,sizeof(overlayPath));
char downloadPath[64];
Format(downloadPath,sizeof(downloadPath),"%s.vtf",overlayPath);
AddFileToDownloadsTable(downloadPath);
Format(downloadPath,sizeof(downloadPath),"%s.vmt",overlayPath);
AddFileToDownloadsTable(downloadPath);
}
void AddSoundToDownload(char[] sound)
{
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "0.98"
"Latest" "1.00"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment