refactor 1
This commit is contained in:
@@ -1913,12 +1913,12 @@ public class LExecutor{
|
|||||||
|
|
||||||
public static class PlaySoundI implements LInstruction{
|
public static class PlaySoundI implements LInstruction{
|
||||||
public boolean positional;
|
public boolean positional;
|
||||||
public int id, volume, pitch, pan, x, y;
|
public LVar id, volume, pitch, pan, x, y;
|
||||||
|
|
||||||
public PlaySoundI(){
|
public PlaySoundI(){
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlaySoundI(boolean positional, int id, int volume, int pitch, int pan, int x, int y){
|
public PlaySoundI(boolean positional, LVar id, LVar volume, LVar pitch, LVar pan, LVar x, LVar y){
|
||||||
this.positional = positional;
|
this.positional = positional;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.volume = volume;
|
this.volume = volume;
|
||||||
@@ -1930,13 +1930,13 @@ public class LExecutor{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(LExecutor exec){
|
public void run(LExecutor exec){
|
||||||
Sound sound = Sounds.getSound(exec.numi(id));
|
Sound sound = Sounds.getSound(id.numi());
|
||||||
if(sound == null || sound == Sounds.swish) sound = Sounds.none; //no.
|
if(sound == null || sound == Sounds.swish) sound = Sounds.none; //no.
|
||||||
|
|
||||||
if(positional){
|
if(positional){
|
||||||
sound.at(World.unconv(exec.numf(x)), World.unconv(exec.numf(y)), exec.numf(pitch), exec.numf(volume));
|
sound.at(World.unconv(x.numf()), World.unconv(y.numf()), pitch.numf(), volume.numf());
|
||||||
}else{
|
}else{
|
||||||
sound.play(exec.numf(volume) * (Core.settings.getInt("sfxvol") / 100f), exec.numf(pitch), exec.numf(pan));
|
sound.play(volume.numf() * (Core.settings.getInt("sfxvol") / 100f), pitch.numf(), pan.numf());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user