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

Controller support #416

Draft
wants to merge 206 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
f34a14b
feat: joystick aim and movement
Arman-AIi Nov 15, 2024
29c3904
refactor: removed unnecessary activePlayer const
Arman-AIi Nov 15, 2024
78dabad
refactor: named axe variables + one less indent
Arman-AIi Nov 15, 2024
dfd54b8
feat: added joystick sensitivity slider for people with stick drift
Arman-AIi Nov 16, 2024
0effb6d
fix: hide controller tab content by default
Arman-AIi Nov 16, 2024
78cc4f5
feat: allow players to switch joystick functions
Arman-AIi Nov 16, 2024
748da8a
feat: hide controller tab when controller isn't detected
Arman-AIi Nov 16, 2024
f3bc168
feat: separate sliders for left and right joystick sensitivity
Arman-AIi Nov 16, 2024
6206403
fix: only start ticker if controller connects, and kill ticker if it …
Arman-AIi Nov 16, 2024
70b757e
slightly adjust mp40 loot+kf
ei-pi Nov 14, 2024
f10a3fc
fix: glitched river generation
hsanger Nov 15, 2024
6b04ff8
feat: update outdated airdrop winter reskins
1092384 Nov 15, 2024
696f78f
feat: update airdrop winter reskin particles
1092384 Nov 15, 2024
30f4e99
feat: oak tree + box 3 updated winter reskins
1092384 Nov 15, 2024
c135992
feat: new emote
1092384 Nov 15, 2024
56ac855
fix: c4 exploding when destroyed
pap-24 Nov 15, 2024
001b79b
perf/refactor: combine ceilingHitbox + scopeHitbox
pap-24 Nov 15, 2024
b518ba0
feat: winter reskins for flint, aegis, normal crates and oil tank
1092384 Nov 16, 2024
b9914b3
feat: sandbags winter reskin
1092384 Nov 16, 2024
12e50c2
feat: refinery ceiling winter reskin
1092384 Nov 16, 2024
a2af537
feat: cooler winter reskin
1092384 Nov 16, 2024
0ffd77c
fix: throwable collisions not having layer checks 💀
pap-24 Nov 16, 2024
03137c5
enhance: dont stop piano hit sounds
pap-24 Nov 16, 2024
b0ccbdb
refactor/perf/fix: metal detector walls
pap-24 Nov 16, 2024
fd2cc74
wip: initial work on improving teammate indicators + colored/tinted c4s
pap-24 Nov 16, 2024
b6e0f25
fix: remove useless element attribute
pap-24 Nov 16, 2024
82dfef6
feat: colored teammate c4s
pap-24 Nov 16, 2024
b6778db
fix: cleanup code with a new method/function ig
pap-24 Nov 16, 2024
03487ae
fix: handle solo case where there are no colors
pap-24 Nov 16, 2024
3551e18
feat: strict checks for color indexing on teams
pap-24 Nov 16, 2024
f91d79f
fix: remove testing stuff
pap-24 Nov 16, 2024
6ef7f6d
fix: only tint c4s and not other throwables
pap-24 Nov 16, 2024
76135f5
enhance: Updated names of VSS Vintorez and PP-19 Vityaz
SolsticeUnlimitd Nov 16, 2024
d8032c5
wip: snow variant generating function
1092384 Nov 16, 2024
6885cea
fix: some template type issues + winter variation
ei-pi Nov 16, 2024
6d768a6
fix: server crash + add winter variants code
1092384 Nov 17, 2024
6b8b15d
feat: barrel, super barrel, grenade crate, flint stone winter reskins
1092384 Nov 17, 2024
fe8d3c8
fix: average 109 fuckup
1092384 Nov 17, 2024
40f01e4
feat: grenade crate, tear gas crate, grenade box winter variations
1092384 Nov 17, 2024
c072ba8
enhance: border standardization for winter variants
1092384 Nov 17, 2024
4215c58
feat: birch tree, dumpster, trash bag winter variants
1092384 Nov 17, 2024
8b62d3b
fix: remove c4 synced particle (lmao)
pap-24 Nov 17, 2024
a2b1f7d
chore: lint + dv
pap-24 Nov 17, 2024
a135d94
perf: minor optimizations
hsanger Nov 17, 2024
c9bfde5
chore: bump deps
hsanger Nov 17, 2024
3a1754a
fix: downgrade eslint to 9.14.0
hsanger Nov 17, 2024
ff4057b
fix: better fix for river gen glitch
hsanger Nov 17, 2024
2d706a4
feat: update changelog
hsanger Nov 17, 2024
15e9c52
chore: bump versions
hsanger Nov 17, 2024
60cf8cd
feat: vibration and a few buttons
Arman-AIi Nov 17, 2024
5433661
feat: added info for current joystick functions
Arman-AIi Nov 19, 2024
f381a85
feat: selecting controllers
Arman-AIi Nov 25, 2024
341ac6d
feat: vibrate selected controller (I love vibrations!)
Arman-AIi Nov 25, 2024
0c76016
fix: don't vibrate controller if it's already selected
Arman-AIi Nov 26, 2024
d1f8545
enhance: hide buttons that don't have a corresponding controller conn…
Arman-AIi Nov 26, 2024
6bbad7d
feat: name of the controller is now taken from controller.id, and use…
Arman-AIi Nov 27, 2024
e7bc76c
fix: melee schema type adjustment
ei-pi Nov 17, 2024
3961d46
Major exploit fixed
Err0r430 Nov 18, 2024
dc278cf
fix: average 109 fuckup x2
1092384 Nov 18, 2024
4a992b1
reskin: blue house & sea traffic control
1092384 Nov 18, 2024
3999993
Removed youtuber from the list
Err0r430 Nov 19, 2024
4e9fe5a
misc changes (TranslationKeys cleanup soon™)
ei-pi Nov 19, 2024
fe53996
loot image adjustments
ei-pi Nov 19, 2024
fbdcc3e
feat: pine tree + weird ass branch in birch tree 2
1092384 Nov 19, 2024
92e2021
reskin: viking chest, gun case, fire hatchet case
1092384 Nov 19, 2024
6e795c9
fix: remove bloat in pine tree
1092384 Nov 19, 2024
a3caa6d
fix: does vite have brain damage
ei-pi Nov 19, 2024
0f034d0
enhance: update purple tent obstacles
pap-24 Nov 19, 2024
ea8cc50
chore: lint
pap-24 Nov 19, 2024
7010659
reskin: bollard, rocks, mobile home + cargo ship ceiling
1092384 Nov 20, 2024
3c2fc70
fix: db
1092384 Nov 20, 2024
9e56a86
enhance: lewis gun rebalance
1092384 Nov 21, 2024
f9e05f8
reskin: finish cargo ship + start on hq
1092384 Nov 21, 2024
f589075
fix: big ass deagle world image
1092384 Nov 21, 2024
04c0327
reskin: hq ceiling progress
1092384 Nov 22, 2024
4248002
reskin: tire + large refinery barrel + update forklift skin for consi…
1092384 Nov 22, 2024
385cec2
reskin: red house
1092384 Nov 22, 2024
3a40470
fix: item emotes' scaling
pap-24 Nov 22, 2024
b5539c4
fix: weapon emotes not showing
pap-24 Nov 22, 2024
c2f658b
fix: potential fix on overlapping gas timer and team container
pap-24 Nov 22, 2024
8df2b89
enhance: cz600 now more common and not in airdrops
1092384 Nov 23, 2024
af06e4f
feat: new warehouse + blue house vault layout
pap-24 Nov 23, 2024
41c47eb
reskin: new obstacle + bookshelf 1
1092384 Nov 23, 2024
cce48f5
fix: some no texture bug
pap-24 Nov 23, 2024
4126c5f
reskin: finish HQ + bookshelf 2
1092384 Nov 24, 2024
5d4ef1f
reskin: small bunker, construction site, porta potty
1092384 Nov 24, 2024
3a75147
feat/reskin: winter map + more buildings
1092384 Nov 24, 2024
189c768
wip: more reskin progress (+ read desc)
pap-24 Nov 24, 2024
6ec0bdd
feat: better mode switching
pap-24 Nov 24, 2024
c69fe4f
fix: minor changes
pap-24 Nov 24, 2024
c32c525
enhance: remove bloat from particle svgs
1092384 Nov 24, 2024
309207c
deletion farm
1092384 Nov 24, 2024
0852e1f
feat: removed unused code
1092384 Nov 25, 2024
178b87d
feat: better way of reskinning building obstacles during winter
1092384 Nov 25, 2024
647bbbe
feat: better reskin switching v2
1092384 Nov 25, 2024
6866ed8
chore: fuck you eslint
1092384 Nov 25, 2024
4fe212b
enhance: adjust some loot images
ei-pi Nov 25, 2024
2c63fa3
refactor: improve mode obstacle variation system
1092384 Nov 26, 2024
d31c66f
feat: finished cargo ship + tugboats
1092384 Nov 26, 2024
bdf9fff
enhance: better red house reskin + svg optimization
1092384 Nov 26, 2024
36994b5
reskin: oil tanker + melee crate + ship thing 1
1092384 Nov 28, 2024
7dd94c6
feat: bring back old oak tree
1092384 Nov 29, 2024
3fa7d68
fix: wrong stroke color
1092384 Nov 29, 2024
679f304
reskin: warehouse
1092384 Nov 29, 2024
f9d3d0f
feat: new obstacle
1092384 Nov 29, 2024
312dd15
enhance: improve warehouse ceiling reskin
1092384 Nov 29, 2024
f3843af
fix: particles spawning in underground layers
pap-24 Dec 1, 2024
10889a9
fix: some svg reskins
pap-24 Dec 1, 2024
ce9467b
feat/fix: Rate limit team pings
pap-24 Dec 1, 2024
3f513c6
feat: finish rate limiting for emotes and team pings
pap-24 Dec 3, 2024
ea897b3
wip: begin writing some changes for the future patch note
pap-24 Dec 3, 2024
b7487de
feat: new obstacle
1092384 Dec 3, 2024
0f16dfe
reskin/wip: containers
pap-24 Dec 3, 2024
e067544
feat: armory reskin
1092384 Dec 4, 2024
98353a3
wip: more reskin progress
pap-24 Dec 4, 2024
aac088f
wip: part 2 of reskin progress ig
pap-24 Dec 4, 2024
b05e0a8
fix: fix new obstacles
1092384 Dec 5, 2024
a761c9c
fix: minor fixes
pap-24 Dec 5, 2024
4e45aed
wip: better loot table
1092384 Dec 5, 2024
8a87b93
fix: some reskins (+ read desc)
pap-24 Dec 5, 2024
51a72e4
feat: remove dev weapons from arena
1092384 Dec 6, 2024
0b07176
feat: add back revitalizer
1092384 Dec 6, 2024
68ef674
fix: oops server crash
1092384 Dec 6, 2024
c4ed157
enhance: rename youtubr to content creatr
pap-24 Dec 6, 2024
958464e
very wip: cancel finding game button (read desc)
pap-24 Dec 6, 2024
4692bbe
fix: annoying lowercase item tooltip desc
pap-24 Dec 6, 2024
e4d9283
fix: armory vault hitbox
pap-24 Dec 7, 2024
ecd447b
feat: new sickle swing animation
pap-24 Dec 7, 2024
b356404
fix: set map to normal
pap-24 Dec 7, 2024
6a17063
fix: lead roles not having their role skin
pap-24 Dec 7, 2024
0f32443
feat: donatr & sound designr badge
pap-24 Dec 7, 2024
e92459f
fix: throwable cooking images
pap-24 Dec 7, 2024
237aef7
feat: port warehouse reskin
pap-24 Dec 8, 2024
a78467f
feat: new ambient variation + fix some reskin obstacles
pap-24 Dec 8, 2024
2e3f3cc
fix: weird ass couches
1092384 Dec 8, 2024
bc90cf3
enhance: improve port warehouse reskin
pap-24 Dec 8, 2024
cf163d2
reskin: crane
1092384 Dec 8, 2024
054dc4e
feat: fix incorrectly scaled truck
1092384 Dec 8, 2024
22d338c
reskin: m1117
1092384 Dec 8, 2024
59c5a3e
reskin/enhance: lewis gun + large bridge
1092384 Dec 8, 2024
279f048
enhance: reskin errors and structure improvements
1092384 Dec 8, 2024
2ac278b
feat: new guns
1092384 Dec 8, 2024
572e937
feat: add new gun to loot tables
1092384 Dec 8, 2024
476c1e1
enhance: fixes, read description
1092384 Dec 9, 2024
53f0a79
fix: remove rsh-12
1092384 Dec 9, 2024
2e917b3
fix: add gun to harvest mode airdrops
1092384 Dec 9, 2024
78ab8d4
enhance: nerf the vector
1092384 Dec 9, 2024
4801959
feat: new skin (and some tweaks)
pap-24 Dec 10, 2024
eece62e
enhance: improve emote spam control
pap-24 Dec 10, 2024
47d503d
feat: update changelog txt file
pap-24 Dec 10, 2024
b3099f9
fix: top ten grammar error
pap-24 Dec 10, 2024
532e516
feat: update actual changelog
pap-24 Dec 10, 2024
46cd930
enhance: improve mode particle effects
pap-24 Dec 10, 2024
3de4f1d
feat: add second variant to [redacted]
pap-24 Dec 10, 2024
dd87211
enhance: update world image of cz75a
pap-24 Dec 10, 2024
b1257c8
feat: update backgrounds
hsanger Dec 11, 2024
11f165c
fix: better map distribution
1092384 Dec 11, 2024
c93bab3
feat: rename new structure
hsanger Dec 11, 2024
59226af
feat: add banner image
hsanger Dec 11, 2024
2668afc
feat: update news
hsanger Dec 11, 2024
7265f15
fix: bush colors
1092384 Dec 11, 2024
6596485
fix: bush take 2
1092384 Dec 11, 2024
b35a40e
chore: bump versions
hsanger Dec 11, 2024
581136e
feat: spritesheet caching
kenos1 Dec 11, 2024
4f10bc6
fix: overlapping gas timer + teammate indicators (FINALLY)
pap-24 Dec 12, 2024
b0bb315
chore: lint
pap-24 Dec 12, 2024
2c1a6f6
fix: some obstacle reskins
pap-24 Dec 12, 2024
5d63191
fix: weird teammate indicator scaling
pap-24 Dec 12, 2024
57c5e6f
enhance: adjust warning modal css
pap-24 Dec 12, 2024
173123e
fix: warning modal translation key
pap-24 Dec 13, 2024
bdc7d40
fix: downed players not being able to see interact messages
pap-24 Dec 13, 2024
a050657
fix: modeVariant on a crate in the port
pap-24 Dec 13, 2024
36bdcd1
fix: clean up some tooltip strings
pap-24 Dec 14, 2024
9fe1acb
fix: bullet whiz playing in non equal layers
pap-24 Dec 14, 2024
cf75d4b
feat: major translation/languages update
pap-24 Dec 14, 2024
4c8eb34
fix: big cz killfeed image
pap-24 Dec 14, 2024
f512dbe
chore: bump deps
hsanger Dec 14, 2024
f1eefc3
feat: brazil translations
pap-24 Dec 14, 2024
e0f27a6
enhance: more translation stuff
pap-24 Dec 14, 2024
51aacae
chore: lint
pap-24 Dec 14, 2024
62561d1
fix: weird badge bug + more translation stuff
pap-24 Dec 15, 2024
5f768ee
remove drunkglish
pap-24 Dec 15, 2024
a784ba7
refactor: combine getPlayerName and getPlayerBadge methods
pap-24 Dec 17, 2024
c630af1
fix: large bridges spawning inside the ocean (lol)
pap-24 Dec 17, 2024
81b19c1
chore: lint
pap-24 Dec 17, 2024
9765e3a
feat: chainsaw realism
pap-24 Dec 17, 2024
6dc7113
fix: map ping wheel getting stuck
ei-pi Dec 18, 2024
c7d5f4c
comment out compiler code lol (whoops)
ei-pi Dec 18, 2024
50af449
fix: coal explosion killfeed
pap-24 Dec 20, 2024
e477e08
fix: optimize coal explosion killfeed
1092384 Dec 20, 2024
99e4147
fix: trees names (only affects wiki)
1092384 Dec 21, 2024
ad7dffc
fix: killfeed bug with downed players
pap-24 Dec 21, 2024
3b23d33
perf/enhance: draw most gun mounts with pixi
pap-24 Dec 21, 2024
a9e130d
fix: update changelog txt
pap-24 Dec 21, 2024
860702d
enhance: update vietnamese to 100%
pap-24 Dec 21, 2024
9747639
fix: hp18 border+mini code simplification
ei-pi Dec 21, 2024
6872515
enhance: update estonian to 100%
pap-24 Dec 21, 2024
7e3d43f
fix: vss + pp19 new names in english
1092384 Dec 22, 2024
883eff6
enhance: shorten sks full reload (3.2s --> 2.4s)
1092384 Dec 23, 2024
7945d09
See desc, prep for new update.
Err0r430 Dec 23, 2024
36cd907
enhance: oak tree --> large oak tree
1092384 Dec 23, 2024
f9571b7
revert to winter mode
hsanger Dec 24, 2024
4ccca28
my dumbass forgot to switch the mode
hsanger Dec 24, 2024
0c9b6ad
Revert "enhance: oak tree --> large oak tree"
hsanger Dec 24, 2024
1c5ca40
Merge branch 'HasangerGames:master' into controller-support
Arman-AIi Dec 24, 2024
1401c6b
feat: weapon switching (LB back 1 weapon, RB forward 1 weapon)
Arman-AIi Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions client/src/scripts/managers/inputManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ItemType, type ItemDefinition } from "@common/utils/objectDefinitions";
import { Vec } from "@common/utils/vector";
import $ from "jquery";
import nipplejs, { type JoystickOutputData } from "nipplejs";
import * as PIXI from "pixi.js";
import { Ticker } from "pixi.js";
Copy link
Contributor

