Fixed sound instruction layout
This commit is contained in:
@@ -94,7 +94,7 @@ public class GlobalVars{
|
|||||||
//sounds
|
//sounds
|
||||||
if(Core.assets != null){
|
if(Core.assets != null){
|
||||||
for(Sound sound : Core.assets.getAll(Sound.class, new Seq<>(Sound.class))){
|
for(Sound sound : Core.assets.getAll(Sound.class, new Seq<>(Sound.class))){
|
||||||
if(sound != Sounds.none && sound != Sounds.swish){
|
if(sound != Sounds.none && sound != Sounds.swish && sound.file != null){
|
||||||
String name = sound.file.nameWithoutExtension();
|
String name = sound.file.nameWithoutExtension();
|
||||||
soundNames.add(name);
|
soundNames.add(name);
|
||||||
put("@sfx-" + name, Sounds.getSoundId(sound));
|
put("@sfx-" + name, Sounds.getSoundId(sound));
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package mindustry.logic;
|
package mindustry.logic;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.audio.*;
|
|
||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
import arc.scene.style.*;
|
import arc.scene.style.*;
|
||||||
@@ -2128,8 +2127,6 @@ public class LStatements{
|
|||||||
public boolean positional;
|
public boolean positional;
|
||||||
public String id = "@sfx-pew", volume = "1", pitch = "1", pan = "0", x = "@thisx", y = "@thisy";
|
public String id = "@sfx-pew", volume = "1", pitch = "1", pan = "0", x = "@thisx", y = "@thisy";
|
||||||
|
|
||||||
private transient TextField tfield;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(Table table){
|
public void build(Table table){
|
||||||
rebuild(table);
|
rebuild(table);
|
||||||
@@ -2145,15 +2142,13 @@ public class LStatements{
|
|||||||
|
|
||||||
row(table);
|
row(table);
|
||||||
|
|
||||||
table.add(" play ");
|
field(table, id, str -> id = str).padRight(0f).get();
|
||||||
|
|
||||||
tfield = field(table, id, str -> id = str).padRight(0f).get();
|
|
||||||
|
|
||||||
table.button(b -> {
|
table.button(b -> {
|
||||||
b.image(Icon.pencilSmall);
|
b.image(Icon.pencilSmall);
|
||||||
|
|
||||||
b.clicked(() -> showSelect(b, GlobalVars.soundNames.toArray(String.class), id.substring(4), t -> {
|
b.clicked(() -> showSelect(b, GlobalVars.soundNames.toArray(String.class), id.substring(4), t -> {
|
||||||
sid("@sfx-" + t);
|
id = "@sfx-" + t;
|
||||||
rebuild(table);
|
rebuild(table);
|
||||||
}, 2, cell -> cell.size(160, 50)));
|
}, 2, cell -> cell.size(160, 50)));
|
||||||
}, Styles.logict, () -> {}).size(40).color(table.color).left().padLeft(-1);
|
}, Styles.logict, () -> {}).size(40).color(table.color).left().padLeft(-1);
|
||||||
@@ -2166,23 +2161,14 @@ public class LStatements{
|
|||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
if(positional){
|
if(positional){
|
||||||
table.add("at ");
|
fieldst(table, "x", x, str -> x = str);
|
||||||
|
|
||||||
fields(table, x, str -> x = str);
|
fieldst(table, "y", y, str -> y = str);
|
||||||
|
|
||||||
table.add(", ");
|
|
||||||
|
|
||||||
fields(table, y, str -> y = str);
|
|
||||||
}else{
|
}else{
|
||||||
fieldst(table, "pan", pan, str -> pan = str);
|
fieldst(table, "pan", pan, str -> pan = str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sid(String text){
|
|
||||||
tfield.setText(text);
|
|
||||||
id = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean privileged(){
|
public boolean privileged(){
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user