Commit graph

165 commits

Author SHA1 Message Date
toaster
0c7d66791b Expand datatype for Unlockables, emblems (Medals + nonmedals), and Conditions.
Made sure there is more than enough headroom for our current purposes.
It should be easy to double again if necessary now that the datatypes have been increased... but that would be obscene at this point
- 1024 Unlockables and 1024 Conditions (these were always tied together in slots)
- 2048 emblems (Medals + nonmedals). If we ship with ~250 maps this permits 8 Medals per map - which is higher than we intend right now but could easily fill out in patches
2023-05-30 21:08:29 +01:00
toaster
f24a640e04 Increase reliability of menuKey system
The intersection between processed buttons and raw keyboard data is a messy one and will probably never be perfect, but it is now consistent.
- Never overwrite a valid keyboard menuKey recieved this frame with a -1 if a different type of event is recieved as well.
- Store previous state of dpad_lr and dpad_ud on menucmd struct.
    - Previously, if `a` was bound to Turn Left, it could produce a valid menuKey for one frame, then be considered a leftward input - switching from manual keyboard to Virtual Keyboard.
    - It still only produces a valid menuKey for one frame... but we simply filter out leftward inputs that are older than this frame to keep things (relatively) clean.
2023-05-20 22:37:31 +01:00
toaster
af334f927f Cleanup of the Virtual Keyboard
- Variable width key support
    - Rearrangement of keys to take advantage of this
- Uses thin strings
    - Or arrow sigils for backspace/shift
- Shift and caps lock have been visually combined to match other virtual keyboards
    - Press shift once to enable shift, press again to disable shift and enable caps lock
    - Indicator light on shift to show capslock state
2023-05-19 21:21:48 +01:00
SteelT
c419d037e8 Port the menu drawer function
- k_hud.c: Add K_DrawSticker function (was previously named M_DrawSticker)
- Seperated the confirm handling into the menu ticker (fixes the confirm delay being framerate dependent)
- Updated to use the button graphics
2023-05-14 20:21:03 -04:00
SteelT
cd59a4d34f Start of reimplementing the discord requests menu
- It's pretty barebones so far, more stuff has yet to be done
- Updated to use the current method of checking if a memu button is pressed

TODO: Port the menu drawer
TODO: Fix confirm delay handling
2023-05-14 16:24:41 -04:00
James R
3bc7b48b7e Remove Replay Hut code 2023-04-28 12:50:43 -07:00
James R
3ccfb71f04 Add Egg TV menu 2023-04-28 12:50:43 -07:00
James R
80421da5b3 Replace hardcoded keys for screenshot etc with bindable controls
Renames M_ScreenshotResponder to M_ScreenshotTicker. No
longer eats events. As a side effect, these controls
cannot be used with the console open.
2023-04-06 20:02:11 +01:00
toaster
bbf2fc0b5f Merge branch 'tutorial-access' into 'master'
Tutorial access

See merge request KartKrew/Kart!1102
2023-04-06 17:02:59 +00:00
toaster
534209b519 Extras Menu adjustment (again)
- Uncomment extras_tutorial again
- Put Tutorial second after Addons, so Challenges and Statistics are next to each other again
2023-04-03 00:28:38 +01:00
toaster
fbfb8a507d Extras menu: Add GT_TUTORIAL selection screen
- Disabled if no maps available/unlocked
- Has another exception for showing TEST RUN under all gametypes
- Splitplayers is forbidden
2023-04-03 00:28:38 +01:00
toaster
89fc9a618e Rumble toggle attached to profile
- Will silently merge conflict with !1093, make sure to adjust PROFILEVER handling
- (profile_t *)->rumble
- cv_rumble[MAXSPLITSCREENPLAYERS]
- cv_dummyprofilerumble
- Disables all current rumbles when toggling off
- Prevents new rumbles from being set while turned off
2023-04-02 23:16:58 +01:00
toaster
027fd2be04 Time elapsed functionality
- Shown on the menu
- soundtest.autosequence
    - Plays all songs in sequence, skipping over the soundtest entry.
        - Plays each looping song twice (and fades out if it's the last one in the musicdef's tracks)
        - Plays non-looping songs once with no fade ever
   - Disabled when S_SoundTestStop called
- Songs that end outside of autosequence will now stop the visible Playing.
2023-03-31 00:27:20 +01:00
toaster
e5c3b566bf Stereo Volume
Access to soundvolume and musicvolume through the Stereo Mode menu
- Draws a knob and volume bar (with loudness warning)
- Changes which cvar is associated with it depending on selected song/lack of
    - If on any regular song, use digital music volume
    - If on soundtest, use sound volume
        - unless on entry 0 aka N/A, where no volume is visible at all
