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

Added a selection menu for the next spawn loadout #894

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

Conversation

ptrstr
Copy link

@ptrstr ptrstr commented Apr 28, 2020

This adds a new button under "Spawn" in the Limbo menu to set the next spawn's loadout. This allows you to set your next loadout for when you'll die rather than killing yourself if you want another gun and not continuing the battle you're currently in. List of issues with the current implementation:

  • Might be excessive to check if player is alive on every LocalPlayer update
  • You can see the button when you just joined a game. I disabled it for when you're in spectator mode since you can't die but couldn't figure out how for the initial menu.

Copy link
Owner

@yvt yvt left a comment

Choose a reason for hiding this comment

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

I like this feature!

  • Might be excessive to check if player is alive on every LocalPlayer update

Looks acceptable to me.

  • You can see the button when you just joined a game. I disabled it for when you're in spectator mode since you can't die but couldn't figure out how for the initial menu.

Addressed in the review.

Sources/Client/Client.h Outdated Show resolved Hide resolved
Sources/Client/Client.h Outdated Show resolved Hide resolved
Sources/Client/LimboView.cpp Outdated Show resolved Hide resolved
Sources/Client/Client.cpp Outdated Show resolved Hide resolved
Sources/Client/Client.h Outdated Show resolved Hide resolved
Sources/Client/Client_Update.cpp Outdated Show resolved Hide resolved
Sources/Client/Client.cpp Show resolved Hide resolved
@ptrstr
Copy link
Author

ptrstr commented Apr 29, 2020

Added all your suggestions. Also, thank you for the scenario idea. Didn’t think of it. Not sure I implemented the stmp::optional correctly though since either way it’d work.

Sources/Client/Client.h Show resolved Hide resolved
@ptrstr
Copy link
Author

ptrstr commented Apr 29, 2020

Thanks for the help. Really nice of you to have made this cheatsheet 👍. Do more C than C++ that's why I was so alienated by those std:: and stmp:: types. Fixed it and tested.

EDIT: Don’t merge just yet. Forgot to implement the preview for spectator mode.

@yvt yvt added this to the 0.1.5 milestone Apr 29, 2020
@ptrstr
Copy link
Author

ptrstr commented Apr 29, 2020

Added support for spectator mode 👍

…ng alive when displaying the new button so you can't request a loadout for your next spawn while being dead, you must just click spawn.
yvt
yvt previously approved these changes Dec 18, 2020
@VierEck
Copy link

VierEck commented Jul 22, 2023

  • Might be excessive to check if player is alive on every LocalPlayer update

u can do the check in this function instead which is only called when a killaction packet is received

void Client::PlayerKilledPlayer(spades::client::Player &killer,
spades::client::Player &victim, KillType kt) {

and send the next spawn loadout if victim == localplayer
// The local player is dead; initialize the look-you-are-dead cam
if (&victim == world->GetLocalPlayer()) {
followCameraState.enabled = false;
Vector3 v = -victim.GetFront();
followAndFreeCameraState.yaw = atan2(v.y, v.x);
followAndFreeCameraState.pitch = 30.f * M_PI / 180.f;
}

it would have been better to have made an additional dedicated feature branch for this and made the pull request from there instead of master branch.

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

Successfully merging this pull request may close these issues.

None yet

3 participants