Tweaked hotkeys
This commit is contained in:
parent
d0e2b3ee88
commit
066efa2bf0
@ -42,9 +42,6 @@ export class CanvasControlHooks {
|
||||
|
||||
@Hook(Events.mouseWheel)
|
||||
static mouseWheel(event: any) {
|
||||
if (!p.keyIsDown(17)) {
|
||||
return;
|
||||
}
|
||||
const zoom = event.deltaY > 0 ? 100 : -100;
|
||||
const oldScale = canvasMultiplier;
|
||||
const multiplierChange = zoom * 0.0008 * oldScale;
|
||||
|
||||
@ -1,46 +1,13 @@
|
||||
import { Hook } from "@/decorators/hook";
|
||||
import { Events } from "@/hooks";
|
||||
import { OsuRenderer } from "@/osu/OsuRenderer";
|
||||
import { p, state } from "@/utils";
|
||||
import { p } from "@/utils";
|
||||
|
||||
export class OsuControlHooks {
|
||||
|
||||
@Hook(Events.keyPressed)
|
||||
static keyPressed() {
|
||||
if (p.keyCode == 32) OsuRenderer.setPlaying(!OsuRenderer.playing);
|
||||
}
|
||||
|
||||
@Hook(Events.mouseWheel)
|
||||
static mouseWheel(event: WheelEvent) {
|
||||
if (event.ctrlKey) return;
|
||||
const currentState = state.getState();
|
||||
|
||||
if (
|
||||
currentState.achivementsDialog ||
|
||||
currentState.dataAnalysisDialog ||
|
||||
currentState.metadataEditorDialog ||
|
||||
currentState.openDialog ||
|
||||
currentState.saveDialog
|
||||
)
|
||||
return;
|
||||
|
||||
if (event.deltaY > 0) {
|
||||
OsuRenderer.setTime(OsuRenderer.time + 35);
|
||||
} else {
|
||||
OsuRenderer.setTime(OsuRenderer.time - 35);
|
||||
}
|
||||
}
|
||||
|
||||
@Hook(Events.mousePressed)
|
||||
static mousePressed(event: WheelEvent) {
|
||||
const currentState = state.getState();
|
||||
|
||||
if (
|
||||
currentState.achivementsDialog ||
|
||||
currentState.dataAnalysisDialog ||
|
||||
currentState.metadataEditorDialog ||
|
||||
currentState.openDialog ||
|
||||
currentState.saveDialog
|
||||
)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,21 +13,15 @@ export function Helper() {
|
||||
<div className="flex flex-col absolute right-10 top-16 gap-2 items-end">
|
||||
<div className="flex gap-2 text-xs items-center">
|
||||
Drag Playfield
|
||||
<img src={middlemouse} />
|
||||
<img src={middlemouse}/>
|
||||
</div>
|
||||
<div className="flex gap-2 text-xs items-center">
|
||||
Seek Beatmap
|
||||
<img src={scroll} />
|
||||
Zoom
|
||||
<img src={scroll}/>
|
||||
</div>
|
||||
<div className="flex gap-2 text-xs items-center">
|
||||
Pause/Play
|
||||
<img src={space} />
|
||||
</div>
|
||||
|
||||
<div className="flex gap-2 text-xs items-center">
|
||||
Zoom
|
||||
<img src={ctrl} />
|
||||
<img src={scroll} />
|
||||
<img src={space}/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user