Commit graph

199 commits

Author SHA1 Message Date
toaster
372854f8d3 Do SOME attempt to add quality of life changes to the admin Change Map flow, rather than just bypassing it entirely.
- Pre-select the current gametype when showing what gamemodes are available.
- Pre-select the current map's cup when opening up the cup view.
2022-11-17 17:28:18 +00:00
toaster
962393f7b9 Restart Map/Try Again pause menu entry
Closer to parity with pre-newmenus behaviour.
- Clinical term for server admins, colloquial for SP contexts (GP/modeattacking)
- Won't show up in GP if you're out of lives
- Also fixes lives going negative in K_PlayerLoseLife
2022-11-17 16:45:07 +00:00
toaster
0c8c3df6a3 Fix menus sometimes getting stuck closed
The problem here is that the menuactive check I added in the followers branch prevented noFurtherInput from being unset. It now can no longer be set while the menu is closed.
2022-11-17 16:42:05 +00:00
toaster
f87366de04 Make menu-created button prompts consistent with d_clisrv.c button prompts 2022-11-17 16:36:54 +00:00
toaster
6eda325561 More character select quality of life
- When selecting follower category, initial follower category is now the category of your last used follower (or None)
- More C/Extra button functionality:
    - Profile selection: Toggle between your last used profile and guest
    - Follower category: Toggle between category of your last selected follower and None
    - Follower: Return to category selection and hover over None (flows seamlessly into above option)
2022-11-07 20:57:02 +00:00
toaster
e086b52055 Fix the MP character select being completely busted and sending infinite changenameandcolor packets
Still has weird inappropriate conditions for changing skin, but gets the feature at least WORKING for now.
2022-11-07 20:16:53 +00:00
toaster
2e75012645 Clean up follower setting to handle strings and values just like player->skin
- Fixes defaulting to follower id 0 (previously chao, currently hot robo) when joining a server without going through the menu flow
- No need to store TWO names for a follower, so save a little memory
- Should make it easier to add unlockable followers later
2022-11-07 18:11:45 +00:00
toaster
8aeaf9738d Major changes to follower selection
- Followers now have categories, definable in SOC
- New character select step: Follower category
    - "None" is a category, just skips straight to Follower None
    - Select a category to go to the previous regular follower selection step
- Press the C/Extra button to reset a character select step to its "default"
    - Character: Center the character in the engine class (goes from [0,1] to [1,1], etc)
    - Character alts: Centers the "primary" alt (prefers Eggman over Eggrobo)
    - Skincolor: Centers the character's prefcolour
    - Follower category: Centers on the "None" option
    - Follower: [CURRENTLY NO BEHAVIOUR]
    - Followercolor: Cycles between follower's defaultcolour, "Match", and "Opposite"
2022-11-06 22:53:12 +00:00
toaster
ca3525a81a Fixing going back in the follower list on the Character Select 2022-11-06 14:52:37 +00:00
toaster
a9e5904d2f Show (and clear) menu messages on the titlescreen 2022-11-04 00:30:03 +00:00
toaster
21be387d0f Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into connection-doinglus
# Conflicts:
#	src/d_clisrv.c
#	src/d_main.c
#	src/k_menudraw.c
#	src/m_misc.c
2022-11-03 22:36:34 +00:00
Oni
95096fbc9a Merge branch 'special-stages' into 'master'
[Special stage prep] GP Bonus Stages + timelimit rework + Hitlag ticking fixes

Closes #236

See merge request KartKrew/Kart!739
2022-10-27 03:10:37 +00:00
James R
ae02579b09 Fix menu start button closing the chat 2022-10-23 13:20:13 -07:00
toaster
ca2ecf6e9f Add "allowdemos" option to K_CanChangeRules()
It's been used interchangably as "this is a singleplayer gameplay context" and "This is a no cvar changing context". This addition repairs some behaviour which might have been inconsistent between netgame and netreplay.
2022-10-15 15:15:22 +01:00
toaster
54a1ac9944 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into special-stages 2022-10-14 18:40:30 +01:00
James R
01faa52162 Clean up instances of malloc replay file path
- Fix allocating only enough for "MAPXX".
- Fix memory leak in M_StartTimeAttack.
- Use va instead of malloc + sprintf, strdup where needed.
Some of these pass gpath to va anyway so that should be
enough room.
2022-10-13 16:34:24 -07:00
toaster
243f38227c Rework time limit a bit
- Make timelimitintics handled a bit more like gamespeed, encore, frantic, etc - update on mapload/starttime, not during gameplay
    - Use default setting if can't change rules - this is a surprise tool that will help us later
- Have it properly update when adjusting gametype from the menu
    - Cleaned up SV_StartSinglePlayerServer to do this
