Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgame: preselect a map in server creation window, remember it #2883

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

illwieckz
Copy link
Member

Preselect a map in server creation window, this means a newcomer has less actions to do to create a server when trying the game for the first time, and then remember the last started map.

unvanquished_2023-12-27_024133_000

src/cgame/cg_rocket_datasource.cpp Outdated Show resolved Hide resolved
src/cgame/cg_rocket_datasource.cpp Outdated Show resolved Hide resolved
src/cgame/cg_rocket_datasource.cpp Show resolved Hide resolved
…ation window

Also unify the look of the callvote map window with the server_create one.
@illwieckz illwieckz force-pushed the illwieckz/preselect-map branch 2 times, most recently from 0a5c009 to c4d4050 Compare December 29, 2023 05:05
@illwieckz
Copy link
Member Author

I added a commit that forces the height of the levelshot. I forced 16:9 ratio. This is not too bad, even on old legacy maps that had 4:3 levelshots.

This prevents the server creation window size to change dynamically while scrolling maps, hence preventing the “Start” button to move up and down while scrolling map, and it would prevent a nasty map with a nasty 1:1000 levelshot to move the “Start” button off screen.

@illwieckz illwieckz force-pushed the illwieckz/preselect-map branch 2 times, most recently from c6f01c9 to b0f7606 Compare December 29, 2023 08:22
@slipher
Copy link
Contributor

slipher commented Dec 29, 2023

I don't have time to review or test, but I would ask to ensure that this does not cause a map pak to be loaded before opening the map menu.

@DolceTriade
Copy link
Member

I don't have time to review or test, but I would ask to ensure that this does not cause a map pak to be loaded before opening the map menu.

This shouldn't do that

@@ -34,6 +34,8 @@ Maryland 20850 USA.

#include "cg_local.h"

static Cvar::Cvar<std::string> g_defaultMap("g_defaultMap", "default map to play", Cvar::ARCHIVE, "plat23");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be cg_

{
if ( rocketInfo.data.mapList.size() != 0 )
{
CG_Rocket_BuildMapList( nullptr );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build the list only if it is already nonempty? Seems weird. Probably this shouldn't be here at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah no it should be == 0, well, I copypasted CG_Rocket_GetResolutionListIndex the cargo cult way, so I don't know if that code is needed, but when duplicating, that should be ==. I'll fix that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the code worked even with !=0 this shouldn't be needed at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants