mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 03:59:26 +02:00
description setting owo
This commit is contained in:
@@ -8,7 +8,6 @@ import arc.graphics.g2d.*;
|
||||
import arc.input.KeyCode;
|
||||
import arc.math.*;
|
||||
import arc.scene.*;
|
||||
import arc.scene.event.ClickListener;
|
||||
import arc.scene.event.HandCursorListener;
|
||||
import arc.scene.style.*;
|
||||
import arc.scene.ui.*;
|
||||
@@ -29,9 +28,7 @@ import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.defense.turrets.*;
|
||||
import mindustry.world.blocks.power.*;
|
||||
import mindustry.world.blocks.storage.*;
|
||||
import mindustry.world.consumers.*;
|
||||
|
||||
import static arc.Core.*;
|
||||
import static mindustry.Vars.*;
|
||||
@@ -73,7 +70,7 @@ public class HudUi {
|
||||
|
||||
public @Nullable Tile getTile(){
|
||||
return Vars.world.tileWorld(Core.input.mouseWorldX(), Core.input.mouseWorldY());
|
||||
};
|
||||
}
|
||||
|
||||
public void setEvent(){
|
||||
Events.run(EventType.Trigger.draw, () -> {
|
||||
@@ -83,7 +80,7 @@ public class HudUi {
|
||||
for(int i = 0; i < 4; i++){
|
||||
float rot = i * 90f + 45f + (-Time.time) % 360f;
|
||||
float length = unit.hitSize * 1.5f + 2.5f;
|
||||
Draw.color(Tmp.c1.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f)).a(settings.getInt("uiopacity") / 100f));
|
||||
Draw.color(Tmp.c1.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f)).a(settings.getInt("selectopacity") / 100f));
|
||||
Draw.rect("select-arrow", unit.x + Angles.trnsx(rot, length), unit.y + Angles.trnsy(rot, length), length / 1.9f, length / 1.9f, rot - 135f);
|
||||
Draw.reset();
|
||||
}
|
||||
@@ -414,9 +411,7 @@ public class HudUi {
|
||||
t.left();
|
||||
|
||||
t.add(new Image(){{
|
||||
update(() -> {
|
||||
setDrawable(getUnit().stack.item == null || getUnit().stack.amount <= 0 ? Core.atlas.find("clear") : getUnit().stack.item.uiIcon);
|
||||
});
|
||||
update(() -> setDrawable(getUnit().stack.item == null || getUnit().stack.amount <= 0 ? Core.atlas.find("clear") : getUnit().stack.item.uiIcon));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,10 +8,10 @@ import arc.scene.ui.layout.*;
|
||||
import arc.struct.Seq;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.game.Team;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.ui.Styles;
|
||||
import mindustry.ui.dialogs.*;
|
||||
import sun.tools.jconsole.Tab;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -40,6 +40,7 @@ public class Setting {
|
||||
public void add(SettingsMenuDialog.SettingsTable table){
|
||||
Slider slider = new Slider(min, max, step, false);
|
||||
|
||||
slider.addListener(new Tooltip(t -> t.background(Tex.button).table(to -> to.add("[lightgray]" + Core.bundle.get("setting." + key + ".description") + "[]"))));
|
||||
slider.setValue(settings.getInt(name));
|
||||
|
||||
Label value = new Label("");
|
||||
@@ -73,6 +74,7 @@ public class Setting {
|
||||
@Override
|
||||
public void add(SettingsMenuDialog.SettingsTable table) {
|
||||
CheckBox box = new CheckBox(title);
|
||||
box.addListener(new Tooltip(t -> t.background(Tex.button).table(to -> to.add("[lightgray]" + Core.bundle.get("setting." + key + ".description") + "[]"))));
|
||||
|
||||
box.update(() -> box.setChecked(settings.getBool(name)));
|
||||
|
||||
@@ -207,10 +209,11 @@ public class Setting {
|
||||
}
|
||||
}).size(40f));
|
||||
|
||||
settingsTable.table((t) -> {
|
||||
settingsTable.table(t -> {
|
||||
t.left().defaults().left();
|
||||
t.add(label).minWidth(label.getPrefWidth() / Scl.scl(1.0F) + 50.0F);
|
||||
t.add(button).size(40F);
|
||||
t.addListener(new Tooltip(tt -> tt.background(Tex.button).table(to -> to.add("[lightgray]" + Core.bundle.get("setting." + key + ".description") + "[]"))));
|
||||
}).left().padTop(3.0F);
|
||||
settingsTable.row();
|
||||
}
|
||||
@@ -218,7 +221,7 @@ public class Setting {
|
||||
}
|
||||
|
||||
public void addGraphicDialogSetting(String key, Seq<SettingsMenuDialog.SettingsTable.Setting> list, SettingsMenuDialog.SettingsTable table){
|
||||
ui.settings.graphics.pref(new SettingsMenuDialog.SettingsTable.Setting() {
|
||||
ui.settings.graphics.pref(new SettingsMenuDialog.SettingsTable.Setting() {
|
||||
{
|
||||
name = key;
|
||||
title = Core.bundle.get("setting." + key + ".name");
|
||||
@@ -238,7 +241,7 @@ public class Setting {
|
||||
table.button(Core.bundle.get("settings.reset", "Reset to Defaults"), () -> {
|
||||
Iterator var2 = list.iterator();
|
||||
|
||||
while(var1.hasNext()) {
|
||||
while(var2.hasNext()) {
|
||||
SettingsMenuDialog.SettingsTable.Setting setting = (SettingsMenuDialog.SettingsTable.Setting)var1.next();
|
||||
if (setting.name != null && setting.title != null) {
|
||||
Core.settings.put(setting.name, Core.settings.getDefault(setting.name));
|
||||
|
||||
Reference in New Issue
Block a user