Skip to content

Commit

Permalink
Reparation for Foo's and added 2 L2D
Browse files Browse the repository at this point in the history
  • Loading branch information
willoizcitron committed Jul 15, 2024
1 parent 21b50d3 commit 32bb119
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 24 deletions.
4 changes: 4 additions & 0 deletions assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ ba-l2d3.name = Misono Mika
ba-l2d4.name = Joumae Saori
ba-l2d5.name = Tendou Arisu
ba-l2d6.name = Uzawa Reisa
ba-l2d7.name = Konoe Mina
ba-l2d8.name = Izayoi Nonomi
# author who made the frame
ba-l2d1.author= by: Hans404
ba-l2d2.author= by: Hans404
ba-l2d3.author= by: FireFury
ba-l2d4.author= by: Hans404
ba-l2d5.author= by: WilloIzCitron
ba-l2d6.author= by: WilloIzCitron
ba-l2d7.author= by: Hans404
ba-l2d8.author= by: Hans404

ba-l2dManager= Live2D Manager
ba-restartDialogText= Sensei. Please restart the game to apply the change...
Expand Down
4 changes: 4 additions & 0 deletions assets/bundles/bundle_id_ID.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ ba-l2d3.name = Misono Mika
ba-l2d4.name = Joumae Saori
ba-l2d5.name = Tendou Arisu
ba-l2d6.name = Uzawa Reisa
ba-l2d7.name = Konoe Mina
ba-l2d8.name = Izayoi Nonomi
# author who made the frame
ba-l2d1.author= dari: Hans404
ba-l2d2.author= dari: Hans404
ba-l2d3.author= dari: FireFury
ba-l2d4.author= dari: Hans404
ba-l2d5.author= dari: WilloIzCitron
ba-l2d6.author= dari: WilloIzCitron
ba-l2d7.author= dari: Hans404
ba-l2d8.author= dari: Hans404

ba-l2dManager= Manajer Live2D
ba-restartDialogText= Sensei. Please restart the game to apply the change...
Expand Down
5 changes: 3 additions & 2 deletions src/bluearchive/ArchivDMusic.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ArchivDMusic {
cat, aspiration, dawn, bunny,
aira, sugar, hare, oriental,
boss3, boss4, dreamer, game10,
game11, honey, amplify, moment, somedaySometime;
game11, honey, amplify, moment, somedaySometime, t171;

// i hope this work :)
protected static void playMusic(Music music){
Expand Down Expand Up @@ -64,12 +64,13 @@ public static void load(){
amplify = new Music(tree.get("music/amplify.ogg"));
moment = new Music(tree.get("music/moment.ogg"));
somedaySometime = new Music(tree.get("music/somedaySometime.ogg"));
t171 = new Music(tree.get("music/t171.ogg"));
} catch (Exception ex) {
// Music has exception throw, why it was created
throw new RuntimeException(ex);
}
// add custom music contents to vanilla SoundControl's music sequences
control.sound.ambientMusic.addAll(dawn, cat, bunny, game10, honey, amplify);
control.sound.ambientMusic.addAll(dawn, cat, bunny, game10, honey, amplify, t171);
control.sound.darkMusic.addAll(aira, sugar, hare, oriental, dreamer, game11,moment, somedaySometime);
control.sound.bossMusic.addAll(boss3, boss4);
// create wave music soundtrack
Expand Down
34 changes: 22 additions & 12 deletions src/bluearchive/ArchiveDustry.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import bluearchive.events.ArchivDClientLoad;
import bluearchive.ui.*;
import bluearchive.ui.dialogs.*;
import mindustry.game.EventType;
import mindustry.gen.*;
import mindustry.game.EventType.*;
import mindustry.mod.*;
import bluearchive.units.*;
import mindustry.ui.dialogs.*;
Expand Down Expand Up @@ -61,20 +61,30 @@ public void init(){
ArchivDBackground.buildL2D("reisa", 146, 4f);
recollectionMusic = tree.loadMusic("somedaySometime");
break;
case 7:
ArchivDBackground.buildL2D("mina", 68, 4f);
recollectionMusic = tree.loadMusic("t171");
break;
case 8:
ArchivDBackground.buildL2D("nonomi", 63, 4f);
recollectionMusic = tree.loadMusic("cat");
break;
}
}
ArchivDSettings.loadSettings();
switch (Core.settings.getInt("setSong")) {
case 1:
if(Musics.menu != tree.loadMusic("menucm")) Musics.menu = tree.loadMusic("menucm");
break;
case 2:
if(Musics.menu != tree.loadMusic("menure-aoh")) Musics.menu = tree.loadMusic("menure-aoh");
break;
case 3:
if(Musics.menu != recollectionMusic) Musics.menu = recollectionMusic;
break;
}
Events.on(EventType.ClientLoadEvent.class, e -> {
switch (Core.settings.getInt("setSong")) {
case 1:
if(Musics.menu != tree.loadMusic("menucm")) Musics.menu = tree.loadMusic("menucm");
break;
case 2:
if(Musics.menu != tree.loadMusic("menure-aoh")) Musics.menu = tree.loadMusic("menure-aoh");
break;
case 3:
if(Musics.menu != recollectionMusic) Musics.menu = recollectionMusic;
break;
}
});
}
}

24 changes: 14 additions & 10 deletions src/bluearchive/ui/ArchivDBackground.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import arc.util.serialization.*;
import mindustry.Vars;
import mindustry.game.EventType;
import mindustry.gen.Tex;

import java.io.*;
import java.net.HttpURLConnection;
Expand All @@ -27,6 +28,7 @@ public class ArchivDBackground {
static final String version = "v1.3";
private static final Interval interval = new Interval(2);
public static boolean L2DInstalled = false;
protected static int animBGFrame;

public static void buildL2D(String name, int frames, float speed){
// Nullable, can be kill every mod with custom MenuRenderer
Expand All @@ -43,21 +45,24 @@ public static void buildL2D(String name, int frames, float speed){
animBG.setFillParent(true);
TextureRegion[] tex = new TextureRegion[frames];
final TextureAtlas.AtlasRegion[] region = new TextureAtlas.AtlasRegion[frames];
for (int i = 0; i <= frames - 1; i++) {
region[i] = Core.atlas.addRegion ("bluearchive-" + name + (1 + i), new TextureRegion (new Texture (Fi.get (dataDirectory + "/live2d/" + name + "/"+(1 + i) + ".png"))));
tex[i] = region[i];
if (i == frames - 1) {
img = tex[0];
break;
}
}
Time.runTask (12f, () -> {
group.addChildAt (0, animBG);
for (int i = 0; i <= frames - 1; i++) {
region[i] = Core.atlas.addRegion ("bluearchive-" + name + (1 + i), new TextureRegion (new Texture (Fi.get (dataDirectory + "/live2d/" + name + "/"+(1 + i) + ".png"))));
tex[i] = region[i];
if (i == frames - 1) {
img = tex[0];
break;
}
}
Log.infoTag ("ArchiveDustry", "Background Loaded!");
Events.run (EventType.Trigger.update, () -> {
int animBGFrame = (int) ((Time.globalTime / speed) % tex.length);
animBGFrame = (int) ((Time.globalTime / speed) % tex.length);
img.set (tex[animBGFrame]);
setRegion (animBG, img);
if(!state.isMenu() || ui.planet.showed || ui.maps.isShown() || state.rules.editor){
animBG.clear();
}
});
});
});
Expand Down Expand Up @@ -138,5 +143,4 @@ public static void unzip(String zipFile, String destFolder) {
ui.showException(e);
}
}

}

0 comments on commit 32bb119

Please sign in to comment.