various: remove dead api, move mixin to proper file
This commit is contained in:
@@ -1034,48 +1034,6 @@ public interface Client extends GameShell
|
|||||||
*/
|
*/
|
||||||
List<GraphicsObject> getGraphicsObjects();
|
List<GraphicsObject> getGraphicsObjects();
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the music volume
|
|
||||||
*
|
|
||||||
* @return volume 0-255 inclusive
|
|
||||||
*/
|
|
||||||
int getMusicVolume();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the music volume
|
|
||||||
*
|
|
||||||
* @param volume 0-255 inclusive
|
|
||||||
*/
|
|
||||||
void setMusicVolume(int volume);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the sound effect volume
|
|
||||||
*
|
|
||||||
* @return volume 0-127 inclusive
|
|
||||||
*/
|
|
||||||
int getSoundEffectVolume();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the sound effect volume
|
|
||||||
*
|
|
||||||
* @param volume 0-127 inclusive
|
|
||||||
*/
|
|
||||||
void setSoundEffectVolume(int volume);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the area sound effect volume
|
|
||||||
*
|
|
||||||
* @return volume 0-127 inclusive
|
|
||||||
*/
|
|
||||||
int getAreaSoundEffectVolume();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the area sound effect volume
|
|
||||||
*
|
|
||||||
* @param volume 0-127 inclusive
|
|
||||||
*/
|
|
||||||
void setAreaSoundEffectVolume(int volume);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Play a sound effect at the player's current location. This is how UI,
|
* Play a sound effect at the player's current location. This is how UI,
|
||||||
* and player-generated (e.g. mining, woodcutting) sound effects are
|
* and player-generated (e.g. mining, woodcutting) sound effects are
|
||||||
|
|||||||
@@ -1815,24 +1815,6 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
|
||||||
@Override
|
|
||||||
public void setMusicVolume(int volume)
|
|
||||||
{
|
|
||||||
if (volume > 0 && client.getMusicVolume() <= 0 && client.getCurrentTrackGroupId() != -1)
|
|
||||||
{
|
|
||||||
client.playMusicTrack(1000, client.getMusicTracks(), client.getCurrentTrackGroupId(), 0, volume, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
client.getPreferences().setMusicVolume(volume);
|
|
||||||
client.setMusicTrackVolume(volume);
|
|
||||||
if (client.getMidiPcmStream() != null)
|
|
||||||
{
|
|
||||||
client.getMidiPcmStream().setPcmStreamVolume(volume);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Copy("changeGameOptions")
|
@Copy("changeGameOptions")
|
||||||
@Replace("changeGameOptions")
|
@Replace("changeGameOptions")
|
||||||
@SuppressWarnings("InfiniteRecursion")
|
@SuppressWarnings("InfiniteRecursion")
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package net.runelite.mixins;
|
||||||
|
|
||||||
|
import net.runelite.api.mixins.Inject;
|
||||||
|
import net.runelite.api.mixins.Mixin;
|
||||||
|
import net.runelite.api.mixins.Shadow;
|
||||||
|
import net.runelite.rs.api.RSClient;
|
||||||
|
import net.runelite.rs.api.RSClientPreferences;
|
||||||
|
|
||||||
|
@Mixin(RSClientPreferences.class)
|
||||||
|
public abstract class RSClientPreferencesMixin implements RSClientPreferences
|
||||||
|
{
|
||||||
|
@Shadow("client")
|
||||||
|
private static RSClient client;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Override
|
||||||
|
public void setMusicVolume(int volume)
|
||||||
|
{
|
||||||
|
if (volume > 0 && client.getPreferences().getMusicVolume() <= 0 && client.getCurrentTrackGroupId() != -1)
|
||||||
|
{
|
||||||
|
client.playMusicTrack(1000, client.getMusicTracks(), client.getCurrentTrackGroupId(), 0, volume, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
client.getPreferences().setMusicVolume(volume);
|
||||||
|
client.setMusicTrackVolume(volume);
|
||||||
|
if (client.getMidiPcmStream() != null)
|
||||||
|
{
|
||||||
|
client.getMidiPcmStream().setPcmStreamVolume(volume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,8 +32,4 @@ public interface RSClientPreferences extends Preferences
|
|||||||
@Import("musicVolume")
|
@Import("musicVolume")
|
||||||
@Override
|
@Override
|
||||||
int getMusicVolume();
|
int getMusicVolume();
|
||||||
|
|
||||||
@Import("musicVolume")
|
|
||||||
@Override
|
|
||||||
void setMusicVolume(int i);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user