[TF2] Remove the hard-coded F4 ready up bind for mp_tournament matches#1778
Open
dilbertron2 wants to merge 2 commits intoValveSoftware:masterfrom
Open
[TF2] Remove the hard-coded F4 ready up bind for mp_tournament matches#1778dilbertron2 wants to merge 2 commits intoValveSoftware:masterfrom
dilbertron2 wants to merge 2 commits intoValveSoftware:masterfrom
Conversation
|
you could center the label by setting it's xpos to |
Contributor
|
I'm not sure if string comparison with == works the way you intend here, but it'd probably also be better to either use a separate boolean for that case, or to just do that case's logic inside the block where the 'ready' text is set. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: I am not well-versed in the TF2 SDK or C++ in general, I tried my best. If I made any errors please tell me :)
The Issue
An issue with readying up in matches that utilise
mp_tournament 1(including Mann VS Machine) is that F4 is permanently bound to theplayer_ready_togglecommand even if you bind another key to that action or unbind F4 via the console.Looking at the code shows that
player_ready_togglesimply simulates an F4 key press and feeds it into theCHudTournamentSetup::ToggleStatefunction.The Solution
Take the code from the
CHudTournamentSetup::ToggleStatefunction that handles readying up and put it into a new function calledCHudTournamentSetup::TogglePlayerReadiness. Now update theplayer_ready_togglecommand to callTogglePlayerReadiness.This is the first part of the fix done but now we need to handle the text (Which is currently hard-coded to display F4 as the specified key.)
Update the
#Tournament_Instructionslocalisation string fromF4 = change team name/statusto%s1 = change team name/status, and change#Tournament_Instructions_ReadyfromF4 = Toggle Readyto%s1 = Toggle Ready.Now in all applicable places in
tf_hud_tournament.cppwe look for the key that is bound toplayer_ready_toggleand insert it into the localisation string! This initially caused truncation in the ready up message for Mann VS Machine so I also increased the width ofTournamentInstructionsLabelandTournamentInstructionsLabelShadowfrom 190 to 300 to ensure enough room, under theif_mvmsection inResource/UI/HudTournament.resThis also requires the
xposof both UI elements to be edited aswell to line up with the new width.TournamentInstructionsLabelgets itsxposset to c-150 andTournamentInstructionsLabelShadowgets itsxposset to c-149Video
https://youtu.be/kE7cYbmGdeM <-- PR in action
Possible Issue
I am unaware if there is a way to dynamically center text based on length, if there is then I either missed it or cant understand it. Because of this the MvM ready up text wont always be centered(?)
Extra Steps for Valve
All other localisation files will need to be adjusted.
Resource/UI/HudTournament.reswill need to be modified.config_default.cfgwill need to havebind "F4" "player_ready_toggle"added.Files
Here are the modified .res and tf_english localisation file :)
Dynamic Ready Up Extra Files.zip (OLD VERSION)
Dynamic Ready Up Extra Files 2.zip (CURRENT VERSION)
Partially fixes ValveSoftware/Source-1-Games #7742