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

Add the mouse wheel shortcut to the chart editor. #15724

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<define name="DISCORD_ALLOWED" />
<define name="TRANSLATIONS_ALLOWED" />
<define name="IRIS_DEBUG"/>

<!-- Delete this if you're making a source mod. -->
<define name="officialBuild" />

<define name="SHOW_LOADING_SCREEN" />
<define name="PSYCH_WATERMARKS"/> <!-- DELETE THIS TO REMOVE THE PSYCH LOGO FROM LOADING SCREEN -->
Expand Down
14 changes: 7 additions & 7 deletions source/states/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
fullTipText.text = [
"W/S/Mouse Wheel - Move Conductor's Time",
"A/D - Change Sections",
"Q/E - Decrease/Increase Note Sustain Length",
"Q / E / CTRL + Mouse Wheel - Decrease/Increase Note Sustain Length",
"Hold Shift/Alt to Increase/Decrease move by 4x",
"",
"F12 - Preview Chart",
Expand Down Expand Up @@ -887,12 +887,12 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
{
Conductor.songPosition = FlxG.sound.music.time = cachedSectionTimes[curSec] + (curSec > 0 ? 0.000001 : 0);
}
else if(FlxG.keys.pressed.W != FlxG.keys.pressed.S || FlxG.mouse.wheel != 0)
else if(FlxG.keys.pressed.W != FlxG.keys.pressed.S || (FlxG.mouse.wheel != 0 && !FlxG.keys.pressed.CONTROL))
{
if(FlxG.sound.music.playing)
setSongPlaying(false);

if(mouseSnapCheckBox.checked && FlxG.mouse.wheel != 0)
if(mouseSnapCheckBox.checked && (FlxG.mouse.wheel != 0 && !FlxG.keys.pressed.CONTROL))
{
var snap:Float = Conductor.stepCrochet / (curQuant/16) / curZoom;
var timeAdd:Float = (FlxG.keys.pressed.SHIFT ? 4 : 1) / (holdingAlt ? 4 : 1) * -FlxG.mouse.wheel * snap;
Expand All @@ -903,9 +903,9 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
else
{
var speedMult:Float = (FlxG.keys.pressed.SHIFT ? 4 : 1) * (FlxG.mouse.wheel != 0 ? 4 : 1) / (holdingAlt ? 4 : 1);
if(FlxG.keys.pressed.W || FlxG.mouse.wheel > 0)
if(FlxG.keys.pressed.W || (FlxG.mouse.wheel > 0 && !FlxG.keys.pressed.CONTROL))
FlxG.sound.music.time -= Conductor.crochet * speedMult * elapsed / curZoom;
else if(FlxG.keys.pressed.S || FlxG.mouse.wheel < 0)
else if(FlxG.keys.pressed.S || (FlxG.mouse.wheel < 0 && !FlxG.keys.pressed.CONTROL))
FlxG.sound.music.time += Conductor.crochet * speedMult * elapsed / curZoom;
}

Expand Down Expand Up @@ -1457,8 +1457,8 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
var sineValue:Float = 0.75 + Math.cos(Math.PI * noteSelectionSine * (isMovingNotes ? 8 : 2)) / 4;
//trace(sineValue);

var qPress = FlxG.keys.justPressed.Q;
var ePress = FlxG.keys.justPressed.E;
var qPress = FlxG.keys.justPressed.Q || ((FlxG.mouse.wheel == 1) && FlxG.keys.pressed.CONTROL);
var ePress = FlxG.keys.justPressed.E || ((FlxG.mouse.wheel == -1) && FlxG.keys.pressed.CONTROL);
var addSus = (FlxG.keys.pressed.SHIFT ? 4 : 1) * (Conductor.stepCrochet / 2);
if(qPress) addSus *= -1;

Expand Down