2023-03-30 01:01:16 +01:00
toaster
f9975d6a71 stereospecial_e
No more magic numbers for M_DrawSoundTest
2023-03-29 23:28:45 +01:00
toaster
d19a7d9a57 Add M_MenuConfirmHeld and M_MenuBackHeld, to go with M_MenuExtraHeld. 2023-03-29 16:04:48 +01:00
toaster
53b24067ee Accidentially committed extras_tutorial to this branch 2023-03-28 00:43:37 +01:00
toaster
6e48a671ee extras-1.c - convert magic numbers for Extras menu listings to enums
Makes this code much less fragile to changing entries.
2023-03-26 21:54:33 +01:00
toaster
8f592c196f Stereo mode
- Minimum viable implementation
- New horizontal menu
    - FUTURE WORK: visuals are extremely basic
- Accessible from both Extras and in-game Pause if SECRET_SOUNDTEST is unlocked
- Rather than the Shadow-the-Hedgehog style free select of SRB2's Sound Test, it's a Best Of The Hacks And Fan Music Sega CD player.
    - Back
        - Exit menu
    - Stop
       - Stops Stereo music entirely
    - Pause
      - Pauses Stereo music without losing place in sequence
          - FUTURE WORK: This should probably just pause the actual player ala minimised viewport
    - Play
      - Begins Stereo music on non-NULL musicdef entry
    - Track
      - For NULL soundtest entry:
          - Switches between sfx
      - For musicdefs with multiple tracks:
          - Switches between them
    - Prev and Next
        - Changes musicdef entry
            - FUTURE WORK: This is extremely naive and doesn't respect the following
                - Cup order
                - Unlocks
- Overrides all game-requested music changes when in Play or Pause mode
    - This makes it an actual fun in-game feature as a menuification of the `tunes` command, not just a pure novelty.
2023-03-25 23:37:07 +00: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
Oni
b9bbb6cb8a Merge branch 'conditions-cascading' into 'master'
Conditions Cascading

Closes #366

See merge request KartKrew/Kart!1053
2023-03-23 23:51:30 +00:00
James R
d878d3941d Call G_MapEventsToControls before M_Responder and G_Responder
Fixes buffered keyup events not having any effect when
exiting the menu back to the Title Screen.
2023-03-22 16:49:36 -07:00
toaster
4c0077e07c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading 2023-03-19 13:01:06 +00:00
James R
8de2910dcb Merge branch 'file-fixems' into 'master'
File Fixems

See merge request KartKrew/Kart!1055
2023-03-18 11:09:11 +00:00
James R
aef45fb005 Rename moviemode_mode cvar to lossless_recorder, remove WebM option, adjust menus 2023-03-16 00:10:08 -07:00
toaster
29f17809bf Addons menu: Adjust most assetsby a handful of pixels to prevent the loaded indicator from going off the bottom of the screen 2023-03-15 17:34:49 +00:00
toaster
22e17fd881 Statistics respects cups now
- Adds headers to the list
- Adds indentation
- Doesn't show extra medals if there are none available
- Cleans up some of the undesired duplication in the drawer
2023-03-14 20:27:58 +00:00
James R
1eed98bc13 Remove screenshot_option, screenshot_folder, movie_option, movie_folder, addons_option, addons_folder
Remove the cvars and menu options to change which folder
screenshots, movies and addons use. Lots of code bloat
that we does not seem necessary.
2023-03-13 20:39:57 -07: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
0f14079555 levellist: Fix type of choosemap 2023-03-13 17:34:14 +00:00
toaster
1701662b6b Lost and Found
- When selecting levels:
    - If the gametype uses cups
    - and a map has no cup
    - and you're not in Grand Prix mode
- show those maps in a quasi-cup called "Lost and Found".
- Implementation details:
    - a few == checks for the pointer to `cupheader_t dummy_lostandfound`
    - Otherwise most of the apparatus was built as part of prior art!
2023-03-13 16:44:21 +00:00
toaster
8b437d5a32 Minimum viable product of Chao Keys condition bypass
- Start with 3, per Sakurai's prior art.
- Earn them per certain number of rounds
    - DEVELOP builds: once every 4 rounds
    - Release builds: once every 50 rounds
    - Has an internal cap based on the maximum number of unlockables supported.
        - Possible future work could adjust this to restrict based on the maximum number of unlockables unlocks.pk3 actually has set.
