Commit graph

405 commits

Author SHA1 Message Date
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
af01ae7bc5 Duplicate levellist data for menu restoration
- More consistent and graceful recovery from gametype change
- Fix a potential bug with restoring the menu from Tutorial stages
- Store the calling menu in this struct
    - Permits removing the Match Race restoreMenu hack
2024-01-25 22:40:51 +00:00
Eidolon
02e56a304e Reset all gamekeydown arrays for all devices 2024-01-11 22:04:13 -06:00
toaster
b5c1e89645 Merge branch 'goner-assignment' into 'master'
Assign p1 device during goner/title + unassign all

See merge request KartKrew/Kart!1768
2024-01-05 12:35:20 +00:00
Eidolon
746da46321 Read staff ghosts from pk3 directory 2024-01-02 21:05:43 -06:00
Eidolon
30cd354014 Assign p1 device during goner/title + unassign all
Avoids the controller reassignment message and ensures only one
controller participates in goner setup. Also unassign all devices when
returning to the title screen
2024-01-02 14:38:42 -06:00
James R
9df8dd2bc0 consvar_t: add step_amount field, used by menus 2024-01-01 03:05:17 -08:00
James R
99baf4e8e1 Menus: cycle float values correctly
- Left of MIN: largest value not within MIN/MAX
  - Keep going left to wrap around to MAX
- Right of MAX: smallest value not within MIN/MAX
  - Keep going right to wrap around to MIN
- Always lands on MIN/MAX
- Trailing zeroes removed
  - Keep ".0" at the end (for style)
2024-01-01 03:05:17 -08:00
AJ Martinez
deb9770c80 Use less aggressive menu delay rampup 2023-12-30 22:46:39 -07:00
James R
41155fd81b Menus: press C to reset text box options to default 2023-12-29 19:24:48 -08:00
James R.
d0e1d0a42a Merge branch 'menu-indents-pass-1' into 'master'
Menu indentation for selected options (first pass)

See merge request KartKrew/Kart!1736
2023-12-29 13:40:51 +00:00
Oni
1ca12f2170 Merge branch 'cache-virtual-kb' into 'master'
Menus/Virtual Keyboard: cache cvar string for duration of typing

See merge request KartKrew/Kart!1737
2023-12-29 09:14:11 +00:00
Sally Coolatta
719f4355a2 Randomize menu backgrounds
Can be any unlocked, non-Special Stage, non-boss map with a thumbnail.
2023-12-28 23:39:10 -05:00
James R
0ef1abcf3a Menus/Virtual Keyboard: cache cvar string for duration of typing
This avoids calling cvar callbacks after every key press.
2023-12-28 05:54:01 -08:00
James R
e114bf8f95 Menus: pop out highlighted button on Gamemode menus (except when fading in)
Effective for:

- Gamepad up/down
- Transition (without fade)

Does not affect buttons inside boxes. My reasoning here is
that these show arrows when highlighted anyway, so that
fulfills the extra feedback.
2023-12-27 12:26:30 -08:00
toaster
f955c639e8 Profile setup music changes
- Plays unconditionally, even while mid-game
- ...except on the Goner Setup, per direct request
2023-12-18 20:03:45 +00:00
toaster
c6edfa0de5 Goner Setup Polish
- Imply passage of time when returning from Tutorial to Outro by resetting all the background variables
- Add an additive layer to the Options cogs, so they show up over an extremely dark background
- Metal Sonic will not focus on Tails/Eggman until video is restored
- Don't draw the Miles Electric transparent unless it's completely in its upright position
2023-12-18 17:01:29 +00:00
toaster
b308a81e9d Clean up interactions between Goner Setup and restoreMenu behaviour 2023-12-18 16:30:12 +00:00
toaster
73ff45458e Quit prompt updates for when game hasn't truly started
- More clinical wording
- Guarantee never auto-show when Playing()
2023-12-18 14:10:55 +00:00
toaster
fe669ff281 Goner Setup Background part 2
- Eggman's mouth moves
- Smooth camera movement
- Smooth Miles Electric movement
- Less fragile/instant blinking
2023-12-18 00:46:20 +00:00
toaster
647a9d0a0e Goner setup music: Change behaviour
- Hook into M_PlayMenuJam, to reduce bespoke behaviour
- Use the finalised track string
- Play on the Sound Options menu
Also, use MAIN_Goner as reference for the password field's presence, because I lost like 30 minutes to a related bug
2023-12-17 13:18:35 +00:00
toaster
c82d24b4bc Music starts after Sound Options completed
Currently plays _OCEAN for testing, but will be changed to play _GONER when Journey In Modulating Time's short loop is ready.
Explicitly restricts the basic title screen's music from playing, too.
2023-12-08 13:08:06 +00:00
toaster
11fcb0b9ae Goner Setup: Cook 3 - Add "Outro"
One last guaranteed visit to the setup, to get a sendoff before the game truly begins.
(The "survey program" joke is now themed softlock prevention.)
2023-12-07 23:36:02 +00:00
toaster
e91115a8fa Goner Setup: Cook 2
- More dialogue
- Restrict access to your choices based on your progress through the Goner Setup.
- Save progress through the setup to gamedata
    - Resets to beginning when Challenges is cleared
