mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-11-11 03:31:19 +03:00
Various fixes
This commit is contained in:
parent
295c922f0a
commit
31e4b2752f
@ -605,6 +605,7 @@ setting.publichost.name = Public Game Visibility
|
||||
setting.chatopacity.name = Chat Opacity
|
||||
setting.playerchat.name = Display Player Bubble Chat
|
||||
public.confirm = Do you want to make your game public?\n[lightgray]This can be changed later in Settings->Game->Public Game Visibility.
|
||||
public.beta = Note that beta versions of the game cannot make public lobbies.
|
||||
uiscale.reset = UI scale has been changed.\nPress "OK" to confirm this scale.\n[scarlet]Reverting and exiting in[accent] {0}[] seconds...
|
||||
uiscale.cancel = Cancel & Exit
|
||||
setting.bloom.name = Bloom
|
||||
|
@ -261,7 +261,7 @@ public class Vars implements Loadable{
|
||||
public static void loadSettings(){
|
||||
Core.settings.setAppName(appName);
|
||||
|
||||
if(steam || "steam".equals(Version.modifier)){
|
||||
if(steam || (Version.modifier != null && Version.modifier.contains("steam"))){
|
||||
Core.settings.setDataDirectory(Core.files.local("saves/"));
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.scene.ui.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.*;
|
||||
import io.anuke.mindustry.game.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
import io.anuke.mindustry.ui.*;
|
||||
|
||||
@ -76,6 +77,12 @@ public class HostDialog extends FloatingDialog{
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
if(Version.modifier.contains("beta")){
|
||||
Core.settings.putSave("publichost", false);
|
||||
platform.updateLobby();
|
||||
Core.settings.getBoolOnce("betapublic", () -> ui.showInfo("$public.beta"));
|
||||
}
|
||||
}catch(IOException e){
|
||||
ui.showException("$server.error", e);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import io.anuke.arc.scene.ui.TextButton.*;
|
||||
import io.anuke.arc.scene.ui.layout.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.core.GameState.*;
|
||||
import io.anuke.mindustry.game.*;
|
||||
import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
import io.anuke.mindustry.graphics.*;
|
||||
@ -227,7 +228,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
|
||||
game.checkPref("hints", true);
|
||||
|
||||
if(steam){
|
||||
if(steam && !Version.modifier.contains("beta")){
|
||||
game.checkPref("publichost", false, i -> {
|
||||
platform.updateLobby();
|
||||
});
|
||||
|
@ -15,6 +15,7 @@ import io.anuke.arc.scene.event.*;
|
||||
import io.anuke.arc.scene.ui.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.arc.util.Log.*;
|
||||
import io.anuke.arc.util.io.*;
|
||||
import io.anuke.arc.util.serialization.*;
|
||||
import io.anuke.mindustry.*;
|
||||
import io.anuke.mindustry.core.GameState.*;
|
||||
@ -64,7 +65,7 @@ public class DesktopLauncher extends ClientLauncher{
|
||||
public DesktopLauncher(String[] args){
|
||||
Log.setUseColors(false);
|
||||
Version.init();
|
||||
boolean useSteam = Version.modifier.equals("steam");
|
||||
boolean useSteam = Version.modifier.contains("steam");
|
||||
testMobile = Array.with(args).contains("-testMobile");
|
||||
|
||||
if(useDiscord){
|
||||
@ -129,7 +130,13 @@ public class DesktopLauncher extends ClientLauncher{
|
||||
}
|
||||
|
||||
try{
|
||||
SteamAPI.loadLibraries();
|
||||
try{
|
||||
SteamAPI.loadLibraries();
|
||||
}catch(Throwable t){
|
||||
Log.err(t);
|
||||
fallbackSteam();
|
||||
}
|
||||
|
||||
if(!SteamAPI.init()){
|
||||
Log.err("Steam client not running.");
|
||||
}else{
|
||||
@ -144,6 +151,19 @@ public class DesktopLauncher extends ClientLauncher{
|
||||
}
|
||||
}
|
||||
|
||||
void fallbackSteam(){
|
||||
try{
|
||||
String name = "steam_api";
|
||||
if(OS.isMac || OS.isLinux) name = "lib" + name;
|
||||
if(OS.isWindows && OS.is64Bit) name += "64";
|
||||
name += (OS.isLinux ? ".so" : OS.isMac ? ".dylib" : ".dll");
|
||||
Streams.copyStream(getClass().getResourceAsStream(name), new FileOutputStream(name));
|
||||
System.loadLibrary(new File(name).getAbsolutePath());
|
||||
}catch(Throwable e){
|
||||
Log.err(e);
|
||||
}
|
||||
}
|
||||
|
||||
void initSteam(String[] args){
|
||||
SVars.net = new SNet(new ArcNetImpl());
|
||||
SVars.stats = new SStats();
|
||||
|
Loading…
Reference in New Issue
Block a user