import com.ranfa.lib.TwitterIntegration;
import com.ranfa.lib.Version;
-@Version(major = 1, minor = 3, patch = 2)
+@Version(major = 1, minor = 3, patch = 6)
public class DelesteRandomSelector extends JFrame {
private static ArrayList<Song> selectedSongsList = new ArrayList<Song>();
private boolean integratorBool = false;
private JTextArea textArea;
private JScrollPane scrollPane;
+ private CompletableFuture<Void> softwareUpdateFuture = null;
/**
* Launch the application.
+ "\nSong Limit: " + property.getSongLimit()
+ "\nSaveScoreLog: " + property.isSaveScoreLog()
+ "\nOutputDebugSentences: " + property.isOutputDebugSentences());
- if(property.isCheckVersion())
- CheckVersion.needToBeUpdated();
+ if(property.isCheckVersion()) {
+ softwareUpdateFuture = CompletableFuture.runAsync(() -> CheckVersion.needToBeUpdated(), es);
+ }
BiConsumer<ArrayList<Song>, ArrayList<Song>> updateConsumer = (list1, list2) -> {
LimitedLog.println(this.getClass() + ":[INFO]: " + "Checking database updates...");
if(list1.size() > list2.size()) {
btnStart.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Random random = new Random(System.currentTimeMillis());
- String[] tmp = new String[property.getSongLimit()];
+ String paneString = "";
integratorArray = new String[property.getSongLimit()];
for(int i = 0; i < property.getSongLimit(); i++) {
int randomInt = random.nextInt(selectedSongsList.size());
- tmp[i] = (i + 1) + "曲目: " + selectedSongsList.get(randomInt).getAttribute() + " [" + selectedSongsList.get(randomInt).getDifficulty() + "]「" + selectedSongsList.get(randomInt).getName() + "」!(Lv:" + selectedSongsList.get(randomInt).getLevel() + ")\n\n";
+ paneString = paneString + (i + 1) + "曲目: " + selectedSongsList.get(randomInt).getAttribute() + " [" + selectedSongsList.get(randomInt).getDifficulty() + "]「" + selectedSongsList.get(randomInt).getName() + "」!(Lv:" + selectedSongsList.get(randomInt).getLevel() + ")\n\n";
integratorArray[i] = selectedSongsList.get(randomInt).getName() + "(Lv" + selectedSongsList.get(randomInt).getLevel() + ")\n";
}
- String paneString = "";
- for (int i = 0; i < tmp.length; i++) {
- paneString = paneString + tmp[i];
- }
- paneString = paneString + "この" + tmp.length + "曲をプレイしましょう!!!";
+ paneString = paneString + "この" + property.getSongLimit() + "曲をプレイしましょう!!!";
textArea.setText(paneString);
integratorBool = true;
LimitedLog.println(this.getClass() + ":[INFO]: " + "show up completed.");
btnExit = new JButton("終了");
btnExit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- LimitedLog.println(this.getClass() + ":[INFO]: " +"Requested Exit by Button");
- System.exit(0);
+ if(softwareUpdateFuture.isDone()) {
+ LimitedLog.println(this.getClass() + ":[INFO]: " +"Requested Exit by Button");
+ System.exit(0);
+ } else {
+ JOptionPane.showMessageDialog(null, "内部更新処理が完了していません。少し待ってからやり直してください。");
+ }
}
});
btnExit.setFont(new Font("UD デジタル 教科書体 NP-B", Font.BOLD, 13));