- Passwords
    - Only permit the password entry in like the first two seconds
        - Preemptively disarms potentially annoying people in stream chats
    - Make wrongwarp also quit the game on exit instead of returning to the title screen
    - Add GDQ cheats
        - `savetheanimals`
        - `savetheframes`
        - Both do practically the same thing, with slightly modified dialogue.
            - Skips all of the normal dialogue.
            - Performing a social experiment on anyone who might stream this game at a charity event. :)
2023-12-03 22:34:06 +00:00
toaster
0f687be7b5 The Goner Setup
The simplest passable version of the first boot experience.
- The minimal set of options you will want are available right in front of you.
    - Quit
    - Password
    - Video Options
    - Sound Options
    - Profile Setup
    - Begin Tutorial
- Will not start any menujams while this is in progress.
2023-11-29 19:37:05 +00:00
AJ Martinez
28405087e5 Y to quick restart attack modes 2023-11-02 16:53:55 -07:00
James R
6c0b042eed Refactor cvar definitions completely, move everything to cvars.cpp
- No need to call CV_RegisterVar
- Cvar definitions live in only one file, easier to locate
- Organized into sections -- netvars, cheats, etc.
- Use builder pattern to initialize cvars
- Still need to extern if you want to read the cvar value
2023-08-25 17:22:40 -07:00
AJ Martinez
3900189199 Auto Spin -> Auto Roulette 2023-08-20 16:26:34 -07:00
AJ Martinez
fbfc75df71 Item box autospin 2023-08-20 05:08:53 -07:00
James R
39f46a0f20 Replace music handling
(This commit does not compile. Sound test and tunes
command code needs to be ported after this.)

This is a big one. Here's the rundown:

The old music system was very direct, much of the time
just a proxy to the real sound API in i_sound.h.

You could change the music on command, but there wasn't
a consistent way to prevent some music from playing over
others. P_RestoreMusic is one example of needing to
address this problem. The jingles system was intended as
another solution. Furthermore, sound test (Stereo) has its
own needs.

I am removing all of that. Music handling in general is
now a very deliberate system, kind of similar to jingles.

In the new system, "tunes" are registered. The tune stores
info such as whether it should loop or fade out. Most of
the configuration is intended to be initialized only ONCE.
Tunes can be mapped to an actual music lump. They can be
remapped at any time too.

Tunes are also configured with a priority number. This
determines which tune is heard, if multiple are supposed
to be playing at a time. You can even tell a tune how long
it should play, so it's unnecessary to track this with
bespoke timers.
2023-08-06 17:31:45 -07:00
toaster
c89048def7 Game End cleanup
- Remove specific gamestate, drawer, etc
- Just add an extra fade straight into G_EndGame
2023-06-25 23:49:19 +01:00
toaster
6b1fadd9d2 Make the Server Connection Ticker use the MenuCMD system
- Permits the use of the existing K_HandleMenuMessage MM_YESNO system, instead of the faked previous implementation
    - Removes the "cl_requestmode" hack
    - The only area of the game that fakes handling Menu Messages is the title screen, now, due to the lack of guarantees for menu inputs.
