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

Unfinished controller support, please follow comments #376

Closed

Conversation

Arman-AIi
Copy link

@Arman-AIi Arman-AIi commented Sep 15, 2024

note: this has only been tested on stadia controller
changes are only in client > src > scripts > managers > inputManager.ts

Copy link
Collaborator

@Compositr Compositr left a comment

Choose a reason for hiding this comment

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

Is there any way to do this without having a ton of gamepadX or whatever vars?

@Arman-AIi
Copy link
Author

You can condense them into a few lines but you need them to use all controller buttons

@tomatopotato17265
Copy link

Controls recommendations:

B: drop items (press to scroll between items, press and hold to actually drop)
X: map
Y: Special emotes (ammo request, medkit request, etc.)

idk how this works but if you can take advantage of the mini-touchpad on ps4 and ps5 controllers for a mini cursor some ppl might like that

@Arman-AIi
Copy link
Author

Controls recommendations:

B: drop items (press to scroll between items, press and hold to actually drop) X: map Y: Special emotes (ammo request, medkit request, etc.)

idk how this works but if you can take advantage of the mini-touchpad on ps4 and ps5 controllers for a mini cursor some ppl might like that

how will Y for special emotes work exactly

@tomatopotato17265
Copy link

Controls recommendations:

B: drop items (press to scroll between items, press and hold to actually drop) X: map Y: Special emotes (ammo request, medkit request, etc.)

idk how this works but if you can take advantage of the mini-touchpad on ps4 and ps5 controllers for a mini cursor some ppl might like that

how will Y for special emotes work exactly

You hold down Y while using the D-pad. This system works similar to mobile special emotes: you toggle that cellular tower thing then select the emotes.

Now it doesn't crash and burn when you try to start it, please follow comments
@Arman-AIi
Copy link
Author

Controls recommendations:

B: drop items (press to scroll between items, press and hold to actually drop) X: map Y: Special emotes (ammo request, medkit request, etc.)

idk how this works but if you can take advantage of the mini-touchpad on ps4 and ps5 controllers for a mini cursor some ppl might like that

how will Y for special emotes work exactly

You hold down Y while using the D-pad. This system works similar to mobile special emotes: you toggle that cellular tower thing then select the emotes.

Sounds good. The primary goal is to have bindable controller buttons and working analog sticks, defaults are just a nice-to-have. We also must have a controller-navigable UI

@tomatopotato17265
Copy link

Controls recommendations:

B: drop items (press to scroll between items, press and hold to actually drop) X: map Y: Special emotes (ammo request, medkit request, etc.)

idk how this works but if you can take advantage of the mini-touchpad on ps4 and ps5 controllers for a mini cursor some ppl might like that

how will Y for special emotes work exactly

You hold down Y while using the D-pad. This system works similar to mobile special emotes: you toggle that cellular tower thing then select the emotes.

Sounds good. The primary goal is to have bindable controller buttons and working analog sticks, defaults are just a nice-to-have. We also must have a controller-navigable UI

We should take things one at a time. Suroi for console doesn't exist yet so we don't need to worry about controller-navigable UI. I say we first add the functionality with default controls, then add the ability to customized bindings. Controller-navigable UI is something we don't have to worry about until we make Suroi for Xbox, PlayStation, Nintendo Switch, or other controller-based platform.

@kenos1
Copy link
Contributor

kenos1 commented Sep 21, 2024

this easily has to be one of the most atrocious pieces of code i've ever seen from a suroi dev

how hard is it to not repeat yourself and do something like

const GamepadButtonMap = ["GamepadA", ...] // truncated for demo purposes

if (event instanceof GamepadEvent) {
  input = GamepadButtonMap.find((_, i) => event.gamepad.buttons[i].pressed) ?? "GamepadUnknown"
}

}


function gameLoop(){
Copy link
Contributor

Choose a reason for hiding this comment

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

me when PIXI.Application.ticker

Copy link
Collaborator

@Compositr Compositr left a comment

Choose a reason for hiding this comment

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

We need to make this far, far more concise. Also what the hell is that gameLoop function... (see Kenos' comment)

@kenos1
Copy link
Contributor

kenos1 commented Sep 21, 2024

Also please read https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/buttons as you are missing critical information lol

Copy link
Contributor

@kenos1 kenos1 left a comment

Choose a reason for hiding this comment

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

oh yeah by the way to anyone whos reading patch-notes channel i am homeless and also the fbi is after me

@@ -16,6 +16,92 @@ import { FIRST_EMOTE_ANGLE, FOURTH_EMOTE_ANGLE, PIXI_SCALE, SECOND_EMOTE_ANGLE,
import { getTranslatedString } from "../../translations";
Copy link
Contributor

Choose a reason for hiding this comment

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

oh yeah by the way to anyone whos reading patch-notes channel i am homeless and also the fbi is after me

@Arman-AIi
Copy link
Author

Also please read https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/buttons as you are missing critical information lol

This is the guide I am using

Copy link
Contributor

@leia-uwu leia-uwu left a comment

Choose a reason for hiding this comment

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

hiiii suroi patch-notes channel I'm totally original and not copying kenos
anyways LGTM should merge asap and push to production 👍

@Arman-AIi
Copy link
Author

hiiii suroi patch-notes channel I'm totally original and not copying kenos anyways LGTM should merge asap and push to production 👍

I agree with this information

@Arman-AIi
Copy link
Author

We need to make this far, far more concise. Also what the hell is that gameLoop function... (see Kenos' comment)

The requested changes have been fully completed sir.

also how did I wake up leia and kenos 💀 💀

@leia-uwu
Copy link
Contributor

also how did I wake up leia and kenos 💀 💀

kenos pinged me to make fun of your code

@@ -485,7 +537,34 @@ export class InputManager {

return input as Ret;
}
if (event instanceof GamepadEvent) {
gameLoop();
Copy link
Collaborator

Choose a reason for hiding this comment

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

kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill kill

@1092384
Copy link
Contributor

1092384 commented Sep 21, 2024

You can condense them into a few lines but you need them to use all controller buttons

i've decided you're a furry

@kenos1
Copy link
Contributor

kenos1 commented Sep 21, 2024

image

@Arman-AIi
Copy link
Author

I already changed it why so mean 😢

Copy link

@tomatopotato17265 tomatopotato17265 left a comment

Choose a reason for hiding this comment

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

While you're decluttering the code, pls add comments for noobs like me :)

@ersek-huba
Copy link

This is the funniest PR comment section, I've ever seen so far (after the Chinese John Cena one (including the Linux PR)).

@Arman-AIi
Copy link
Author

new commit, fixed issue where the buttons just refused to register, working and tested

@Arman-AIi Arman-AIi closed this by deleting the head repository Sep 23, 2024
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.

10 participants