music: Add ingame granular volume adjustment

This commit is contained in:
Max Weber
2019-10-16 09:38:44 -06:00
parent 2e3475a577
commit 3b356f7a25
9 changed files with 434 additions and 48 deletions

View File

@@ -61,4 +61,9 @@ public interface ScriptEvent
* @see net.runelite.api.events.MenuOptionClicked
*/
String getOpbase();
/**
* Parent relative x coordinate for mouse related events
*/
int getMouseX();
}

View File

@@ -83,6 +83,16 @@ public final class ScriptID
@ScriptArguments(integer = 2)
public static final int MESSAGE_LAYER_CLOSE = 299;
/**
* Sets the background for sound option bars
* <ul>
* <li> int Value of the slider (0-4) </li>
* <li> int (WidgetID) * 5, segments of the slider </li>
* </ul>
*/
@ScriptArguments(integer = 6)
public static final int OPTIONS_ALLSOUNDS = 358;
/**
* Readies the chatbox panel for things like the chatbox input
* Inverse of MESSAGE_LAYER_CLOSE

View File

@@ -553,7 +553,7 @@ public interface Widget
void setOnMouseOverListener(Object... args);
/**
* Sets a script to be ran every frame when the mouse is in the widget bounds
* Sets a script to be ran every client tick when the mouse is in the widget bounds
*
* @param args A ScriptID, then the args for the script
*/
@@ -567,7 +567,7 @@ public interface Widget
void setOnMouseLeaveListener(Object... args);
/**
* Sets a script to be ran every frame
* Sets a script to be ran every client tick
*
* @param args A ScriptID, then the args for the script
*/
@@ -823,4 +823,31 @@ public interface Widget
* Can widgets under this widgets be scrolled in this widgets bounding box
*/
void setNoScrollThrough(boolean noScrollThrough);
/**
* {@link net.runelite.api.VarPlayer}s that triggers this widgets varTransmitListener
*/
void setVarTransmitTrigger(int ...trigger);
/**
* Sets a script to be ran the first client tick the mouse is held ontop of this widget
*
* @param args A ScriptID, then the args for the script
*/
void setOnClickListener(Object ...args);
/**
* Sets a script to be ran the every client tick the mouse is held ontop of this widget,
* except the first client tick.
*
* @param args A ScriptID, then the args for the script
*/
void setOnHoldListener(Object ...args);
/**
* Sets a script to be ran the first client tick the mouse is not held ontop of this widget
*
* @param args A ScriptID, then the args for the script
*/
void setOnReleaseListener(Object ...args);
}

View File

@@ -143,6 +143,7 @@ public class WidgetID
public static final int ITEMS_KEPT_ON_DEATH_GROUP_ID = 4;
public static final int SEED_VAULT_GROUP_ID = 631;
public static final int EXPLORERS_RING_ALCH_GROUP_ID = 483;
public static final int OPTIONS_GROUP_ID = 261;
static class WorldMap
{
@@ -834,4 +835,11 @@ public class WidgetID
{
static final int INVENTORY = 7;
}
static class Options
{
static final int MUSIC_SLIDER = 44;
static final int SOUND_EFFECT_SLIDER = 50;
static final int AREA_SOUND_SLIDER = 56;
}
}

View File

@@ -498,7 +498,11 @@ public enum WidgetInfo
SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER),
SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER),
SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT);
SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT),
OPTIONS_MUSIC_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.MUSIC_SLIDER),
OPTIONS_SOUND_EFFECT_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.SOUND_EFFECT_SLIDER),
OPTIONS_AREA_SOUND_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.AREA_SOUND_SLIDER);
private final int groupId;
private final int childId;