diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-04-29 08:48:54 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2020-04-29 08:48:54 +0300 |
| commit | 1a5c97cc9435f443065107a70ee51f1d45942435 (patch) | |
| tree | c1638ad540192eb40f648b0480498265c11c3965 | |
| parent | 95e3f7d2406beba2f120ecddd3f98e0ae5883443 (diff) | |
| download | Mundus-1a5c97cc9435f443065107a70ee51f1d45942435.tar Mundus-1a5c97cc9435f443065107a70ee51f1d45942435.tar.gz Mundus-1a5c97cc9435f443065107a70ee51f1d45942435.zip | |
Completed documenttion (for the most part). Changed game and mob generation structure a bit. All mobs now have an inventory. Build name is stored in a constant (Data/Windows/WI.cs). Updated executable.
25 files changed, 166 insertions, 52 deletions
diff --git a/Mundus Build 28-04-2020 No1.exe b/Mundus Build 29-04-2020 No1.exe Binary files differindex f85273e..d60c607 100644 --- a/Mundus Build 28-04-2020 No1.exe +++ b/Mundus Build 29-04-2020 No1.exe diff --git a/Mundus/Data/SuperLayers/Mobs/MI.cs b/Mundus/Data/SuperLayers/Mobs/MI.cs index 1faf580..bc725a6 100644 --- a/Mundus/Data/SuperLayers/Mobs/MI.cs +++ b/Mundus/Data/SuperLayers/Mobs/MI.cs @@ -3,16 +3,16 @@ using Mundus.Service.Mobs.LandMobs; using Mundus.Service.Tiles.ItemPresets; namespace Mundus.Data.Superlayers.Mobs { - public static class MI { //stands for Land Mob Instances + public static class MI { //stands for Mob Instances public static Player Player { get; private set; } - +
+ /// <summary>
+ /// Creates the instances of the universally accessed mobs.
+ /// Note: player has a health of 4 * inventorySize
+ /// </summary> public static void CreateInstances(int inventorySize) { - Player = new Player("player", 20, LI.Land, inventorySize); - } - - public static void CreateInventories(int screenInvSize) { - Player.Inventory.SetNewSizes(screenInvSize); - Player.Inventory.AppendToHotbar(ToolPresets.GetAWoodenAxe()); + Player = new Player("player", 4 * inventorySize, LI.Land, inventorySize);
+ Player.Inventory.AppendToHotbar(ToolPresets.GetAWoodenAxe());
Player.Inventory.AppendToHotbar(ToolPresets.GetAWoodenPickaxe()); } } diff --git a/Mundus/Data/Windows/WI.cs b/Mundus/Data/Windows/WI.cs index 7fd3e99..71f24d4 100644 --- a/Mundus/Data/Windows/WI.cs +++ b/Mundus/Data/Windows/WI.cs @@ -2,6 +2,8 @@ namespace Mundus.Data.Windows { public static class WI { //stands for Window Instances + public const string BuildName = "Build 29-04-2020 No1"; + public static IGameWindow SelWin { get; set; } public static MainWindow WMain { get; private set; } diff --git a/Mundus/Mundus.csproj b/Mundus/Mundus.csproj index c186234..4f4c787 100644 --- a/Mundus/Mundus.csproj +++ b/Mundus/Mundus.csproj @@ -46,7 +46,6 @@ <Reference Include="atk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
- <Reference Include="Mono.Posix" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
diff --git a/Mundus/Program.cs b/Mundus/Program.cs index 120e5a9..7df0dc9 100644 --- a/Mundus/Program.cs +++ b/Mundus/Program.cs @@ -11,11 +11,10 @@ namespace Mundus { public static void Main(string[] args) { Application.Init(); - //All windows that are used by user (instances) are saved and created in WindowInstances.cs + //All windows and dialogues that are used by user (instances) are saved and created in WindowInstances.cs WI.CreateInstances(); DI.CreateInstances(); LI.CreateInstances(); - MI.CreateInstances( 1 ); RI.CreateInstances(); WI.WMain.Show(); diff --git a/Mundus/Service/Calculate.cs b/Mundus/Service/Calculate.cs index 5a8d491..9d2e6c0 100644 --- a/Mundus/Service/Calculate.cs +++ b/Mundus/Service/Calculate.cs @@ -8,8 +8,7 @@ namespace Mundus.Service { *On the edge it doesn't follow the player and only shows the corner "chunk". In the other parts it follows the *the player, making sure he stays in the center of the screen. *This means that when the player is followed, rendered part of the map depend on the player position, but when - *he isn't, it depends on the screen and map sizes.*/
- //kind of hardcoded + *he isn't, it depends on the screen and map sizes.*/ public static int CalculateMaxY(int size) { int maxY = (MI.Player.YPos - size/2 >= 0) ? MI.Player.YPos + size/2 : size - 1; if (maxY >= MapSizes.CurrSize) maxY = MapSizes.CurrSize - 1; diff --git a/Mundus/Service/GameGenerator.cs b/Mundus/Service/GameGenerator.cs index 832f486..61c08e9 100644 --- a/Mundus/Service/GameGenerator.cs +++ b/Mundus/Service/GameGenerator.cs @@ -6,6 +6,10 @@ using Mundus.Service.SuperLayers.Generators; namespace Mundus.Service { public static class GameGenerator { + /// <summary> + /// Sets the map size and starts generation of all superlayers + /// </summary> + /// <param name="size">Size of the map ("small", "medium" or "large")</param> public static void GenerateMap(string size) { switch (size.ToLower()) { case "small": MapSizes.CurrSize = MapSizes.SMALL; break; @@ -19,20 +23,25 @@ namespace Mundus.Service { UndergroundSuperLayerGenerator.GenerateAllLayers(MapSizes.CurrSize); } - public static void GameWindowInventorySetup(string size) { + /// <summary> + /// Sets the game window size and setups mob inventory for certain mobs + /// Note: certain mobs base their inventory size from the game window size + /// </summary> + /// <param name="size">Size of the game window ("small", "medium" or "large")</param> + public static void GameWindowSizeSetup(string size) { switch (size.ToLower()) { case "small": WI.SelWin = WI.WSGame; break; case "medium": WI.SelWin = WI.WMGame; break; case "large": WI.SelWin = WI.WLGame; break; default: throw new ArgumentException("Screen & inventory size must be \"small\", \"medium\" or \"large\""); } - GameWindowInventorySetup(); - } - public static void GameWindowInventorySetup() { WI.SelWin.SetDefaults(); + MI.CreateInstances(WI.SelWin.Size); + } + + public static void GameWindowInitialize() { WI.WPause.GameWindow = WI.SelWin; - MI.CreateInventories(WI.SelWin.Size); WI.SelWin.PrintScreen(); WI.SelWin.PrintMainMenu(); WI.SelWin.Show(); diff --git a/Mundus/Service/Inventory.cs b/Mundus/Service/Inventory.cs index a94e9ec..de9c3ac 100644 --- a/Mundus/Service/Inventory.cs +++ b/Mundus/Service/Inventory.cs @@ -4,16 +4,28 @@ using System.Linq; namespace Mundus.Service { public class Inventory { + /// <summary> + /// Has a size of "Screen and Inventory" and can hold Tools, Materials, Structures and Gear + /// </summary> public ItemTile[] Hotbar { get; set; } + /// <summary> + /// Has a size of the "Screen and Inventory" squared and can hold Tools, Materials, Structures and Gear + /// </summary> public ItemTile[] Items { get; set; } + /// <summary> + /// Has a size of double the "Screen and Inventory" and can only hold Gear + /// </summary> public Gear[] Accessories { get; set; } + /// <summary> + /// Has a size of "Screen and Inventory" and can only hold Gear + /// </summary> public Gear[] Gear { get; set; } public Inventory(int screenInvSize) { - this.SetNewSizes(screenInvSize); + this.SetSizes(screenInvSize); } - public void SetNewSizes(int screenInvSize) { + public void SetSizes(int screenInvSize) { this.Hotbar = new ItemTile[screenInvSize]; this.Items = new ItemTile[screenInvSize * screenInvSize]; this.Accessories = new Gear[screenInvSize * 2]; @@ -68,6 +80,10 @@ namespace Mundus.Service { this.Gear[index] = null; } + /// <summary> + /// Returns an ItemTile depending on specified place ("hotbar", "items", "accessories" or "gear") + /// and specified index + /// </summary> public ItemTile GetItemTile(string place, int index) { ItemTile toReturn = null; @@ -80,6 +96,10 @@ namespace Mundus.Service { return toReturn; } + /// <summary> + /// Deletes an ItemTile depending on specified place ("hotbar", "items", "accessories" or "gear") + /// and specified index + /// </summary> public void DeleteItemTile(string place, int index) { switch (place.ToLower()) { case "hotbar": this.Hotbar[index] = null; break; @@ -89,6 +109,10 @@ namespace Mundus.Service { } } + /// <summary> + /// Returns an ItemTile depending on specified place ("hotbar", "items", "accessories" or "gear") + /// and specified index in player's inventory + /// </summary> public static ItemTile GetPlayerItem(string place, int index) { return Data.Superlayers.Mobs.MI.Player.Inventory.GetItemTile(place, index); } diff --git a/Mundus/Service/Mobs/LandMobs/LandMobsPresets.cs b/Mundus/Service/Mobs/LandMobs/LandMobsPresets.cs index 7d3f2a8..304b5f8 100644 --- a/Mundus/Service/Mobs/LandMobs/LandMobsPresets.cs +++ b/Mundus/Service/Mobs/LandMobs/LandMobsPresets.cs @@ -4,6 +4,9 @@ using Mundus.Service.Tiles; namespace Mundus.Service.Mobs.LandMobs { public static class LandMobsPresets { + /// <summary> + /// Returns a new instance of the cow mob tile + /// </summary> public static MobTile GetACow() { return new MobTile("L_test_icon_mob", 10, LI.Land); } diff --git a/Mundus/Service/Mobs/LandMobs/Player.cs b/Mundus/Service/Mobs/LandMobs/Player.cs index fb4859d..7262429 100644 --- a/Mundus/Service/Mobs/LandMobs/Player.cs +++ b/Mundus/Service/Mobs/LandMobs/Player.cs @@ -1,13 +1,17 @@ -using Mundus.Data.SuperLayers;
+using System.Linq;
+using Mundus.Data.SuperLayers;
using Mundus.Service.Tiles; using Mundus.Service.Tiles.Items; namespace Mundus.Service.Mobs.LandMobs { - public class Player : MobTile { + public class Player : MobTile {
+ /// <summary>
+ /// Note: player has an rndMovementQualifier of -1 and drops first item in the hotbar
+ /// </summary> public Player(string stock_id, int health, ISuperLayer currentSuperLayer, int inventorySize)
- : base(stock_id, health, currentSuperLayer, inventorySize, -1, null)
+ : base(stock_id, health, currentSuperLayer, inventorySize, null, -1)
{ - base.DroppedUponDeath = (Material)Inventory.Hotbar[0]; + this.DroppedUponDeath = (Material)this.Inventory.Hotbar[0];
} } } diff --git a/Mundus/Service/Mobs/MobTile.cs b/Mundus/Service/Mobs/MobTile.cs index 1c0c56b..697b2ec 100644 --- a/Mundus/Service/Mobs/MobTile.cs +++ b/Mundus/Service/Mobs/MobTile.cs @@ -23,7 +23,7 @@ namespace Mundus.Service.Tiles { /// </summary>
public int RndMovementRate { get; protected set; } - public MobTile(string stock_id, int health, ISuperLayer currentSuperLayer, int inventorySize = 5, int rndMovementQualifier = 3, Material droppedUponDeath = null) { + public MobTile(string stock_id, int health, ISuperLayer currentSuperLayer, int inventorySize = 5, Material droppedUponDeath = null, int rndMovementQualifier = 3) { this.stock_id = stock_id; this.Texture = new Image(stock_id, IconSize.Dnd); this.Health = health;
diff --git a/Mundus/Service/SwitchItems.cs b/Mundus/Service/SwitchItems.cs index e1f5b64..e44a02b 100644 --- a/Mundus/Service/SwitchItems.cs +++ b/Mundus/Service/SwitchItems.cs @@ -8,7 +8,13 @@ namespace Mundus.Service { private static ItemTile[] origin = null;
private static int oIndex = -1;
+ /// <summary>
+ /// Sets the item that will be moved (switched)
+ /// </summary>
+ /// <param name="originName">Name of the inventory location of the item ("hotbar", "items", "accessories" or "gear")</param>
+ /// <param name="originIndex">Index of the inventory location of the item</param>
public static void SetOrigin(string originName, int originIndex) {
+ // This method overload only extracts the inventory location as an array
ItemTile[] newOrigin = null;
switch (originName.ToLower()) {
@@ -26,6 +32,11 @@ namespace Mundus.Service { WI.SelWin.PrintSelectedItemInfo(newOrigin[originIndex]);
}
+ /// <summary>
+ /// Tries to switch the location of the originally selected item (origin) with the currently selected item
+ /// </summary>
+ /// <param name="destination">Name of the inventory location of the currently selected item ("hotbar", "items", "accessories" or "gear")</param>
+ /// <param name="destinationIndex">Index of the inventory location of the currently selected item</param>
public static void ReplaceItems(string destination, int destinationIndex) {
ItemTile[] destinationLocation = null;
diff --git a/Mundus/Service/Tiles/ItemPresets/GroundPresets.cs b/Mundus/Service/Tiles/ItemPresets/GroundPresets.cs index 2f349df..76e5d01 100644 --- a/Mundus/Service/Tiles/ItemPresets/GroundPresets.cs +++ b/Mundus/Service/Tiles/ItemPresets/GroundPresets.cs @@ -4,18 +4,23 @@ using Mundus.Service.Tiles.ItemPresets; namespace Mundus.Service.Tiles.ItemPresets { public static class GroundPresets { + /// <summary> + /// Returns a new instance of the sky ground tile + /// </summary> public static GroundTile GetASSky() { return new GroundTile("S_sky", -1, false); } /// <summary> - /// Returns a new instance of the grass ground tile + /// Returns a new instance of the land grass ground tile /// </summary> - /// <returns>New instance of the grass ground tile</returns> public static GroundTile GetALGrass() { return new GroundTile("L_grass", 1); } + /// <summary> + /// Returns a new instance of the underground roche ground tile + /// </summary> public static GroundTile GetAURoche() { return new GroundTile("U_roche", 10); } diff --git a/Mundus/Service/Tiles/ItemPresets/MaterialPresets.cs b/Mundus/Service/Tiles/ItemPresets/MaterialPresets.cs index 08eb7cd..e55fbf1 100644 --- a/Mundus/Service/Tiles/ItemPresets/MaterialPresets.cs +++ b/Mundus/Service/Tiles/ItemPresets/MaterialPresets.cs @@ -3,18 +3,30 @@ using Mundus.Service.Tiles.Items; namespace Mundus.Service.Tiles.ItemPresets { public static class MaterialPresets { + /// <summary> + /// Returns a new instance of the land rock material tile + /// </summary> public static Material GetALandRock() { return new Material("L_rock"); } + /// <summary> + /// Returns a new instance of the stick material tile + /// </summary> public static Material GetAStick() { return new Material("L_stick"); } + /// <summary> + /// (TEMPORARY) + /// </summary> public static Material GetAGrass() { return new Material("L_grass"); } + /// <summary> + /// (TEMPORARY) + /// </summary> public static Material GetAStone() { return new Material("U_stone"); } diff --git a/Mundus/Service/Tiles/ItemPresets/StructurePresets.cs b/Mundus/Service/Tiles/ItemPresets/StructurePresets.cs index 2fb9268..5a9a739 100644 --- a/Mundus/Service/Tiles/ItemPresets/StructurePresets.cs +++ b/Mundus/Service/Tiles/ItemPresets/StructurePresets.cs @@ -4,14 +4,23 @@ using Mundus.Service.Tiles.Items; namespace Mundus.Service.Tiles.ItemPresets { public static class StructurePresets { + /// <summary> + /// Returns a new instance of the land boulder structure + /// </summary> public static Structure GetALBoulder() { return new Structure("L_boulder", "L_boulder_inventory", 7, ToolTypes.Pickaxe, 1, false, false, MaterialPresets.GetALandRock()); } + /// <summary> + /// Returns a new instance of the land tree structure + /// </summary> public static Structure GetALTree() { return new Structure("L_tree", "L_tree_inventory", 5, ToolTypes.Axe, 1, false, false, MaterialPresets.GetAStick()); } + /// <summary> + /// Returns a new instance of the underground rock structure + /// </summary> public static Structure GetAURock() { return new Structure("U_rock", "U_rock", 10, ToolTypes.Pickaxe, 2, false, false, MaterialPresets.GetAStone()); } diff --git a/Mundus/Service/Tiles/Items/GroundTile.cs b/Mundus/Service/Tiles/Items/GroundTile.cs index 4b5eea2..3f31a7f 100644 --- a/Mundus/Service/Tiles/Items/GroundTile.cs +++ b/Mundus/Service/Tiles/Items/GroundTile.cs @@ -3,7 +3,13 @@ using Mundus.Data.Tiles; namespace Mundus.Service.Tiles.Items { public class GroundTile : ItemTile { + /// <summary> + /// Required minimal shovel class for destroying the ground tile + /// </summary> public int ReqShovelClass { get; private set; } + /// <summary> + /// Determines whether mobs can go through and structures can be placed (if not solid) + /// </summary> public bool Solid { get; private set; } public GroundTile(GroundTile groundTile) :this(groundTile.stock_id, groundTile.ReqShovelClass, groundTile.Solid) diff --git a/Mundus/Service/Tiles/Items/Structure.cs b/Mundus/Service/Tiles/Items/Structure.cs index 26fdbba..8423966 100644 --- a/Mundus/Service/Tiles/Items/Structure.cs +++ b/Mundus/Service/Tiles/Items/Structure.cs @@ -2,12 +2,27 @@ public class Structure : ItemTile { private Material droppedMaterial; + /// <summary> + /// stock_id for when the structure is in an inventory + /// </summary> public string inventory_stock_id { get; private set; } + /// <summary> + /// Required type of tool to break the structure + /// </summary> public int ReqToolType { get; private set; } + /// <summary> + /// Required minimal tool class to break the structure + /// </summary> public int ReqToolClass { get; private set; } public int Health { get; private set; } + /// <summary> + /// Determines whether mobs can change superlayers (climb up or down a superlayer ; true) or not (false) + /// </summary> public bool IsClimable { get; private set; } + /// <summary> + /// Determines whether mob can walk on top of the structure (true) or not (false) + /// </summary> public bool IsWalkable { get; private set; } @@ -15,15 +30,6 @@ structure.IsWalkable, (structure.droppedMaterial != null)?new Material(structure.droppedMaterial.stock_id):null) { } - /// <summary> - /// Initializes a new instance of the Stucture class. - /// </summary> - /// <param name="stock_id">Stock identifier.</param> - /// <param name="health">Health.</param> - /// <param name="reqToolType">Required tool type.</param> - /// <param name="reqToolClass">Required tool class.</param> - /// <param name="isWalkable">If set to <c>true</c> is walkable.</param> - /// <param name="droppedMaterial">Dropped material. If null, structure drops itself</param> public Structure(string stock_id, string inventory_stock_id, int health, int reqToolType, int reqToolClass, bool isWalkable = false, bool isClimable = false, Material droppedMaterial = null) : base(stock_id) { this.inventory_stock_id = inventory_stock_id; this.Health = health; @@ -37,7 +43,6 @@ /// <summary> /// Returns what the structure drops after being broken /// </summary> - /// <returns>The drop.</returns> public ItemTile GetDrop() { if (droppedMaterial == null) { return this; @@ -48,7 +53,7 @@ /// <summary> /// Removes health from structure /// </summary> - /// <returns>If the structure can still be damaged</returns> + /// <returns>Whether the structure can still be damaged</returns> public bool Damage(int damagePoints) { this.Health -= damagePoints; return this.Health > 0; diff --git a/Mundus/Service/WindowController.cs b/Mundus/Service/WindowController.cs index 97bb6e7..72a6558 100644 --- a/Mundus/Service/WindowController.cs +++ b/Mundus/Service/WindowController.cs @@ -3,17 +3,26 @@ using Mundus.Data.Windows; namespace Mundus.Service { public static class WindowController { + /// <summary> + /// Shows the settings window and hides the sender + /// </summary> public static void ShowSettingsWindow(Window sender) { sender.Hide(); WI.WSettings.Show(sender); } + /// <summary> + /// Shows the new game window, sets it's default values and hides the sender + /// </summary> public static void ShowNewGameWindow(Window sender) { sender.Hide(); WI.WNewGame.SetDefaults(); WI.WNewGame.Show(); } + /// <summary> + /// Shows the main window and hides the sender + /// </summary> public static void ShowMainWindow(Window sender) { sender.Hide(); WI.WMain.Show(); @@ -21,17 +30,26 @@ namespace Mundus.Service { public static bool PauseWindowVisible { get; set; } + /// <summary> + /// Shows the pause window on top of all windows and "pauses" game input (bool PauseWindowVisible) + /// </summary> public static void ShowPauseWindow() { WI.WPause.Show(); WI.WPause.Present(); PauseWindowVisible = true; } + /// <summary> + /// Shows the music window on top of all windows + /// </summary> public static void ShowMusicWindow() { WI.WMusic.Show(); WI.WMusic.Present(); } + /// <summary> + /// Shows the crafting window on top of all windows and does initializes it + /// </summary> public static void ShowCraftingWindow() { WI.WCrafting.Initialize(); WI.WCrafting.Show(); diff --git a/Mundus/Views/Windows/CraftingWindow.cs b/Mundus/Views/Windows/CraftingWindow.cs index adf61f6..0a087a4 100644 --- a/Mundus/Views/Windows/CraftingWindow.cs +++ b/Mundus/Views/Windows/CraftingWindow.cs @@ -28,6 +28,9 @@ namespace Mundus.Views.Windows { UpdateNextPrevBtns(); } + /// <summary> + /// Sets information values for the currently selected recipe + /// </summary> private void PrintRecipe() { if (Recipes.Length > 0) { ClearScreen(); @@ -68,13 +71,17 @@ namespace Mundus.Views.Windows { } } - - + /// <summary> + /// Selects the previous avalable recipe and updates + /// </summary> protected void OnBtnPrevClicked(object sender, System.EventArgs e) { recipeIndex--; PrintRecipe(); UpdateNextPrevBtns(); } + /// <summary> + /// Selects the following avalable recipe and updates + /// </summary> protected void OnBtnNextClicked(object sender, System.EventArgs e) { recipeIndex++; PrintRecipe(); @@ -86,6 +93,7 @@ namespace Mundus.Views.Windows { btnPrev.Sensitive = recipeIndex > 0; } + // Sets default empty values for required items and their amounts private void ClearScreen() { lblC1.Text = "0"; lblC2.Text = "0"; @@ -100,6 +108,7 @@ namespace Mundus.Views.Windows { imgI5.SetFromStock("empty", IconSize.Dnd); } + // Sets default empty values for the whole window private void Reset() { ClearScreen(); @@ -110,7 +119,6 @@ namespace Mundus.Views.Windows { btnCraft.Sensitive = false; } - protected void OnBtnCraftClicked(object sender, EventArgs e) { CraftingController.CraftItemPlayer(Recipes[recipeIndex]); this.Hide(); diff --git a/Mundus/Views/Windows/MainWindow.cs b/Mundus/Views/Windows/MainWindow.cs index d2d36b4..ae666be 100644 --- a/Mundus/Views/Windows/MainWindow.cs +++ b/Mundus/Views/Windows/MainWindow.cs @@ -6,6 +6,7 @@ namespace Mundus.Views.Windows { public partial class MainWindow : Gtk.Window { public MainWindow() : base( Gtk.WindowType.Toplevel ) { this.Build(); + this.lblBuild.Text = Mundus.Data.Windows.WI.BuildName; } private void OnDeleteEvent(object sender, DeleteEventArgs a) { diff --git a/Mundus/Views/Windows/NewGameWindow.cs b/Mundus/Views/Windows/NewGameWindow.cs index abce12d..61999d7 100644 --- a/Mundus/Views/Windows/NewGameWindow.cs +++ b/Mundus/Views/Windows/NewGameWindow.cs @@ -17,7 +17,10 @@ namespace Mundus.Views.Windows { WindowController.ShowMainWindow(this); } - //You can choose your Map size only in creative, it is predetermined by screen & inventory size in survival. + /// <summary> + /// You can choose your Map size only in creative, it is predetermined by screen & inventory size in survival. + /// </summary> + private void OnRbCreativeToggled(object sender, EventArgs e) { if (rbCreative.Active) { rbMSmall.Sensitive = true; @@ -31,8 +34,6 @@ namespace Mundus.Views.Windows { } } - /*Sometimes the default values get messed up and you could have, for example, - *a large map with large screen & inventory on survival. This prevents that.*/ public void SetDefaults() { rbSurvival.Active = true; rbEasy.Active = true; @@ -78,11 +79,13 @@ namespace Mundus.Views.Windows { //TODO: save settings somewhere this.Hide(); - this.MapGenerate(); this.ScreenInventorySetup(); + this.GenerateMap(); + GameGenerator.GameWindowInitialize(); } - private void MapGenerate() { + // Calls GameGenerator to generate the map depending on the selected map size button + private void GenerateMap() { string size; if (rbMSmall.Active) { size = "small"; @@ -99,7 +102,7 @@ namespace Mundus.Views.Windows { GameGenerator.GenerateMap(size); } - //Does the inital steps that are required by all windows upon game generation + // Does the inital steps that are required by all windows upon game generation private void ScreenInventorySetup() { string gameWindow; @@ -116,7 +119,7 @@ namespace Mundus.Views.Windows { throw new ArgumentException("No screen & inventory size was selected"); } - GameGenerator.GameWindowInventorySetup(gameWindow); + GameGenerator.GameWindowSizeSetup(gameWindow); } } } diff --git a/Mundus/Views/Windows/PauseWindow.cs b/Mundus/Views/Windows/PauseWindow.cs index 7cd5bf9..b67e27c 100644 --- a/Mundus/Views/Windows/PauseWindow.cs +++ b/Mundus/Views/Windows/PauseWindow.cs @@ -8,6 +8,7 @@ namespace Mundus.Views.Windows { public PauseWindow() : base( Gtk.WindowType.Toplevel ) { this.Build(); + this.lblBuild.Text = Mundus.Data.Windows.WI.BuildName; } protected void OnDeleteEvent(object o, Gtk.DeleteEventArgs args) { diff --git a/Mundus/gtk-gui/Mundus.Views.Windows.MainWindow.cs b/Mundus/gtk-gui/Mundus.Views.Windows.MainWindow.cs index b734c09..37b236b 100644 --- a/Mundus/gtk-gui/Mundus.Views.Windows.MainWindow.cs +++ b/Mundus/gtk-gui/Mundus.Views.Windows.MainWindow.cs @@ -47,7 +47,6 @@ namespace Mundus.Views.Windows this.lblBuild.WidthRequest = 300; this.lblBuild.HeightRequest = 20; this.lblBuild.Name = "lblBuild"; - this.lblBuild.LabelProp = "Build 16-04-2020 No2"; this.lblBuild.Justify = ((global::Gtk.Justification)(2)); this.vboxUI.Add(this.lblBuild); global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vboxUI[this.lblBuild])); diff --git a/Mundus/gtk-gui/Mundus.Views.Windows.PauseWindow.cs b/Mundus/gtk-gui/Mundus.Views.Windows.PauseWindow.cs index f6c1e0a..e6adc7f 100644 --- a/Mundus/gtk-gui/Mundus.Views.Windows.PauseWindow.cs +++ b/Mundus/gtk-gui/Mundus.Views.Windows.PauseWindow.cs @@ -59,7 +59,6 @@ namespace Mundus.Views.Windows this.lblBuild.WidthRequest = 300; this.lblBuild.HeightRequest = 20; this.lblBuild.Name = "lblBuild"; - this.lblBuild.LabelProp = "Build 16-04-2020 No2"; this.lblBuild.Justify = ((global::Gtk.Justification)(2)); this.vbox1.Add(this.lblBuild); global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.lblBuild])); diff --git a/Mundus/gtk-gui/gui.stetic b/Mundus/gtk-gui/gui.stetic index 07b976b..5220cf1 100644 --- a/Mundus/gtk-gui/gui.stetic +++ b/Mundus/gtk-gui/gui.stetic @@ -12815,7 +12815,6 @@ <property name="MemberName" /> <property name="WidthRequest">300</property> <property name="HeightRequest">20</property> - <property name="LabelProp">Build 16-04-2020 No2</property> <property name="Justify">Center</property> </widget> <packing> @@ -14016,7 +14015,6 @@ <property name="MemberName" /> <property name="WidthRequest">300</property> <property name="HeightRequest">20</property> - <property name="LabelProp">Build 16-04-2020 No2</property> <property name="Justify">Center</property> </widget> <packing> |