- Use on the Challenges screen to bust open small tiles with hints (or the very first tile, if you haven't unlocked anything yet).
    - Will do a funny shake if you try anything else.
- Interrupts menu flow just like getting an unlock.
    - The matches you've played will tick upwards, giving you keys as they loop over.
2023-03-09 22:33:10 +00:00
toaster
d2c36c952a Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading
# Conflicts:
#	src/k_grandprix.c
#	src/k_grandprix.h
2023-03-07 19:37:46 +00:00
Eidolon
4bb0c39133 Fix controller delay in menus
M_UpdateMenuCMD only needs to be called once per tick per player.
It was being called for every event, which really mangled the repeat
delays as more attached controllers sent axis events.
2023-03-05 16:07:17 -06:00
toaster
0f715454fa Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading 2023-03-05 19:51:48 +00:00
AJ Martinez
320685cf97 SPB Attack: review fixup omnibus 2023-03-04 06:41:44 -07:00
AJ Martinez
211206ba6f Fix menus, fix failure condition 2023-03-03 12:17:10 -08:00
AJ Martinez
79d8e4e109 WIP: SPB Attack - temp menu draws OOB, no unlocks 2023-03-03 12:14:58 -08:00
toaster
54a58178a1 Add Extras-related unlocks
- When SECRET_ADDONS is locked
    - No Addons option on Extras submenu
    - No mid-game Addons in K_CanChangeRules
    - Forced onto CORE on Server Browser room selection page
        - Semi-related: If modifiedgame is true, force onto MODDED, even if you haven't unlocked it
        - TODO: Update UI to show you can't switch in a more elegant way
    - Hide Addons Options on Data Options submenu
- When SECRET_EGGTV is locked
    - No Egg TV option on Extras submenu
    - Semi-related: Rename to Egg TV per team discussion
2023-02-27 19:55:11 +00:00
toaster
6d43d8ef09 Add SECRET_ONLINE.
- Online menu is inaccessible until unlocked.
- Unlike most unlocks, the fact that it's not enabled is very clearly signposted.
    - This is because the previous entry in the series barely had any offline content at all, so the fact you'll have to work for it will catch a lot of people by surprise.
    - Has a message that straight up tells you you need experience in Grand Prix mode.
- Has no affect in TESTERS builds, for which this is the only method of play available.
2023-02-27 17:01:15 +00:00
toaster
26ceb13672 Character Select: Press R (drift) to toggle an "extra info" mode
- Hides "A PLAYER/A $profilename" text
- Shows extra info relevant text
    - Early stages: "[EXTRAINFOMODE]"
    - Grid select: Speed and weight
    - Clone select/READY!!: Character name
    - Color: Color name
    - Follower category: Category name
    - Follower: Follower name
    - Follower color: Follower color name
- The hidden setup_page toggle feature now only uses L button
2023-02-26 23:28:00 +00:00
toaster
1ccde62f8a Challenges menu: Sidestep the problem with holding down the "flip to see the other side" button by making it instead a toggle
This toggle gets switched off when pressing any movement input to make it not possible to just leave on all the time and make the menu messy
2023-02-26 21:19:38 +00:00
toaster
9779d6066c Challenge Grid: Introduce flipping tiles
- When a tile is selected, flips from category side to specific icon side
- Flips back when unselected
- Hold R (drift) to flip all tiles to visible side
2023-02-25 00:21:28 +00:00
toaster
4380876959 Challenges Grid: create dedicated struct for menu extradata
- challengegridextradata_t
- Existing UINT8 data per entry has been converted to "flags" property
- This is a tool that will help us later.
2023-02-24 17:38:08 +00:00
toaster
a154b1a565 restoreMenu: Go to Difficulty select after Match Race, instead of the level selection menu
- Splits M_SetupDifficultyOptions out of M_SetupDifficultySelect.
    - Permits Encore to be handled on Difficulty menu if unlocked after a Match Race.
- Fixes an issue where the in-game Pause menu could be accessed in the menu
    - The prevMenu that was set was overriden with in-game Pause.
    - The assumption made - that the levelsearch/levellist struct would not be touched - is pretty transparently violated.
- I made it go back to the Difficulty select instead of fixing the issue because:
    - Match Race is more dependent on the rules you configure for that particular round
    - This mode of play will be modified in future to not be literally offline MP with things like voting, but instead return to the menu
    - It was easier relative to the amount of work to properly restore (this is the biggest reason)
2023-02-09 22:38:04 +00:00
toaster
6dd32deecb M_HandleStaffReplay, M_DrawTimeAttack: Re-support selecting staff replays from the menu 2023-02-04 11:06:57 +00:00
toaster
a2fadd2ff4 M_ChangeCvar: Split out core of function into M_ChangeCvarDirect, to prevent future code duplication 2023-02-04 11:06:28 +00: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
f46fbf0418 Remove MessageDef
This was a dummy conditional which was necessary in the old menu system; this is no longer the case as of newmenus.
2023-02-01 22:39:35 +00:00
toaster
57b22f32d5 M_PlayMenuJam
Pre-emptive work for more complicated menu music behaviour, permitting consistent implementation of the cycling music.
2023-02-01 22:12:41 +00:00