static private GetCurrentLobbySaveMetadata ( NetworkUser exceptUser = null ) : |
||
exceptUser | NetworkUser | |
return |
private static void UpdateLobbyControls(NetworkUser exceptUser = null) { var interactable = SteamworksLobbyManager.isInLobby == SteamworksLobbyManager.ownsLobby && File.Exists(SaveFileMetadata.GetCurrentLobbySaveMetadata(exceptUser)?.FilePath); try { if (lobbyButton) { var component = lobbyButton?.GetComponent <HGButton>(); if (component) { component.interactable = interactable; } } } catch { } try { if (lobbyGlyphAndDescription) { var color = interactable ? Color.white : new Color(0.3F, 0.3F, 0.3F); var glyphText = lobbyGlyphAndDescription.transform.GetChild(0).GetComponent <HGTextMeshProUGUI>(); glyphText.color = color; var descriptionText = lobbyGlyphAndDescription.transform.GetChild(1).GetComponent <HGTextMeshProUGUI>(); descriptionText.color = color; } } catch { } }
private static void SaveGame() { var save = ProperSavePlugin.CurrentSave = new SaveFile { SaveFileMeta = SaveFileMetadata.GetCurrentLobbySaveMetadata() ?? SaveFileMetadata.CreateMetadataForCurrentLobby() }; if (string.IsNullOrEmpty(save.SaveFileMeta.FileName)) { do { save.SaveFileMeta.FileName = Guid.NewGuid().ToString(); }while (File.Exists(save.SaveFileMeta.FilePath)); } try { var json = JSONWriter.ToJson(save); File.WriteAllText(save.SaveFileMeta.FilePath, json); SaveFileMetadata.AddIfNotExists(save.SaveFileMeta); Chat.AddMessage(Language.GetString(LanguageConsts.PS_CHAT_SAVE)); } catch (Exception e) { ProperSavePlugin.InstanceLogger.LogWarning("Failed to save the game"); ProperSavePlugin.InstanceLogger.LogError(e); } }