Functional level generation + moving the submarine

This commit is contained in:
Regalis
2015-06-26 23:05:51 +03:00
parent bda9b31cbe
commit 9237a9efe2
48 changed files with 1629 additions and 750 deletions

View File

@@ -64,7 +64,7 @@ namespace Subsurface
new GUITextBlock(new Rectangle(0, 30, 0, 30), "Selected map:", Color.Transparent, Color.Black, Alignment.Left, menuTabs[(int)Tabs.NewGame]);
mapList = new GUIListBox(new Rectangle(0, 60, 200, 400), Color.White, menuTabs[(int)Tabs.NewGame]);
foreach (Map map in Map.SavedMaps)
foreach (Submarine map in Submarine.SavedSubmarines)
{
GUITextBlock textBlock = new GUITextBlock(
new Rectangle(0, 0, 0, 25),
@@ -76,7 +76,7 @@ namespace Subsurface
textBlock.Padding = new Vector4(10.0f, 0.0f, 0.0f, 0.0f);
textBlock.UserData = map;
}
if (Map.SavedMaps.Count > 0) mapList.Select(Map.SavedMaps[0]);
if (Submarine.SavedSubmarines.Count > 0) mapList.Select(Submarine.SavedSubmarines[0]);
button = new GUIButton(new Rectangle(0, 0, 100, 30), "Start", GUI.style, Alignment.Right | Alignment.Bottom, menuTabs[(int)Tabs.NewGame]);
@@ -173,7 +173,7 @@ namespace Subsurface
private bool StartGame(GUIButton button, object obj)
{
Map selectedMap = mapList.SelectedData as Map;
Submarine selectedMap = mapList.SelectedData as Submarine;
if (selectedMap == null) return false;
Game1.GameSession = new GameSession(selectedMap, GameModePreset.list.Find(gm => gm.Name == "Single Player"));