Choose a reason for hiding this comment

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

this is still wrong, use the Game update method

import { isMobile } from "pixi.js";
import { getTranslatedString } from "../../translations";
import { type Game } from "../game";
Expand Down Expand Up @@ -343,8 +343,7 @@ export class InputManager {
shootOnRelease = false;
});
}
const ticker = new PIXI.Ticker();
ticker.stop();
const ticker = new Ticker();
ticker.add(() => {
const gamepads = navigator.getGamepads();
Copy link
Contributor

@kenos1 kenos1 Nov 15, 2024

Choose a reason for hiding this comment

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

if you use Game's pixi ticker, put this into its own method

Copy link
Contributor

@kenos1 kenos1 Nov 15, 2024

Choose a reason for hiding this comment

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

do you really need to call this method every frame, is it required?

if (gamepads[0]) {
Arman-AIi marked this conversation as resolved.
Show resolved Hide resolved
Arman-AIi marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -360,13 +359,12 @@ export class InputManager {
if (!rightJoystickMoving) {
this.rotation = movementAngle;
this.turning = true;
const activePlayer = game.activePlayer;
if (game.console.getBuiltInCVar("cv_responsive_rotation") && !game.gameOver && game.activePlayer) {
game.activePlayer.container.rotation = this.rotation;
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't there a better way to do this in the Player class?

this.turning = true;
}
if (!activePlayer) return;
activePlayer.images.aimTrail.alpha = 0;
if (!game.activePlayer) return;
game.activePlayer.images.aimTrail.alpha = 0;
}
} else {
this.movement.moving = false;
Expand All @@ -375,14 +373,11 @@ export class InputManager {
if (rightJoystickMoving) {
this.rotation = Math.atan2(gamepads[0].axes[3], gamepads[0].axes[2]);
this.turning = true;
const activePlayer = game.activePlayer;

if (game.console.getBuiltInCVar("cv_responsive_rotation") && !game.gameOver && activePlayer) {
if (game.console.getBuiltInCVar("cv_responsive_rotation") && !game.gameOver && game.activePlayer) {
game.activePlayer.container.rotation = this.rotation;
game.activePlayer.images.aimTrail.alpha = 1;
}

if (!activePlayer) return;
activePlayer.images.aimTrail.alpha = 1;
}
}
});
Expand Down