Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
WilloIzCitron committed Dec 31, 2024
1 parent 6b17c98 commit 72b132c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 29 deletions.
29 changes: 23 additions & 6 deletions src/bluearchive/ui/dialogs/ArchivDLive2DSelectionDialog.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
package bluearchive.ui.dialogs;

import arc.Core;
import arc.scene.actions.Actions;
import arc.scene.ui.*;
import arc.scene.ui.layout.*;
import bluearchive.ui.ArchivDBackground;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.ui.*;


public class ArchivDLive2DSelectionDialog extends Dialog {
private static TextButton a,b,c;
public ArchivDLive2DSelectionDialog() {
super();
row();
add(Core.bundle.get("ba-caution")).color(Pal.techBlue).style(Styles.techLabel).fontScale(2f).row();
image(Tex.whiteui, Pal.techBlue).width(450f).height(3f).pad(4f).center().row();
add(Core.bundle.get("ba-caution-text")).style(Styles.defaultLabel).row();
TextButton a = button(Core.bundle.get("ba-l2dInstallLocally"), Icon.download, () -> { this.hide(); Core.settings.put("live2dinstalled", true);}).padLeft(8f).growX().padTop(3f).get();
row();
TextButton b = button(Core.bundle.get("ba-l2dInstallRepo"), Icon.download, ArchivDBackground::downloadLive2D).padLeft(8f).growX().padTop(3f).get();
row();
TextButton c = button(Core.bundle.get("cancel"), Icon.left, this::hide).padLeft(8f).padTop(3f).width(250f).get();
table(t -> {
a = t.button(Core.bundle.get("ba-l2dInstallLocally"), Icon.download, () -> { this.hide(); Core.settings.put("live2dinstalled", true);}).padLeft(8f).padTop(3f).width(250f).get();
b = t.button(Core.bundle.get("ba-l2dInstallRepo"), Icon.download, ArchivDBackground::downloadLive2D).padLeft(8f).padTop(3f).width(250f).get();
c = t.button(Core.bundle.get("cancel"), Icon.left, this::hide).padLeft(8f).padTop(3f).width(250f).get();
}).center();
show();
}

@Override
public Dialog show() {
a.actions(Actions.fadeIn(1f), Actions.visible(true));
b.actions(Actions.fadeIn(2f), Actions.visible(true));
c.actions(Actions.fadeIn(3f), Actions.visible(true));
return super.show();
}

@Override
public void hide() {
a.clearActions();
b.clearActions();
c.clearActions();
super.hide();
}
}
49 changes: 26 additions & 23 deletions src/bluearchive/ui/overrides/ArchivDLoadingFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import arc.scene.ui.*;
import arc.scene.ui.layout.*;
import arc.util.Nullable;
import mindustry.Vars;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.ui.*;
import mindustry.ui.fragments.*;
Expand All @@ -20,26 +20,30 @@

public class ArchivDLoadingFragment extends LoadingFragment {
private Table table;
private TextButton button;
private static TextButton button;
private Bar bar;
private Label nameLabel;
private static Label nameLabel;
private float progValue;
private Label tooltipTitle;
private Label tooltipInfo;
private static float scale;
public static boolean loadFragShow;
private static Table tabl;

public static void init() {
ui.loadfrag = new ArchivDLoadingFragment();
ui.loadfrag.build(Core.scene.root);
if(!mobile){
scale = 45f;
} else {
scale = 60f;
}
}

public void build(Group parent){
if(tabl == null) {
tabl = new Table(table -> {
nameLabel = table.add("@loading").color(Pal.techBlue).pad(10f).style(Styles.techLabel).left().get();
table.image(Tex.clear).growX();
button = table.button("@cancel", () -> {
}).size(250f, 50f).visible(false).right().get();
updateLabel(false, "@loading");
});
}
parent.fill(t -> {
//rect must fill screen completely.
t.rect((x, y, w, h) -> {
Expand All @@ -48,23 +52,21 @@ public void build(Group parent){
});
t.visible = false;
t.touchable = Touchable.enabled;
t.add().height((Core.graphics.getHeight())/ 2f).row();
t.row();
tooltipTitle = t.add("Lorem Ipsum").color(Pal.techBlue).fontScale(1.5f).style(Styles.techLabel).pad(10).left().get();
t.row();
tooltipInfo = t.add("Line1\nline2\nline3\n").pad(10).left().get();
t.row();
t.add().height((Core.graphics.getHeight() - scale)/2f).row();
t.row();
nameLabel = t.add("@loading").color(Pal.techBlue).pad(10f).style(Styles.techLabel).left().get();
t.add().growY();
t.row();
t.add(new WarningBar()).color(Pal.techBlue).growX().height(24f);
t.table(a -> {
tooltipTitle = a.add("Lorem Ipsum").color(Pal.techBlue).fontScale(1.5f).style(Styles.techLabel).pad(10).left().get();
a.row();
tooltipInfo = a.add("Line1\nline2\nline3\n").pad(10).left().get();
}).left().row();
t.add().growY();
t.row();
updateLabel(false,"@loading");
bar = t.add(new Bar()).pad(3).padTop(6).height(40f).growX().visible(false).get();
if(tabl != null) t.add(tabl).growX();
t.row();
button = t.button("@cancel", () -> {
}).size(250f, 50f).visible(false).get();
t.table(a -> {
a.add(new WarningBar()).color(Pal.techBlue).growX().height(24f).row();
bar = a.add(new Bar()).pad(3).padTop(6).height(40f).growX().visible(false).get();
}).bottom().growX().row();
table = t;
});
}
Expand Down Expand Up @@ -127,6 +129,7 @@ public void hide(){
table.toFront();
table.touchable = Touchable.disabled;
table.actions(Actions.fadeOut(0.5f), Actions.visible(false));
tabl = null;
loadFragShow = false;
}

Expand Down

0 comments on commit 72b132c

Please sign in to comment.