Skip to content
Merged
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
4 changes: 2 additions & 2 deletions de.peeeq.wurstscript/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ dependencies {
compile 'com.github.inwc3:jmpq3:1.7.14'

// Water's wc3 libs
compile 'com.github.inwc3:wc3libs:f29e038ced'
compile 'com.github.inwc3:wc3libs:86f3db6854'

// The setup tool for wurst.build handling
compile 'com.github.wurstscript:wurstsetup:376ce9a330'
compile 'com.github.wurstscript:wurstsetup:4c65824b40'

compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.moonlightflower.wc3libs.bin.app.W3I.Force;
import net.moonlightflower.wc3libs.bin.app.W3I.Player;
import net.moonlightflower.wc3libs.dataTypes.app.Controller;
import net.moonlightflower.wc3libs.dataTypes.app.LoadingScreenBackground;
import net.moonlightflower.wc3libs.port.GameVersion;
import org.apache.commons.lang.StringUtils;
import org.eclipse.lsp4j.MessageType;
Expand Down Expand Up @@ -144,7 +145,10 @@ private static void applyScenarioData(W3I w3I, WurstProjectBuildMapData buildMap
}

private static void applyLoadingScreen(W3I w3I, WurstProjectBuildLoadingScreenData loadingScreen) {
w3I.setLoadingScreenModel(loadingScreen.getModel());
if (StringUtils.isNotBlank(loadingScreen.getModel())) {
w3I.setLoadingScreenModel(loadingScreen.getModel());
}
w3I.getLoadingScreen().setBackground(LoadingScreenBackground.PresetBackground.findByName(loadingScreen.getBackground()));
w3I.getLoadingScreen().setTitle(loadingScreen.getTitle());
w3I.getLoadingScreen().setSubtitle(loadingScreen.getSubTitle());
w3I.getLoadingScreen().setText(loadingScreen.getText());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@

class Jmpq3BasedEditor implements MpqEditor {

private JMpqEditor editor;
private final JMpqEditor editor;

private JMpqEditor getEditor() {
if (editor == null) {
throw new RuntimeException("editor already closed");
}
return editor;
}

Expand Down Expand Up @@ -56,13 +53,10 @@ public void deleteFile(String filenameInMpq) {

@Override
public void close() throws IOException {
if (editor != null) {
try {
editor.close();
} catch (JMpqException e) {
throw new IOException(e);
}
editor = null;
try {
editor.close();
} catch (JMpqException e) {
throw new IOException(e);
}
}

Expand All @@ -78,9 +72,7 @@ public void setKeepHeaderOffset(boolean flag) {

@Override
protected void finalize() throws Throwable {
if (editor != null) {
WLogger.severe("JMPQ editor not closed normally");
editor.close();
}
WLogger.severe("JMPQ editor not closed normally");
editor.close();
}
}