- *Also* permits Screenshots and video/lossless Recordings to be started/ended on this menu.
2023-06-25 23:44:38 +01:00
toaster
d450faeaaf General Menu Message input cleanup
- M_StopMessage is now in charge of setting the answer to a given prompt.
- Menu Messages can now be dismissed on the title screen, instead of carried into the top-level menu transition.
2023-06-25 23:44:38 +01:00
toaster
6c6306889a M_StartMessage revamp
Immense 25-file diff, so spun off into its own branch.
- Improved appearance
    - Not just a big block of text on a blue background
    - Well, OK, the main part is, but some stuff has been spun out into its own fields
        - Title text
        - Text and button prompt for Yes/No or OK
    - Slides with pow on and off the screen
- Disabled MM_EVENTHANDLER, which has always been dog but got considerably worse after newmenus to the point nothing's using it anymore
    - Required in order to reduce the reliance on FUNCPTRCAST, which prevents Eidolon from compiling some stuff because it's not valid C++
2023-06-09 19:23:36 +01:00
toaster
aa4c3ab4a2 K_MenuButtonPressed, K_MenuButtonHeld: Return *actual* booleans, not numerical flag values 2023-06-09 14:31:16 +01:00
toaster
8efd4788e7 enum gdmusic_t
Replaces existing musicflag system, which only had one flag, with a priority system that overrides menu music in general.
Also adds the CHAO KEY FREE DDL WORKING 2023 goofy music for matchesplayed Chao Key generation.
2023-06-07 23:05:19 +01:00
toaster
c8f74aef2b menubehaviourflags_t: Add MBF_NOLOOPENTRIES
Abstracts one previously hardcoded exception to M_NextOpt/M_PrevOpt
2023-06-07 17:46:21 +01:00
toaster
7fd957c929 M_InitExtras: Call with parameter -1 in more circumstances, to prevent an incorrect Extras Menu after Addon load/Challenge unlock. 2023-06-07 17:46:21 +01:00
toaster
d8e2b4a906 Password entry on Extras menu
- Type in anything you want
- On closing the field, if a cheat sequence is matched *exactly*, activate it!
    - Directly hooked up to a modified form of the previously existing SCRAMBLE interpreter system in m_cheat.c
- The existing cht_Responder call in D_ProcessEvents is gone
    - Done this way because the new input paragadim is not very friendly to unqualified keyboard/controller input, and we still want text
- Plenty of opportunity to add fun future passwords in addition to the currently underbaked Tournament Mode
    - Got a debug M_StartMessage just so you can tell what's up without sound
2023-06-07 17:46:20 +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
df31f7cf3a M_HandleMenuInput: Fix incorrect menuKey comparison that was preventing the Virtual Keyboard from ever being activated on first opening 2023-05-20 21:03:23 +01:00
toaster
d86743f0ba Profile selection music
- `_OCEAN` on first launch without profile set, to avoid skipping between three different tracks in quick succession
- 'FILE' if you create a new profile on first launch OR if you go into Options->Profiles
2023-05-19 23:10:13 +01:00
James R
3bc7b48b7e Remove Replay Hut code 2023-04-28 12:50:43 -07: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
06763da0e7 Merge branch 'bind-function-keys' into 'master'
Remove hardcoded Function keys for screenshot etc, add RECORD LOSSLESS to the profile controls

Closes #284

See merge request KartKrew/Kart!1093
2023-04-11 16:16:23 +00:00
toaster
5dd4e36b72 S_StopMusicCredit: Make killing a music credit a request, not a guarantee
Fixes some menu events causing Stereo-caused music credits to disappear
2023-04-08 12:32:47 +01:00
toaster
ed3ed6f189 M_UpdateMenuCMD: Enable access to screenshots/etc based on player inputs
Returns early if any of these have been added this tic
2023-04-06 20:02:12 +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
d19a7d9a57 Add M_MenuConfirmHeld and M_MenuBackHeld, to go with M_MenuExtraHeld. 2023-03-29 16:04:48 +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