From ff74d9561c391e2bb356bd37b77ebb8bcf451c0a Mon Sep 17 00:00:00 2001 From: Resxt <55228336+Resxt@users.noreply.github.com> Date: Tue, 25 Oct 2022 16:30:07 +0200 Subject: [PATCH] mapvote 1.1.0 Added mapvote_sounds_menu_enabled dvar. You can now enable or disable the sounds playing in the menu when selecting an item, moving up or down and canceling a choice Added mapvote_sounds_timer_enabled dvar. You can now choose if the timer will start beeping when there's only 5s left or not Added mapvote_display_wait_time dvar. Changed the wait time before displaying the menu from 3s to a configurable dvar Replace most level.mapvote variables with GetDvar instead to avoid setting too much variables when we can simply retrieve the dvar value (try to avoid hitting the variable limit that the game has) Replace start notify and end function listener with a direct with direct function calls for better compatibility for future updates --- mapvote/README.md | 13 ++- mapvote/mapvote.gsc | Bin 16197 -> 15629 bytes mapvote/mapvote_mp_extend.gsc | Bin 662 -> 716 bytes mapvote/source/mapvote-source.gsc | 100 +++++++++++--------- mapvote/source/mapvote_mp_extend-source.gsc | 12 +-- 5 files changed, 72 insertions(+), 53 deletions(-) diff --git a/mapvote/README.md b/mapvote/README.md index d517898..0339722 100644 --- a/mapvote/README.md +++ b/mapvote/README.md @@ -58,10 +58,13 @@ Here are the dvars you can configure: | mapvote_colors_help_text | The color of the help text at the bottom explaining how to use the menu | "white" | red, green, yellow, blue, cyan, purple, white, grey, gray, black | | mapvote_colors_help_accent | The color of the accented text of the help text at the bottom | "blue" | red, green, yellow, blue, cyan, purple, white, grey, gray, black | | mapvote_colors_help_accent_mode | The accenting mode for the help text. `standard` only puts the accent color on the button to press and `max` puts it on both the buttons and the action it does | "standard" | standard or max | +| mapvote_sounds_menu_enabled | Toggle whether the mapvote menu sounds are enabled or not. 0 is off and 1 is on | 1 | 0 or 1 | +| mapvote_sounds_timer_enabled | Toggle whether the timer will start making a beeping sound every second when there's 5 or less seconds remaining to vote or not. 0 is off and 1 is on | 1 | 0 or 1 | | mapvote_vote_time | The time the vote lasts (in seconds) | 30 | Any plain number above 5 | | mapvote_blur_level | The amount of blur to put at the end of the killcam. The max recommended value is 5. 0 disables it | 2.5 | Any number | | mapvote_blur_fade_in_time | The time (in seconds) it takes for the blur to reach `mapvote_blur_level`. For example if you set it to 10 and `mapvote_blur_level` is 5 then it will progressively blur the screen from 0 to 5 in 10 seconds | 2 | Any number | | mapvote_horizontal_spacing | The horizontal spacing between the map/mode names on the left and the vote counts on the right. I recommend setting this value according to your map and modes length so that it doesn't overlap with the vote counts | 75 | Any plain number | +| mapvote_display_wait_time | Once the killcam ends, the time to wait before displaying the vote menu after the killcam ends (in seconds) | 1 | 0.05 or above | ### Configuration @@ -79,10 +82,13 @@ set mapvote_colors_timer_low "red" set mapvote_colors_help_text "white" set mapvote_colors_help_accent "blue" set mapvote_colors_help_accent_mode "standard" +set mapvote_sounds_menu_enabled 1 +set mapvote_sounds_timer_enabled 1 set mapvote_vote_time 30 set mapvote_blur_level 2.5 set mapvote_blur_fade_in_time 2 set mapvote_horizontal_spacing 75 +set mapvote_display_wait_time 1 ``` Here are some pre-set values if you want to quickly copy/paste something @@ -100,9 +106,12 @@ Here are some pre-set values if you want to quickly copy/paste something ### Notes -- If right click is set to toggle ads then pressing right click will make the player go up by one every 0.35s. If I didn't change it to be that way players with toggle ads would have to press right click twice to go up by one all the time. Now instead they simply right click once to start going up and right click again to stop. +- If right click is set to toggle ads then pressing right click will make the player go up by one every 0.35s. +If I didn't change it to be that way players with toggle ads would have to press right click twice to go up by one all the time. +Now instead they simply right click once to start going up and right click again to stop. - When two maps/modes have the same votes, the lowest one in the list will win. In the future it would be nice to randomize between both -- Ending the game with ESC doesn't work when in debug mode. Use `map_restart` in the console when your script is compiled. And if you want to leave use `disconnect` in the console until this is fixed +- Ending the game with ESC doesn't work when in debug mode. +Use `map_restart` in the console when your script is compiled. And if you want to leave use `disconnect` in the console until this is fixed - When there's only one map/mode the right map/mode will be chosen but adding an option to hide single vote elements would be nice ## mapvote_mp_extend.gsc diff --git a/mapvote/mapvote.gsc b/mapvote/mapvote.gsc index a8aa06dfbc427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UJoLlL@q-PmOUK=UJ~)h`sk{=daMW zBELY}3*pn?o5+jd_rc#Gx5H<^_mDf_55NzRm%?Ykza!rQe+d4Q_LhlEKb>$F@&6G0 zoJZe9dSJO^(guM_7tD8?J?0;PG$=JON$-*THMyDR3B`3J<~!@Gv|L{(X2R{D<%ycpDsm{~Qj&&%mwl zUU)Hl0PcWahi`%3hCAVZgIB<(;8pO?;5D$T)=)igE!+!Fg!^DWydItgr{EjlEW8*V zf^UX5!d>td_>1uUa4-B2JODoe=in#dJK^2%J@8)mK6pR84SogQ0Uv@NhmXKd!|%e+ z!asud!l&Vv;j{3!;q&l!;WEB=y#d$4KY%B|N8u^(zrqdhf50>0|AYhZS-2Ix0C&LN zvG@rd1FwR|!#(gMxDWQjDYzaUf}6&=j4kj+-o|sr@@|FqfqBSt;BSLAa=KOp-H PkgWq`Cj;H|2gn8h=JP{9 delta 344 zcmX@ZI*rx1!9CcSmy3ao0SHnV85q)-7#MP)G#8Mq1jN&zcrH+l0|V{DEuw~$c^DM2I7?>GZn6)Fg zfHDGMU@}ydnGwhk2vvn^Le;~}z`_XA1lI!;0-0U{vJ%7qf;m9;3Lw3rm|-~skj+>N zBrY&)1+!a#?8jhnCZ--Bo0)Mr1JH*|%Yp1WKr8^|Zw0bn0`Ux>t}-C~o`I2Z0g#qu bWMVi0r2hc10g!zTNHYNqa0I&J8juYDUL7&v diff --git a/mapvote/source/mapvote-source.gsc b/mapvote/source/mapvote-source.gsc index 612aa63..171a345 100644 --- a/mapvote/source/mapvote-source.gsc +++ b/mapvote/source/mapvote-source.gsc @@ -20,6 +20,9 @@ Init() { if (GetDvarInt("mapvote_enable")) { + level.mapvote_start_function = ::StartVote; + level.mapvote_end_function = ::ListenForEndVote; + InitMapvote(); } } @@ -33,14 +36,12 @@ InitMapvote() InitDvars(); InitVariables(); - level thread ListenForStartVote(); - level thread ListenForEndVote(); - if (GetDvarInt("mapvote_debug")) { Print("[MAPVOTE] Debug mode is ON"); wait 3; - level notify("mapvote_vote_start"); + level thread StartVote(); + level thread ListenForEndVote(); } else { @@ -62,29 +63,19 @@ InitDvars() SetDvarIfNotInitialized("mapvote_colors_help_text", "white"); SetDvarIfNotInitialized("mapvote_colors_help_accent", "blue"); SetDvarIfNotInitialized("mapvote_colors_help_accent_mode", "standard"); + SetDvarIfNotInitialized("mapvote_sounds_menu_enabled", 1); + SetDvarIfNotInitialized("mapvote_sounds_timer_enabled", 1); SetDvarIfNotInitialized("mapvote_vote_time", 30); SetDvarIfNotInitialized("mapvote_blur_level", 2.5); SetDvarIfNotInitialized("mapvote_blur_fade_in_time", 2); SetDvarIfNotInitialized("mapvote_horizontal_spacing", 75); + SetDvarIfNotInitialized("mapvote_display_wait_time", 1); } InitVariables() { SetMapvoteData("map"); SetMapvoteData("mode"); - level.mapvote["vote_time"] = GetDvarInt("mapvote_vote_time"); - - level.mapvote["colors"]["unselected"] = GetGscColor(GetDvar("mapvote_colors_unselected")); - level.mapvote["colors"]["selected"] = GetGscColor(GetDvar("mapvote_colors_selected")); - level.mapvote["colors"]["timer"] = GetGscColor(GetDvar("mapvote_colors_timer")); - level.mapvote["colors"]["timer_low"] = GetGscColor(GetDvar("mapvote_colors_timer_low")); - level.mapvote["colors"]["help_text"] = GetChatColor(GetDvar("mapvote_colors_help_text")); - level.mapvote["colors"]["help_accent"] = GetChatColor(GetDvar("mapvote_colors_help_accent")); - level.mapvote["colors"]["help_accent_mode"] = GetDvar("mapvote_colors_help_accent_mode"); - - level.mapvote["blur_level"] = GetDvarInt("mapvote_blur_level"); - level.mapvote["blur_fade_in_time"] = GetDvarInt("mapvote_blur_fade_in_time"); - level.mapvote["horizontal_spacing"] = GetDvarInt("mapvote_horizontal_spacing"); level.mapvote["vote"]["maps"] = []; level.mapvote["vote"]["modes"] = []; @@ -148,7 +139,11 @@ ListenForVoteInputs() { if (self.mapvote[section]["hovered_index"] < (level.mapvote[section + "s"]["by_index"].size - 1)) { - self playlocalsound("uin_start_count_down"); + if (GetDvarInt("mapvote_sounds_menu_enabled")) + { + self playlocalsound("uin_start_count_down"); + } + self UpdateSelection(section, (self.mapvote[section]["hovered_index"] + 1)); } } @@ -156,20 +151,32 @@ ListenForVoteInputs() { if (self.mapvote[section]["hovered_index"] > 0) { - self playlocalsound("uin_start_count_down"); + if (GetDvarInt("mapvote_sounds_menu_enabled")) + { + self playlocalsound("uin_start_count_down"); + } + self UpdateSelection(section, (self.mapvote[section]["hovered_index"] - 1)); } } else if (input == "mapvote_select") { - self playlocalsound("mpl_killconfirm_tags_pickup"); + if (GetDvarInt("mapvote_sounds_menu_enabled")) + { + self playlocalsound("mpl_killconfirm_tags_pickup"); + } + self ConfirmSelection(section); } else if (input == "mapvote_unselect") { if (section != "map") { - self playlocalsound("fly_betty_jump"); + if (GetDvarInt("mapvote_sounds_menu_enabled")) + { + self playlocalsound("fly_betty_jump"); + } + self CancelSelection(section); } } @@ -214,14 +221,14 @@ CreateVoteMenu() for (mapIndex = 0; mapIndex < level.mapvote["maps"]["by_index"].size; mapIndex++) { - mapVotesHud = CreateHudText("", "objective", 1.5, "LEFT", "CENTER", level.mapvote["horizontal_spacing"], hudLastPosY, true, 0); - mapVotesHud.color = level.mapvote["colors"]["selected"]; + mapVotesHud = CreateHudText("", "objective", 1.5, "LEFT", "CENTER", GetDvarInt("mapvote_horizontal_spacing"), hudLastPosY, true, 0); + mapVotesHud.color = GetGscColor(GetDvar("mapvote_colors_selected")); level.mapvote["hud"]["maps"][mapIndex] = mapVotesHud; foreach (player in GetHumanPlayers()) { - player.mapvote["map"][mapIndex]["hud"] = player CreateHudText(level.mapvote["maps"]["by_index"][mapIndex], "objective", 1.5, "LEFT", "CENTER", -level.mapvote["horizontal_spacing"], hudLastPosY); + player.mapvote["map"][mapIndex]["hud"] = player CreateHudText(level.mapvote["maps"]["by_index"][mapIndex], "objective", 1.5, "LEFT", "CENTER", -(GetDvarInt("mapvote_horizontal_spacing")), hudLastPosY); if (mapIndex == 0) { @@ -240,14 +247,14 @@ CreateVoteMenu() for (modeIndex = 0; modeIndex < level.mapvote["modes"]["by_index"].size; modeIndex++) { - modeVotesHud = CreateHudText("", "objective", 1.5, "LEFT", "CENTER", level.mapvote["horizontal_spacing"], hudLastPosY, true, 0); - modeVotesHud.color = level.mapvote["colors"]["selected"]; + modeVotesHud = CreateHudText("", "objective", 1.5, "LEFT", "CENTER", GetDvarInt("mapvote_horizontal_spacing"), hudLastPosY, true, 0); + modeVotesHud.color = GetGscColor(GetDvar("mapvote_colors_selected")); level.mapvote["hud"]["modes"][modeIndex] = modeVotesHud; foreach (player in GetHumanPlayers()) { - player.mapvote["mode"][modeIndex]["hud"] = player CreateHudText(level.mapvote["modes"]["by_index"][modeIndex], "objective", 1.5, "LEFT", "CENTER", -level.mapvote["horizontal_spacing"], hudLastPosY); + player.mapvote["mode"][modeIndex]["hud"] = player CreateHudText(level.mapvote["modes"]["by_index"][modeIndex], "objective", 1.5, "LEFT", "CENTER", -(GetDvarInt("mapvote_horizontal_spacing")), hudLastPosY); SetElementUnselected(player.mapvote["mode"][modeIndex]["hud"]); } @@ -262,24 +269,24 @@ CreateVoteMenu() buttonsHelpMessage = ""; - if (level.mapvote["colors"]["help_accent_mode"] == "standard") + if (GetDvar("mapvote_colors_help_accent_mode") == "standard") { - buttonsHelpMessage = level.mapvote["colors"]["help_text"] + "Press " + level.mapvote["colors"]["help_accent"] + "[{+attack}] " + level.mapvote["colors"]["help_text"] + "to go down - Press " + level.mapvote["colors"]["help_accent"] + "[{+speed_throw}] " + level.mapvote["colors"]["help_text"] + "to go up - Press " + level.mapvote["colors"]["help_accent"] + "[{+gostand}] " + level.mapvote["colors"]["help_text"] + "to select - Press " + level.mapvote["colors"]["help_accent"] + "[{+activate}] " + level.mapvote["colors"]["help_text"] + "to undo"; + buttonsHelpMessage = GetChatColor(GetDvar("mapvote_colors_help_text")) + "Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+attack}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to go down - Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+speed_throw}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to go up - Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+gostand}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to select - Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+activate}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to undo"; } - else if(level.mapvote["colors"]["help_accent_mode"] == "max") + else if(GetDvar("mapvote_colors_help_accent_mode") == "max") { - buttonsHelpMessage = level.mapvote["colors"]["help_text"] + "Press " + level.mapvote["colors"]["help_accent"] + "[{+attack}] " + level.mapvote["colors"]["help_text"] + "to go " + level.mapvote["colors"]["help_accent"] + "down " + level.mapvote["colors"]["help_text"] + "- Press " + level.mapvote["colors"]["help_accent"] + "[{+speed_throw}] " + level.mapvote["colors"]["help_text"] + "to go " + level.mapvote["colors"]["help_accent"] + "up " + level.mapvote["colors"]["help_text"] + "- Press " + level.mapvote["colors"]["help_accent"] + "[{+gostand}] " + level.mapvote["colors"]["help_text"] + "to " + level.mapvote["colors"]["help_accent"] + "select " + level.mapvote["colors"]["help_text"] + "- Press " + level.mapvote["colors"]["help_accent"] + "[{+activate}] " + level.mapvote["colors"]["help_text"] + "to " + level.mapvote["colors"]["help_accent"] + "undo"; + buttonsHelpMessage = GetChatColor(GetDvar("mapvote_colors_help_text")) + "Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+attack}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to go " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "down " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "- Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+speed_throw}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to go " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "up " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "- Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+gostand}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "select " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "- Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+activate}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "undo"; } if (GetDvarInt("mapvote_debug")) { - if (level.mapvote["colors"]["help_accent_mode"] == "standard") + if (GetDvar("mapvote_colors_help_accent_mode") == "standard") { - buttonsHelpMessage = buttonsHelpMessage + " - Press " + level.mapvote["colors"]["help_accent"] + "[{+melee}] " + level.mapvote["colors"]["help_text"] + "to debug"; + buttonsHelpMessage = buttonsHelpMessage + " - Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+melee}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to debug"; } - else if(level.mapvote["colors"]["help_accent_mode"] == "max") + else if(GetDvar("mapvote_colors_help_accent_mode") == "max") { - buttonsHelpMessage = buttonsHelpMessage + level.mapvote["colors"]["help_text"] + " - Press " + level.mapvote["colors"]["help_accent"] + "[{+melee}] " + level.mapvote["colors"]["help_text"] + "to " + level.mapvote["colors"]["help_accent"] + "debug"; + buttonsHelpMessage = buttonsHelpMessage + GetChatColor(GetDvar("mapvote_colors_help_text")) + " - Press " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "[{+melee}] " + GetChatColor(GetDvar("mapvote_colors_help_text")) + "to " + GetChatColor(GetDvar("mapvote_colors_help_accent")) + "debug"; } } @@ -292,24 +299,27 @@ CreateVoteTimer() soundFX = spawn("script_origin", (0,0,0)); soundFX hide(); - timerhud = CreateTimer(level.mapvote["vote_time"], &"Vote ends in: ", "objective", 1.5, "CENTER", "CENTER", 0, -210); - timerhud.color = level.mapvote["colors"]["timer"]; - for (i = level.mapvote["vote_time"]; i > 0; i--) + timerhud = CreateTimer(GetDvarInt("mapvote_vote_time"), &"Vote ends in: ", "objective", 1.5, "CENTER", "CENTER", 0, -210); + timerhud.color = GetGscColor(GetDvar("mapvote_colors_timer")); + for (i = GetDvarInt("mapvote_vote_time"); i > 0; i--) { if(i <= 5) { - timerhud.color = level.mapvote["colors"]["timer_low"]; - soundFX playSound( "mpl_ui_timer_countdown" ); + timerhud.color = GetGscColor(GetDvar("mapvote_colors_timer_low")); + + if (GetDvarInt("mapvote_sounds_timer_enabled")) + { + soundFX playSound( "mpl_ui_timer_countdown" ); + } } wait(1); } level notify("mapvote_vote_end"); } -ListenForStartVote() +StartVote() { level endon("end_game"); - level waittill("mapvote_vote_start"); for (i = 0; i < level.mapvote["maps"]["by_index"].size; i++) { @@ -327,7 +337,7 @@ ListenForStartVote() foreach (player in GetHumanPlayers()) { player FreezeControlsAllowLook(1); - player SetBlur(level.mapvote["blur_level"], level.mapvote["blur_fade_in_time"]); + player SetBlur(GetDvarInt("mapvote_blur_level"), GetDvarInt("mapvote_blur_fade_in_time")); player thread ListenForVoteInputs(); } @@ -535,12 +545,12 @@ CancelSelection(type) SetElementSelected(element) { - element.color = level.mapvote["colors"]["selected"]; + element.color = GetGscColor(GetDvar("mapvote_colors_selected")); } SetElementUnselected(element) { - element.color = level.mapvote["colors"]["unselected"]; + element.color = GetGscColor(GetDvar("mapvote_colors_unselected")); } CreateHudText(text, font, fontScale, relativeToX, relativeToY, relativeX, relativeY, isServer, value) diff --git a/mapvote/source/mapvote_mp_extend-source.gsc b/mapvote/source/mapvote_mp_extend-source.gsc index d546011..2186f73 100644 --- a/mapvote/source/mapvote_mp_extend-source.gsc +++ b/mapvote/source/mapvote_mp_extend-source.gsc @@ -14,19 +14,19 @@ OnKillcamEnd() { if (isRoundBased() && !wasLastRound()) return false; - wait 3; + wait GetDvarInt("mapvote_display_wait_time"); - level notify("mapvote_vote_start"); - level waittill("mapvote_vote_end"); + [[level.mapvote_start_function]](); + [[level.mapvote_end_function]](); return false; } level waittill("final_killcam_done"); if (isRoundBased() && !wasLastRound()) return true; - wait 3; + wait GetDvarInt("mapvote_display_wait_time"); - level notify("mapvote_vote_start"); - level waittill("mapvote_vote_end"); + [[level.mapvote_start_function]](); + [[level.mapvote_end_function]](); return true; } \ No newline at end of file