Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version string in MainController when compiling #611

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<property environment="env" />
<property name="build.src" value="src" />
<property name="build.dest" value="build" />
<property name="app.version" value="0.5.4"/>
<property name="app.version" value="0.8.3"/>
<property name="dir.release" value="release" />
<property name="dir.release.windows" value="${dir.release}/windows" />
<property name="dir.release.linux" value="${dir.release}/linux" />
Expand Down Expand Up @@ -32,7 +32,7 @@
<mkdir dir="${dir.release}/linux" />
</target>

<target name="compile" depends="clean">
<target name="compile" depends="clean,inject_version">
<javac classpathref="build.lib" srcdir="${build.src}" debug="${debug}" destdir="${build.dest}" encoding="UTF-8" />
</target>

Expand Down Expand Up @@ -111,6 +111,11 @@
</copy>
</target>

<target name="inject_version">
<echo message="Updating game version in src/bms/player/beatoraja/MainController.java to ${app.version}" />
<replaceregexp file="src/bms/player/beatoraja/MainController.java" match="beatoraja \d+(?:\.\d+)+" replace="beatoraja ${app.version}" />
</target>

<target name="make_zip">
<zip destfile="${dir.release.windows}/${zipname}_windows.zip" basedir="${dir.release.windows}" />
<zip destfile="${dir.release.linux}/${zipname}_linux.zip" basedir="${dir.release.linux}" />
Expand Down
31 changes: 17 additions & 14 deletions src/bms/player/beatoraja/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
*/
public class MainController extends ApplicationAdapter {

/*
* NOTE: Version number is updated by ant's 'inject_version' task
*/
private static final String VERSION = "beatoraja 0.8.3";

public static final boolean debug = false;
Expand Down Expand Up @@ -175,10 +178,10 @@ public MainController(Path f, Config config, PlayerConfig player, BMSPlayerMode
}
}
}

}
ir = irarray.toArray(IRStatus.class);

switch(config.getAudioConfig().getDriver()) {
case PortAudio:
try {
Expand Down Expand Up @@ -266,7 +269,7 @@ public void changeState(MainStateType state) {
}
newState.create();
if(newState.getSkin() != null) {
newState.getSkin().prepare(newState);
newState.getSkin().prepare(newState);
}
current = newState;
starttime = System.nanoTime();
Expand All @@ -279,7 +282,7 @@ public void changeState(MainStateType state) {
Gdx.input.setInputProcessor(input.getKeyBoardInputProcesseor());
}
}

public MainState getCurrentState() {
return current;
}
Expand All @@ -299,7 +302,7 @@ public void create() {
generator = new FreeTypeFontGenerator(Gdx.files.internal("skin/default/VL-Gothic-Regular.ttf"));
FreeTypeFontParameter parameter = new FreeTypeFontParameter();
parameter.size = 24;
systemfont = generator.generateFont(parameter);
systemfont = generator.generateFont(parameter);
} catch (GdxRuntimeException e) {
Logger.getGlobal().severe("System Font1読み込み失敗");
}
Expand Down Expand Up @@ -378,7 +381,7 @@ public void create() {
});
download.start(null);
}

if(ir.length > 0) {
messageRenderer.addMessage(ir.length + " IR Connection Succeed" ,5000, Color.GREEN, 1);
}
Expand Down Expand Up @@ -628,7 +631,7 @@ public SystemSoundManager getSoundManager() {
public MusicDownloadProcessor getMusicDownloadProcessor(){
return download;
}

public MessageRenderer getMessageRenderer() {
return messageRenderer;
}
Expand Down Expand Up @@ -742,7 +745,7 @@ public void downloadIpfsMessageRenderer(String message) {
downloadIpfs.start();
}
}

public static String getVersion() {
return VERSION;
}
Expand Down Expand Up @@ -823,7 +826,7 @@ public void run() {

/**
* BGM、効果音セット管理用クラス
*
*
* @author exch
*/
public static class SystemSoundManager {
Expand All @@ -846,10 +849,10 @@ public static class SystemSoundManager {

public SystemSoundManager(Config config) {
if(config.getBgmpath() != null && config.getBgmpath().length() > 0) {
scan(Paths.get(config.getBgmpath()).toAbsolutePath(), bgms, "select.wav");
scan(Paths.get(config.getBgmpath()).toAbsolutePath(), bgms, "select.wav");
}
if(config.getSoundpath() != null && config.getSoundpath().length() > 0) {
scan(Paths.get(config.getSoundpath()).toAbsolutePath(), sounds, "clear.wav");
scan(Paths.get(config.getSoundpath()).toAbsolutePath(), sounds, "clear.wav");
}
Logger.getGlobal().info("検出されたBGM Set : " + bgms.size + " Sound Set : " + sounds.size);
}
Expand Down Expand Up @@ -883,16 +886,16 @@ private void scan(Path p, Array<Path> paths, String name) {
}
} catch (IOException e) {
}
}
}
}
}

public static class IRStatus {

public final IRConfig config;
public final IRConnection connection;
public final IRPlayerData player;

public IRStatus(IRConfig config, IRConnection connection, IRPlayerData player) {
this.config = config;
this.connection = connection;
Expand Down