Added final features for this release. Now only polishing (if needed) remains.
Features: Sacrifice-Node, Maintain-Node, Options for screen type, lightcolor and soundvolume, tied in sound effects, game pause when menu is open, visibly open up gate when opening it.
This commit is contained in:
@@ -61,6 +61,7 @@ public static class SaveGameManager
|
||||
LowestLayer = GameData.lowestLayer,
|
||||
MaxRobotCount = GameData.maxRobotCount,
|
||||
CanMove = GameData.canMove,
|
||||
Settings = CreateSettingsSaveData(),
|
||||
Survival = CreateSurvivalSaveData(),
|
||||
Inventory = CreateInventorySaveData(),
|
||||
Research = CreateResearchSaveData(),
|
||||
@@ -80,6 +81,7 @@ public static class SaveGameManager
|
||||
GameData.maxRobotCount = saveGame.MaxRobotCount;
|
||||
GameData.canMove = saveGame.CanMove;
|
||||
|
||||
ApplySettingsData(saveGame.Settings);
|
||||
ApplySurvivalData(saveGame.Survival);
|
||||
ApplyInventoryData(saveGame.Inventory);
|
||||
ApplyResearchData(saveGame.Research);
|
||||
@@ -100,6 +102,19 @@ public static class SaveGameManager
|
||||
};
|
||||
}
|
||||
|
||||
private static SettingsSaveData CreateSettingsSaveData()
|
||||
{
|
||||
return new SettingsSaveData
|
||||
{
|
||||
ScreenMode = GameData.screenMode,
|
||||
SoundVolume = GameData.soundVolume,
|
||||
LightColorR = GameData.lightColor.R,
|
||||
LightColorG = GameData.lightColor.G,
|
||||
LightColorB = GameData.lightColor.B,
|
||||
LightColorA = GameData.lightColor.A
|
||||
};
|
||||
}
|
||||
|
||||
private static List<ItemSaveData> CreateInventorySaveData()
|
||||
{
|
||||
List<ItemSaveData> result = new List<ItemSaveData>();
|
||||
@@ -201,6 +216,7 @@ public static class SaveGameManager
|
||||
LowestLayer = saveGame.LowestLayer,
|
||||
MaxRobotCount = saveGame.MaxRobotCount,
|
||||
CanMove = saveGame.CanMove,
|
||||
Settings = saveGame.Settings,
|
||||
Survival = saveGame.Survival,
|
||||
Inventory = saveGame.Inventory,
|
||||
Research = new List<ResearchSaveData>(),
|
||||
@@ -286,6 +302,43 @@ public static class SaveGameManager
|
||||
GameData.survival.elapsedSeconds = survival.ElapsedSeconds;
|
||||
}
|
||||
|
||||
private static void ApplySettingsData(SettingsSaveData settings)
|
||||
{
|
||||
if (settings == null) return;
|
||||
|
||||
GameData.screenMode = settings.ScreenMode;
|
||||
GameData.soundVolume = settings.SoundVolume;
|
||||
GameData.lightColor = new Color(
|
||||
settings.LightColorR,
|
||||
settings.LightColorG,
|
||||
settings.LightColorB,
|
||||
settings.LightColorA
|
||||
);
|
||||
|
||||
ApplyScreenMode(settings.ScreenMode);
|
||||
SoundManager.SetMasterVolume(settings.SoundVolume);
|
||||
LightHandler.RedrawLights(GameData.lightColor);
|
||||
}
|
||||
|
||||
private static void ApplyScreenMode(int screenMode)
|
||||
{
|
||||
switch (screenMode)
|
||||
{
|
||||
case 0:
|
||||
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Fullscreen);
|
||||
DisplayServer.WindowSetFlag(DisplayServer.WindowFlags.Borderless, false);
|
||||
break;
|
||||
case 1:
|
||||
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed);
|
||||
DisplayServer.WindowSetFlag(DisplayServer.WindowFlags.Borderless, false);
|
||||
break;
|
||||
case 2:
|
||||
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Fullscreen);
|
||||
DisplayServer.WindowSetFlag(DisplayServer.WindowFlags.Borderless, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyInventoryData(List<ItemSaveData> savedItems)
|
||||
{
|
||||
GameData.inventory = new Inventory();
|
||||
@@ -353,7 +406,7 @@ public static class SaveGameManager
|
||||
tile.containsResource = savedTile.ContainsResource;
|
||||
tile.wasVisited = savedTile.WasVisited;
|
||||
tile.resource = savedTile.Resource == null ? null : GameResource.FromSaveData(savedTile.Resource);
|
||||
tile.ContentNode.Visible = savedTile.WasVisited || tile.collapsedMesh == "gate";
|
||||
tile.ContentNode.Visible = savedTile.WasVisited || (tile.collapsedMesh == "gate" && !layer.isGateOpen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user