- Remove CV_SAVE to prevent time limit bruh moments
2022-10-11 23:00:44 +01:00
Sally Coolatta
80d9637dda devmode cheat online 2022-09-29 12:19:45 -04:00
toaster
52f0217bac Completely rewrite how joined IPs are saved and written... again
- Use strlcpy instead of strcpy to prevent footguns
- Use fprintf instead of raw fputs
- Enforce consistent MAX_LOGIP (255) length for each component instead of a combination of magic number 255 and MAXSTRINGLENGTH (32!?) depending on where you look
- Fix fun memory leak in waiting
- Avoid pointless strlens
2022-09-26 21:28:33 +01:00
toaster
ff629a4c78 Merge branch 'kill-nonet' into 'master'
Kill last of NONET, DJGPP (DOS), WATTCP (also DOS?), _WINDOWS (DirectDraw)

See merge request KartKrew/Kart!704
2022-09-26 17:02:55 +00:00
Sally Coolatta
139d6f4a49 Merge branch 'master' into rng-states-2 2022-09-25 14:04:19 -04:00
James R
89abbd33b4 Kill last of DJGPP, WATTCP, _WINDOWS (ol' DirectDraw) 2022-09-24 19:43:44 -07:00
James R
f6a5ed9c6c Remove NONET 2022-09-24 19:22:04 -07:00
toaster
5c36e72115 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into rng-states-2
# Conflicts:
#	src/p_enemy.c
2022-09-24 20:29:53 +01:00
toaster
fe49543456 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into big-large-map-markers 2022-09-24 19:53:36 +01:00
toaster
75c8749939 Menu jammin
- Menu uses one of three songs (already in music.pk3)
- Cycles between them every time you return to the title screen after starting a map
- Console-accessible. Do what you want
2022-09-23 22:58:51 +01:00
toaster
859375ce3d Disable all staffghosts code since the lumpname stuff needs addressing (but that'll come later) 2022-09-23 21:08:26 +01:00
toaster
48e9138dda Refactoring ahoy
* Instead of doing constant G_MapNumbers when finding the relationship between maps and cups...
    * Add a cache of level IDs to cups, to go with the strings.
    * Add a cache of the cup pointer to maps, so we don't have to search through all cups to find our map. (done in P_InitMapData)
    * Pre-emptive work: G_IsSpecialStage and P_GetNextEmerald now reference cup data instead of a hardcoded ID set.
* Remove a bunch of old stuff from mapheaderinfo_t/associated, and reorder what stays
    * Countdowntimer? 💥
    * Startrings? 💥
    * sstimer/ssspheres? 💥
    * forcecharacter? 💥 (distinct from forceskin)
    * interscreen? 💥
    * sstage_start/end and smpstage_start/end? 💥💥💥💥
    * You've been blocked
* G_MapNumber now returns a special NEXTMAP_INVALID if not found, for more consistent reference.
* Incorporate a good chunk of the `edit-headers` branch. Can't clear maps individually because of the new restrictions on sequential mapheaders, but we can add a "disable in vote screen, not even for map hell/archive" flag to a map at some future juncture for equivalent functionality...
2022-09-22 17:14:41 +01:00
Sally Coolatta
a60d4a13a1 RNG classes, take 2
Redone version of my old branch
2022-09-19 00:04:57 -04:00
toaster
7d990c4f15 Rework nextmap to be automatic
- Refactor significantly (now has its own func, `G_GetNextMap`)
    - If gametype uses cups, iterate through cups to find the current level, then grab the next valid level
    - If not, get the next valid mapheader for your gametype
    - SOC `nextmap`/`marathonnext` is not just deprecated but REMOVED
    - Hide the NEXTMAP_ constants again, but leave support dummied out for if we have them publically accessible again
- Also get rid of a bunch of OTHER mapheader stuff we're never gonna use
    - NiGHTS Grades? NOPE
    - Vanilla titlecard patches? NOPE
    - Boss music fadeout/replacement? NOPE
    - Select Heading? NOPE
    - You've been blocked.
- Don't show maps without lumps on the level select list
- this is me being petty, but making it NOTIMEATTACK in SOC instead of TIMEATTACK so we can reconsider the maps with/without them.
2022-09-18 20:00:28 +01:00
toaster
7e17f5456c I_Error in all situations where mapheaders were previously allocated outside of SOC.
Also:
- improved error prints for SOC condition definitions
- improved bounds checking to use `nummapheaders` for iterating over mapheaderinfo
There are still situations that use NUMMAPS like mapvisited, randmapbuffer, etc, which need to be addressed before merger.
2022-09-17 13:07:48 +01:00
toaster
b08ae2a716 Fix confirm connect
Still shows the message when you open the pause menu. Needs more attention I can't give it right now
2022-09-13 22:59:02 +01:00
toaster
36f8ce8f78 Slightly refactor M_StartControlPanel
In anticipation of attempt to incorporate into CL_ABORT process
2022-09-13 20:33:05 +01:00
toaster
2d253e0105 Clear menus in one location.
Fixes a number of weird extra fade and gamestate set events.
2022-09-13 13:09:03 +01:00
Sally Coolatta
524eff9fde Update new menus to use long names 2022-09-10 16:01:47 -04:00
toaster
212907122b Repair shitsfree 2022-09-04 22:21:42 +01:00
toaster
0c4dca611d Hide Encore on the Gameplay Options menu if not unlocked 2022-09-04 22:14:41 +01:00
toaster
49f7552009 Improve profile deletion further
- Also adjust cv_currprofile in PR_DeleteProfile, instead of half-heartedly outside
- Make it clearer if you're going to destroy your current profile
- Add an "[In use]" identifier to the menu's visuals
2022-09-04 21:44:39 +01:00
toaster
de5370b134 Fix the options menu on first boot bug.
- Was reproducible by spamming back button events during game launch.
- Caused by the way profile data was initialised - D_StartTitle was calling a function with too many side effects.
- In addition, never instantly skip the title screen when the above occours.
    - This would be enough to patch over the mentioned bug, but I made sure to solve it properly so it won't break when we touch this again later.
2022-09-04 21:08:44 +01:00
toaster
acd777a77a Significant work into the play-starting experience
- Take the weird extra mini settings menu out of the Online Host Game sequence
- Make sure to actively use the server variables in Match Race creation
    - Hides the Auto options for Encore and Kartspeed on the Match Race menu specifically...
    - BUT if you leave it at the default it'll secretly set them to Auto!!!
2022-09-04 20:14:30 +01:00
toaster
6544e95c01 Rework gamespeed cvar handling a little bit.
- Make the menu-only dummykartspeed and dummygpdifficulty cvars also affected by the unlock system.
- Master mode is currently behind SECRET_HARDSPEED, this can be changed later when we're seriously thinking about unlock progression.
- Complete forwardport of changes to cv_kartspeed from 1.4+, since I missed a spot previously.
2022-09-04 14:56:07 +01:00
toaster
587f814ab3 Adjust some messagebox-related material.
- Fix an issue where if the last line of an M_StartMessage was the longest, the box width wouldn't account for it. (port from v1)
- Reduce length of some common error messages the Addons menu may produce.
- Add a warning for attempting to run .cfg files, since I absentmindedly overwrote ringconfig.cfg with kartconfig.cfg info while testing...
2022-09-03 22:01:40 +01:00
toaster
26461d568c Addons menu refactor part 3
Search finally works again!
- Now uses a cvar which is copied into static memory to uppercase it, instead of a weird static string uppercased into zone memory.
- You have to scroll to the top of the menu to use it, one entry above the previous first file/folder/"UP...".
- Don't play menu sound if you've reached the end of an un-looping menu.
2022-09-03 21:15:23 +01:00
toaster
8312f12d6c Addons menu refactor part 1
- Move M_AddonsRefresh out of M_DrawAddons - death to a HORRIBLE hack
- Use it as the tickroutine for the addons menu instead
- Behaves as before, possibly more consistent
2022-09-03 16:23:16 +01:00
toaster
52c1cfd1cf Remove redundant settings -- PR_ApplyProfile does these for us! 2022-09-02 22:56:55 +01:00
toaster
061eca773b Fix itemOn out-of-bounds event for Main Menu and its ilk.
Was caused by the following actions:
- Starting a game
- Going to the Options menu
- scrolling beyond the 4th entry
- Exiting to title screen
- Opening up main menu again
2022-09-02 22:05:11 +01:00
toaster
bcd9c7efba Fix circumstances the game restricts access to certain pause menu options.
Changed conditions -
- Switch Map and Addons on in-game pause menu
    - now restricted by !K_CanChangeRules(), which covers all singleplayer conditions
- Gameplay and Server Options
    - now restricted if in-game, and either singleplayer conditions or not admin
- Erase data
    - now restricted if in-game at all (fixes new-menus regression)
2022-09-02 21:55:29 +01:00
toaster
86b1e57f32 Permit KEY_ESCAPE to close the typing view as well.
Preparation for reworking Addons menu -- I have been caught in these virtual keyboard popups without remembering how to escape a little too often for comfort.
2022-09-01 21:58:39 +01:00
toaster
cd2bb2b300 Extra profile menu improvements
* Don't allow creation/loading of more profiles than the game supports.
* Add a few missing M_SetMenuDelay()'s
* Fix PRF%c default name generation issues
   * There could still be an infinite loop if MAXPROFILES is ever increased >= 26... but we can handle that one later.
2022-09-01 18:44:56 +01:00
toaster
a6843bae78 Improve profile deletion further
- Fix the check for deleting the current profile
- Handle cv_ttlprofilen like cv_lastprofile[]
2022-09-01 17:40:26 +01:00