Commit graph

32 commits

Author SHA1 Message Date
FreakyMutantMan
ea8acf33aa Fix crash when trying to queue cup while highlighting an empty square. 2025-10-22 11:20:32 -07:00
Freaky Mutant Man
188d168ace Add ability to queue all maps in a cup for netgames and local matches by pressing Action on cup select. 2025-10-20 14:24:16 -05:00
toaster
c3131f697e Tutorial Recommendation hints for GP cup select
One new parameter on cupheader_t that can only be set in mainwads
If specified hint condition has been achieved, identifies from the actual unlock condition what Tutorial it should surface in a popup.
Funny question mark
2025-08-27 23:33:11 +01:00
Eidolon
892a6b8620 Merge public master 2025-08-12 16:49:14 -05:00
Eidolon
255570cfca Dynamically allocate skins
This avoids an issue where the skins array takes up a fixed, but large
amount of memory at runtime. On x86_64 linux, that array is roughly 80
megabytes in memory, most of which is unused when the game is unmodded.
Instead, we treat `skins` as a dynamically resizing array, and it is an
array-of-pointers into separate allocated `skin_t`.

This is based on Lactozilla's skin limit MR for SRB2, but I've rewritten
it because RR has diverged quite a bit.

This was verified to check every access of `skins` by using clangd's
find-all-references function. However, I have only tested plain skins,
not Lua addons, so that could afford some extra checking.
2025-08-12 15:33:00 -05:00
toaster
71e1179030 M_MenuToLevelPreamble: Seriously clean up the process of starting a course from the menu
A lot of messy, copypasted boilerplate has been bundled together into a single function.
Programmers can now fire up a Match Race, the most basic type of gameplay, from menu code in only four steps (other modes take a little more attention):
- **M_MenuToLevelPreamble(UINT8 - splitscreen players #, boolean - false to extend wipe/true for short wipe)**
- set restoremenu
- D_MapChange(...)
- M_ClearMenus(...)
Includes the following fixes:
- Encore no longer has over-long wipes when started from menu, only standard-length
- "Boss Intro" and Encore start-of-round sounds will always play, even if no Title Card is drawn
- No long wipe when restarting a Time Attack run
- Auto Encore and Auto Gamespeed are no longer accidentially forced if you've manually changed them to Off and Gear 2 before starting netgame
2025-06-01 00:05:45 +01:00
Eidolon
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
toaster
1034dd7ec9 Grand Prix course preview adjustment: Show Prison Break stages too, just like on Challenges Board preview
- All gametypes will be shown in the drawer, as opposed to just Race
- However, don't attempt to add the preview pic for CUPCACHE_SPECIAL (the Sealed Star)
2024-04-09 17:47:30 +01:00
toaster
224deed01d More copyright updates
- TehRealSalt and Lat` are currently preoccupied, so handle their credits
- Correct some accidential copypastes of existing boilerplate into new files
- Add a handful more of mine
- Consistency for Kaito Sinclaire's online handle
2024-04-02 22:14:49 +01:00
SteelT
73c9a7a90f Fix roundqueue empty error starting a splitscreen GP
Fixes KartKrew/Kart#1156
2024-03-12 12:04:18 -04:00
toaster
4aa13105c4 Fix problems exposed by a Round Star potentially being the first entry in a Cup
- Don't assume that the first Round in a Cup defines the default gametype for it
    - Now consistently uses GT_RACE
    - It was written this way to try and permit non-Race cups in future...
    - But there are much more solid ways to approach this down the line, instead of overloading this pre-existing data.
- cup-select.c: Don't assume `roundqueue.position == 1` means starting a fresh Cup from scratch
- G_HandleSaveLevel: Allow saving GP backups for overridden Courses at the front of the roundqueue
2024-03-09 20:33:24 +00:00
toaster
037c3a2aa1 M_StartCup: Also set restorelevellist 2024-01-25 22:40:52 +00:00
toaster
5e85de05ec QOL: Also support left/right inputs switching the Course from the top-level Time Attack view directly
- Abstracts out M_LevelSelectCupSwitch
- Pre-emptively supports cvars/arrow options on that menu
2024-01-25 22:40:52 +00:00
toaster
38258fc40a M_CupSelectHandler: small code cleanup done while writing the previous commit 2024-01-25 22:40:51 +00:00
James R
17a43430a7 Menus/Grand Prix: do not carry over Encore setting from Match Race 2024-01-11 03:05:27 -08:00
James R
d9f0f70987 Menus/Level Select: interpolate
- Uses slightly different easing
2023-12-29 05:46:56 -08:00
James R
1c2ed2b306 Menus/Cup Grid: stagger cursor movement 2023-12-29 05:46:56 -08:00
toaster
60e6445fd2 Special Mode Time Attack swag to unwind
- Play O_SSTAR3
- Special darkened background
- Imagery to replace the minimap, since Special Mode maps generally don't have them as a rule
    - Sealed Stars:
        - Star Within The Seal, from the standard Evaluation
    - Versus:
        - The DeviantArt SignatuRes
- Fix messed-up transitions between Time Attack main menu and Replay, Guests, and Ghosts submenus
    - Special Mode specifically:
        - Forced unexpected wipes
    - All modes:
        - Don't slide away the minimap (or replacement imagery) when going between these menus
        - Fix music not being correctly attached
- Correctly center minimaps in Time Attack view
2023-12-05 21:23:58 +00:00
toaster
85d8cfdf85 menu_t: Add bgroutine
All backgrounds are now handled by a seperate routine.
This will allow more fine handling without a ton of special cases everywhere.
Creates an absolutely nasty diff because all menu_t have been updated in one blast 🥹
For the things that DO need to draw outside of GS_MENU (M_DrawOptionsCogs, the Wrongwarp), the behaviourflag MBF_DRAWBGWHILEPLAYING has also been added.
2023-12-04 20:10:03 +00:00
toaster
382119b8fb Second row of cups is invisible if none of them are unlocked
- Controlled by M_CupSecondRowLocked
    - Looks for any Cup with associated unlockable that's on the second row
    - Cached on load for both relevant menus - Cupgrid and Challenges
- Custom cups will be stretched out onto more pages
    - Side incentive of unlocking more material: Less annoying interactions with custom material
- Pages with nothing unlocked are completely skipped over

Also moves a bunch of minor things which previously used magic numbers to the CUPMENU_COLUMNS/CUPMENU_ROWS defines, for sanity
2023-11-20 21:09:33 +00:00
toaster
defd885092 GP Backup tidy (connected to ending gamestate)
- Handle removing GP Backups when any game end sequence is started, not just the Podium (in case no Podium exists)
- Guarantee removal in M_StartCup out-of-entries failure state
2023-06-26 20:54:43 +01:00
toaster
a016a54e52 Rework how GP Backups are accessed
- Now actually from the relevant GP difficulty's Cupgrid, instead of the top-level Play choice
    - Permits a much cleaner M_StartCup, combining two of the previously four copypasted, slightly modified level startup regions (which could be further combined for sanity's sake, but would take a LITTLE more work right now than I have in me)
- Shows a funny exclamation mark from Sonic Rush on the relevant cup on the grid
- Selected by default when loading the menu, if appropriate
2023-06-25 23:44:39 +01:00
toaster
9788df79e7 Hide song credit in artificial fade on menu-caused playsim start
Technically unrelated but it was annoying me, and since I modified songcredit here I can attach it as a second bullet point
2023-05-10 14:42:58 +01:00
toaster
a08683e819 Improved round-queue state net communication
- Only send from the server when an update to roundqueue state is relevant
- Perform sanity checking on reciept
- Initialise when map command is sent with roundqueue size greater than the client's
- Correct gametype/encore state on reciept
- Only permit from the server, forbid admin clients from providing it on penalty of kick
2023-04-11 17:18:28 +01:00
toaster
19ef96351a roundqueue
A general purpose system that permits cacheing of GP progression in one place, but which permits future expansion and brings Online GP a little closer to reality.
- Stores a bunch of levels, gametypes, encore state, and restricted-by-rank-ness in sequence.
    - Initialised on GP cup select.
    - FUTURE WORK: Open to being initialised by other methods
- Digests its way through that sequence as maps are completed.
- Stores round number instead of `grandprixinfo`.
- Map commands as sent over the wire have been adjusted.
    - Sends round number and size of/position in roundqueue.
    - Now figures out GP Event Type from gametype.
        - Can be swung in the direction of a Special Stage with a hint flag.
        - This hint flag replaces "fromlevelselect", which was functionally vestigal.
2023-04-11 17:18:27 +01:00
toaster
42cc95f6ed menubehaviourflags_t / (menu_t).behaviourflags
- MBF_UD_LR_FLIPPED
    - Genericisation of the control flip for PAUSE_PlaybackMenuDef
- MBF_SOUNDLESS
    - Do not create sound for default menu actions
2023-03-25 22:39:07 +00:00
toaster
492babd73d Linear Level Select polish
- Even if there's only one level in the group, only skip over the mini linear list in a Time Attack mode
    - Improves some of the jumpscare of looking into Lost and Found and being blasted to TEST RUN
- Fix lists of one map being wedged against the bottom of the screen
- Precache valid map count
2023-03-13 18:20:50 +00:00
toaster
07f7be03a1 M_CupSelectHandler: Fix data types 2023-03-13 15:11:14 +00:00
Eidolon
83b6c30952 hwr2: add wipe mode to F_RunWipe, fix all wipes 2023-02-27 21:45:59 -06:00
toaster
03d422560d menu_t, M_PlayMenuJam: const char *music parameter
If Playing(), does nothing.
- If NULL, cycle between Cascade Cave as is traditional.
- If ".", stop music. (will one day be used for sound test)
- Any other case, call S_ChangeMusicInternal on the string directly

Notable menu sets:
- All Extra menus, excepting the Replay Hut, use "EXTRAS"
- Replay Hut uses "REPLAY"
- All online menus use "NETMD2".
    - I know we wanted to do something with switching between "NETMDE" and "NETMD2". I would prefer a more consistent API for transferring song position across between tracks be implemented before implementing this.
    - Known bug: Music restarts when exiting from failed connection screen
    - Known bug: Music goes back to Cascade Cave when selecting "GO" for server creation
        - Wontfix as we want that button to go directly to the voting screen, which we can do in a voting revamp branch
- Data Erase, Profile Erase: "SHWDN2"
    - Not in the spec but I think it's both funny and a valuable tell for the most "dangerous" menu to play with.
    - Also shifts the background to SKINCOLOR_BLACK
2023-02-01 23:15:51 +00:00
toaster
20e9b2f5e8 Restore menu state after playsim
- restoreMenu, M_SpecificMenuRestore
    - From any Cup Select, Level Select, or Time Attack context (including non-net replay playback), return to the relevant "core menu"
    - From any server OR server connection failure, return to the Online EGGA CHANNEL top-level menu
    - From netreplay, head to replay hut without incorrect gamestate/fade cope
    - Interruption for Challenges unlock sequence now happens on all menu returns, not just post-titlescreen
- M_StartControlPanel
    - Integrate with above
    - Handle menu re-initialisation properly under more contexts
- D_ClearState
    - Split out from D_StartTitle
    - Can be used alongside M_StartControlPanel to restore menu state from any play session in a way just as reliable as D_StartTitle was
2023-01-29 23:53:21 +00:00
James R
b26cd786ec Move all specialized code out of k_menufunc.c
Adds new files:

- menus/extras-statistics.c
- menus/play-online-room-select.c
- menus/transient/cup-select.c
- menus/transient/explosions.c
- menus/transient/gametype.c
- menus/transient/message-box.c
- menus/transient/virtual-keyboard.c
2023-01-12 20:31:31 -08:00