forked from splewis/get5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix veto menu pagination (splewis#121)
Fix map pick and veto pagination on <=7 maps. Turns out that setting menu.Pagination = 7 won't work, since 7 is apparently too high a number (i think there might be a miscalculation in sourcemod on this). This can be seen by checking the return value of calling SetMenuPagination (which will be false). This is fixed by turning off pagination entirely if we have 7 maps or less. I haven't added this logic to the side pick handler, as there are never more than 2 options. Offending code is either here: https://github.com/alliedmodders/sourcemod/blob/237db0504c7a59e394828446af3e8ca3d53ef647/core/MenuStyle_Valve.cpp#L367 or here: https://github.com/alliedmodders/sourcemod/blob/237db0504c7a59e394828446af3e8ca3d53ef647/core/MenuStyle_Radio.cpp#L598 * Rename functions to increase consistency Renames some functions to increase consistency. Functions that present menus are now: - GiveSidePickMenu - GiveMapPickMenu - GiveMapVetoMenu And their handlers are: - SidePickMenuHandler - MapPickMenuHandler - MapVetoMenuHandler * Rename main veto controller for clarity Renames the main veto controller from MapVetoController to just VetoController, for consistency with VetoFinished and AbortVeto. Reasoning is that anything related to specific maps (veto or pick) is now named with a "Map" prefix, while the process as a whole is just named "Veto" * Reorganize and introduce sections Add a header to each section of code, and move them around, so that they are more in line with how the usual veto process happens (i.e. ban -> pick -> side)
- Loading branch information
Showing
2 changed files
with
82 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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