aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mundus/Data/Windows/WI.cs3
-rw-r--r--Mundus/Mundus.csproj31
-rw-r--r--Mundus/Service/SuperLayers/ImageController.cs1
-rw-r--r--Mundus/Service/Tiles/Items/ItemController.cs91
-rw-r--r--Mundus/Service/Tiles/Items/Presets/GroundPresets.cs4
-rw-r--r--Mundus/Service/Tiles/Items/Presets/MaterialPresets.cs4
-rw-r--r--Mundus/Service/Tiles/Items/Presets/StructurePresets.cs3
-rw-r--r--Mundus/Service/Tiles/Items/Presets/ToolPresets.cs3
-rw-r--r--Mundus/Service/Tiles/Items/SwitchItems.cs95
-rw-r--r--Mundus/Service/Tiles/Items/Types/Gear.cs (renamed from Mundus/Service/Tiles/Items/Gear.cs)2
-rw-r--r--Mundus/Service/Tiles/Items/Types/GroundTile.cs (renamed from Mundus/Service/Tiles/Items/GroundTile.cs)2
-rw-r--r--Mundus/Service/Tiles/Items/Types/Material.cs (renamed from Mundus/Service/Tiles/Items/Material.cs)2
-rw-r--r--Mundus/Service/Tiles/Items/Types/Structure.cs (renamed from Mundus/Service/Tiles/Items/Structure.cs)2
-rw-r--r--Mundus/Service/Tiles/Items/Types/Tool.cs (renamed from Mundus/Service/Tiles/Items/Tool.cs)2
-rw-r--r--Mundus/Service/Tiles/Mobs/Controllers/MobFighting.cs22
-rw-r--r--Mundus/Service/Tiles/Mobs/Controllers/MobTerraforming.cs29
-rw-r--r--Mundus/Service/Tiles/Mobs/Inventory.cs42
-rw-r--r--Mundus/Service/Tiles/Mobs/LandMobs/Player.cs1
-rw-r--r--Mundus/Service/Tiles/Mobs/MobTile.cs1
-rw-r--r--Mundus/Service/Windows/Calculate.cs (renamed from Mundus/Service/Calculate.cs)2
-rw-r--r--Mundus/Service/Windows/WindowController.cs (renamed from Mundus/Service/WindowController.cs)43
-rw-r--r--Mundus/Views/Windows/GameWindows/IGameWindow.cs2
-rw-r--r--Mundus/Views/Windows/GameWindows/Large/LargeButtonClickedEvents.cs401
-rw-r--r--Mundus/Views/Windows/GameWindows/Large/LargeLogic.cs769
-rw-r--r--Mundus/Views/Windows/GameWindows/Large/LargePrinting.cs3
-rw-r--r--Mundus/Views/Windows/GameWindows/Medium/MediumButtonClickedEvents.cs257
-rw-r--r--Mundus/Views/Windows/GameWindows/Medium/MediumLogic.cs83
-rw-r--r--Mundus/Views/Windows/GameWindows/Medium/MediumPrinting.cs3
-rw-r--r--Mundus/Views/Windows/GameWindows/Small/SmallButtonClickedEvents.cs145
-rw-r--r--Mundus/Views/Windows/GameWindows/Small/SmallLogic.cs79
-rw-r--r--Mundus/Views/Windows/GameWindows/Small/SmallPrinting.cs3
-rw-r--r--Mundus/Views/Windows/MainWindow.cs2
-rw-r--r--Mundus/Views/Windows/NewGameWindow.cs1
-rw-r--r--Mundus/Views/Windows/PauseWindow.cs2
-rw-r--r--Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Large.LargeGameWindow.cs (renamed from Mundus/gtk-gui/Mundus.Views.Windows.LargeGameWindow.cs)8
-rw-r--r--Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Medium.MediumGameWindow.cs (renamed from Mundus/gtk-gui/Mundus.Views.Windows.MediumGameWindow.cs)8
-rw-r--r--Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Small.SmallGameWindow.cs (renamed from Mundus/gtk-gui/Mundus.Views.Windows.SmallGameWindow.cs)8
-rw-r--r--Mundus/gtk-gui/Mundus.Views.Windows.NewGameWindow.cs4
-rw-r--r--Mundus/gtk-gui/gui.stetic6
39 files changed, 1027 insertions, 1142 deletions
diff --git a/Mundus/Data/Windows/WI.cs b/Mundus/Data/Windows/WI.cs
index 0aa04a2..14e5f6e 100644
--- a/Mundus/Data/Windows/WI.cs
+++ b/Mundus/Data/Windows/WI.cs
@@ -1,6 +1,9 @@
namespace Mundus.Data.Windows
{
using Mundus.Views.Windows;
+ using Mundus.Views.Windows.GameWindows.Large;
+ using Mundus.Views.Windows.GameWindows.Medium;
+ using Mundus.Views.Windows.GameWindows.Small;
/// <summary>
/// Used to store universally accessed windows
diff --git a/Mundus/Mundus.csproj b/Mundus/Mundus.csproj
index 1264034..ec15c2d 100644
--- a/Mundus/Mundus.csproj
+++ b/Mundus/Mundus.csproj
@@ -17,6 +17,7 @@
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <DocumentationFile>bin\Debug\Mundus.xml</DocumentationFile>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
@@ -247,9 +248,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Views\Windows\NewGameWindow.cs" />
<Compile Include="gtk-gui\Mundus.Views.Windows.NewGameWindow.cs" />
- <Compile Include="gtk-gui\Mundus.Views.Windows.SmallGameWindow.cs" />
- <Compile Include="gtk-gui\Mundus.Views.Windows.MediumGameWindow.cs" />
- <Compile Include="gtk-gui\Mundus.Views.Windows.LargeGameWindow.cs" />
+ <Compile Include="gtk-gui\Mundus.Views.Windows.GameWindows.Small.SmallGameWindow.cs" />
+ <Compile Include="gtk-gui\Mundus.Views.Windows.GameWindows.Medium.MediumGameWindow.cs" />
+ <Compile Include="gtk-gui\Mundus.Views.Windows.GameWindows.Large.LargeGameWindow.cs" />
<Compile Include="Views\Windows\SettingsWindow.cs" />
<Compile Include="gtk-gui\Mundus.Views.Windows.SettingsWindow.cs" />
<Compile Include="Views\Windows\PauseWindow.cs" />
@@ -264,20 +265,12 @@
<Compile Include="gtk-gui\Mundus.Views.Dialogs.ExitDialog.cs" />
<Compile Include="Service\Tiles\ITile.cs" />
<Compile Include="Service\SuperLayers\ImageController.cs" />
- <Compile Include="Service\Calculate.cs" />
<Compile Include="Data\Windows\WI.cs" />
<Compile Include="Data\Dialogues\DI.cs" />
<Compile Include="Data\SuperLayers\Mobs\MI.cs" />
- <Compile Include="Service\WindowController.cs" />
<Compile Include="Service\GameGenerator.cs" />
- <Compile Include="Service\Tiles\Items\ItemTile.cs" />
- <Compile Include="Service\Tiles\Items\Tool.cs" />
- <Compile Include="Service\Tiles\Items\Structure.cs" />
- <Compile Include="Service\Tiles\Items\Material.cs" />
- <Compile Include="Service\Tiles\Items\Gear.cs" />
<Compile Include="Service\SuperLayers\Generators\LandSuperLayerGenerator.cs" />
<Compile Include="Service\SuperLayers\Generators\UndergroundSuperLayerGenerator.cs" />
- <Compile Include="Service\Tiles\Items\GroundTile.cs" />
<Compile Include="Service\SuperLayers\HeightController.cs" />
<Compile Include="Service\SuperLayers\Generators\SkySuperLayerGenerator.cs" />
<Compile Include="Service\GameEventLogController.cs" />
@@ -291,9 +284,6 @@
<Compile Include="Service\Tiles\Mobs\LandMobs\Player.cs" />
<Compile Include="Service\Tiles\Mobs\MobTile.cs" />
<Compile Include="Service\Tiles\Mobs\Inventory.cs" />
- <Compile Include="Service\Tiles\Items\SwitchItems.cs">
- <IncludeInPackage>true</IncludeInPackage>
- </Compile>
<Compile Include="Service\Tiles\Crafting\CraftingController.cs" />
<Compile Include="Service\Tiles\Crafting\CraftingRecipe.cs" />
<Compile Include="Service\Tiles\Items\Presets\GroundPresets.cs" />
@@ -333,6 +323,15 @@
<Compile Include="Views\Windows\GameWindows\Large\LargeLogic.cs" />
<Compile Include="Views\Windows\GameWindows\Large\LargeButtonClickedEvents.cs" />
<Compile Include="Views\Windows\GameWindows\Large\LargePrinting.cs" />
+ <Compile Include="Service\Windows\WindowController.cs" />
+ <Compile Include="Service\Windows\Calculate.cs" />
+ <Compile Include="Service\Tiles\Items\ItemController.cs" />
+ <Compile Include="Service\Tiles\Items\Types\Gear.cs" />
+ <Compile Include="Service\Tiles\Items\Types\GroundTile.cs" />
+ <Compile Include="Service\Tiles\Items\Types\Material.cs" />
+ <Compile Include="Service\Tiles\Items\Types\Structure.cs" />
+ <Compile Include="Service\Tiles\Items\Types\Tool.cs" />
+ <Compile Include="Service\Tiles\Items\ItemTile.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Service\" />
@@ -362,6 +361,8 @@
<Folder Include="Views\Windows\GameWindows\Small\" />
<Folder Include="Views\Windows\GameWindows\Medium\" />
<Folder Include="Views\Windows\GameWindows\Large\" />
+ <Folder Include="Service\Windows\" />
+ <Folder Include="Service\Tiles\Items\Types\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -369,4 +370,4 @@
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.1.1.1\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.1.1.1\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
-</Project> \ No newline at end of file
+</Project>
diff --git a/Mundus/Service/SuperLayers/ImageController.cs b/Mundus/Service/SuperLayers/ImageController.cs
index 2e598d2..aafd487 100644
--- a/Mundus/Service/SuperLayers/ImageController.cs
+++ b/Mundus/Service/SuperLayers/ImageController.cs
@@ -3,6 +3,7 @@ using Mundus.Data;
using Mundus.Data.Superlayers.Mobs;
using Mundus.Data.SuperLayers;
using Mundus.Service.Tiles.Items;
+using Mundus.Service.Tiles.Items.Types;
using static Mundus.Data.Values;
namespace Mundus.Service.SuperLayers {
diff --git a/Mundus/Service/Tiles/Items/ItemController.cs b/Mundus/Service/Tiles/Items/ItemController.cs
new file mode 100644
index 0000000..13e03cd
--- /dev/null
+++ b/Mundus/Service/Tiles/Items/ItemController.cs
@@ -0,0 +1,91 @@
+using System;
+using Mundus.Data;
+using Mundus.Data.Superlayers.Mobs;
+using Mundus.Data.Windows;
+using Mundus.Service.Tiles.Items.Types;
+using static Mundus.Data.Values;
+using static Mundus.Service.Tiles.Mobs.Inventory;
+
+namespace Mundus.Service.Tiles.Items {
+ public static class ItemController {
+ private static ItemTile[] selItemLocation;
+ public static int SelItemIndex { get; private set; }
+
+ public static InventoryPlace SelItemPlace { get; private set; }
+
+ /// <summary>
+ /// Sets the item that will be moved (switched)
+ /// </summary>
+ public static void SelectItem(InventoryPlace place, int index) {
+ SelItemPlace = place;
+ selItemLocation = GetInventoryArray(place);
+ SelItemIndex = index;
+
+ WI.SelWin.PrintSelectedItemInfo(selItemLocation[SelItemIndex]);
+ }
+
+ /// <summary>
+ /// Tries to switch the location of the originally selected item (origin) with the currently selected item
+ /// </summary>
+ public static void SwitchItems(InventoryPlace destination, int index) {
+ ItemTile[] destinationLocation = GetInventoryArray(destination);
+ ItemTile toTransfer = selItemLocation[SelItemIndex];
+
+ if (toTransfer != null) {
+ // Consumable materials can be consumed by double clicking on them (transfering them to their current location)
+ if (toTransfer == destinationLocation[index]) {
+ if (toTransfer.GetType() == typeof(Material) &&
+ PlayerTryEat((Material)toTransfer)) {
+ selItemLocation[SelItemIndex] = null;
+ }
+ }
+ else if (ItemCanGoThere(toTransfer, destination)) {
+ selItemLocation[SelItemIndex] = destinationLocation[index];
+ destinationLocation[index] = toTransfer;
+ }
+ }
+
+ ResetSelection();
+ }
+
+ public static void ResetSelection() {
+ selItemLocation = null;
+ SelItemIndex = -1;
+
+ SelItemPlace = 0;
+ }
+
+ // Certain item types can only be placed inside certain inventory places.
+ private static ItemTile[] GetInventoryArray(InventoryPlace place) {
+ switch (place) {
+ case InventoryPlace.Hotbar: return MI.Player.Inventory.Hotbar;
+ case InventoryPlace.Items: return MI.Player.Inventory.Items;
+ case InventoryPlace.Accessories: return MI.Player.Inventory.Accessories;
+ case InventoryPlace.Gear: return MI.Player.Inventory.Gear;
+ default: throw new System.ArgumentException($"Destination of itemtile must be either \"hotbar\", \"items\", \"accessories\" or \"gear\", not {place}");
+ }
+ }
+
+ private static bool ItemCanGoThere(ItemTile toTransfer, InventoryPlace place) {
+ switch (place) {
+ case InventoryPlace.Hotbar: return toTransfer.GetType() != typeof(GroundTile);
+ case InventoryPlace.Items: return true;
+ case InventoryPlace.Accessories: return toTransfer.GetType() == typeof(Gear);
+ case InventoryPlace.Gear: return toTransfer.GetType() == typeof(Gear);
+ default: throw new System.ArgumentException($"Destination of itemtile {toTransfer.stock_id} must be either \"hotbar\", \"items\", \"accessories\" or \"gear\", not {place}");
+ }
+ }
+
+ public static bool HasSelectedItem() {
+ return selItemLocation != null && SelItemIndex != -1;
+ }
+
+ private static bool PlayerTryEat(Material material) {
+ if (material.EnergyRestorePoints > 0) {
+ MI.Player.RestoreEnergy(material.EnergyRestorePoints);
+ return true;
+ }
+ return false;
+ }
+ }
+}
diff --git a/Mundus/Service/Tiles/Items/Presets/GroundPresets.cs b/Mundus/Service/Tiles/Items/Presets/GroundPresets.cs
index 2222fa4..9ec33eb 100644
--- a/Mundus/Service/Tiles/Items/Presets/GroundPresets.cs
+++ b/Mundus/Service/Tiles/Items/Presets/GroundPresets.cs
@@ -1,4 +1,6 @@
-namespace Mundus.Service.Tiles.Items.Presets {
+using Mundus.Service.Tiles.Items.Types;
+
+namespace Mundus.Service.Tiles.Items.Presets {
public static class GroundPresets {
private static GroundTile sSky = new GroundTile("S_sky", -1, false);
private static GroundTile lGrass = new GroundTile("L_grass", 1);
diff --git a/Mundus/Service/Tiles/Items/Presets/MaterialPresets.cs b/Mundus/Service/Tiles/Items/Presets/MaterialPresets.cs
index 491513e..0f2d44b 100644
--- a/Mundus/Service/Tiles/Items/Presets/MaterialPresets.cs
+++ b/Mundus/Service/Tiles/Items/Presets/MaterialPresets.cs
@@ -1,4 +1,6 @@
-namespace Mundus.Service.Tiles.Items.Presets {
+using Mundus.Service.Tiles.Items.Types;
+
+namespace Mundus.Service.Tiles.Items.Presets {
public static class MaterialPresets {
/// <returns>New instance</returns>
public static Material GetALandRock() {
diff --git a/Mundus/Service/Tiles/Items/Presets/StructurePresets.cs b/Mundus/Service/Tiles/Items/Presets/StructurePresets.cs
index 815d4a1..f2ca7ea 100644
--- a/Mundus/Service/Tiles/Items/Presets/StructurePresets.cs
+++ b/Mundus/Service/Tiles/Items/Presets/StructurePresets.cs
@@ -1,4 +1,5 @@
-using static Mundus.Data.Values;
+using Mundus.Service.Tiles.Items.Types;
+using static Mundus.Data.Values;
namespace Mundus.Service.Tiles.Items.Presets {
public static class StructurePresets {
diff --git a/Mundus/Service/Tiles/Items/Presets/ToolPresets.cs b/Mundus/Service/Tiles/Items/Presets/ToolPresets.cs
index 6bac612..791e77c 100644
--- a/Mundus/Service/Tiles/Items/Presets/ToolPresets.cs
+++ b/Mundus/Service/Tiles/Items/Presets/ToolPresets.cs
@@ -1,4 +1,5 @@
-using static Mundus.Data.Values;
+using Mundus.Service.Tiles.Items.Types;
+using static Mundus.Data.Values;
namespace Mundus.Service.Tiles.Items.Presets {
public static class ToolPresets {
diff --git a/Mundus/Service/Tiles/Items/SwitchItems.cs b/Mundus/Service/Tiles/Items/SwitchItems.cs
deleted file mode 100644
index c10baad..0000000
--- a/Mundus/Service/Tiles/Items/SwitchItems.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-using Mundus.Data.Superlayers.Mobs;
-using Mundus.Data.Windows;
-
-namespace Mundus.Service.Tiles.Items {
- public static class SwitchItems {
- 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()) {
- case "hotbar": newOrigin = MI.Player.Inventory.Hotbar; break;
- case "items": newOrigin = MI.Player.Inventory.Items; break;
- case "accessories": newOrigin = MI.Player.Inventory.Accessories; break;
- case "gear": newOrigin = MI.Player.Inventory.Gear; break;
- }
- SetOrigin(newOrigin, originIndex);
- }
-
- private static void SetOrigin(ItemTile[] newOrigin, int originIndex) {
- origin = newOrigin;
- oIndex = originIndex;
- 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) {
- destination = destination.ToLower(); // just in case
-
- ItemTile[] destinationLocation = DestinationArray(destination);
- ItemTile toTransfer = origin[oIndex];
-
- if (toTransfer != null) {
- // Consumable materials can be consumed by double clicking on them (transfering them to their current location)
- if (toTransfer == destinationLocation[destinationIndex]) {
- if (toTransfer.GetType() == typeof(Material) &&
- PlayerTryEat((Material)toTransfer)) {
- origin[oIndex] = null;
- }
- }
- else if (ItemCanGoThere(toTransfer, destination)) {
- origin[oIndex] = destinationLocation[destinationIndex];
- destinationLocation[destinationIndex] = toTransfer;
- }
- }
-
- origin = null;
- oIndex = -1;
- }
-
- // Certain item types can only be placed inside certain inventory places.
- private static ItemTile[] DestinationArray(string destination) {
- switch (destination) {
- case "hotbar": return MI.Player.Inventory.Hotbar;
- case "items": return MI.Player.Inventory.Items;
- case "accessories": return MI.Player.Inventory.Accessories;
- case "gear": return MI.Player.Inventory.Gear;
- default: throw new System.ArgumentException($"Destination of itemtile must be either \"hotbar\", \"items\", \"accessories\" or \"gear\", not {destination}");
- }
- }
-
- private static bool ItemCanGoThere(ItemTile toTransfer, string destination) {
- switch (destination) {
- case "hotbar": return toTransfer.GetType() != typeof(GroundTile);
- case "items": return true;
- case "accessories": return toTransfer.GetType() == typeof(Gear);
- case "gear": return toTransfer.GetType() == typeof(Gear);
- default: throw new System.ArgumentException($"Destination of itemtile {toTransfer.stock_id} must be either \"hotbar\", \"items\", \"accessories\" or \"gear\", not {destination}");
- }
- }
-
- public static bool HasOrigin() {
- return origin != null && oIndex != -1;
- }
-
- private static bool PlayerTryEat(Material material) {
- if (material.EnergyRestorePoints > 0) {
- MI.Player.RestoreEnergy(material.EnergyRestorePoints);
- return true;
- }
- return false;
- }
- }
-}
diff --git a/Mundus/Service/Tiles/Items/Gear.cs b/Mundus/Service/Tiles/Items/Types/Gear.cs
index 7beef40..52f8d9d 100644
--- a/Mundus/Service/Tiles/Items/Gear.cs
+++ b/Mundus/Service/Tiles/Items/Types/Gear.cs
@@ -1,4 +1,4 @@
-namespace Mundus.Service.Tiles.Items {
+namespace Mundus.Service.Tiles.Items.Types {
public class Gear : ItemTile {
public Gear(Gear gear) : base(gear.stock_id)
{ }
diff --git a/Mundus/Service/Tiles/Items/GroundTile.cs b/Mundus/Service/Tiles/Items/Types/GroundTile.cs
index e6657d2..215ff96 100644
--- a/Mundus/Service/Tiles/Items/GroundTile.cs
+++ b/Mundus/Service/Tiles/Items/Types/GroundTile.cs
@@ -1,7 +1,7 @@
using Gtk;
using static Mundus.Data.Values;
-namespace Mundus.Service.Tiles.Items {
+namespace Mundus.Service.Tiles.Items.Types {
public class GroundTile : ItemTile {
/// <summary>
/// Required minimal shovel class for destroying the ground tile
diff --git a/Mundus/Service/Tiles/Items/Material.cs b/Mundus/Service/Tiles/Items/Types/Material.cs
index 5a1931a..565713e 100644
--- a/Mundus/Service/Tiles/Items/Material.cs
+++ b/Mundus/Service/Tiles/Items/Types/Material.cs
@@ -1,4 +1,4 @@
-namespace Mundus.Service.Tiles.Items {
+namespace Mundus.Service.Tiles.Items.Types {
public class Material : ItemTile {
/// <summary>
/// Certain materials can be eaten to replenish energy points. This stores by how much to restore energy points.
diff --git a/Mundus/Service/Tiles/Items/Structure.cs b/Mundus/Service/Tiles/Items/Types/Structure.cs
index 8db23ad..8b84978 100644
--- a/Mundus/Service/Tiles/Items/Structure.cs
+++ b/Mundus/Service/Tiles/Items/Types/Structure.cs
@@ -1,6 +1,6 @@
using static Mundus.Data.Values;
-namespace Mundus.Service.Tiles.Items {
+namespace Mundus.Service.Tiles.Items.Types {
public class Structure : ItemTile {
private Material droppedMaterial;
diff --git a/Mundus/Service/Tiles/Items/Tool.cs b/Mundus/Service/Tiles/Items/Types/Tool.cs
index deb5a01..424a15a 100644
--- a/Mundus/Service/Tiles/Items/Tool.cs
+++ b/Mundus/Service/Tiles/Items/Types/Tool.cs
@@ -1,6 +1,6 @@
using static Mundus.Data.Values;
-namespace Mundus.Service.Tiles.Items {
+namespace Mundus.Service.Tiles.Items.Types {
public class Tool : ItemTile {
public ToolType Type { get; private set; }
public int Class { get; private set; }
diff --git a/Mundus/Service/Tiles/Mobs/Controllers/MobFighting.cs b/Mundus/Service/Tiles/Mobs/Controllers/MobFighting.cs
index 07a67c6..3b813d3 100644
--- a/Mundus/Service/Tiles/Mobs/Controllers/MobFighting.cs
+++ b/Mundus/Service/Tiles/Mobs/Controllers/MobFighting.cs
@@ -2,8 +2,8 @@
using Mundus.Data;
using Mundus.Data.Superlayers.Mobs;
using Mundus.Service.Tiles.Items;
+using Mundus.Service.Tiles.Items.Types;
using Mundus.Service.Tiles.Mobs.LandMobs;
-using static Mundus.Data.Values;
namespace Mundus.Service.Tiles.Mobs.Controllers {
public static class MobFighting {
@@ -35,16 +35,16 @@ namespace Mundus.Service.Tiles.Mobs.Controllers {
/// <param name="selIndex">Inventory index of the selected item place (item will be checked if its a valid tool)</param>
/// <param name="mapYPos">YPos of target mob</param>
/// <param name="mapXPos">XPos of target mob</param>
- public static void PlayerTryFight(string selPlace, int selIndex, int mapYPos, int mapXPos) {
- if (MobTryFight(MI.Player, selPlace, selIndex, mapYPos, mapXPos)) {
- MI.Player.DrainEnergy(TAKEN_ENERGY_FROM_FIGHTING + DifficultyValueModifier());
+ public static void PlayerTryFight(int mapYPos, int mapXPos) {
+ if (MobTryFight(MI.Player, mapYPos, mapXPos)) {
+ MI.Player.DrainEnergy(TAKEN_ENERGY_FROM_FIGHTING + Values.DifficultyValueModifier());
}
}
// Checks if the mob has a proper fighting item selected
- private static bool MobCanFight(MobTile mob, string selPlace, int selIndex, int mapYPos, int mapXPos) {
- return Inventory.GetPlayerItem(selPlace, selIndex).GetType() == typeof(Tool) &&
- ((Tool)Inventory.GetPlayerItem(selPlace, selIndex)).Type == ToolType.Sword &&
+ private static bool MobCanFight(MobTile mob, int mapYPos, int mapXPos) {
+ return Inventory.GetPlayerItemFromItemSelection().GetType() == typeof(Tool) &&
+ ((Tool)Inventory.GetPlayerItemFromItemSelection()).Type == Values.ToolType.Sword &&
mob.CurrSuperLayer.GetMobLayerStock(mapYPos, mapXPos) != null;
}
@@ -58,9 +58,9 @@ namespace Mundus.Service.Tiles.Mobs.Controllers {
/// <param name="selIndex">Inventory index of the selected item place (item will be checked if its a valid tool)</param>
/// <param name="mapYPos">YPos of target mob</param>
/// <param name="mapXPos">XPos of target mob</param>
- public static bool MobTryFight(MobTile mob, string selPlace, int selIndex, int mapYPos, int mapXPos) {
- if (MobCanFight(mob, selPlace, selIndex, mapYPos, mapXPos)) {
- Tool selTool = (Tool)Inventory.GetPlayerItem(selPlace, selIndex);
+ public static bool MobTryFight(MobTile mob, int mapYPos, int mapXPos) {
+ if (MobCanFight(mob, mapYPos, mapXPos)) {
+ Tool selTool = (Tool)Inventory.GetPlayerItemFromItemSelection();
MobTile targetMob = LandMobsPresets.GetFromStock(mob.CurrSuperLayer.GetMobLayerStock(mapYPos, mapXPos));
if (selTool.Class >= targetMob.Defense) {
@@ -89,7 +89,7 @@ namespace Mundus.Service.Tiles.Mobs.Controllers {
GameEventLogController.AddMessage($"There is no mob to fight on \"{mob.CurrSuperLayer}\" at Y:{mapYPos}, X:{mapXPos}");
}
else if (mob.GetType() == typeof(Player)) { // Inventory.GetPlayerItem(selPlace, selIndex).GetType() != typeof(Tool) || ((Tool)Inventory.GetPlayerItem(selPlace, selIndex)).Type != ToolTypes.Sword
- GameEventLogController.AddMessage($"You need a Tool of type {ToolType.Sword} to fight with other mobs");
+ GameEventLogController.AddMessage($"You need a Tool of type {Values.ToolType.Sword} to fight with other mobs");
}
return false;
}
diff --git a/Mundus/Service/Tiles/Mobs/Controllers/MobTerraforming.cs b/Mundus/Service/Tiles/Mobs/Controllers/MobTerraforming.cs
index e4ba86c..0e641f8 100644
--- a/Mundus/Service/Tiles/Mobs/Controllers/MobTerraforming.cs
+++ b/Mundus/Service/Tiles/Mobs/Controllers/MobTerraforming.cs
@@ -6,22 +6,21 @@ using Mundus.Service.SuperLayers;
using Mundus.Service.Tiles.Items;
using Mundus.Service.Tiles.Items.Presets;
using Mundus.Data;
+using Mundus.Service.Tiles.Items.Types;
namespace Mundus.Service.Tiles.Mobs.Controllers {
public static class MobTerraforming {
/// <summary>
/// Tries to place a selected structure/ground tile or to mine/dig (destroy) at the selected location
/// </summary>
- /// <param name="inventoryPlace">Place where the selected item is located ("hotbar", "items", ...)</param>
- /// <param name="inventoryIndex">Index of the place where the item is located</param>
- public static void PlayerTerraformAt(int mapYPos, int mapXPos, string inventoryPlace, int inventoryIndex) {
- var selectedItemType = Inventory.GetPlayerItem(inventoryPlace, inventoryIndex).GetType();
+ public static void PlayerTerraformAt(int mapYPos, int mapXPos) {
+ var selectedItemType = Inventory.GetPlayerItemFromItemSelection().GetType();
// If player can place strucure
if (selectedItemType == typeof(Structure)) {
if (PlayerCanBuildStructureAt(mapYPos, mapXPos)) {
- PlayerBuildStructureAt(mapYPos, mapXPos, inventoryPlace, inventoryIndex);
- MI.Player.Inventory.DeleteItemTile(inventoryPlace, inventoryIndex);
+ PlayerBuildStructureAt(mapYPos, mapXPos);
+ Inventory.DeletePlayerItemTileFromItemSelection();
}
else {
GameEventLogController.AddMessage($"Cannot build structure at Y:{mapYPos}, X:{mapXPos}");
@@ -31,8 +30,8 @@ namespace Mundus.Service.Tiles.Mobs.Controllers {
// If Player can place ground
else if (selectedItemType == typeof(GroundTile)) {
if (PlayerCanPlaceGroundAt(mapYPos, mapXPos)) {
- PlayerPlaceGroundAt(mapYPos, mapXPos, inventoryPlace, inventoryIndex);
- MI.Player.Inventory.DeleteItemTile(inventoryPlace, inventoryIndex);
+ PlayerPlaceGroundAt(mapYPos, mapXPos);
+ Inventory.DeletePlayerItemTileFromItemSelection();
}
else {
GameEventLogController.AddMessage($"Cannot place ground at Y:{mapYPos}, X:{mapXPos}");
@@ -41,7 +40,7 @@ namespace Mundus.Service.Tiles.Mobs.Controllers {
// If player can mine/dig
else if (selectedItemType == typeof(Tool)) {
if (PlayerCanDestroyAt(mapYPos, mapXPos)) {
- PlayerDestroyAt(mapYPos, mapXPos, inventoryPlace, inventoryIndex);
+ PlayerDestroyAt(mapYPos, mapXPos);
}
else {
GameEventLogController.AddMessage($"Cannot destroy at Y:{mapYPos}, X:{mapXPos}");
@@ -56,8 +55,8 @@ namespace Mundus.Service.Tiles.Mobs.Controllers {
}
private const double ENERGY_TAKEN_FROM_DESTROYING = 0.6;
- private static void PlayerDestroyAt(int mapYPos, int mapXPos, string place, int index) {
- var selectedTool = (Tool)MI.Player.Inventory.GetItemTile(place, index);
+ private static void PlayerDestroyAt(int mapYPos, int mapXPos) {
+ var selectedTool = (Tool)Inventory.GetPlayerItemFromItemSelection();
// Only shovels can destroy ground layer tiles, but not when there is something over the ground tile
if (selectedTool.Type == ToolType.Shovel && MI.Player.CurrSuperLayer.GetStructureLayerStock(mapYPos, mapXPos) == null) {
@@ -150,8 +149,8 @@ namespace Mundus.Service.Tiles.Mobs.Controllers {
}
private const double ENERGY_TAKEN_FROM_PLACING_GROUND = 0.4;
- private static void PlayerPlaceGroundAt(int yPos, int xPos, string inventoryPlace, int inventoryIndex) {
- GroundTile toPlace = (GroundTile)MI.Player.Inventory.GetItemTile(inventoryPlace, inventoryIndex);
+ private static void PlayerPlaceGroundAt(int yPos, int xPos) {
+ GroundTile toPlace = (GroundTile)Inventory.GetPlayerItemFromItemSelection();
MI.Player.CurrSuperLayer.SetGroundAtPosition(toPlace.stock_id, yPos, xPos);
MI.Player.DrainEnergy(ENERGY_TAKEN_FROM_PLACING_GROUND + Values.DifficultyValueModifier());
@@ -165,8 +164,8 @@ namespace Mundus.Service.Tiles.Mobs.Controllers {
}
private const double ENERGY_TAKEN_FROM_BUILDING_STRUCTURE = 0.5;
- private static void PlayerBuildStructureAt(int yPos, int xPos, string inventoryPlace, int inventoryIndex) {
- Structure toBuild = (Structure)MI.Player.Inventory.GetItemTile(inventoryPlace, inventoryIndex);
+ private static void PlayerBuildStructureAt(int yPos, int xPos) {
+ Structure toBuild = (Structure)Inventory.GetPlayerItemFromItemSelection();
// Climable structures will be placed under a hole (if they can be).
// Non climable structures won't be placed anywhere if there is a hole.
diff --git a/Mundus/Service/Tiles/Mobs/Inventory.cs b/Mundus/Service/Tiles/Mobs/Inventory.cs
index 58e1767..ae4f141 100644
--- a/Mundus/Service/Tiles/Mobs/Inventory.cs
+++ b/Mundus/Service/Tiles/Mobs/Inventory.cs
@@ -1,9 +1,17 @@
using Mundus.Service.Tiles.Items;
+using Mundus.Service.Tiles.Items.Types;
using System;
using System.Linq;
namespace Mundus.Service.Tiles.Mobs {
public class Inventory {
+ public enum InventoryPlace {
+ Hotbar,
+ Items,
+ Accessories,
+ Gear
+ }
+
/// <summary>
/// Has a size of "Screen and Inventory" and can hold Tools, Materials, Structures and Gear
/// </summary>
@@ -84,14 +92,14 @@ namespace Mundus.Service.Tiles.Mobs {
/// Returns an ItemTile depending on specified place ("hotbar", "items", "accessories" or "gear")
/// and specified index
/// </summary>
- public ItemTile GetItemTile(string place, int index) {
+ public ItemTile GetItemTile(InventoryPlace place, int index) {
ItemTile toReturn = null;
- switch (place.ToLower()) {
- case "hotbar": toReturn = this.Hotbar[index]; break;
- case "items": toReturn = this.Items[index]; break;
- case "accessories": toReturn = this.Accessories[index]; break;
- case "gear": toReturn = this.Gear[index]; break;
+ switch (place) {
+ case InventoryPlace.Hotbar: toReturn = this.Hotbar[index]; break;
+ case InventoryPlace.Items: toReturn = this.Items[index]; break;
+ case InventoryPlace.Accessories: toReturn = this.Accessories[index]; break;
+ case InventoryPlace.Gear: toReturn = this.Gear[index]; break;
}
return toReturn;
}
@@ -100,21 +108,25 @@ namespace Mundus.Service.Tiles.Mobs {
/// 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;
- case "items": this.Items[index] = null; break;
- case "accessories": this.Accessories[index] = null; break;
- case "gear": this.Gear[index] = null; break;
- }
+ public static void DeletePlayerItemTileFromItemSelection() {
+ Data.Superlayers.Mobs.MI.Player.Inventory.DeleteItem(ItemController.SelItemPlace, ItemController.SelItemIndex);
}
/// <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);
+ public static ItemTile GetPlayerItemFromItemSelection() {
+ return Data.Superlayers.Mobs.MI.Player.Inventory.GetItemTile(ItemController.SelItemPlace, ItemController.SelItemIndex);
+ }
+
+ public void DeleteItem(InventoryPlace place, int index) {
+ switch (place) {
+ case InventoryPlace.Hotbar: this.Hotbar[index] = null; break;
+ case InventoryPlace.Items: this.Items[index] = null; break;
+ case InventoryPlace.Accessories: this.Accessories[index] = null; break;
+ case InventoryPlace.Gear: this.Gear[index] = null; break;
+ }
}
}
}
diff --git a/Mundus/Service/Tiles/Mobs/LandMobs/Player.cs b/Mundus/Service/Tiles/Mobs/LandMobs/Player.cs
index 80c10d9..f7a1329 100644
--- a/Mundus/Service/Tiles/Mobs/LandMobs/Player.cs
+++ b/Mundus/Service/Tiles/Mobs/LandMobs/Player.cs
@@ -2,6 +2,7 @@
using Mundus.Data.SuperLayers;
using Mundus.Data.Windows;
using Mundus.Service.Tiles.Items;
+using Mundus.Service.Tiles.Items.Types;
namespace Mundus.Service.Tiles.Mobs.LandMobs {
public class Player : MobTile {
diff --git a/Mundus/Service/Tiles/Mobs/MobTile.cs b/Mundus/Service/Tiles/Mobs/MobTile.cs
index a3702af..10d9fef 100644
--- a/Mundus/Service/Tiles/Mobs/MobTile.cs
+++ b/Mundus/Service/Tiles/Mobs/MobTile.cs
@@ -3,6 +3,7 @@ using Mundus.Data;
using Mundus.Data.SuperLayers;
using Mundus.Data.Windows;
using Mundus.Service.Tiles.Items;
+using Mundus.Service.Tiles.Items.Types;
namespace Mundus.Service.Tiles.Mobs {
public class MobTile : ITile {
diff --git a/Mundus/Service/Calculate.cs b/Mundus/Service/Windows/Calculate.cs
index f1a730f..873bf63 100644
--- a/Mundus/Service/Calculate.cs
+++ b/Mundus/Service/Windows/Calculate.cs
@@ -2,7 +2,7 @@
using Mundus.Data.Superlayers.Mobs;
using System;
-namespace Mundus.Service {
+namespace Mundus.Service.Windows {
public static class Calculate {
/*Depending on whether you are on the edge of the map or in the center, the screen renders a bit differently.
*On the edge it doesn't follow the player and only shows the corner "chunk". In the other parts it follows the
diff --git a/Mundus/Service/WindowController.cs b/Mundus/Service/Windows/WindowController.cs
index d662a19..09174ed 100644
--- a/Mundus/Service/WindowController.cs
+++ b/Mundus/Service/Windows/WindowController.cs
@@ -1,8 +1,14 @@
-using Gtk;
+using System;
+using Gtk;
using Mundus.Data.Windows;
+using Mundus.Service.Tiles.Items;
+using Mundus.Service.Tiles.Mobs;
+using Mundus.Service.Tiles.Mobs.Controllers;
+using Mundus.Views.Windows;
-namespace Mundus.Service {
+namespace Mundus.Service.Windows {
public static class WindowController {
+
/// <summary>
/// Shows the settings window and hides the sender
/// </summary>
@@ -61,5 +67,38 @@ namespace Mundus.Service {
WI.WLog.Show();
WI.WLog.Present();
}
+
+ public static void React(int button)
+ {
+ int size = WI.SelWin.Size;
+
+ int buttonYPos = (button - 1) / size;
+ int buttonXPos = (button - (buttonYPos * size)) - 1;
+
+ int mapXPos = Calculate.CalculateXFromButton(buttonXPos, size);
+ int mapYPos = Calculate.CalculateYFromButton(buttonYPos, size);
+
+ if (!ItemController.HasSelectedItem()) {
+ MobMovement.MovePlayer(mapYPos, mapXPos, size);
+ MobMovement.MoveRandomlyAllMobs();
+ }
+ else {
+ if (Inventory.GetPlayerItemFromItemSelection() != null) {
+ if (MobFighting.ExistsFightTargetForPlayer(mapYPos, mapXPos)) {
+ MobFighting.PlayerTryFight(mapYPos, mapXPos);
+ }
+ else {
+ MobTerraforming.PlayerTerraformAt(mapYPos, mapXPos);
+ }
+ }
+
+ ItemController.ResetSelection();
+ }
+
+ WI.SelWin.PrintWorldScreen();
+ WI.SelWin.PrintMainMenu();
+
+ WI.SelWin.PrintMapOrInv();
+ }
}
}
diff --git a/Mundus/Views/Windows/GameWindows/IGameWindow.cs b/Mundus/Views/Windows/GameWindows/IGameWindow.cs
index c864fe9..7f05216 100644
--- a/Mundus/Views/Windows/GameWindows/IGameWindow.cs
+++ b/Mundus/Views/Windows/GameWindows/IGameWindow.cs
@@ -21,6 +21,8 @@
void PrintInventory();
+ void PrintMapOrInv();
+
void PrintSelectedItemInfo(ItemTile itemTile);
void Show();
diff --git a/Mundus/Views/Windows/GameWindows/Large/LargeButtonClickedEvents.cs b/Mundus/Views/Windows/GameWindows/Large/LargeButtonClickedEvents.cs
index e69e04c..3590c25 100644
--- a/Mundus/Views/Windows/GameWindows/Large/LargeButtonClickedEvents.cs
+++ b/Mundus/Views/Windows/GameWindows/Large/LargeButtonClickedEvents.cs
@@ -1,7 +1,8 @@
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Large
{
using System;
- using Mundus.Service;
+ using Mundus.Service.Windows;
+ using static Mundus.Service.Tiles.Mobs.Inventory;
public partial class LargeGameWindow
{
@@ -59,7 +60,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(1);
+ WindowController.React(1);
}
}
@@ -67,7 +68,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(2);
+ WindowController.React(2);
}
}
@@ -75,7 +76,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(3);
+ WindowController.React(3);
}
}
@@ -83,7 +84,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(4);
+ WindowController.React(4);
}
}
@@ -91,7 +92,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(5);
+ WindowController.React(5);
}
}
@@ -99,7 +100,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(6);
+ WindowController.React(6);
}
}
@@ -107,7 +108,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(7);
+ WindowController.React(7);
}
}
@@ -115,7 +116,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(8);
+ WindowController.React(8);
}
}
@@ -123,7 +124,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(9);
+ WindowController.React(9);
}
}
@@ -131,7 +132,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(10);
+ WindowController.React(10);
}
}
@@ -139,7 +140,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(11);
+ WindowController.React(11);
}
}
@@ -147,7 +148,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(12);
+ WindowController.React(12);
}
}
@@ -155,7 +156,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(13);
+ WindowController.React(13);
}
}
@@ -163,7 +164,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(14);
+ WindowController.React(14);
}
}
@@ -171,7 +172,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(15);
+ WindowController.React(15);
}
}
@@ -179,7 +180,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(16);
+ WindowController.React(16);
}
}
@@ -187,7 +188,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(17);
+ WindowController.React(17);
}
}
@@ -195,7 +196,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(18);
+ WindowController.React(18);
}
}
@@ -203,7 +204,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(19);
+ WindowController.React(19);
}
}
@@ -211,7 +212,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(20);
+ WindowController.React(20);
}
}
@@ -219,7 +220,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(21);
+ WindowController.React(21);
}
}
@@ -227,7 +228,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(22);
+ WindowController.React(22);
}
}
@@ -235,7 +236,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(23);
+ WindowController.React(23);
}
}
@@ -243,7 +244,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(24);
+ WindowController.React(24);
}
}
@@ -251,7 +252,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(25);
+ WindowController.React(25);
}
}
@@ -259,7 +260,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(26);
+ WindowController.React(26);
}
}
@@ -267,7 +268,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(27);
+ WindowController.React(27);
}
}
@@ -275,7 +276,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(28);
+ WindowController.React(28);
}
}
@@ -283,7 +284,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(29);
+ WindowController.React(29);
}
}
@@ -291,7 +292,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(30);
+ WindowController.React(30);
}
}
@@ -299,7 +300,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(31);
+ WindowController.React(31);
}
}
@@ -307,7 +308,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(32);
+ WindowController.React(32);
}
}
@@ -315,7 +316,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(33);
+ WindowController.React(33);
}
}
@@ -323,7 +324,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(34);
+ WindowController.React(34);
}
}
@@ -331,7 +332,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(35);
+ WindowController.React(35);
}
}
@@ -339,7 +340,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(36);
+ WindowController.React(36);
}
}
@@ -347,7 +348,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(37);
+ WindowController.React(37);
}
}
@@ -355,7 +356,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(38);
+ WindowController.React(38);
}
}
@@ -363,7 +364,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(39);
+ WindowController.React(39);
}
}
@@ -371,7 +372,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(40);
+ WindowController.React(40);
}
}
@@ -379,7 +380,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(41);
+ WindowController.React(41);
}
}
@@ -387,7 +388,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(42);
+ WindowController.React(42);
}
}
@@ -395,7 +396,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(43);
+ WindowController.React(43);
}
}
@@ -403,7 +404,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(44);
+ WindowController.React(44);
}
}
@@ -411,7 +412,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(45);
+ WindowController.React(45);
}
}
@@ -419,7 +420,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(46);
+ WindowController.React(46);
}
}
@@ -427,7 +428,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(47);
+ WindowController.React(47);
}
}
@@ -435,7 +436,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(48);
+ WindowController.React(48);
}
}
@@ -443,7 +444,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(49);
+ WindowController.React(49);
}
}
@@ -451,7 +452,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(50);
+ WindowController.React(50);
}
}
@@ -459,7 +460,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(51);
+ WindowController.React(51);
}
}
@@ -467,7 +468,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(52);
+ WindowController.React(52);
}
}
@@ -475,7 +476,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(53);
+ WindowController.React(53);
}
}
@@ -483,7 +484,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(54);
+ WindowController.React(54);
}
}
@@ -491,7 +492,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(55);
+ WindowController.React(55);
}
}
@@ -499,7 +500,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(56);
+ WindowController.React(56);
}
}
@@ -507,7 +508,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(57);
+ WindowController.React(57);
}
}
@@ -515,7 +516,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(58);
+ WindowController.React(58);
}
}
@@ -523,7 +524,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(59);
+ WindowController.React(59);
}
}
@@ -531,7 +532,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(60);
+ WindowController.React(60);
}
}
@@ -539,7 +540,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(61);
+ WindowController.React(61);
}
}
@@ -547,7 +548,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(62);
+ WindowController.React(62);
}
}
@@ -555,7 +556,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(63);
+ WindowController.React(63);
}
}
@@ -563,7 +564,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(64);
+ WindowController.React(64);
}
}
@@ -571,7 +572,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(65);
+ WindowController.React(65);
}
}
@@ -579,7 +580,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(66);
+ WindowController.React(66);
}
}
@@ -587,7 +588,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(67);
+ WindowController.React(67);
}
}
@@ -595,7 +596,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(68);
+ WindowController.React(68);
}
}
@@ -603,7 +604,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(69);
+ WindowController.React(69);
}
}
@@ -611,7 +612,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(70);
+ WindowController.React(70);
}
}
@@ -619,7 +620,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(71);
+ WindowController.React(71);
}
}
@@ -627,7 +628,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(72);
+ WindowController.React(72);
}
}
@@ -635,7 +636,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(73);
+ WindowController.React(73);
}
}
@@ -643,7 +644,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(74);
+ WindowController.React(74);
}
}
@@ -651,7 +652,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(75);
+ WindowController.React(75);
}
}
@@ -659,7 +660,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(76);
+ WindowController.React(76);
}
}
@@ -667,7 +668,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(77);
+ WindowController.React(77);
}
}
@@ -675,7 +676,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(78);
+ WindowController.React(78);
}
}
@@ -683,7 +684,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(79);
+ WindowController.React(79);
}
}
@@ -691,7 +692,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(80);
+ WindowController.React(80);
}
}
@@ -699,7 +700,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(81);
+ WindowController.React(81);
}
}
@@ -711,7 +712,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 0);
+ this.SelectItem(InventoryPlace.Hotbar, 0);
this.PrintMainMenu();
}
}
@@ -720,7 +721,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 1);
+ this.SelectItem(InventoryPlace.Hotbar, 1);
this.PrintMainMenu();
}
}
@@ -729,7 +730,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 2);
+ this.SelectItem(InventoryPlace.Hotbar, 2);
this.PrintMainMenu();
}
}
@@ -738,7 +739,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 3);
+ this.SelectItem(InventoryPlace.Hotbar, 3);
this.PrintMainMenu();
}
}
@@ -747,7 +748,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 4);
+ this.SelectItem(InventoryPlace.Hotbar, 4);
this.PrintMainMenu();
}
}
@@ -756,7 +757,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 5);
+ this.SelectItem(InventoryPlace.Hotbar, 5);
this.PrintMainMenu();
}
}
@@ -765,7 +766,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 6);
+ this.SelectItem(InventoryPlace.Hotbar, 6);
this.PrintMainMenu();
}
}
@@ -774,7 +775,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 7);
+ this.SelectItem(InventoryPlace.Hotbar, 7);
this.PrintMainMenu();
}
}
@@ -783,7 +784,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 8);
+ this.SelectItem(InventoryPlace.Hotbar, 8);
this.PrintMainMenu();
}
}
@@ -801,7 +802,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 0);
+ this.SelectItem(InventoryPlace.Items, 0);
this.PrintInventory();
}
}
@@ -810,7 +811,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 1);
+ this.SelectItem(InventoryPlace.Items, 1);
this.PrintInventory();
}
}
@@ -819,7 +820,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 2);
+ this.SelectItem(InventoryPlace.Items, 2);
this.PrintInventory();
}
}
@@ -828,7 +829,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 3);
+ this.SelectItem(InventoryPlace.Items, 3);
this.PrintInventory();
}
}
@@ -837,7 +838,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 4);
+ this.SelectItem(InventoryPlace.Items, 4);
this.PrintInventory();
}
}
@@ -846,7 +847,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 5);
+ this.SelectItem(InventoryPlace.Items, 5);
this.PrintInventory();
}
}
@@ -855,7 +856,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 6);
+ this.SelectItem(InventoryPlace.Items, 6);
this.PrintInventory();
}
}
@@ -864,7 +865,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 7);
+ this.SelectItem(InventoryPlace.Items, 7);
this.PrintInventory();
}
}
@@ -873,7 +874,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 8);
+ this.SelectItem(InventoryPlace.Items, 8);
this.PrintInventory();
}
}
@@ -882,7 +883,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 9);
+ this.SelectItem(InventoryPlace.Items, 9);
this.PrintInventory();
}
}
@@ -891,7 +892,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 10);
+ this.SelectItem(InventoryPlace.Items, 10);
this.PrintInventory();
}
}
@@ -900,7 +901,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 11);
+ this.SelectItem(InventoryPlace.Items, 11);
this.PrintInventory();
}
}
@@ -909,7 +910,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 12);
+ this.SelectItem(InventoryPlace.Items, 12);
this.PrintInventory();
}
}
@@ -918,7 +919,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 13);
+ this.SelectItem(InventoryPlace.Items, 13);
this.PrintInventory();
}
}
@@ -927,7 +928,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 14);
+ this.SelectItem(InventoryPlace.Items, 14);
this.PrintInventory();
}
}
@@ -936,7 +937,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 15);
+ this.SelectItem(InventoryPlace.Items, 15);
this.PrintInventory();
}
}
@@ -945,7 +946,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 16);
+ this.SelectItem(InventoryPlace.Items, 16);
this.PrintInventory();
}
}
@@ -954,7 +955,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 17);
+ this.SelectItem(InventoryPlace.Items, 17);
this.PrintInventory();
}
}
@@ -963,7 +964,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 18);
+ this.SelectItem(InventoryPlace.Items, 18);
this.PrintInventory();
}
}
@@ -972,7 +973,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 19);
+ this.SelectItem(InventoryPlace.Items, 19);
this.PrintInventory();
}
}
@@ -981,7 +982,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 20);
+ this.SelectItem(InventoryPlace.Items, 20);
this.PrintInventory();
}
}
@@ -990,7 +991,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 21);
+ this.SelectItem(InventoryPlace.Items, 21);
this.PrintInventory();
}
}
@@ -999,7 +1000,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 22);
+ this.SelectItem(InventoryPlace.Items, 22);
this.PrintInventory();
}
}
@@ -1008,7 +1009,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 23);
+ this.SelectItem(InventoryPlace.Items, 23);
this.PrintInventory();
}
}
@@ -1017,7 +1018,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 24);
+ this.SelectItem(InventoryPlace.Items, 24);
this.PrintInventory();
}
}
@@ -1026,7 +1027,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 25);
+ this.SelectItem(InventoryPlace.Items, 25);
this.PrintInventory();
}
}
@@ -1035,7 +1036,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 26);
+ this.SelectItem(InventoryPlace.Items, 26);
this.PrintInventory();
}
}
@@ -1044,7 +1045,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 27);
+ this.SelectItem(InventoryPlace.Items, 27);
this.PrintInventory();
}
}
@@ -1053,7 +1054,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 28);
+ this.SelectItem(InventoryPlace.Items, 28);
this.PrintInventory();
}
}
@@ -1062,7 +1063,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 29);
+ this.SelectItem(InventoryPlace.Items, 29);
this.PrintInventory();
}
}
@@ -1071,7 +1072,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 30);
+ this.SelectItem(InventoryPlace.Items, 30);
this.PrintInventory();
}
}
@@ -1080,7 +1081,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 31);
+ this.SelectItem(InventoryPlace.Items, 31);
this.PrintInventory();
}
}
@@ -1089,7 +1090,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 32);
+ this.SelectItem(InventoryPlace.Items, 32);
this.PrintInventory();
}
}
@@ -1098,7 +1099,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 33);
+ this.SelectItem(InventoryPlace.Items, 33);
this.PrintInventory();
}
}
@@ -1107,7 +1108,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 34);
+ this.SelectItem(InventoryPlace.Items, 34);
this.PrintInventory();
}
}
@@ -1116,7 +1117,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 35);
+ this.SelectItem(InventoryPlace.Items, 35);
this.PrintInventory();
}
}
@@ -1125,7 +1126,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 36);
+ this.SelectItem(InventoryPlace.Items, 36);
this.PrintInventory();
}
}
@@ -1134,7 +1135,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 37);
+ this.SelectItem(InventoryPlace.Items, 37);
this.PrintInventory();
}
}
@@ -1143,7 +1144,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 38);
+ this.SelectItem(InventoryPlace.Items, 38);
this.PrintInventory();
}
}
@@ -1152,7 +1153,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 39);
+ this.SelectItem(InventoryPlace.Items, 39);
this.PrintInventory();
}
}
@@ -1161,7 +1162,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 40);
+ this.SelectItem(InventoryPlace.Items, 40);
this.PrintInventory();
}
}
@@ -1170,7 +1171,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 41);
+ this.SelectItem(InventoryPlace.Items, 41);
this.PrintInventory();
}
}
@@ -1179,7 +1180,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 42);
+ this.SelectItem(InventoryPlace.Items, 42);
this.PrintInventory();
}
}
@@ -1188,7 +1189,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 43);
+ this.SelectItem(InventoryPlace.Items, 43);
this.PrintInventory();
}
}
@@ -1197,7 +1198,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 44);
+ this.SelectItem(InventoryPlace.Items, 44);
this.PrintInventory();
}
}
@@ -1206,7 +1207,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 45);
+ this.SelectItem(InventoryPlace.Items, 45);
this.PrintInventory();
}
}
@@ -1215,7 +1216,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 46);
+ this.SelectItem(InventoryPlace.Items, 46);
this.PrintInventory();
}
}
@@ -1224,7 +1225,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 47);
+ this.SelectItem(InventoryPlace.Items, 47);
this.PrintInventory();
}
}
@@ -1233,7 +1234,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 48);
+ this.SelectItem(InventoryPlace.Items, 48);
this.PrintInventory();
}
}
@@ -1242,7 +1243,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 49);
+ this.SelectItem(InventoryPlace.Items, 49);
this.PrintInventory();
}
}
@@ -1251,7 +1252,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 50);
+ this.SelectItem(InventoryPlace.Items, 50);
this.PrintInventory();
}
}
@@ -1260,7 +1261,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 51);
+ this.SelectItem(InventoryPlace.Items, 51);
this.PrintInventory();
}
}
@@ -1269,7 +1270,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 52);
+ this.SelectItem(InventoryPlace.Items, 52);
this.PrintInventory();
}
}
@@ -1278,7 +1279,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 53);
+ this.SelectItem(InventoryPlace.Items, 53);
this.PrintInventory();
}
}
@@ -1287,7 +1288,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 54);
+ this.SelectItem(InventoryPlace.Items, 54);
this.PrintInventory();
}
}
@@ -1296,7 +1297,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 55);
+ this.SelectItem(InventoryPlace.Items, 55);
this.PrintInventory();
}
}
@@ -1305,7 +1306,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 56);
+ this.SelectItem(InventoryPlace.Items, 56);
this.PrintInventory();
}
}
@@ -1314,7 +1315,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 57);
+ this.SelectItem(InventoryPlace.Items, 57);
this.PrintInventory();
}
}
@@ -1323,7 +1324,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 58);
+ this.SelectItem(InventoryPlace.Items, 58);
this.PrintInventory();
}
}
@@ -1332,7 +1333,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 59);
+ this.SelectItem(InventoryPlace.Items, 59);
this.PrintInventory();
}
}
@@ -1341,7 +1342,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 60);
+ this.SelectItem(InventoryPlace.Items, 60);
this.PrintInventory();
}
}
@@ -1350,7 +1351,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 61);
+ this.SelectItem(InventoryPlace.Items, 61);
this.PrintInventory();
}
}
@@ -1359,7 +1360,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 62);
+ this.SelectItem(InventoryPlace.Items, 62);
this.PrintInventory();
}
}
@@ -1368,7 +1369,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 63);
+ this.SelectItem(InventoryPlace.Items, 63);
this.PrintInventory();
}
}
@@ -1377,7 +1378,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 64);
+ this.SelectItem(InventoryPlace.Items, 64);
this.PrintInventory();
}
}
@@ -1386,7 +1387,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 65);
+ this.SelectItem(InventoryPlace.Items, 65);
this.PrintInventory();
}
}
@@ -1395,7 +1396,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 66);
+ this.SelectItem(InventoryPlace.Items, 66);
this.PrintInventory();
}
}
@@ -1404,7 +1405,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 67);
+ this.SelectItem(InventoryPlace.Items, 67);
this.PrintInventory();
}
}
@@ -1413,7 +1414,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 68);
+ this.SelectItem(InventoryPlace.Items, 68);
this.PrintInventory();
}
}
@@ -1422,7 +1423,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 69);
+ this.SelectItem(InventoryPlace.Items, 69);
this.PrintInventory();
}
}
@@ -1431,7 +1432,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 70);
+ this.SelectItem(InventoryPlace.Items, 70);
this.PrintInventory();
}
}
@@ -1440,7 +1441,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 71);
+ this.SelectItem(InventoryPlace.Items, 71);
this.PrintInventory();
}
}
@@ -1449,7 +1450,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 72);
+ this.SelectItem(InventoryPlace.Items, 72);
this.PrintInventory();
}
}
@@ -1458,7 +1459,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 73);
+ this.SelectItem(InventoryPlace.Items, 73);
this.PrintInventory();
}
}
@@ -1467,7 +1468,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 74);
+ this.SelectItem(InventoryPlace.Items, 74);
this.PrintInventory();
}
}
@@ -1476,7 +1477,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 75);
+ this.SelectItem(InventoryPlace.Items, 75);
this.PrintInventory();
}
}
@@ -1485,7 +1486,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 76);
+ this.SelectItem(InventoryPlace.Items, 76);
this.PrintInventory();
}
}
@@ -1494,7 +1495,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 77);
+ this.SelectItem(InventoryPlace.Items, 77);
this.PrintInventory();
}
}
@@ -1503,7 +1504,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 78);
+ this.SelectItem(InventoryPlace.Items, 78);
this.PrintInventory();
}
}
@@ -1512,7 +1513,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 79);
+ this.SelectItem(InventoryPlace.Items, 79);
this.PrintInventory();
}
}
@@ -1521,7 +1522,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 80);
+ this.SelectItem(InventoryPlace.Items, 80);
this.PrintInventory();
}
}
@@ -1534,7 +1535,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 0);
+ this.SelectItem(InventoryPlace.Accessories, 0);
this.PrintInventory();
}
}
@@ -1543,7 +1544,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 1);
+ this.SelectItem(InventoryPlace.Accessories, 1);
this.PrintInventory();
}
}
@@ -1552,7 +1553,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 2);
+ this.SelectItem(InventoryPlace.Accessories, 2);
this.PrintInventory();
}
}
@@ -1561,7 +1562,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 3);
+ this.SelectItem(InventoryPlace.Accessories, 3);
this.PrintInventory();
}
}
@@ -1570,7 +1571,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 4);
+ this.SelectItem(InventoryPlace.Accessories, 4);
this.PrintInventory();
}
}
@@ -1579,7 +1580,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 5);
+ this.SelectItem(InventoryPlace.Accessories, 5);
this.PrintInventory();
}
}
@@ -1588,7 +1589,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 6);
+ this.SelectItem(InventoryPlace.Accessories, 6);
this.PrintInventory();
}
}
@@ -1597,7 +1598,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 7);
+ this.SelectItem(InventoryPlace.Accessories, 7);
this.PrintInventory();
}
}
@@ -1606,7 +1607,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 8);
+ this.SelectItem(InventoryPlace.Accessories, 8);
this.PrintInventory();
}
}
@@ -1615,7 +1616,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 9);
+ this.SelectItem(InventoryPlace.Accessories, 9);
this.PrintInventory();
}
}
@@ -1624,7 +1625,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 10);
+ this.SelectItem(InventoryPlace.Accessories, 10);
this.PrintInventory();
}
}
@@ -1633,7 +1634,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 11);
+ this.SelectItem(InventoryPlace.Accessories, 11);
this.PrintInventory();
}
}
@@ -1642,7 +1643,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 12);
+ this.SelectItem(InventoryPlace.Accessories, 12);
this.PrintInventory();
}
}
@@ -1651,7 +1652,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 13);
+ this.SelectItem(InventoryPlace.Accessories, 13);
this.PrintInventory();
}
}
@@ -1660,7 +1661,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 14);
+ this.SelectItem(InventoryPlace.Accessories, 14);
this.PrintInventory();
}
}
@@ -1669,7 +1670,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 15);
+ this.SelectItem(InventoryPlace.Accessories, 15);
this.PrintInventory();
}
}
@@ -1678,7 +1679,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 16);
+ this.SelectItem(InventoryPlace.Accessories, 16);
this.PrintInventory();
}
}
@@ -1687,7 +1688,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 17);
+ this.SelectItem(InventoryPlace.Accessories, 17);
this.PrintInventory();
}
}
@@ -1700,7 +1701,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 0);
+ this.SelectItem(InventoryPlace.Gear, 0);
this.PrintInventory();
}
}
@@ -1709,7 +1710,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 1);
+ this.SelectItem(InventoryPlace.Gear, 1);
this.PrintInventory();
}
}
@@ -1718,7 +1719,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 2);
+ this.SelectItem(InventoryPlace.Gear, 2);
this.PrintInventory();
}
}
@@ -1727,7 +1728,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 3);
+ this.SelectItem(InventoryPlace.Gear, 3);
this.PrintInventory();
}
}
@@ -1736,7 +1737,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 4);
+ this.SelectItem(InventoryPlace.Gear, 4);
this.PrintInventory();
}
}
@@ -1745,7 +1746,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 5);
+ this.SelectItem(InventoryPlace.Gear, 5);
this.PrintInventory();
}
}
@@ -1754,7 +1755,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 6);
+ this.SelectItem(InventoryPlace.Gear, 6);
this.PrintInventory();
}
}
@@ -1763,7 +1764,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 7);
+ this.SelectItem(InventoryPlace.Gear, 7);
this.PrintInventory();
}
}
@@ -1772,7 +1773,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 8);
+ this.SelectItem(InventoryPlace.Gear, 8);
this.PrintInventory();
}
}
diff --git a/Mundus/Views/Windows/GameWindows/Large/LargeLogic.cs b/Mundus/Views/Windows/GameWindows/Large/LargeLogic.cs
index a4aef01..99806c4 100644
--- a/Mundus/Views/Windows/GameWindows/Large/LargeLogic.cs
+++ b/Mundus/Views/Windows/GameWindows/Large/LargeLogic.cs
@@ -1,433 +1,370 @@
-namespace Mundus.Views.Windows {
+namespace Mundus.Views.Windows.GameWindows.Large
+{
using Gtk;
- using Mundus.Service;
using Mundus.Service.Tiles.Items;
- using Mundus.Service.Tiles.Mobs;
- using Mundus.Service.Tiles.Mobs.Controllers;
+ using static Mundus.Service.Tiles.Mobs.Inventory;
- public partial class LargeGameWindow : Gtk.Window, IGameWindow
- {
- /// <summary>
- /// TODO: Make it an enum
- /// Saves the place from which the player has selected an item
- /// Must be either: "hotbar", "items", "accessories" or "gear"
- /// </summary>
- private string selPlace = null;
-
- /// <summary>
- /// Saves the index of the selected item
- /// </summary>
- private int selIndex = -1;
-
- public LargeGameWindow() : base(Gtk.WindowType.Toplevel)
+ public partial class LargeGameWindow : Gtk.Window, IGameWindow
+ {
+
+ public LargeGameWindow() : base(Gtk.WindowType.Toplevel)
{
this.Build();
- }
-
- /// <summary>
- /// Gets value for the height and width of the game screen, map screens and inventory screen
- /// and the width of stats, hotbar, accessories, gear and items on the ground menus
+ }
+
+ /// <summary>
+ /// Gets value for the height and width of the game screen, map screens and inventory screen
+ /// and the width of stats, hotbar, accessories, gear and items on the ground menus
/// </summary>
public int Size { get; private set; }
- public void OnDeleteEvent(object o, DeleteEventArgs args)
+ public void OnDeleteEvent(object o, DeleteEventArgs args)
{
Application.Quit();
}
- public void SetDefaults()
- {
- this.Size = 9;
- this.SetMapMenuVisibility(false);
- this.SetInvMenuVisibility(false);
- }
-
- private void SelectItem(string place, int index)
- {
- if (this.HasSelection())
- {
- this.ResetSelection();
- SwitchItems.ReplaceItems(place, index);
- }
- else
- {
- this.selPlace = place;
- this.selIndex = index;
- SwitchItems.SetOrigin(place, index);
- }
-
- this.PrintMainMenu();
- this.PrintInventory();
- }
-
- private void React(int button)
- {
- int buttonYPos = (button - 1) / this.Size;
- int buttonXPos = (button - (buttonYPos * this.Size)) - 1;
-
- int mapXPos = Calculate.CalculateXFromButton(buttonXPos, this.Size);
- int mapYPos = Calculate.CalculateYFromButton(buttonYPos, this.Size);
-
- if (!this.HasSelection())
- {
- MobMovement.MovePlayer(mapYPos, mapXPos, this.Size);
- MobMovement.MoveRandomlyAllMobs();
- }
- else
- {
- if (Inventory.GetPlayerItem(this.selPlace, this.selIndex) != null)
- {
- if (MobFighting.ExistsFightTargetForPlayer(mapYPos, mapXPos))
- {
- MobFighting.PlayerTryFight(this.selPlace, this.selIndex, mapYPos, mapXPos);
- }
- else
- {
- MobTerraforming.PlayerTerraformAt(mapYPos, mapXPos, this.selPlace, this.selIndex);
- }
- }
-
- this.ResetSelection();
- }
-
- this.PrintWorldScreen();
- this.PrintMainMenu();
-
- if (this.MapMenuIsVisible())
- {
- this.PrintMap();
- }
- else if (this.InvMenuIsVisible())
- {
- this.PrintInventory();
- }
- }
-
- private void ResetSelection()
- {
- this.selPlace = null;
- this.selIndex = -1;
- }
-
- private bool HasSelection()
- {
- return this.selPlace != null;
- }
-
- private bool InvMenuIsVisible()
- {
- return btnI1.Visible;
- }
-
- private bool MapMenuIsVisible()
- {
- return imgG1.Visible;
+ public void SetDefaults()
+ {
+ this.Size = 9;
+ this.SetMapMenuVisibility(false);
+ this.SetInvMenuVisibility(false);
+ }
+
+ private void SelectItem(InventoryPlace place, int index) {
+ if (ItemController.HasSelectedItem()) {
+ ItemController.SwitchItems(place, index);
+ }
+ else {
+ ItemController.SelectItem(place, index);
+ }
+
+ this.PrintMainMenu();
+ this.PrintInventory();
+ }
+
+ public void PrintMapOrInv() {
+ if (this.MapMenuIsVisible()) {
+ this.PrintMap();
+ }
+ else if (this.InvMenuIsVisible()) {
+ this.PrintInventory();
+ }
+ }
+
+ private bool InvMenuIsVisible()
+ {
+ return btnI1.Visible;
+ }
+
+ private bool MapMenuIsVisible()
+ {
+ return imgG1.Visible;
}
- /// <summary>
- /// The map menu is the left menu with the grond layer, structure layer, coordinates, superlayer and "ground above player" items
- /// </summary>
- private void SetMapMenuVisibility(bool isVisible)
- {
- lblGroundLayer.Visible = isVisible;
- imgG1.Visible = isVisible;
- imgG2.Visible = isVisible;
- imgG3.Visible = isVisible;
- imgG4.Visible = isVisible;
- imgG5.Visible = isVisible;
- imgG6.Visible = isVisible;
- imgG7.Visible = isVisible;
- imgG8.Visible = isVisible;
- imgG9.Visible = isVisible;
- imgG10.Visible = isVisible;
- imgG11.Visible = isVisible;
- imgG12.Visible = isVisible;
- imgG13.Visible = isVisible;
- imgG14.Visible = isVisible;
- imgG15.Visible = isVisible;
- imgG16.Visible = isVisible;
- imgG17.Visible = isVisible;
- imgG18.Visible = isVisible;
- imgG19.Visible = isVisible;
- imgG20.Visible = isVisible;
- imgG21.Visible = isVisible;
- imgG22.Visible = isVisible;
- imgG23.Visible = isVisible;
- imgG24.Visible = isVisible;
- imgG25.Visible = isVisible;
- imgG26.Visible = isVisible;
- imgG27.Visible = isVisible;
- imgG28.Visible = isVisible;
- imgG29.Visible = isVisible;
- imgG30.Visible = isVisible;
- imgG31.Visible = isVisible;
- imgG32.Visible = isVisible;
- imgG33.Visible = isVisible;
- imgG34.Visible = isVisible;
- imgG35.Visible = isVisible;
- imgG36.Visible = isVisible;
- imgG37.Visible = isVisible;
- imgG38.Visible = isVisible;
- imgG39.Visible = isVisible;
- imgG40.Visible = isVisible;
- imgG41.Visible = isVisible;
- imgG42.Visible = isVisible;
- imgG43.Visible = isVisible;
- imgG44.Visible = isVisible;
- imgG45.Visible = isVisible;
- imgG46.Visible = isVisible;
- imgG47.Visible = isVisible;
- imgG48.Visible = isVisible;
- imgG49.Visible = isVisible;
- imgG50.Visible = isVisible;
- imgG51.Visible = isVisible;
- imgG52.Visible = isVisible;
- imgG53.Visible = isVisible;
- imgG54.Visible = isVisible;
- imgG55.Visible = isVisible;
- imgG56.Visible = isVisible;
- imgG57.Visible = isVisible;
- imgG58.Visible = isVisible;
- imgG59.Visible = isVisible;
- imgG60.Visible = isVisible;
- imgG61.Visible = isVisible;
- imgG62.Visible = isVisible;
- imgG63.Visible = isVisible;
- imgG64.Visible = isVisible;
- imgG65.Visible = isVisible;
- imgG66.Visible = isVisible;
- imgG67.Visible = isVisible;
- imgG68.Visible = isVisible;
- imgG69.Visible = isVisible;
- imgG70.Visible = isVisible;
- imgG71.Visible = isVisible;
- imgG72.Visible = isVisible;
- imgG73.Visible = isVisible;
- imgG74.Visible = isVisible;
- imgG75.Visible = isVisible;
- imgG76.Visible = isVisible;
- imgG77.Visible = isVisible;
- imgG78.Visible = isVisible;
- imgG79.Visible = isVisible;
- imgG80.Visible = isVisible;
- imgG81.Visible = isVisible;
-
- lblSuperLayer.Visible = isVisible;
- lblCoord1.Visible = isVisible;
- lblCoord2.Visible = isVisible;
-
- lblItemLayer.Visible = isVisible;
- imgI1.Visible = isVisible;
- imgI2.Visible = isVisible;
- imgI3.Visible = isVisible;
- imgI4.Visible = isVisible;
- imgI5.Visible = isVisible;
- imgI6.Visible = isVisible;
- imgI7.Visible = isVisible;
- imgI8.Visible = isVisible;
- imgI9.Visible = isVisible;
- imgI10.Visible = isVisible;
- imgI11.Visible = isVisible;
- imgI12.Visible = isVisible;
- imgI13.Visible = isVisible;
- imgI14.Visible = isVisible;
- imgI15.Visible = isVisible;
- imgI16.Visible = isVisible;
- imgI17.Visible = isVisible;
- imgI18.Visible = isVisible;
- imgI19.Visible = isVisible;
- imgI20.Visible = isVisible;
- imgI21.Visible = isVisible;
- imgI22.Visible = isVisible;
- imgI23.Visible = isVisible;
- imgI24.Visible = isVisible;
- imgI25.Visible = isVisible;
- imgI26.Visible = isVisible;
- imgI27.Visible = isVisible;
- imgI28.Visible = isVisible;
- imgI29.Visible = isVisible;
- imgI30.Visible = isVisible;
- imgI31.Visible = isVisible;
- imgI32.Visible = isVisible;
- imgI33.Visible = isVisible;
- imgI34.Visible = isVisible;
- imgI35.Visible = isVisible;
- imgI36.Visible = isVisible;
- imgI37.Visible = isVisible;
- imgI38.Visible = isVisible;
- imgI39.Visible = isVisible;
- imgI40.Visible = isVisible;
- imgI41.Visible = isVisible;
- imgI42.Visible = isVisible;
- imgI43.Visible = isVisible;
- imgI44.Visible = isVisible;
- imgI45.Visible = isVisible;
- imgI46.Visible = isVisible;
- imgI47.Visible = isVisible;
- imgI48.Visible = isVisible;
- imgI49.Visible = isVisible;
- imgI50.Visible = isVisible;
- imgI51.Visible = isVisible;
- imgI52.Visible = isVisible;
- imgI53.Visible = isVisible;
- imgI54.Visible = isVisible;
- imgI55.Visible = isVisible;
- imgI56.Visible = isVisible;
- imgI57.Visible = isVisible;
- imgI58.Visible = isVisible;
- imgI59.Visible = isVisible;
- imgI60.Visible = isVisible;
- imgI61.Visible = isVisible;
- imgI62.Visible = isVisible;
- imgI63.Visible = isVisible;
- imgI64.Visible = isVisible;
- imgI65.Visible = isVisible;
- imgI66.Visible = isVisible;
- imgI67.Visible = isVisible;
- imgI68.Visible = isVisible;
- imgI69.Visible = isVisible;
- imgI70.Visible = isVisible;
- imgI71.Visible = isVisible;
- imgI72.Visible = isVisible;
- imgI73.Visible = isVisible;
- imgI74.Visible = isVisible;
- imgI75.Visible = isVisible;
- imgI76.Visible = isVisible;
- imgI77.Visible = isVisible;
- imgI78.Visible = isVisible;
- imgI79.Visible = isVisible;
- imgI80.Visible = isVisible;
- imgI81.Visible = isVisible;
-
- lblHoleMsg.Visible = isVisible;
- lblHoleOnTop.Visible = isVisible;
-
- lblBlank6.Visible = isVisible;
- }
-
- /// <summary>
- /// The inventory menu is the right menu with the items, accessories, gear incentories, item info and crafting button
- /// </summary>
- private void SetInvMenuVisibility(bool isVisible)
- {
- btnI1.Visible = isVisible;
- btnI2.Visible = isVisible;
- btnI3.Visible = isVisible;
- btnI4.Visible = isVisible;
- btnI5.Visible = isVisible;
- btnI6.Visible = isVisible;
- btnI7.Visible = isVisible;
- btnI8.Visible = isVisible;
- btnI9.Visible = isVisible;
- btnI10.Visible = isVisible;
- btnI11.Visible = isVisible;
- btnI12.Visible = isVisible;
- btnI13.Visible = isVisible;
- btnI14.Visible = isVisible;
- btnI15.Visible = isVisible;
- btnI16.Visible = isVisible;
- btnI17.Visible = isVisible;
- btnI18.Visible = isVisible;
- btnI19.Visible = isVisible;
- btnI20.Visible = isVisible;
- btnI21.Visible = isVisible;
- btnI22.Visible = isVisible;
- btnI23.Visible = isVisible;
- btnI24.Visible = isVisible;
- btnI25.Visible = isVisible;
- btnI26.Visible = isVisible;
- btnI27.Visible = isVisible;
- btnI28.Visible = isVisible;
- btnI29.Visible = isVisible;
- btnI30.Visible = isVisible;
- btnI31.Visible = isVisible;
- btnI32.Visible = isVisible;
- btnI33.Visible = isVisible;
- btnI34.Visible = isVisible;
- btnI35.Visible = isVisible;
- btnI36.Visible = isVisible;
- btnI37.Visible = isVisible;
- btnI38.Visible = isVisible;
- btnI39.Visible = isVisible;
- btnI40.Visible = isVisible;
- btnI41.Visible = isVisible;
- btnI42.Visible = isVisible;
- btnI43.Visible = isVisible;
- btnI44.Visible = isVisible;
- btnI45.Visible = isVisible;
- btnI46.Visible = isVisible;
- btnI47.Visible = isVisible;
- btnI48.Visible = isVisible;
- btnI49.Visible = isVisible;
- btnI50.Visible = isVisible;
- btnI51.Visible = isVisible;
- btnI52.Visible = isVisible;
- btnI53.Visible = isVisible;
- btnI54.Visible = isVisible;
- btnI55.Visible = isVisible;
- btnI56.Visible = isVisible;
- btnI57.Visible = isVisible;
- btnI58.Visible = isVisible;
- btnI59.Visible = isVisible;
- btnI60.Visible = isVisible;
- btnI61.Visible = isVisible;
- btnI62.Visible = isVisible;
- btnI63.Visible = isVisible;
- btnI64.Visible = isVisible;
- btnI65.Visible = isVisible;
- btnI66.Visible = isVisible;
- btnI67.Visible = isVisible;
- btnI68.Visible = isVisible;
- btnI69.Visible = isVisible;
- btnI70.Visible = isVisible;
- btnI71.Visible = isVisible;
- btnI72.Visible = isVisible;
- btnI73.Visible = isVisible;
- btnI74.Visible = isVisible;
- btnI75.Visible = isVisible;
- btnI76.Visible = isVisible;
- btnI77.Visible = isVisible;
- btnI78.Visible = isVisible;
- btnI79.Visible = isVisible;
- btnI80.Visible = isVisible;
- btnI81.Visible = isVisible;
- btnCrafting.Visible = isVisible;
-
- lblAccessories.Visible = isVisible;
- btnA1.Visible = isVisible;
- btnA2.Visible = isVisible;
- btnA3.Visible = isVisible;
- btnA4.Visible = isVisible;
- btnA5.Visible = isVisible;
- btnA6.Visible = isVisible;
- btnA7.Visible = isVisible;
- btnA8.Visible = isVisible;
- btnA9.Visible = isVisible;
- btnA10.Visible = isVisible;
- btnA11.Visible = isVisible;
- btnA12.Visible = isVisible;
- btnA13.Visible = isVisible;
- btnA14.Visible = isVisible;
- btnA15.Visible = isVisible;
- btnA16.Visible = isVisible;
- btnA17.Visible = isVisible;
- btnA18.Visible = isVisible;
-
- lblGear.Visible = isVisible;
- btnG1.Visible = isVisible;
- btnG2.Visible = isVisible;
- btnG3.Visible = isVisible;
- btnG4.Visible = isVisible;
- btnG5.Visible = isVisible;
- btnG6.Visible = isVisible;
- btnG7.Visible = isVisible;
- btnG8.Visible = isVisible;
- btnG9.Visible = isVisible;
-
- imgInfo.Visible = isVisible;
- lblInfo.Visible = isVisible;
-
- lblBlank6.Visible = isVisible;
+ /// <summary>
+ /// The map menu is the left menu with the grond layer, structure layer, coordinates, superlayer and "ground above player" items
+ /// </summary>
+ private void SetMapMenuVisibility(bool isVisible)
+ {
+ lblGroundLayer.Visible = isVisible;
+ imgG1.Visible = isVisible;
+ imgG2.Visible = isVisible;
+ imgG3.Visible = isVisible;
+ imgG4.Visible = isVisible;
+ imgG5.Visible = isVisible;
+ imgG6.Visible = isVisible;
+ imgG7.Visible = isVisible;
+ imgG8.Visible = isVisible;
+ imgG9.Visible = isVisible;
+ imgG10.Visible = isVisible;
+ imgG11.Visible = isVisible;
+ imgG12.Visible = isVisible;
+ imgG13.Visible = isVisible;
+ imgG14.Visible = isVisible;
+ imgG15.Visible = isVisible;
+ imgG16.Visible = isVisible;
+ imgG17.Visible = isVisible;
+ imgG18.Visible = isVisible;
+ imgG19.Visible = isVisible;
+ imgG20.Visible = isVisible;
+ imgG21.Visible = isVisible;
+ imgG22.Visible = isVisible;
+ imgG23.Visible = isVisible;
+ imgG24.Visible = isVisible;
+ imgG25.Visible = isVisible;
+ imgG26.Visible = isVisible;
+ imgG27.Visible = isVisible;
+ imgG28.Visible = isVisible;
+ imgG29.Visible = isVisible;
+ imgG30.Visible = isVisible;
+ imgG31.Visible = isVisible;
+ imgG32.Visible = isVisible;
+ imgG33.Visible = isVisible;
+ imgG34.Visible = isVisible;
+ imgG35.Visible = isVisible;
+ imgG36.Visible = isVisible;
+ imgG37.Visible = isVisible;
+ imgG38.Visible = isVisible;
+ imgG39.Visible = isVisible;
+ imgG40.Visible = isVisible;
+ imgG41.Visible = isVisible;
+ imgG42.Visible = isVisible;
+ imgG43.Visible = isVisible;
+ imgG44.Visible = isVisible;
+ imgG45.Visible = isVisible;
+ imgG46.Visible = isVisible;
+ imgG47.Visible = isVisible;
+ imgG48.Visible = isVisible;
+ imgG49.Visible = isVisible;
+ imgG50.Visible = isVisible;
+ imgG51.Visible = isVisible;
+ imgG52.Visible = isVisible;
+ imgG53.Visible = isVisible;
+ imgG54.Visible = isVisible;
+ imgG55.Visible = isVisible;
+ imgG56.Visible = isVisible;
+ imgG57.Visible = isVisible;
+ imgG58.Visible = isVisible;
+ imgG59.Visible = isVisible;
+ imgG60.Visible = isVisible;
+ imgG61.Visible = isVisible;
+ imgG62.Visible = isVisible;
+ imgG63.Visible = isVisible;
+ imgG64.Visible = isVisible;
+ imgG65.Visible = isVisible;
+ imgG66.Visible = isVisible;
+ imgG67.Visible = isVisible;
+ imgG68.Visible = isVisible;
+ imgG69.Visible = isVisible;
+ imgG70.Visible = isVisible;
+ imgG71.Visible = isVisible;
+ imgG72.Visible = isVisible;
+ imgG73.Visible = isVisible;
+ imgG74.Visible = isVisible;
+ imgG75.Visible = isVisible;
+ imgG76.Visible = isVisible;
+ imgG77.Visible = isVisible;
+ imgG78.Visible = isVisible;
+ imgG79.Visible = isVisible;
+ imgG80.Visible = isVisible;
+ imgG81.Visible = isVisible;
+
+ lblSuperLayer.Visible = isVisible;
+ lblCoord1.Visible = isVisible;
+ lblCoord2.Visible = isVisible;
+
+ lblItemLayer.Visible = isVisible;
+ imgI1.Visible = isVisible;
+ imgI2.Visible = isVisible;
+ imgI3.Visible = isVisible;
+ imgI4.Visible = isVisible;
+ imgI5.Visible = isVisible;
+ imgI6.Visible = isVisible;
+ imgI7.Visible = isVisible;
+ imgI8.Visible = isVisible;
+ imgI9.Visible = isVisible;
+ imgI10.Visible = isVisible;
+ imgI11.Visible = isVisible;
+ imgI12.Visible = isVisible;
+ imgI13.Visible = isVisible;
+ imgI14.Visible = isVisible;
+ imgI15.Visible = isVisible;
+ imgI16.Visible = isVisible;
+ imgI17.Visible = isVisible;
+ imgI18.Visible = isVisible;
+ imgI19.Visible = isVisible;
+ imgI20.Visible = isVisible;
+ imgI21.Visible = isVisible;
+ imgI22.Visible = isVisible;
+ imgI23.Visible = isVisible;
+ imgI24.Visible = isVisible;
+ imgI25.Visible = isVisible;
+ imgI26.Visible = isVisible;
+ imgI27.Visible = isVisible;
+ imgI28.Visible = isVisible;
+ imgI29.Visible = isVisible;
+ imgI30.Visible = isVisible;
+ imgI31.Visible = isVisible;
+ imgI32.Visible = isVisible;
+ imgI33.Visible = isVisible;
+ imgI34.Visible = isVisible;
+ imgI35.Visible = isVisible;
+ imgI36.Visible = isVisible;
+ imgI37.Visible = isVisible;
+ imgI38.Visible = isVisible;
+ imgI39.Visible = isVisible;
+ imgI40.Visible = isVisible;
+ imgI41.Visible = isVisible;
+ imgI42.Visible = isVisible;
+ imgI43.Visible = isVisible;
+ imgI44.Visible = isVisible;
+ imgI45.Visible = isVisible;
+ imgI46.Visible = isVisible;
+ imgI47.Visible = isVisible;
+ imgI48.Visible = isVisible;
+ imgI49.Visible = isVisible;
+ imgI50.Visible = isVisible;
+ imgI51.Visible = isVisible;
+ imgI52.Visible = isVisible;
+ imgI53.Visible = isVisible;
+ imgI54.Visible = isVisible;
+ imgI55.Visible = isVisible;
+ imgI56.Visible = isVisible;
+ imgI57.Visible = isVisible;
+ imgI58.Visible = isVisible;
+ imgI59.Visible = isVisible;
+ imgI60.Visible = isVisible;
+ imgI61.Visible = isVisible;
+ imgI62.Visible = isVisible;
+ imgI63.Visible = isVisible;
+ imgI64.Visible = isVisible;
+ imgI65.Visible = isVisible;
+ imgI66.Visible = isVisible;
+ imgI67.Visible = isVisible;
+ imgI68.Visible = isVisible;
+ imgI69.Visible = isVisible;
+ imgI70.Visible = isVisible;
+ imgI71.Visible = isVisible;
+ imgI72.Visible = isVisible;
+ imgI73.Visible = isVisible;
+ imgI74.Visible = isVisible;
+ imgI75.Visible = isVisible;
+ imgI76.Visible = isVisible;
+ imgI77.Visible = isVisible;
+ imgI78.Visible = isVisible;
+ imgI79.Visible = isVisible;
+ imgI80.Visible = isVisible;
+ imgI81.Visible = isVisible;
+
+ lblHoleMsg.Visible = isVisible;
+ lblHoleOnTop.Visible = isVisible;
+
+ lblBlank6.Visible = isVisible;
+ }
+
+ /// <summary>
+ /// The inventory menu is the right menu with the items, accessories, gear incentories, item info and crafting button
+ /// </summary>
+ private void SetInvMenuVisibility(bool isVisible)
+ {
+ btnI1.Visible = isVisible;
+ btnI2.Visible = isVisible;
+ btnI3.Visible = isVisible;
+ btnI4.Visible = isVisible;
+ btnI5.Visible = isVisible;
+ btnI6.Visible = isVisible;
+ btnI7.Visible = isVisible;
+ btnI8.Visible = isVisible;
+ btnI9.Visible = isVisible;
+ btnI10.Visible = isVisible;
+ btnI11.Visible = isVisible;
+ btnI12.Visible = isVisible;
+ btnI13.Visible = isVisible;
+ btnI14.Visible = isVisible;
+ btnI15.Visible = isVisible;
+ btnI16.Visible = isVisible;
+ btnI17.Visible = isVisible;
+ btnI18.Visible = isVisible;
+ btnI19.Visible = isVisible;
+ btnI20.Visible = isVisible;
+ btnI21.Visible = isVisible;
+ btnI22.Visible = isVisible;
+ btnI23.Visible = isVisible;
+ btnI24.Visible = isVisible;
+ btnI25.Visible = isVisible;
+ btnI26.Visible = isVisible;
+ btnI27.Visible = isVisible;
+ btnI28.Visible = isVisible;
+ btnI29.Visible = isVisible;
+ btnI30.Visible = isVisible;
+ btnI31.Visible = isVisible;
+ btnI32.Visible = isVisible;
+ btnI33.Visible = isVisible;
+ btnI34.Visible = isVisible;
+ btnI35.Visible = isVisible;
+ btnI36.Visible = isVisible;
+ btnI37.Visible = isVisible;
+ btnI38.Visible = isVisible;
+ btnI39.Visible = isVisible;
+ btnI40.Visible = isVisible;
+ btnI41.Visible = isVisible;
+ btnI42.Visible = isVisible;
+ btnI43.Visible = isVisible;
+ btnI44.Visible = isVisible;
+ btnI45.Visible = isVisible;
+ btnI46.Visible = isVisible;
+ btnI47.Visible = isVisible;
+ btnI48.Visible = isVisible;
+ btnI49.Visible = isVisible;
+ btnI50.Visible = isVisible;
+ btnI51.Visible = isVisible;
+ btnI52.Visible = isVisible;
+ btnI53.Visible = isVisible;
+ btnI54.Visible = isVisible;
+ btnI55.Visible = isVisible;
+ btnI56.Visible = isVisible;
+ btnI57.Visible = isVisible;
+ btnI58.Visible = isVisible;
+ btnI59.Visible = isVisible;
+ btnI60.Visible = isVisible;
+ btnI61.Visible = isVisible;
+ btnI62.Visible = isVisible;
+ btnI63.Visible = isVisible;
+ btnI64.Visible = isVisible;
+ btnI65.Visible = isVisible;
+ btnI66.Visible = isVisible;
+ btnI67.Visible = isVisible;
+ btnI68.Visible = isVisible;
+ btnI69.Visible = isVisible;
+ btnI70.Visible = isVisible;
+ btnI71.Visible = isVisible;
+ btnI72.Visible = isVisible;
+ btnI73.Visible = isVisible;
+ btnI74.Visible = isVisible;
+ btnI75.Visible = isVisible;
+ btnI76.Visible = isVisible;
+ btnI77.Visible = isVisible;
+ btnI78.Visible = isVisible;
+ btnI79.Visible = isVisible;
+ btnI80.Visible = isVisible;
+ btnI81.Visible = isVisible;
+ btnCrafting.Visible = isVisible;
+
+ lblAccessories.Visible = isVisible;
+ btnA1.Visible = isVisible;
+ btnA2.Visible = isVisible;
+ btnA3.Visible = isVisible;
+ btnA4.Visible = isVisible;
+ btnA5.Visible = isVisible;
+ btnA6.Visible = isVisible;
+ btnA7.Visible = isVisible;
+ btnA8.Visible = isVisible;
+ btnA9.Visible = isVisible;
+ btnA10.Visible = isVisible;
+ btnA11.Visible = isVisible;
+ btnA12.Visible = isVisible;
+ btnA13.Visible = isVisible;
+ btnA14.Visible = isVisible;
+ btnA15.Visible = isVisible;
+ btnA16.Visible = isVisible;
+ btnA17.Visible = isVisible;
+ btnA18.Visible = isVisible;
+
+ lblGear.Visible = isVisible;
+ btnG1.Visible = isVisible;
+ btnG2.Visible = isVisible;
+ btnG3.Visible = isVisible;
+ btnG4.Visible = isVisible;
+ btnG5.Visible = isVisible;
+ btnG6.Visible = isVisible;
+ btnG7.Visible = isVisible;
+ btnG8.Visible = isVisible;
+ btnG9.Visible = isVisible;
+
+ imgInfo.Visible = isVisible;
+ lblInfo.Visible = isVisible;
+
+ lblBlank6.Visible = isVisible;
}
}
}
diff --git a/Mundus/Views/Windows/GameWindows/Large/LargePrinting.cs b/Mundus/Views/Windows/GameWindows/Large/LargePrinting.cs
index fce9ad6..2111a17 100644
--- a/Mundus/Views/Windows/GameWindows/Large/LargePrinting.cs
+++ b/Mundus/Views/Windows/GameWindows/Large/LargePrinting.cs
@@ -1,10 +1,11 @@
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Large
{
using Gtk;
using Mundus.Service;
using Mundus.Service.SuperLayers;
using Mundus.Service.Tiles.Items;
using Mundus.Service.Tiles.Mobs.Controllers;
+ using Mundus.Service.Windows;
public partial class LargeGameWindow
{
diff --git a/Mundus/Views/Windows/GameWindows/Medium/MediumButtonClickedEvents.cs b/Mundus/Views/Windows/GameWindows/Medium/MediumButtonClickedEvents.cs
index 8bc6d9a..f3df190 100644
--- a/Mundus/Views/Windows/GameWindows/Medium/MediumButtonClickedEvents.cs
+++ b/Mundus/Views/Windows/GameWindows/Medium/MediumButtonClickedEvents.cs
@@ -1,7 +1,8 @@
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Medium
{
using System;
- using Mundus.Service;
+ using Mundus.Service.Windows;
+ using static Mundus.Service.Tiles.Mobs.Inventory;
public partial class MediumGameWindow
{
@@ -65,7 +66,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(1);
+ WindowController.React(1);
}
}
@@ -73,7 +74,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(2);
+ WindowController.React(2);
}
}
@@ -81,7 +82,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(3);
+ WindowController.React(3);
}
}
@@ -89,7 +90,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(4);
+ WindowController.React(4);
}
}
@@ -97,7 +98,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(5);
+ WindowController.React(5);
}
}
@@ -105,7 +106,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(6);
+ WindowController.React(6);
}
}
@@ -113,7 +114,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(7);
+ WindowController.React(7);
}
}
@@ -121,7 +122,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(8);
+ WindowController.React(8);
}
}
@@ -129,7 +130,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(9);
+ WindowController.React(9);
}
}
@@ -137,7 +138,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(10);
+ WindowController.React(10);
}
}
@@ -145,7 +146,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(11);
+ WindowController.React(11);
}
}
@@ -153,7 +154,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(12);
+ WindowController.React(12);
}
}
@@ -161,7 +162,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(13);
+ WindowController.React(13);
}
}
@@ -169,7 +170,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(14);
+ WindowController.React(14);
}
}
@@ -177,7 +178,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(15);
+ WindowController.React(15);
}
}
@@ -185,7 +186,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(16);
+ WindowController.React(16);
}
}
@@ -193,7 +194,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(17);
+ WindowController.React(17);
}
}
@@ -201,7 +202,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(18);
+ WindowController.React(18);
}
}
@@ -209,7 +210,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(19);
+ WindowController.React(19);
}
}
@@ -217,7 +218,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(20);
+ WindowController.React(20);
}
}
@@ -225,7 +226,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(21);
+ WindowController.React(21);
}
}
@@ -233,7 +234,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(22);
+ WindowController.React(22);
}
}
@@ -241,7 +242,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(23);
+ WindowController.React(23);
}
}
@@ -249,7 +250,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(24);
+ WindowController.React(24);
}
}
@@ -257,7 +258,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(25);
+ WindowController.React(25);
}
}
@@ -265,7 +266,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(26);
+ WindowController.React(26);
}
}
@@ -273,7 +274,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(27);
+ WindowController.React(27);
}
}
@@ -281,7 +282,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(28);
+ WindowController.React(28);
}
}
@@ -289,7 +290,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(29);
+ WindowController.React(29);
}
}
@@ -297,7 +298,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(30);
+ WindowController.React(30);
}
}
@@ -305,7 +306,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(31);
+ WindowController.React(31);
}
}
@@ -313,7 +314,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(32);
+ WindowController.React(32);
}
}
@@ -321,7 +322,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(33);
+ WindowController.React(33);
}
}
@@ -329,7 +330,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(34);
+ WindowController.React(34);
}
}
@@ -337,7 +338,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(35);
+ WindowController.React(35);
}
}
@@ -345,7 +346,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(36);
+ WindowController.React(36);
}
}
@@ -353,7 +354,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(37);
+ WindowController.React(37);
}
}
@@ -361,7 +362,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(38);
+ WindowController.React(38);
}
}
@@ -369,7 +370,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(39);
+ WindowController.React(39);
}
}
@@ -377,7 +378,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(40);
+ WindowController.React(40);
}
}
@@ -385,7 +386,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(41);
+ WindowController.React(41);
}
}
@@ -393,7 +394,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(42);
+ WindowController.React(42);
}
}
@@ -401,7 +402,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(43);
+ WindowController.React(43);
}
}
@@ -409,7 +410,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(44);
+ WindowController.React(44);
}
}
@@ -417,7 +418,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(45);
+ WindowController.React(45);
}
}
@@ -425,7 +426,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(46);
+ WindowController.React(46);
}
}
@@ -433,7 +434,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(47);
+ WindowController.React(47);
}
}
@@ -441,7 +442,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(48);
+ WindowController.React(48);
}
}
@@ -449,7 +450,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(49);
+ WindowController.React(49);
}
}
@@ -461,7 +462,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 0);
+ this.SelectItem(InventoryPlace.Hotbar, 0);
this.PrintMainMenu();
}
}
@@ -470,7 +471,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 1);
+ this.SelectItem(InventoryPlace.Hotbar, 1);
this.PrintMainMenu();
}
}
@@ -479,7 +480,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 2);
+ this.SelectItem(InventoryPlace.Hotbar, 2);
this.PrintMainMenu();
}
}
@@ -488,7 +489,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 3);
+ this.SelectItem(InventoryPlace.Hotbar, 3);
this.PrintMainMenu();
}
}
@@ -497,7 +498,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 4);
+ this.SelectItem(InventoryPlace.Hotbar, 4);
this.PrintMainMenu();
}
}
@@ -506,7 +507,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 5);
+ this.SelectItem(InventoryPlace.Hotbar, 5);
this.PrintMainMenu();
}
}
@@ -515,7 +516,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 6);
+ this.SelectItem(InventoryPlace.Hotbar, 6);
this.PrintMainMenu();
}
}
@@ -533,7 +534,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 0);
+ this.SelectItem(InventoryPlace.Items, 0);
this.PrintInventory();
}
}
@@ -542,7 +543,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 1);
+ this.SelectItem(InventoryPlace.Items, 1);
this.PrintInventory();
}
}
@@ -551,7 +552,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 2);
+ this.SelectItem(InventoryPlace.Items, 2);
this.PrintInventory();
}
}
@@ -560,7 +561,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 3);
+ this.SelectItem(InventoryPlace.Items, 3);
this.PrintInventory();
}
}
@@ -569,7 +570,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 4);
+ this.SelectItem(InventoryPlace.Items, 4);
this.PrintInventory();
}
}
@@ -578,7 +579,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 5);
+ this.SelectItem(InventoryPlace.Items, 5);
this.PrintInventory();
}
}
@@ -587,7 +588,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 6);
+ this.SelectItem(InventoryPlace.Items, 6);
this.PrintInventory();
}
}
@@ -596,7 +597,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 7);
+ this.SelectItem(InventoryPlace.Items, 7);
this.PrintInventory();
}
}
@@ -605,7 +606,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 8);
+ this.SelectItem(InventoryPlace.Items, 8);
this.PrintInventory();
}
}
@@ -614,7 +615,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 9);
+ this.SelectItem(InventoryPlace.Items, 9);
this.PrintInventory();
}
}
@@ -623,7 +624,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 10);
+ this.SelectItem(InventoryPlace.Items, 10);
this.PrintInventory();
}
}
@@ -632,7 +633,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 11);
+ this.SelectItem(InventoryPlace.Items, 11);
this.PrintInventory();
}
}
@@ -641,7 +642,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 12);
+ this.SelectItem(InventoryPlace.Items, 12);
this.PrintInventory();
}
}
@@ -650,7 +651,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 13);
+ this.SelectItem(InventoryPlace.Items, 13);
this.PrintInventory();
}
}
@@ -659,7 +660,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 14);
+ this.SelectItem(InventoryPlace.Items, 14);
this.PrintInventory();
}
}
@@ -668,7 +669,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 15);
+ this.SelectItem(InventoryPlace.Items, 15);
this.PrintInventory();
}
}
@@ -677,7 +678,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 16);
+ this.SelectItem(InventoryPlace.Items, 16);
this.PrintInventory();
}
}
@@ -686,7 +687,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 17);
+ this.SelectItem(InventoryPlace.Items, 17);
this.PrintInventory();
}
}
@@ -695,7 +696,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 18);
+ this.SelectItem(InventoryPlace.Items, 18);
this.PrintInventory();
}
}
@@ -704,7 +705,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 19);
+ this.SelectItem(InventoryPlace.Items, 19);
this.PrintInventory();
}
}
@@ -713,7 +714,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 20);
+ this.SelectItem(InventoryPlace.Items, 20);
this.PrintInventory();
}
}
@@ -722,7 +723,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 21);
+ this.SelectItem(InventoryPlace.Items, 21);
this.PrintInventory();
}
}
@@ -731,7 +732,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 22);
+ this.SelectItem(InventoryPlace.Items, 22);
this.PrintInventory();
}
}
@@ -740,7 +741,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 23);
+ this.SelectItem(InventoryPlace.Items, 23);
this.PrintInventory();
}
}
@@ -749,7 +750,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 24);
+ this.SelectItem(InventoryPlace.Items, 24);
this.PrintInventory();
}
}
@@ -758,7 +759,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 25);
+ this.SelectItem(InventoryPlace.Items, 25);
this.PrintInventory();
}
}
@@ -767,7 +768,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 26);
+ this.SelectItem(InventoryPlace.Items, 26);
this.PrintInventory();
}
}
@@ -776,7 +777,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 27);
+ this.SelectItem(InventoryPlace.Items, 27);
this.PrintInventory();
}
}
@@ -785,7 +786,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 28);
+ this.SelectItem(InventoryPlace.Items, 28);
this.PrintInventory();
}
}
@@ -794,7 +795,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 29);
+ this.SelectItem(InventoryPlace.Items, 29);
this.PrintInventory();
}
}
@@ -803,7 +804,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 30);
+ this.SelectItem(InventoryPlace.Items, 30);
this.PrintInventory();
}
}
@@ -812,7 +813,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 31);
+ this.SelectItem(InventoryPlace.Items, 31);
this.PrintInventory();
}
}
@@ -821,7 +822,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 32);
+ this.SelectItem(InventoryPlace.Items, 32);
this.PrintInventory();
}
}
@@ -830,7 +831,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 33);
+ this.SelectItem(InventoryPlace.Items, 33);
this.PrintInventory();
}
}
@@ -839,7 +840,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 34);
+ this.SelectItem(InventoryPlace.Items, 34);
this.PrintInventory();
}
}
@@ -848,7 +849,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 35);
+ this.SelectItem(InventoryPlace.Items, 35);
this.PrintInventory();
}
}
@@ -857,7 +858,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 36);
+ this.SelectItem(InventoryPlace.Items, 36);
this.PrintInventory();
}
}
@@ -866,7 +867,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 37);
+ this.SelectItem(InventoryPlace.Items, 37);
this.PrintInventory();
}
}
@@ -875,7 +876,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 38);
+ this.SelectItem(InventoryPlace.Items, 38);
this.PrintInventory();
}
}
@@ -884,7 +885,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 39);
+ this.SelectItem(InventoryPlace.Items, 39);
this.PrintInventory();
}
}
@@ -893,7 +894,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 40);
+ this.SelectItem(InventoryPlace.Items, 40);
this.PrintInventory();
}
}
@@ -902,7 +903,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 41);
+ this.SelectItem(InventoryPlace.Items, 41);
this.PrintInventory();
}
}
@@ -911,7 +912,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 42);
+ this.SelectItem(InventoryPlace.Items, 42);
this.PrintInventory();
}
}
@@ -920,7 +921,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 43);
+ this.SelectItem(InventoryPlace.Items, 43);
this.PrintInventory();
}
}
@@ -929,7 +930,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 44);
+ this.SelectItem(InventoryPlace.Items, 44);
this.PrintInventory();
}
}
@@ -938,7 +939,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 45);
+ this.SelectItem(InventoryPlace.Items, 45);
this.PrintInventory();
}
}
@@ -947,7 +948,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 46);
+ this.SelectItem(InventoryPlace.Items, 46);
this.PrintInventory();
}
}
@@ -956,7 +957,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 47);
+ this.SelectItem(InventoryPlace.Items, 47);
this.PrintInventory();
}
}
@@ -965,7 +966,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 48);
+ this.SelectItem(InventoryPlace.Items, 48);
this.PrintInventory();
}
}
@@ -978,7 +979,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 0);
+ this.SelectItem(InventoryPlace.Accessories, 0);
this.PrintInventory();
}
}
@@ -987,7 +988,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 1);
+ this.SelectItem(InventoryPlace.Accessories, 1);
this.PrintInventory();
}
}
@@ -996,7 +997,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 2);
+ this.SelectItem(InventoryPlace.Accessories, 2);
this.PrintInventory();
}
}
@@ -1005,7 +1006,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 3);
+ this.SelectItem(InventoryPlace.Accessories, 3);
this.PrintInventory();
}
}
@@ -1014,7 +1015,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 4);
+ this.SelectItem(InventoryPlace.Accessories, 4);
this.PrintInventory();
}
}
@@ -1023,7 +1024,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 5);
+ this.SelectItem(InventoryPlace.Accessories, 5);
this.PrintInventory();
}
}
@@ -1032,7 +1033,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 6);
+ this.SelectItem(InventoryPlace.Accessories, 6);
this.PrintInventory();
}
}
@@ -1041,7 +1042,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 7);
+ this.SelectItem(InventoryPlace.Accessories, 7);
this.PrintInventory();
}
}
@@ -1050,7 +1051,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 8);
+ this.SelectItem(InventoryPlace.Accessories, 8);
this.PrintInventory();
}
}
@@ -1059,7 +1060,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 9);
+ this.SelectItem(InventoryPlace.Accessories, 9);
this.PrintInventory();
}
}
@@ -1068,7 +1069,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 10);
+ this.SelectItem(InventoryPlace.Accessories, 10);
this.PrintInventory();
}
}
@@ -1077,7 +1078,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 11);
+ this.SelectItem(InventoryPlace.Accessories, 11);
this.PrintInventory();
}
}
@@ -1086,7 +1087,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 12);
+ this.SelectItem(InventoryPlace.Accessories, 12);
this.PrintInventory();
}
}
@@ -1095,7 +1096,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 13);
+ this.SelectItem(InventoryPlace.Accessories, 13);
this.PrintInventory();
}
}
@@ -1108,7 +1109,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 0);
+ this.SelectItem(InventoryPlace.Gear, 0);
this.PrintInventory();
}
}
@@ -1117,7 +1118,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 1);
+ this.SelectItem(InventoryPlace.Gear, 1);
this.PrintInventory();
}
}
@@ -1126,7 +1127,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 2);
+ this.SelectItem(InventoryPlace.Gear, 2);
this.PrintInventory();
}
}
@@ -1135,7 +1136,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 3);
+ this.SelectItem(InventoryPlace.Gear, 3);
this.PrintInventory();
}
}
@@ -1144,7 +1145,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 4);
+ this.SelectItem(InventoryPlace.Gear, 4);
this.PrintInventory();
}
}
@@ -1153,7 +1154,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 5);
+ this.SelectItem(InventoryPlace.Gear, 5);
this.PrintInventory();
}
}
@@ -1162,7 +1163,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 6);
+ this.SelectItem(InventoryPlace.Gear, 6);
this.PrintInventory();
}
}
diff --git a/Mundus/Views/Windows/GameWindows/Medium/MediumLogic.cs b/Mundus/Views/Windows/GameWindows/Medium/MediumLogic.cs
index a7558bd..d283ee6 100644
--- a/Mundus/Views/Windows/GameWindows/Medium/MediumLogic.cs
+++ b/Mundus/Views/Windows/GameWindows/Medium/MediumLogic.cs
@@ -1,25 +1,11 @@
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Medium
{
using Gtk;
- using Mundus.Service;
using Mundus.Service.Tiles.Items;
- using Mundus.Service.Tiles.Mobs;
- using Mundus.Service.Tiles.Mobs.Controllers;
+ using static Mundus.Service.Tiles.Mobs.Inventory;
public partial class MediumGameWindow : Gtk.Window, IGameWindow
{
- /// <summary>
- /// TODO: Make it an enum
- /// Saves the place from which the player has selected an item
- /// Must be either: "hotbar", "items", "accessories" or "gear"
- /// </summary>
- private string selPlace = null;
-
- /// <summary>
- /// Saves the index of the selected item
- /// </summary>
- private int selIndex = -1;
-
public MediumGameWindow() : base( Gtk.WindowType.Toplevel )
{
this.Build();
@@ -44,76 +30,27 @@
this.SetInvMenuVisibility(false);
}
- private void SelectItem(string place, int index)
- {
- if (HasSelection())
- {
- ResetSelection();
- SwitchItems.ReplaceItems(place, index);
+ private void SelectItem(InventoryPlace place, int index) {
+ if (ItemController.HasSelectedItem()) {
+ ItemController.SwitchItems(place, index);
}
- else
- {
- selPlace = place;
- selIndex = index;
- SwitchItems.SetOrigin(place, index);
+ else {
+ ItemController.SelectItem(place, index);
}
this.PrintMainMenu();
this.PrintInventory();
}
- private void React(int button)
- {
- int buttonYPos = (button - 1) / Size;
- int buttonXPos = (button - (buttonYPos * Size)) - 1;
-
- int mapXPos = Calculate.CalculateXFromButton(buttonXPos, Size);
- int mapYPos = Calculate.CalculateYFromButton(buttonYPos, Size);
-
- if (!HasSelection())
- {
- MobMovement.MovePlayer(mapYPos, mapXPos, Size);
- MobMovement.MoveRandomlyAllMobs();
- }
- else
- {
- if (Inventory.GetPlayerItem(selPlace, selIndex) != null)
- {
- if (MobFighting.ExistsFightTargetForPlayer(mapYPos, mapXPos))
- {
- MobFighting.PlayerTryFight(selPlace, selIndex, mapYPos, mapXPos);
- }
- else
- {
- MobTerraforming.PlayerTerraformAt(mapYPos, mapXPos, selPlace, selIndex);
- }
- }
- ResetSelection();
- }
-
- this.PrintWorldScreen();
- this.PrintMainMenu();
-
- if (this.MapMenuIsVisible())
- {
+ public void PrintMapOrInv() {
+ if (this.MapMenuIsVisible()) {
this.PrintMap();
}
- else if (this.InvMenuIsVisible())
- {
+ else if (this.InvMenuIsVisible()) {
this.PrintInventory();
}
}
- private void ResetSelection()
- {
- selPlace = null;
- selIndex = -1;
- }
- private bool HasSelection()
- {
- return selPlace != null;
- }
-
private bool InvMenuIsVisible()
{
return btnI1.Visible;
diff --git a/Mundus/Views/Windows/GameWindows/Medium/MediumPrinting.cs b/Mundus/Views/Windows/GameWindows/Medium/MediumPrinting.cs
index 6301ca0..5010f86 100644
--- a/Mundus/Views/Windows/GameWindows/Medium/MediumPrinting.cs
+++ b/Mundus/Views/Windows/GameWindows/Medium/MediumPrinting.cs
@@ -1,10 +1,11 @@
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Medium
{
using Gtk;
using Mundus.Service;
using Mundus.Service.SuperLayers;
using Mundus.Service.Tiles.Items;
using Mundus.Service.Tiles.Mobs.Controllers;
+ using Mundus.Service.Windows;
public partial class MediumGameWindow
{
diff --git a/Mundus/Views/Windows/GameWindows/Small/SmallButtonClickedEvents.cs b/Mundus/Views/Windows/GameWindows/Small/SmallButtonClickedEvents.cs
index 5c5daab..87ac695 100644
--- a/Mundus/Views/Windows/GameWindows/Small/SmallButtonClickedEvents.cs
+++ b/Mundus/Views/Windows/GameWindows/Small/SmallButtonClickedEvents.cs
@@ -1,7 +1,8 @@
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Small
{
using System;
- using Mundus.Service;
+ using Mundus.Service.Windows;
+ using static Mundus.Service.Tiles.Mobs.Inventory;
public partial class SmallGameWindow : Gtk.Window
{
@@ -75,7 +76,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(1);
+ WindowController.React(1);
}
}
@@ -83,7 +84,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(2);
+ WindowController.React(2);
}
}
@@ -91,7 +92,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(3);
+ WindowController.React(3);
}
}
@@ -99,7 +100,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(4);
+ WindowController.React(4);
}
}
@@ -107,7 +108,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(5);
+ WindowController.React(5);
}
}
@@ -115,7 +116,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(6);
+ WindowController.React(6);
}
}
@@ -123,7 +124,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(7);
+ WindowController.React(7);
}
}
@@ -131,7 +132,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(8);
+ WindowController.React(8);
}
}
@@ -139,7 +140,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(9);
+ WindowController.React(9);
}
}
@@ -147,7 +148,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(10);
+ WindowController.React(10);
}
}
@@ -155,7 +156,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(11);
+ WindowController.React(11);
}
}
@@ -163,7 +164,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(12);
+ WindowController.React(12);
}
}
@@ -171,7 +172,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(13);
+ WindowController.React(13);
}
}
@@ -179,7 +180,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(14);
+ WindowController.React(14);
}
}
@@ -187,7 +188,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(15);
+ WindowController.React(15);
}
}
@@ -195,7 +196,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(16);
+ WindowController.React(16);
}
}
@@ -203,7 +204,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(17);
+ WindowController.React(17);
}
}
@@ -211,7 +212,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(18);
+ WindowController.React(18);
}
}
@@ -219,7 +220,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(19);
+ WindowController.React(19);
}
}
@@ -227,7 +228,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(20);
+ WindowController.React(20);
}
}
@@ -235,7 +236,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(21);
+ WindowController.React(21);
}
}
@@ -243,7 +244,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(22);
+ WindowController.React(22);
}
}
@@ -251,7 +252,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(23);
+ WindowController.React(23);
}
}
@@ -259,7 +260,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(24);
+ WindowController.React(24);
}
}
@@ -267,7 +268,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.React(25);
+ WindowController.React(25);
}
}
@@ -279,7 +280,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 0);
+ this.SelectItem(InventoryPlace.Hotbar, 0);
this.PrintMainMenu();
}
}
@@ -288,7 +289,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 1);
+ this.SelectItem(InventoryPlace.Hotbar, 1);
this.PrintMainMenu();
}
}
@@ -297,7 +298,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 2);
+ this.SelectItem(InventoryPlace.Hotbar, 2);
this.PrintMainMenu();
}
}
@@ -306,7 +307,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 3);
+ this.SelectItem(InventoryPlace.Hotbar, 3);
this.PrintMainMenu();
}
}
@@ -315,7 +316,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("hotbar", 4);
+ this.SelectItem(InventoryPlace.Hotbar, 4);
this.PrintMainMenu();
}
}
@@ -333,7 +334,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 0);
+ this.SelectItem(InventoryPlace.Items, 0);
this.PrintInventory();
}
}
@@ -342,7 +343,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 1);
+ this.SelectItem(InventoryPlace.Items, 1);
this.PrintInventory();
}
}
@@ -351,7 +352,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 2);
+ this.SelectItem(InventoryPlace.Items, 2);
this.PrintInventory();
}
}
@@ -360,7 +361,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 3);
+ this.SelectItem(InventoryPlace.Items, 3);
this.PrintInventory();
}
}
@@ -369,7 +370,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 4);
+ this.SelectItem(InventoryPlace.Items, 4);
this.PrintInventory();
}
}
@@ -378,7 +379,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 5);
+ this.SelectItem(InventoryPlace.Items, 5);
this.PrintInventory();
}
}
@@ -387,7 +388,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 6);
+ this.SelectItem(InventoryPlace.Items, 6);
this.PrintInventory();
}
}
@@ -396,7 +397,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 7);
+ this.SelectItem(InventoryPlace.Items, 7);
this.PrintInventory();
}
}
@@ -405,7 +406,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 8);
+ this.SelectItem(InventoryPlace.Items, 8);
this.PrintInventory();
}
}
@@ -414,7 +415,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 9);
+ this.SelectItem(InventoryPlace.Items, 9);
this.PrintInventory();
}
}
@@ -423,7 +424,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 10);
+ this.SelectItem(InventoryPlace.Items, 10);
this.PrintInventory();
}
}
@@ -432,7 +433,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 11);
+ this.SelectItem(InventoryPlace.Items, 11);
this.PrintInventory();
}
}
@@ -441,7 +442,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 12);
+ this.SelectItem(InventoryPlace.Items, 12);
this.PrintInventory();
}
}
@@ -450,7 +451,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 13);
+ this.SelectItem(InventoryPlace.Items, 13);
this.PrintInventory();
}
}
@@ -459,7 +460,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 14);
+ this.SelectItem(InventoryPlace.Items, 14);
this.PrintInventory();
}
}
@@ -468,7 +469,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 15);
+ this.SelectItem(InventoryPlace.Items, 15);
this.PrintInventory();
}
}
@@ -477,7 +478,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 16);
+ this.SelectItem(InventoryPlace.Items, 16);
this.PrintInventory();
}
}
@@ -486,7 +487,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 17);
+ this.SelectItem(InventoryPlace.Items, 17);
this.PrintInventory();
}
}
@@ -495,7 +496,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 18);
+ this.SelectItem(InventoryPlace.Items, 18);
this.PrintInventory();
}
}
@@ -504,7 +505,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 19);
+ this.SelectItem(InventoryPlace.Items, 19);
this.PrintInventory();
}
}
@@ -513,7 +514,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 20);
+ this.SelectItem(InventoryPlace.Items, 20);
this.PrintInventory();
}
}
@@ -522,7 +523,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 21);
+ this.SelectItem(InventoryPlace.Items, 21);
this.PrintInventory();
}
}
@@ -531,7 +532,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 22);
+ this.SelectItem(InventoryPlace.Items, 22);
this.PrintInventory();
}
}
@@ -540,7 +541,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 23);
+ this.SelectItem(InventoryPlace.Items, 23);
this.PrintInventory();
}
}
@@ -549,7 +550,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("items", 24);
+ this.SelectItem(InventoryPlace.Items, 24);
this.PrintInventory();
}
}
@@ -562,7 +563,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 0);
+ this.SelectItem(InventoryPlace.Accessories, 0);
this.PrintInventory();
}
}
@@ -571,7 +572,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 1);
+ this.SelectItem(InventoryPlace.Accessories, 1);
this.PrintInventory();
}
}
@@ -580,7 +581,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 2);
+ this.SelectItem(InventoryPlace.Accessories, 2);
this.PrintInventory();
}
}
@@ -589,7 +590,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 3);
+ this.SelectItem(InventoryPlace.Accessories, 3);
this.PrintInventory();
}
}
@@ -598,7 +599,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 4);
+ this.SelectItem(InventoryPlace.Accessories, 4);
this.PrintInventory();
}
}
@@ -607,7 +608,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 5);
+ this.SelectItem(InventoryPlace.Accessories, 5);
this.PrintInventory();
}
}
@@ -616,7 +617,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 6);
+ this.SelectItem(InventoryPlace.Accessories, 6);
this.PrintInventory();
}
}
@@ -625,7 +626,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 7);
+ this.SelectItem(InventoryPlace.Accessories, 7);
this.PrintInventory();
}
}
@@ -634,7 +635,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 8);
+ this.SelectItem(InventoryPlace.Accessories, 8);
this.PrintInventory();
}
}
@@ -643,7 +644,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("accessories", 9);
+ this.SelectItem(InventoryPlace.Accessories, 9);
this.PrintInventory();
}
}
@@ -655,7 +656,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 0);
+ this.SelectItem(InventoryPlace.Gear, 0);
this.PrintInventory();
}
}
@@ -664,7 +665,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 1);
+ this.SelectItem(InventoryPlace.Gear, 1);
this.PrintInventory();
}
}
@@ -673,7 +674,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 2);
+ this.SelectItem(InventoryPlace.Gear, 2);
this.PrintInventory();
}
}
@@ -682,7 +683,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 3);
+ this.SelectItem(InventoryPlace.Gear, 3);
this.PrintInventory();
}
}
@@ -691,7 +692,7 @@
{
if (!WindowController.PauseWindowVisible)
{
- this.SelectItem("gear", 4);
+ this.SelectItem(InventoryPlace.Gear, 4);
this.PrintInventory();
}
}
diff --git a/Mundus/Views/Windows/GameWindows/Small/SmallLogic.cs b/Mundus/Views/Windows/GameWindows/Small/SmallLogic.cs
index 42edde0..c5cd1f9 100644
--- a/Mundus/Views/Windows/GameWindows/Small/SmallLogic.cs
+++ b/Mundus/Views/Windows/GameWindows/Small/SmallLogic.cs
@@ -1,25 +1,11 @@
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Small
{
using Gtk;
- using Mundus.Service;
using Mundus.Service.Tiles.Items;
- using Mundus.Service.Tiles.Mobs;
- using Mundus.Service.Tiles.Mobs.Controllers;
+ using static Mundus.Service.Tiles.Mobs.Inventory;
public partial class SmallGameWindow : Gtk.Window, IGameWindow
{
- /// <summary>
- /// TODO: Make it an enum
- /// Saves the place from which the player has selected an item
- /// Must be either: "hotbar", "items", "accessories" or "gear"
- /// </summary>
- private string selPlace = null;
-
- /// <summary>
- /// Saves the index of the selected item
- /// </summary>
- private int selIndex = -1;
-
public SmallGameWindow() : base(Gtk.WindowType.Toplevel)
{
this.Build();
@@ -60,57 +46,21 @@
this.SetInvMenuVisibility(false);
}
- private void SelectItem(string place, int index)
- {
- if (this.HasItemSelection())
- {
- this.ResetSelection();
- SwitchItems.ReplaceItems(place, index);
+ private void SelectItem(InventoryPlace place, int index)
+ {
+ if (ItemController.HasSelectedItem()) {
+ ItemController.SwitchItems(place, index);
}
- else
- {
- this.selPlace = place;
- this.selIndex = index;
- SwitchItems.SetOrigin(place, index);
+ else {
+ ItemController.SelectItem(place, index);
}
this.PrintMainMenu();
this.PrintInventory();
}
- private void React(int button)
+ public void PrintMapOrInv()
{
- int buttonYPos = (button - 1) / this.Size;
- int buttonXPos = (button - (buttonYPos * this.Size)) - 1;
-
- int mapXPos = Calculate.CalculateXFromButton(buttonXPos, this.Size);
- int mapYPos = Calculate.CalculateYFromButton(buttonYPos, this.Size);
-
- if (!this.HasItemSelection())
- {
- MobMovement.MovePlayer(mapYPos, mapXPos, this.Size);
- MobMovement.MoveRandomlyAllMobs();
- }
- else
- {
- if (Inventory.GetPlayerItem(this.selPlace, this.selIndex) != null)
- {
- if (MobFighting.ExistsFightTargetForPlayer(mapYPos, mapXPos))
- {
- MobFighting.PlayerTryFight(this.selPlace, this.selIndex, mapYPos, mapXPos);
- }
- else
- {
- MobTerraforming.PlayerTerraformAt(mapYPos, mapXPos, this.selPlace, this.selIndex);
- }
- }
-
- this.ResetSelection();
- }
-
- this.PrintWorldScreen();
- this.PrintMainMenu();
-
if (this.MapMenuIsVisible())
{
this.PrintMap();
@@ -121,17 +71,6 @@
}
}
- private void ResetSelection()
- {
- this.selPlace = null;
- this.selIndex = -1;
- }
-
- private bool HasItemSelection()
- {
- return this.selPlace != null;
- }
-
private bool MapMenuIsVisible()
{
return imgG1.Visible;
diff --git a/Mundus/Views/Windows/GameWindows/Small/SmallPrinting.cs b/Mundus/Views/Windows/GameWindows/Small/SmallPrinting.cs
index a076771..bbf3594 100644
--- a/Mundus/Views/Windows/GameWindows/Small/SmallPrinting.cs
+++ b/Mundus/Views/Windows/GameWindows/Small/SmallPrinting.cs
@@ -1,10 +1,11 @@
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Small
{
using Gtk;
using Mundus.Service;
using Mundus.Service.SuperLayers;
using Mundus.Service.Tiles.Items;
using Mundus.Service.Tiles.Mobs.Controllers;
+ using Mundus.Service.Windows;
public partial class SmallGameWindow
{
diff --git a/Mundus/Views/Windows/MainWindow.cs b/Mundus/Views/Windows/MainWindow.cs
index fd09fa2..ca3b529 100644
--- a/Mundus/Views/Windows/MainWindow.cs
+++ b/Mundus/Views/Windows/MainWindow.cs
@@ -2,7 +2,7 @@
{
using System;
using Gtk;
- using Mundus.Service;
+ using Mundus.Service.Windows;
public partial class MainWindow : Gtk.Window
{
diff --git a/Mundus/Views/Windows/NewGameWindow.cs b/Mundus/Views/Windows/NewGameWindow.cs
index 929f8d0..98c52e9 100644
--- a/Mundus/Views/Windows/NewGameWindow.cs
+++ b/Mundus/Views/Windows/NewGameWindow.cs
@@ -3,6 +3,7 @@
using System;
using Gtk;
using Mundus.Service;
+ using Mundus.Service.Windows;
public partial class NewGameWindow : Gtk.Window
{
diff --git a/Mundus/Views/Windows/PauseWindow.cs b/Mundus/Views/Windows/PauseWindow.cs
index 45067be..4dde656 100644
--- a/Mundus/Views/Windows/PauseWindow.cs
+++ b/Mundus/Views/Windows/PauseWindow.cs
@@ -2,7 +2,7 @@
{
using System;
using Gtk;
- using Mundus.Service;
+ using Mundus.Service.Windows;
public partial class PauseWindow : Gtk.Window
{
diff --git a/Mundus/gtk-gui/Mundus.Views.Windows.LargeGameWindow.cs b/Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Large.LargeGameWindow.cs
index 3a31e9d..95086c1 100644
--- a/Mundus/gtk-gui/Mundus.Views.Windows.LargeGameWindow.cs
+++ b/Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Large.LargeGameWindow.cs
@@ -1,6 +1,6 @@
// This file has been generated by the GUI designer. Do not modify.
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Large
{
public partial class LargeGameWindow
{
@@ -831,13 +831,13 @@ namespace Mundus.Views.Windows
protected virtual void Build()
{
global::Stetic.Gui.Initialize(this);
- // Widget Mundus.Views.Windows.LargeGameWindow
- this.Name = "Mundus.Views.Windows.LargeGameWindow";
+ // Widget Mundus.Views.Windows.GameWindows.Large.LargeGameWindow
+ this.Name = "Mundus.Views.Windows.GameWindows.Large.LargeGameWindow";
this.Title = "LargeGameWindow";
this.WindowPosition = ((global::Gtk.WindowPosition)(2));
this.Resizable = false;
this.AllowGrow = false;
- // Container child Mundus.Views.Windows.LargeGameWindow.Gtk.Container+ContainerChild
+ // Container child Mundus.Views.Windows.GameWindows.Large.LargeGameWindow.Gtk.Container+ContainerChild
this.tbUI = new global::Gtk.Table(((uint)(25)), ((uint)(33)), false);
this.tbUI.Name = "tbUI";
// Container child tbUI.Gtk.Table+TableChild
diff --git a/Mundus/gtk-gui/Mundus.Views.Windows.MediumGameWindow.cs b/Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Medium.MediumGameWindow.cs
index 7dac688..b0b5860 100644
--- a/Mundus/gtk-gui/Mundus.Views.Windows.MediumGameWindow.cs
+++ b/Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Medium.MediumGameWindow.cs
@@ -1,6 +1,6 @@
// This file has been generated by the GUI designer. Do not modify.
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Medium
{
public partial class MediumGameWindow
{
@@ -547,13 +547,13 @@ namespace Mundus.Views.Windows
protected virtual void Build()
{
global::Stetic.Gui.Initialize(this);
- // Widget Mundus.Views.Windows.MediumGameWindow
- this.Name = "Mundus.Views.Windows.MediumGameWindow";
+ // Widget Mundus.Views.Windows.GameWindows.Medium.MediumGameWindow
+ this.Name = "Mundus.Views.Windows.GameWindows.Medium.MediumGameWindow";
this.Title = "MediumGameWindow";
this.WindowPosition = ((global::Gtk.WindowPosition)(2));
this.Resizable = false;
this.AllowGrow = false;
- // Container child Mundus.Views.Windows.MediumGameWindow.Gtk.Container+ContainerChild
+ // Container child Mundus.Views.Windows.GameWindows.Medium.MediumGameWindow.Gtk.Container+ContainerChild
this.tbUI = new global::Gtk.Table(((uint)(21)), ((uint)(27)), false);
this.tbUI.Name = "tbUI";
// Container child tbUI.Gtk.Table+TableChild
diff --git a/Mundus/gtk-gui/Mundus.Views.Windows.SmallGameWindow.cs b/Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Small.SmallGameWindow.cs
index 4a39ace..37b84da 100644
--- a/Mundus/gtk-gui/Mundus.Views.Windows.SmallGameWindow.cs
+++ b/Mundus/gtk-gui/Mundus.Views.Windows.GameWindows.Small.SmallGameWindow.cs
@@ -1,6 +1,6 @@
// This file has been generated by the GUI designer. Do not modify.
-namespace Mundus.Views.Windows
+namespace Mundus.Views.Windows.GameWindows.Small
{
public partial class SmallGameWindow
{
@@ -333,13 +333,13 @@ namespace Mundus.Views.Windows
protected virtual void Build()
{
global::Stetic.Gui.Initialize(this);
- // Widget Mundus.Views.Windows.SmallGameWindow
- this.Name = "Mundus.Views.Windows.SmallGameWindow";
+ // Widget Mundus.Views.Windows.GameWindows.Small.SmallGameWindow
+ this.Name = "Mundus.Views.Windows.GameWindows.Small.SmallGameWindow";
this.Title = "Mundus (Small Window)";
this.WindowPosition = ((global::Gtk.WindowPosition)(2));
this.Resizable = false;
this.AllowGrow = false;
- // Container child Mundus.Views.Windows.SmallGameWindow.Gtk.Container+ContainerChild
+ // Container child Mundus.Views.Windows.GameWindows.Small.SmallGameWindow.Gtk.Container+ContainerChild
this.tbUI = new global::Gtk.Table(((uint)(17)), ((uint)(21)), false);
this.tbUI.Name = "tbUI";
// Container child tbUI.Gtk.Table+TableChild
diff --git a/Mundus/gtk-gui/Mundus.Views.Windows.NewGameWindow.cs b/Mundus/gtk-gui/Mundus.Views.Windows.NewGameWindow.cs
index 0bbc355..2ea610e 100644
--- a/Mundus/gtk-gui/Mundus.Views.Windows.NewGameWindow.cs
+++ b/Mundus/gtk-gui/Mundus.Views.Windows.NewGameWindow.cs
@@ -247,6 +247,7 @@ namespace Mundus.Views.Windows
this.rbCreative.Sensitive = false;
this.rbCreative.CanFocus = true;
this.rbCreative.Name = "rbCreative";
+ this.rbCreative.Active = true;
this.rbCreative.DrawIndicator = true;
this.rbCreative.UseUnderline = true;
this.rbCreative.Group = new global::GLib.SList(global::System.IntPtr.Zero);
@@ -263,6 +264,7 @@ namespace Mundus.Views.Windows
this.rbEasy.WidthRequest = 90;
this.rbEasy.CanFocus = true;
this.rbEasy.Name = "rbEasy";
+ this.rbEasy.Active = true;
this.rbEasy.DrawIndicator = true;
this.rbEasy.UseUnderline = true;
this.rbEasy.Group = new global::GLib.SList(global::System.IntPtr.Zero);
@@ -311,6 +313,7 @@ namespace Mundus.Views.Windows
this.rbLarge.WidthRequest = 90;
this.rbLarge.CanFocus = true;
this.rbLarge.Name = "rbLarge";
+ this.rbLarge.Active = true;
this.rbLarge.DrawIndicator = true;
this.rbLarge.UseUnderline = true;
this.rbLarge.Group = new global::GLib.SList(global::System.IntPtr.Zero);
@@ -342,6 +345,7 @@ namespace Mundus.Views.Windows
this.rbMLarge = new global::Gtk.RadioButton("Large");
this.rbMLarge.CanFocus = true;
this.rbMLarge.Name = "rbMLarge";
+ this.rbMLarge.Active = true;
this.rbMLarge.DrawIndicator = true;
this.rbMLarge.UseUnderline = true;
this.rbMLarge.Group = new global::GLib.SList(global::System.IntPtr.Zero);
diff --git a/Mundus/gtk-gui/gui.stetic b/Mundus/gtk-gui/gui.stetic
index 9807d52..e61aae8 100644
--- a/Mundus/gtk-gui/gui.stetic
+++ b/Mundus/gtk-gui/gui.stetic
@@ -950,7 +950,7 @@
</widget>
</child>
</widget>
- <widget class="Gtk.Window" id="Mundus.Views.Windows.SmallGameWindow" design-size="890 770">
+ <widget class="Gtk.Window" id="Mundus.Views.Windows.GameWindows.Small.SmallGameWindow" design-size="890 770">
<property name="MemberName" />
<property name="Title">Mundus (Small Window)</property>
<property name="WindowPosition">Mouse</property>
@@ -5381,7 +5381,7 @@
</widget>
</child>
</widget>
- <widget class="Gtk.Window" id="Mundus.Views.Windows.MediumGameWindow" design-size="1390 970">
+ <widget class="Gtk.Window" id="Mundus.Views.Windows.GameWindows.Medium.MediumGameWindow" design-size="1390 970">
<property name="MemberName" />
<property name="Title">MediumGameWindow</property>
<property name="WindowPosition">Mouse</property>
@@ -12704,7 +12704,7 @@
</widget>
</child>
</widget>
- <widget class="Gtk.Window" id="Mundus.Views.Windows.LargeGameWindow" design-size="1690 1170">
+ <widget class="Gtk.Window" id="Mundus.Views.Windows.GameWindows.Large.LargeGameWindow" design-size="1690 1170">
<property name="MemberName" />
<property name="Title">LargeGameWindow</property>
<property name="WindowPosition">Mouse</property>