Using the shortcuts for class selection doesn't update the class selected

Discussion in 'Closed bugs' started by LordDz_2, Jan 4, 2013.

  1. LordDz_2

    LordDz_2 Strange things happens here

    Messages:
    2,956
    Likes Received:
    93
    Trophy Points:
    0
    Actually, it doesn't just update the string..
    Found it out tonight that you could use shortcuts for selecting class, didn't know that :)

    How to reproduce:
    Bring up your class selection menu, press E, G, R or S. A to accept.

    [​IMG]

    (I spawned normally as a Scout).
     
  2. Jephir

    Jephir ALL GLORY TO THE JEPHIR

    Messages:
    1,409
    Likes Received:
    6
    Trophy Points:
    0
    Going to need some info from the person implemented the shortcuts. Where are the shortcuts defined? I did a search for "acceptLoadout" in both the code and SVN and couldn't find the source of the string.
     
  3. Beerdude26

    Beerdude26 OnThink(){ IsDownYet(); }

    Messages:
    7,243
    Likes Received:
    13
    Trophy Points:
    0
    I can't remember implementing this either? Perhaps I was ON CRAAAACK
     
  4. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    The culprit would be me... :headshot:

    I've added the E/G/R/S-hotkeys to the resources/ui/class2.res (at the end as invisible buttons, since the dropdown didn't directly support hotkeys), they're sending the same commands as the dropdown selections.

    The problem seems to be that just the dropdown selection is not updated to the current state when the layout is updated.

    Sorry for this extra work - in some weird case of gui-blindness I've never noticed this until now, and have mistaken this bug as the old wrong-loadout-after-revive...

    This is probably a duplicate of Vicki's bug: The loadout is that of the scout, because she somehow pressed 's' after she opened it wafter having previously selected engy in the dropdown.

    If noone wants to touch the dropdown-update code, I can just remove the class hotkeys.
    The number hotkeys seem to work flawlessly though, so I'd like to keep them.
     
  5. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    Okay I think I fixed it. Fixed in cdf6810fbb1fa3d90d2a2034870ccc83767a8bf5.

    Did you define hotkeys for other menus?
     
    Last edited: Jan 8, 2013
  6. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    Just wanted to add, that this is fucking awesome.
     
  7. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    In class2.res and also in class_submenu.res for the generic/specific (G/S) dropdown (and submenu button numbers).
     
    Last edited: Jan 8, 2013
  8. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    Okay I fix the second one tomorrow.
     
  9. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    It's honestly incredible that you managed to anything at all like this without code support.

    Is it only possible for the class menu or can you do anything with the comm menu? I've always wanted building hotkeys.
     
  10. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    The comm gui is out of reach for me, as it seems fully code generated and doesn't use any .res templates where I could sneak something in.
    The vehicle menu has little room for hotkeys: The dropdowns for chassis and loadout seem to handle selection in their own way, and the few recognised command keywords that I could figure out are of questionable use for hotkeys (like switching between weapon/armor/engine config panels or accidentally building random garbage vehicles).
     
  11. Beerdude26

    Beerdude26 OnThink(){ IsDownYet(); }

    Messages:
    7,243
    Likes Received:
    13
    Trophy Points:
    0
    Are these shortcut keys hardcoded into the .res file, or can they be changed in the controls menu?
     
  12. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    The secret lies in the vgui Label-class, which the button control uses for its text. It scans the label text (defined in the .res) for characters preceded by '&' and sets these as hotkeys.
    Being able to change them from the controls menu would probably require code to adjust the button labels with the defined hotkeys.

    Imho being able to reconfiguring them is of limited help, since they are only valid in the context of the currently open class menu or submenu, and the label-hotkeys are restricted to alphanum chars, so you wouldn't be able to bind them to f-keys and the like.

    To give the player a hint about the class hotkeys, I could change the dropdown descriptons to something like
    [G] - Grenadier
    [E] - Engineer
    ...
    Maybe not overly elegant, but still a visible clue...
     
  13. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    Need a better hotkey solution for those dropdown menus, this is somewhat hacky what I am doing.

    Anyway fixed in 3ad5b5f58fd3ffb1d688372e0d78bea04f90b446.
     
  14. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    Can you add Hotkeys for team selection? One more form where I don't have to use my mouse for.
     
  15. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    Yes, seems to work - though I have to use 1,2,3,4 (nf,be,spec,auto) for the team selection, because 'b' and 'n' inferferes with the chooseclass/chooseteam bindings, which are also 'b' and 'n' by default, and causes popup-spam with both class and the team selection panels suddenly open. Works well with the numbers though.

    I'll put the modifications with the rest of the stuff which I still need to have committed by someone...
     
  16. LordDz_2

    LordDz_2 Strange things happens here

    Messages:
    2,956
    Likes Received:
    93
    Trophy Points:
    0
    Can you add the shortcuts to the names of the teams in the selection?
    So it says Northern Faction [1] ?
     
  17. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Problem is, that's where it says how many players are on that team (I think).
     
  18. Ducky

    Ducky 2D Artist

    Messages:
    158
    Likes Received:
    0
    Trophy Points:
    0
    Yes, that seems to be the problem: Whatever I set as label text for nf/be/spec is updated by code with a formatted sting containing the current number of players.

    I could possibly position a dummy number label next to the buttons, but that would look awkward somehow...
    While thinking about it now, maybe replacing the simple buttons with bigger nf/be-themed button graphics could work and provide room for a hotkey label. I'll have to check how much of the layout from the .res is retained when the panel is prepared, to see if this could work.
     

Share This Page