sudo rm -rf /*

This commit is contained in:
ThatGamerBlue
2021-07-02 09:46:52 +01:00
3 changed files with 34 additions and 13 deletions

View File

@@ -25,9 +25,9 @@
object ProjectVersions { object ProjectVersions {
const val launcherVersion = "2.2.0" const val launcherVersion = "2.2.0"
const val rlVersion = "1.7.14" const val rlVersion = "1.7.14.1"
const val openosrsVersion = "4.9.3" const val openosrsVersion = "4.9.4"
const val rsversion = 197 const val rsversion = 197
const val cacheversion = 165 const val cacheversion = 165

View File

@@ -188,8 +188,11 @@ public class MusicPlugin extends Plugin
channels = new Channel[]{musicChannel, effectChannel, areaChannel}; channels = new Channel[]{musicChannel, effectChannel, areaChannel};
addMusicButtons(); addMusicButtons();
updateMusicOptions(); if (musicConfig.granularSliders())
resetSettingsWindow(); {
updateMusicOptions();
resetSettingsWindow();
}
}); });
} }
@@ -581,7 +584,11 @@ public class MusicPlugin extends Plugin
// emulate [proc,settings_update_icon] // emulate [proc,settings_update_icon]
boolean unmuted = val != 0; boolean unmuted = val != 0;
icon.getChild(1).setHidden(unmuted); Widget strikethrough = icon.getChild(1);
if (strikethrough != null)
{
strikethrough.setHidden(unmuted);
}
icon.setAction(0, unmuted ? "Mute" : "Unmute"); icon.setAction(0, unmuted ? "Mute" : "Unmute");
// Set name + no tooltip; we have our own for ops // Set name + no tooltip; we have our own for ops
icon.setName(channel.getName()); icon.setName(channel.getName());
@@ -743,6 +750,16 @@ public class MusicPlugin extends Plugin
s.update(); s.update();
s.getChannel().setWindowSlider(s); s.getChannel().setWindowSlider(s);
} }
if (ev.getScriptId() == ScriptID.TOPLEVEL_REDRAW && musicConfig.granularSliders())
{
// we have to set the var to our value so toplevel_redraw doesn't try to set
// the volume to what vanilla has stored
for (Channel c : channels)
{
c.updateVar();
}
}
} }
private class Channel private class Channel
@@ -788,12 +805,12 @@ public class MusicPlugin extends Plugin
// the varps are known by the engine and it requires they are stored so // the varps are known by the engine and it requires they are stored so
// 0 = max and 4 = muted // 0 = max and 4 = muted
int raw = 4 - client.getVar(var); int raw = client.getVar(var);
if (raw == 0) if (raw == 0)
{ {
raw = -(4 - client.getVar(mutedVar)); raw = -client.getVar(mutedVar);
} }
value = ((raw * max) / 4); value = raw * this.max / 100;
// readd our 1 offset for unknown's place // readd our 1 offset for unknown's place
value += value < 0 ? -1 : 1; value += value < 0 ? -1 : 1;
@@ -843,6 +860,12 @@ public class MusicPlugin extends Plugin
} }
} }
public void updateVar()
{
int val = getValue();
client.getVarps()[this.var.getId()] = val * 100 / this.max;
}
public void shutDown() public void shutDown()
{ {
sideSlider.shutDown(); sideSlider.shutDown();
@@ -851,9 +874,7 @@ public class MusicPlugin extends Plugin
windowSlider.shutDown(); windowSlider.shutDown();
} }
int raw = 4 - client.getVar(var); volumeChanger.accept(client.getVar(var) * this.max / 100);
int value = ((raw * max) / 4);
volumeChanger.accept(value);
} }
} }

View File

@@ -975,9 +975,9 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
// Constrain overlay position to be within the parent bounds // Constrain overlay position to be within the parent bounds
return new Point( return new Point(
Ints.constrainToRange(overlayX, parentBounds.x, Ints.constrainToRange(overlayX, parentBounds.x,
Math.max(parentBounds.x, parentBounds.width - overlayWidth)), Math.max(parentBounds.x, parentBounds.x + parentBounds.width - overlayWidth)),
Ints.constrainToRange(overlayY, parentBounds.y, Ints.constrainToRange(overlayY, parentBounds.y,
Math.max(parentBounds.y, parentBounds.height - overlayHeight)) Math.max(parentBounds.y, parentBounds.y + parentBounds.height - overlayHeight))
); );
} }
} }