mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2026-08-28 05:45:03 -06:00
SFX volume control
This commit is contained in:
parent
eea165aae5
commit
a7cd02ced3
3 changed files with 17 additions and 14 deletions
|
|
@ -212,17 +212,6 @@ public class PojavLoginActivity extends BaseActivity {
|
|||
mkdirs(Tools.CTRLMAP_PATH);
|
||||
try {
|
||||
Tools.copyAssetFile(this, "components/security/pro-grade.jar", Tools.DIR_DATA, true);
|
||||
|
||||
// Unpack Music
|
||||
for(int i = 0; i < 645; i++){
|
||||
Tools.copyAssetFile(this, "music/"+i+".ogg", Tools.DIR_DATA + "/music", true);
|
||||
}
|
||||
|
||||
// Unpack Effects
|
||||
for(int i = 0; i < 6749; i++){
|
||||
Tools.copyAssetFile(this, "effects/"+i+".ogg", Tools.DIR_DATA + "/effects", true);
|
||||
}
|
||||
|
||||
Tools.copyAssetFile(this, "components/security/java_sandbox.policy", Tools.DIR_DATA, true);
|
||||
Tools.copyAssetFile(this, "options.txt", Tools.DIR_GAME_NEW, false);
|
||||
// TODO: Remove after implement.
|
||||
|
|
@ -244,7 +233,7 @@ public class PojavLoginActivity extends BaseActivity {
|
|||
}
|
||||
}
|
||||
private boolean installRuntimeAutomatically(AssetManager am, boolean otherRuntimesAvailable) {
|
||||
/* Check if JRE is included */
|
||||
/* Check if JRE is included, This only runs on first startup. */
|
||||
String rt_version = null;
|
||||
String current_rt_version = MultiRTUtils.__internal__readBinpackVersion("Internal");
|
||||
try {
|
||||
|
|
@ -260,6 +249,20 @@ public class PojavLoginActivity extends BaseActivity {
|
|||
(resid, vararg) -> runOnUiThread(()->{if(startupTextView!=null)startupTextView.setText(getString(resid,vararg));}));
|
||||
MultiRTUtils.postPrepare(PojavLoginActivity.this,"Internal");
|
||||
|
||||
try{
|
||||
// Unpack Music
|
||||
for(int i = 0; i < 645; i++){
|
||||
Tools.copyAssetFile(this, "music/"+i+".ogg", Tools.DIR_DATA + "/music", true);
|
||||
}
|
||||
// Unpack Effects
|
||||
for(int i = 0; i < 6749; i++){
|
||||
Tools.copyAssetFile(this, "effects/"+i+".ogg", Tools.DIR_DATA + "/effects", true);
|
||||
}
|
||||
}
|
||||
catch (Exception e){
|
||||
System.out.println("Error Unpacking Music.");
|
||||
}
|
||||
|
||||
// Copy config.json to writable storage
|
||||
// https://stackoverflow.com/questions/38590996/copy-xml-from-raw-folder-to-internal-storage-and-use-it-in-android
|
||||
File file = new File(getFilesDir(), "raw/config.json");
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class JMessageHandler {
|
|||
break;
|
||||
case "NEW_EFFECT":
|
||||
// EXAMPLE: AMESSAGE NEW_EFFECT EFFECT_ID: 2555 EFFECT_VOLUME: 10 EFFECT_DELAY: 0
|
||||
JAudioManager.setEffectVolume(Integer.valueOf(args[5])/10f);
|
||||
JAudioManager.setEffectVolume(Float.valueOf(args[5])/10f);
|
||||
JAudioManager.setEffectTrack(Integer.valueOf(args[3]));
|
||||
break;
|
||||
case "MUSIC_VOLUME":
|
||||
|
|
@ -24,7 +24,7 @@ public class JMessageHandler {
|
|||
break;
|
||||
case "EFFECT_VOLUME":
|
||||
// EXAMPLE: AMESSAGE EFFECT_VOLUME: 10
|
||||
JAudioManager.setEffectVolume(Integer.valueOf(args[2])/10f);
|
||||
JAudioManager.setEffectVolume(Float.valueOf(args[2])/10f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue