aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2020-03-10 19:37:39 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2020-03-10 19:37:39 +0200
commit65d6ddb127e22652d4edebca2e47167a18ec8541 (patch)
tree83cb57a364911a2efaf5f2f9b8dc20d229ca7fef
parentaca492ea4a70acf24642b3c7f4336c026c24170c (diff)
downloadMundus-65d6ddb127e22652d4edebca2e47167a18ec8541.tar
Mundus-65d6ddb127e22652d4edebca2e47167a18ec8541.tar.gz
Mundus-65d6ddb127e22652d4edebca2e47167a18ec8541.zip
Started work on item types
-rw-r--r--Mundus/Data/SuperLayers/ISuperLayer.cs9
-rw-r--r--Mundus/Data/SuperLayers/Land.cs19
-rw-r--r--Mundus/Data/Tiles/ToolTypes.cs6
-rw-r--r--Mundus/Icons/Blanks/blank.pngbin0 -> 3315 bytes
-rw-r--r--Mundus/Icons/Blanks/blank_gear.pngbin0 -> 4339 bytes
-rw-r--r--Mundus/Icons/Blanks/blank_hand.pngbin0 -> 4339 bytes
-rw-r--r--Mundus/Icons/Project files/blank_gear.xcfbin0 -> 2700 bytes
-rw-r--r--Mundus/Icons/Project files/blank_hand.xcfbin0 -> 1734 bytes
-rw-r--r--Mundus/Icons/blank.jpgbin815 -> 0 bytes
-rw-r--r--Mundus/Mundus.csproj13
-rw-r--r--Mundus/Service/GameGenerator.cs4
-rw-r--r--Mundus/Service/Inventory.cs20
-rw-r--r--Mundus/Service/Mobs/MobMoving.cs4
-rw-r--r--Mundus/Service/SuperLayers/ImageController.cs20
-rw-r--r--Mundus/Service/SuperLayers/LandSuperLayerGenerator.cs10
-rw-r--r--Mundus/Service/SwitchItems.cs51
-rw-r--r--Mundus/Service/Tiles/ItemTile.cs20
-rw-r--r--Mundus/Service/Tiles/Items/Gear.cs6
-rw-r--r--Mundus/Service/Tiles/Items/ItemTile.cs14
-rw-r--r--Mundus/Service/Tiles/Items/Material.cs6
-rw-r--r--Mundus/Service/Tiles/Items/Structure.cs14
-rw-r--r--Mundus/Service/Tiles/Items/Tool.cs13
-rw-r--r--Mundus/Views/Windows/SmallGameWindow.cs7
-rw-r--r--Mundus/gtk-gui/Mundus.Views.Windows.SmallGameWindow.cs110
-rw-r--r--Mundus/gtk-gui/generated.cs16
-rw-r--r--Mundus/gtk-gui/gui.stetic31
26 files changed, 246 insertions, 147 deletions
diff --git a/Mundus/Data/SuperLayers/ISuperLayer.cs b/Mundus/Data/SuperLayers/ISuperLayer.cs
index 2b0af02..c1f62a3 100644
--- a/Mundus/Data/SuperLayers/ISuperLayer.cs
+++ b/Mundus/Data/SuperLayers/ISuperLayer.cs
@@ -1,18 +1,19 @@
using Mundus.Service.Tiles;
+using Mundus.Service.Tiles.Items;
namespace Mundus.Data.SuperLayers {
public interface ISuperLayer {
MobTile GetMobLayerTile(int yPpos, int xPos);
- ItemTile GetItemLayerTile(int yPos, int xPos);
+ Structure GetStructureLayerTile(int yPos, int xPos);
GroundTile GetGroundLayerTile(int yPos, int xPos);
void SetMobLayer(MobTile[,] mobTiles);
void SetMobAtPosition(MobTile tile, int yPos, int xPos);
void RemoveMobFromPosition(int yPos, int xPos);
- void SetItemLayer(ItemTile[,] itemTiles);
- void SetItemAtPosition(ItemTile tile, int yPos, int xPos);
- void RemoveItemFromPosition(int yPos, int xPos);
+ void SetStructureLayer(Structure[,] itemTiles);
+ void SetStructureAtPosition(Structure tile, int yPos, int xPos);
+ void RemoveStructureFromPosition(int yPos, int xPos);
void SetGroundLayer(GroundTile[,] groundTiles);
void SetGroundAtPosition(GroundTile tile, int yPos, int xPos);
diff --git a/Mundus/Data/SuperLayers/Land.cs b/Mundus/Data/SuperLayers/Land.cs
index 069b7cb..8e88374 100644
--- a/Mundus/Data/SuperLayers/Land.cs
+++ b/Mundus/Data/SuperLayers/Land.cs
@@ -1,9 +1,10 @@
using Mundus.Service.Tiles;
+using Mundus.Service.Tiles.Items;
namespace Mundus.Data.SuperLayers {
public class Land : ISuperLayer {
private static MobTile[,] mobLayer;
- private static ItemTile[,] itemLayer;
+ private static Structure[,] structureLayer;
private static GroundTile[,] groundLayer;
public Land() { }
@@ -11,8 +12,8 @@ namespace Mundus.Data.SuperLayers {
public MobTile GetMobLayerTile(int yPos, int xPos) {
return mobLayer[yPos, xPos];
}
- public ItemTile GetItemLayerTile(int yPos, int xPos) {
- return itemLayer[yPos, xPos];
+ public Structure GetStructureLayerTile(int yPos, int xPos) {
+ return structureLayer[yPos, xPos];
}
public GroundTile GetGroundLayerTile(int yPos, int xPos) {
return groundLayer[yPos, xPos];
@@ -28,14 +29,14 @@ namespace Mundus.Data.SuperLayers {
mobLayer[yPos, xPos] = null;
}
- public void SetItemLayer(ItemTile[,] itemTiles) {
- itemLayer = itemTiles;
+ public void SetStructureLayer(Structure[,] itemTiles) {
+ structureLayer = itemTiles;
}
- public void SetItemAtPosition(ItemTile tile, int yPos, int xPos) {
- itemLayer[yPos, xPos] = tile;
+ public void SetStructureAtPosition(Structure tile, int yPos, int xPos) {
+ structureLayer[yPos, xPos] = tile;
}
- public void RemoveItemFromPosition(int yPos, int xPos) {
- itemLayer[yPos, xPos] = null;
+ public void RemoveStructureFromPosition(int yPos, int xPos) {
+ structureLayer[yPos, xPos] = null;
}
public void SetGroundLayer(GroundTile[,] groundTiles) {
diff --git a/Mundus/Data/Tiles/ToolTypes.cs b/Mundus/Data/Tiles/ToolTypes.cs
new file mode 100644
index 0000000..9d0c0d9
--- /dev/null
+++ b/Mundus/Data/Tiles/ToolTypes.cs
@@ -0,0 +1,6 @@
+namespace Mundus.Data.Tiles {
+ public static class ToolTypes {
+ public static int Sword = 0;
+ public static int Pickaxe = 1;
+ }
+}
diff --git a/Mundus/Icons/Blanks/blank.png b/Mundus/Icons/Blanks/blank.png
new file mode 100644
index 0000000..049be24
--- /dev/null
+++ b/Mundus/Icons/Blanks/blank.png
Binary files differ
diff --git a/Mundus/Icons/Blanks/blank_gear.png b/Mundus/Icons/Blanks/blank_gear.png
new file mode 100644
index 0000000..3d369a7
--- /dev/null
+++ b/Mundus/Icons/Blanks/blank_gear.png
Binary files differ
diff --git a/Mundus/Icons/Blanks/blank_hand.png b/Mundus/Icons/Blanks/blank_hand.png
new file mode 100644
index 0000000..3c41e07
--- /dev/null
+++ b/Mundus/Icons/Blanks/blank_hand.png
Binary files differ
diff --git a/Mundus/Icons/Project files/blank_gear.xcf b/Mundus/Icons/Project files/blank_gear.xcf
new file mode 100644
index 0000000..9aae9cf
--- /dev/null
+++ b/Mundus/Icons/Project files/blank_gear.xcf
Binary files differ
diff --git a/Mundus/Icons/Project files/blank_hand.xcf b/Mundus/Icons/Project files/blank_hand.xcf
new file mode 100644
index 0000000..b55e803
--- /dev/null
+++ b/Mundus/Icons/Project files/blank_hand.xcf
Binary files differ
diff --git a/Mundus/Icons/blank.jpg b/Mundus/Icons/blank.jpg
deleted file mode 100644
index 96da13b..0000000
--- a/Mundus/Icons/blank.jpg
+++ /dev/null
Binary files differ
diff --git a/Mundus/Mundus.csproj b/Mundus/Mundus.csproj
index fbddcf9..f3cede2 100644
--- a/Mundus/Mundus.csproj
+++ b/Mundus/Mundus.csproj
@@ -52,10 +52,12 @@
<EmbeddedResource Include="gtk-gui\gui.stetic">
<LogicalName>gui.stetic</LogicalName>
</EmbeddedResource>
- <EmbeddedResource Include="Icons\blank.jpg" />
<EmbeddedResource Include="Icons\Land\Ground\grass.png" />
<EmbeddedResource Include="Icons\Land\Items\boulder.png" />
<EmbeddedResource Include="Icons\player.png" />
+ <EmbeddedResource Include="Icons\Blanks\blank.png" />
+ <EmbeddedResource Include="Icons\Blanks\blank_hand.png" />
+ <EmbeddedResource Include="Icons\Blanks\blank_gear.png" />
</ItemGroup>
<ItemGroup>
<Compile Include="gtk-gui\generated.cs" />
@@ -82,7 +84,6 @@
<Compile Include="Views\Dialogs\ExitDialog.cs" />
<Compile Include="gtk-gui\Mundus.Views.Dialogs.ExitDialog.cs" />
<Compile Include="Service\Tiles\GroundTile.cs" />
- <Compile Include="Service\Tiles\ItemTile.cs" />
<Compile Include="Service\Tiles\ITile.cs" />
<Compile Include="Service\Mobs\IMob.cs" />
<Compile Include="Service\Tiles\MobTile.cs" />
@@ -103,6 +104,12 @@
<Compile Include="Data\SuperLayers\Mobs\LMI.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="Data\Tiles\ToolTypes.cs" />
+ <Compile Include="Service\Tiles\Items\Material.cs" />
+ <Compile Include="Service\Tiles\Items\Gear.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Service\" />
@@ -120,6 +127,8 @@
<Folder Include="Data\Dialogues\" />
<Folder Include="Data\SuperLayers\" />
<Folder Include="Data\SuperLayers\Mobs\" />
+ <Folder Include="Service\Tiles\Items\" />
+ <Folder Include="Data\Tiles\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file
diff --git a/Mundus/Service/GameGenerator.cs b/Mundus/Service/GameGenerator.cs
index 4baf325..4925757 100644
--- a/Mundus/Service/GameGenerator.cs
+++ b/Mundus/Service/GameGenerator.cs
@@ -29,9 +29,9 @@ namespace Mundus.Service {
}
public static void GameWindowInventorySetup(IGameWindow gameWindow) {
- LMI.CreateInventories(gameWindow.Size);
- WI.WPause.GameWindow = gameWindow;
gameWindow.SetDefaults();
+ WI.WPause.GameWindow = gameWindow;
+ LMI.CreateInventories(gameWindow.Size);
gameWindow.PrintScreen();
gameWindow.PrintInventory();
gameWindow.Show();
diff --git a/Mundus/Service/Inventory.cs b/Mundus/Service/Inventory.cs
index b0e0257..a60a2fb 100644
--- a/Mundus/Service/Inventory.cs
+++ b/Mundus/Service/Inventory.cs
@@ -1,26 +1,28 @@
-using Mundus.Service.Tiles;
+using Mundus.Service.Tiles.Items;
namespace Mundus.Service {
public class Inventory {
- public ItemTile[] Hotbar { get; set; }
- public ItemTile[] Items { get; set; }
- public ItemTile[] Accessories { get; set; }
- public ItemTile[] Gear { get; set; }
+ public Tool Hand { get; set; }
+ public Material[] Hotbar { get; set; }
+ public Material[] Items { get; set; }
+ public Gear[] Accessories { get; set; }
+ public Gear[] Gear { get; set; }
public Inventory(int screenInvSize) {
this.SetNewSizes(screenInvSize);
}
public void SetNewSizes(int screenInvSize) {
- this.Hotbar = new ItemTile[screenInvSize];
- this.Items = new ItemTile[screenInvSize * screenInvSize];
- this.Accessories = new ItemTile[screenInvSize * 2];
- this.Gear = new ItemTile[screenInvSize];
+ this.Hotbar = new Material[screenInvSize - 1];
+ this.Items = new Material[screenInvSize * screenInvSize];
+ this.Accessories = new Gear[screenInvSize * 2];
+ this.Gear = new Gear[screenInvSize];
}
public void AddItem(string place, ItemTile newItem) {
ItemTile[] tmp = null;
switch (place.ToLower()) {
+ case "hand": tmp[0] = this.Hand; break;
case "hotbar": tmp = this.Hotbar; break;
case "items": tmp = this.Items; break;
case "accessories": tmp = this.Accessories; break;
diff --git a/Mundus/Service/Mobs/MobMoving.cs b/Mundus/Service/Mobs/MobMoving.cs
index 7628edc..8ac821b 100644
--- a/Mundus/Service/Mobs/MobMoving.cs
+++ b/Mundus/Service/Mobs/MobMoving.cs
@@ -19,8 +19,8 @@ namespace Mundus.Service.Mobs {
}
public static void ChangePosition(IMob mob, int yPos, int xPos) {
- if (mob.CurrSuperLayer.GetItemLayerTile( yPos, xPos ) == null ||
- mob.CurrSuperLayer.GetItemLayerTile( yPos, xPos ).IsWalkable) {
+ if (mob.CurrSuperLayer.GetStructureLayerTile( yPos, xPos ) == null ||
+ mob.CurrSuperLayer.GetStructureLayerTile( yPos, xPos ).IsWalkable) {
mob.CurrSuperLayer.RemoveMobFromPosition( mob.YPos, mob.XPos );
mob.YPos = yPos;
mob.XPos = xPos;
diff --git a/Mundus/Service/SuperLayers/ImageController.cs b/Mundus/Service/SuperLayers/ImageController.cs
index c66f29d..f7b5c28 100644
--- a/Mundus/Service/SuperLayers/ImageController.cs
+++ b/Mundus/Service/SuperLayers/ImageController.cs
@@ -21,8 +21,8 @@ namespace Mundus.Service.SuperLayers {
}
}
else if (layer == 1 &&
- superLayer.GetItemLayerTile( row, col ) != null) {
- img = new Image( superLayer.GetItemLayerTile( row, col ).stock_id, IconSize.Dnd );
+ superLayer.GetStructureLayerTile( row, col ) != null) {
+ img = new Image( superLayer.GetStructureLayerTile( row, col ).stock_id, IconSize.Dnd );
}
else if (layer == 2 &&
superLayer.GetMobLayerTile( row, col ) != null) {
@@ -49,8 +49,16 @@ namespace Mundus.Service.SuperLayers {
Image img = new Image( "blank", IconSize.Dnd );
if (row >= 0 && col >= 0 && col < MapSizes.CurrSize && row < MapSizes.CurrSize &&
- superLayer.GetItemLayerTile( row, col ) != null) {
- img = superLayer.GetItemLayerTile( row, col ).Texture;
+ superLayer.GetStructureLayerTile( row, col ) != null) {
+ img = superLayer.GetStructureLayerTile( row, col ).Texture;
+ }
+ return img;
+ }
+
+ public static Image GetHandImage() {
+ Image img = new Image("blank_hand", IconSize.Dnd);
+ if (LMI.Player.Inventory.Hand != null) {
+ img = LMI.Player.Inventory.Hand.Texture;
}
return img;
}
@@ -77,7 +85,7 @@ namespace Mundus.Service.SuperLayers {
}
public static Image GetAccessoryImage(int index) {
- Image img = new Image("blank", IconSize.Dnd);
+ Image img = new Image("blank_gear", IconSize.Dnd);
if (index < LMI.Player.Inventory.Accessories.Length) {
if (LMI.Player.Inventory.Accessories[index] != null) {
img = LMI.Player.Inventory.Accessories[index].Texture;
@@ -87,7 +95,7 @@ namespace Mundus.Service.SuperLayers {
}
public static Image GetGearImage(int index) {
- Image img = new Image( "blank", IconSize.Dnd );
+ Image img = new Image("blank_gear", IconSize.Dnd);
if (index < LMI.Player.Inventory.Gear.Length) {
if (LMI.Player.Inventory.Gear[index] != null) {
img = LMI.Player.Inventory.Gear[index].Texture;
diff --git a/Mundus/Service/SuperLayers/LandSuperLayerGenerator.cs b/Mundus/Service/SuperLayers/LandSuperLayerGenerator.cs
index 8446ced..8157295 100644
--- a/Mundus/Service/SuperLayers/LandSuperLayerGenerator.cs
+++ b/Mundus/Service/SuperLayers/LandSuperLayerGenerator.cs
@@ -1,7 +1,9 @@
using System;
using Mundus.Data.Superlayers.Mobs;
using Mundus.Data.SuperLayers;
+using Mundus.Data.Tiles;
using Mundus.Service.Tiles;
+using Mundus.Service.Tiles.Items;
namespace Mundus.Service.SuperLayers {
public static class LandSuperLayerGenerator {
@@ -10,7 +12,7 @@ namespace Mundus.Service.SuperLayers {
public static void GenerateAllLayers(int size) {
LI.Land.SetMobLayer(GenerateMobLayer(size));
LI.Land.SetGroundLayer(GenerateGroundLayer(size));
- LI.Land.SetItemLayer(GenerateItemLayer(size));
+ LI.Land.SetStructureLayer(GenerateStructureLayer(size));
}
private static MobTile[,] GenerateMobLayer(int size) {
@@ -41,13 +43,13 @@ namespace Mundus.Service.SuperLayers {
return tiles;
}
- private static ItemTile[,] GenerateItemLayer(int size) {
- ItemTile[,] tiles = new ItemTile[size, size];
+ private static Structure[,] GenerateStructureLayer(int size) {
+ Structure[,] tiles = new Structure[size, size];
for (int col = 0; col < size; col++) {
for (int row = 0; row < size; row++) {
if (rnd.Next( 0, 50 ) == 1) {
- tiles[col, row] = new ItemTile("boulder");
+ tiles[col, row] = new Structure("boulder", ToolTypes.Pickaxe, 1);
}
}
}
diff --git a/Mundus/Service/SwitchItems.cs b/Mundus/Service/SwitchItems.cs
index 4a2d2fd..a8dcb5b 100644
--- a/Mundus/Service/SwitchItems.cs
+++ b/Mundus/Service/SwitchItems.cs
@@ -1,48 +1,65 @@
using Mundus.Data.Superlayers.Mobs;
using Mundus.Service.Tiles;
+using Mundus.Service.Tiles.Items;
namespace Mundus.Service {
- public static class SwitchItems {
+ public static class SwitchItems {
+ private static string originType = null;
private static ItemTile[] origin = null;
private static int oIndex = -1;
public static void SetOrigin(string originName, int originIndex) {
ItemTile[] newOrigin = null;
- switch (originName.ToLower()) {
+ switch (originName.ToLower()) {
+ case "hand": newOrigin = new ItemTile[] { LMI.Player.Inventory.Hand }; break;
case "hotbar": newOrigin = LMI.Player.Inventory.Hotbar; break;
case "items": newOrigin = LMI.Player.Inventory.Items; break;
case "accessories": newOrigin = LMI.Player.Inventory.Accessories; break;
case "gear": newOrigin = LMI.Player.Inventory.Gear; break;
}
- SetOrigin(newOrigin, originIndex);
+ SetOrigin(originName, newOrigin, originIndex);
}
- public static void SetOrigin(ItemTile[] newOrigin, int originIndex) {
+ private static void SetOrigin(string newOriginType, ItemTile[] newOrigin, int originIndex) {
+ originType = newOriginType;
origin = newOrigin;
oIndex = originIndex;
}
- public static void ReplaceItems(string destnation, int destinationIndex) {
- ItemTile[] destinationLocation = null;
+ public static void ReplaceItems(string destination, int destinationIndex) {
+ if (destination == originType) {
+ ItemTile[] destinationLocation = null;
- switch (destnation.ToLower()) {
- case "hotbar": destinationLocation = LMI.Player.Inventory.Hotbar; break;
- case "items": destinationLocation = LMI.Player.Inventory.Items; break;
- case "accessories": destinationLocation = LMI.Player.Inventory.Accessories; break;
- case "gear": destinationLocation = LMI.Player.Inventory.Gear; break;
+ switch (destination.ToLower()) {
+ case "hand": destinationLocation = new ItemTile[] { LMI.Player.Inventory.Hand }; break;
+ case "hotbar": destinationLocation = LMI.Player.Inventory.Hotbar; break;
+ case "items": destinationLocation = LMI.Player.Inventory.Items; break;
+ case "accessories": destinationLocation = LMI.Player.Inventory.Accessories; break;
+ case "gear": destinationLocation = LMI.Player.Inventory.Gear; break;
+ }
+ ReplaceItems(destinationLocation, destinationIndex);
+ }
+ else {
+ Reset();
}
- ReplaceItems(destinationLocation, destinationIndex);
}
public static void ReplaceItems(ItemTile[] destination, int destinationIndex) {
- var toTransfer = origin[oIndex];
- origin[oIndex] = destination[destinationIndex];
- destination[destinationIndex] = toTransfer;
+ if (origin[0].GetType() == destination[0].GetType()) {
+ var toTransfer = origin[oIndex];
+ origin[oIndex] = destination[destinationIndex];
+ destination[destinationIndex] = toTransfer;
+ }
- origin = null;
- oIndex = -1;
+ Reset();
}
+
+ private static void Reset() {
+ originType = null;
+ origin = null;
+ oIndex = -1;
+ }
public static bool HasOrigin() {
return origin != null && oIndex != -1;
diff --git a/Mundus/Service/Tiles/ItemTile.cs b/Mundus/Service/Tiles/ItemTile.cs
deleted file mode 100644
index 67134a4..0000000
--- a/Mundus/Service/Tiles/ItemTile.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Gtk;
-
-namespace Mundus.Service.Tiles {
- public class ItemTile {
- public string stock_id { get; private set; }
- public Image Texture { get; private set; }
-
- public bool IsWalkable { get; private set; }
-
- public ItemTile(string stock_id) : this(stock_id, false )
- { }
-
- public ItemTile(string stock_id, bool isWalkable) {
- this.stock_id = stock_id;
- this.Texture = new Image( stock_id, IconSize.Dnd );
-
- this.IsWalkable = isWalkable;
- }
- }
-}
diff --git a/Mundus/Service/Tiles/Items/Gear.cs b/Mundus/Service/Tiles/Items/Gear.cs
new file mode 100644
index 0000000..84c34fb
--- /dev/null
+++ b/Mundus/Service/Tiles/Items/Gear.cs
@@ -0,0 +1,6 @@
+namespace Mundus.Service.Tiles.Items {
+ public class Gear : ItemTile {
+ public Gear(string stock_id) : base(stock_id)
+ { }
+ }
+}
diff --git a/Mundus/Service/Tiles/Items/ItemTile.cs b/Mundus/Service/Tiles/Items/ItemTile.cs
new file mode 100644
index 0000000..56c95a2
--- /dev/null
+++ b/Mundus/Service/Tiles/Items/ItemTile.cs
@@ -0,0 +1,14 @@
+using Gtk;
+using Mundus.Service.Tiles;
+
+namespace Mundus.Service.Tiles.Items {
+ public abstract class ItemTile : ITile {
+ public string stock_id { get; private set; }
+ public Image Texture { get; private set; }
+
+ public ItemTile(string stock_id) {
+ this.stock_id = stock_id;
+ this.Texture = new Image( stock_id, IconSize.Dnd );
+ }
+ }
+}
diff --git a/Mundus/Service/Tiles/Items/Material.cs b/Mundus/Service/Tiles/Items/Material.cs
new file mode 100644
index 0000000..008619f
--- /dev/null
+++ b/Mundus/Service/Tiles/Items/Material.cs
@@ -0,0 +1,6 @@
+namespace Mundus.Service.Tiles.Items {
+ public class Material : ItemTile {
+ public Material(string stock_id) : base(stock_id)
+ { }
+ }
+}
diff --git a/Mundus/Service/Tiles/Items/Structure.cs b/Mundus/Service/Tiles/Items/Structure.cs
new file mode 100644
index 0000000..569f712
--- /dev/null
+++ b/Mundus/Service/Tiles/Items/Structure.cs
@@ -0,0 +1,14 @@
+namespace Mundus.Service.Tiles.Items {
+ public class Structure : ItemTile {
+ public int ReqToolType { get; private set; }
+ public int ReqToolClass { get; private set; }
+
+ public bool IsWalkable { get; private set; }
+
+ public Structure(string stock_id, int reqToolType, int reqToolClass, bool isWalkable = false) : base(stock_id) {
+ this.ReqToolType = reqToolType;
+ this.ReqToolClass = reqToolClass;
+ this.IsWalkable = isWalkable;
+ }
+ }
+}
diff --git a/Mundus/Service/Tiles/Items/Tool.cs b/Mundus/Service/Tiles/Items/Tool.cs
new file mode 100644
index 0000000..436470c
--- /dev/null
+++ b/Mundus/Service/Tiles/Items/Tool.cs
@@ -0,0 +1,13 @@
+using Mundus.Data.Tiles;
+
+namespace Mundus.Service.Tiles.Items {
+ public class Tool : ItemTile {
+ public int Type { get; private set; }
+ public int Class { get; private set; }
+
+ public Tool(string stock_id, int toolType, int toolClass) : base(stock_id) {
+ this.Type = toolType;
+ this.Class = toolClass;
+ }
+ }
+}
diff --git a/Mundus/Views/Windows/SmallGameWindow.cs b/Mundus/Views/Windows/SmallGameWindow.cs
index c4668ed..331f531 100644
--- a/Mundus/Views/Windows/SmallGameWindow.cs
+++ b/Mundus/Views/Windows/SmallGameWindow.cs
@@ -322,6 +322,8 @@ namespace Mundus.Views.Windows {
}
public void PrintInventory() {
+ btnH.Image = ImageController.GetHandImage();
+
//Prints hotbar
for (int i = 0; i < Size; i++) {
Image img = ImageController.GetHotbarImage(i);
@@ -331,7 +333,6 @@ namespace Mundus.Views.Windows {
case 2: btnH2.Image = img; break;
case 3: btnH3.Image = img; break;
case 4: btnH4.Image = img; break;
- case 5: btnH5.Image = img; break;
}
}
@@ -835,5 +836,9 @@ namespace Mundus.Views.Windows {
this.PrintInventory();
}
+
+ protected void OnBtnIG1Clicked(object sender, EventArgs e) {
+ Mundus.Data.Superlayers.Mobs.LMI.Player.Inventory.AddItem("items");
+ }
}
}
diff --git a/Mundus/gtk-gui/Mundus.Views.Windows.SmallGameWindow.cs b/Mundus/gtk-gui/Mundus.Views.Windows.SmallGameWindow.cs
index 7338701..10e424c 100644
--- a/Mundus/gtk-gui/Mundus.Views.Windows.SmallGameWindow.cs
+++ b/Mundus/gtk-gui/Mundus.Views.Windows.SmallGameWindow.cs
@@ -42,6 +42,8 @@ namespace Mundus.Views.Windows
private global::Gtk.Button btnGM3;
+ private global::Gtk.Button btnH;
+
private global::Gtk.Button btnH1;
private global::Gtk.Button btnH2;
@@ -50,8 +52,6 @@ namespace Mundus.Views.Windows
private global::Gtk.Button btnH4;
- private global::Gtk.Button btnH5;
-
private global::Gtk.Button btnI1;
private global::Gtk.Button btnI10;
@@ -658,6 +658,24 @@ namespace Mundus.Views.Windows
w33.XOptions = ((global::Gtk.AttachOptions)(4));
w33.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child tbUI.Gtk.Table+TableChild
+ this.btnH = new global::Gtk.Button();
+ this.btnH.WidthRequest = 50;
+ this.btnH.HeightRequest = 50;
+ this.btnH.CanFocus = true;
+ this.btnH.Name = "btnH";
+ this.btnH.UseUnderline = true;
+ this.btnH.Relief = ((global::Gtk.ReliefStyle)(1));
+ global::Gtk.Image w34 = new global::Gtk.Image();
+ this.btnH.Image = w34;
+ this.tbUI.Add(this.btnH);
+ global::Gtk.Table.TableChild w35 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH]));
+ w35.TopAttach = ((uint)(10));
+ w35.BottomAttach = ((uint)(11));
+ w35.LeftAttach = ((uint)(8));
+ w35.RightAttach = ((uint)(9));
+ w35.XOptions = ((global::Gtk.AttachOptions)(4));
+ w35.YOptions = ((global::Gtk.AttachOptions)(4));
+ // Container child tbUI.Gtk.Table+TableChild
this.btnH1 = new global::Gtk.Button();
this.btnH1.WidthRequest = 50;
this.btnH1.HeightRequest = 50;
@@ -665,16 +683,16 @@ namespace Mundus.Views.Windows
this.btnH1.Name = "btnH1";
this.btnH1.UseUnderline = true;
this.btnH1.Relief = ((global::Gtk.ReliefStyle)(1));
- global::Gtk.Image w34 = new global::Gtk.Image();
- this.btnH1.Image = w34;
+ global::Gtk.Image w36 = new global::Gtk.Image();
+ this.btnH1.Image = w36;
this.tbUI.Add(this.btnH1);
- global::Gtk.Table.TableChild w35 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH1]));
- w35.TopAttach = ((uint)(10));
- w35.BottomAttach = ((uint)(11));
- w35.LeftAttach = ((uint)(8));
- w35.RightAttach = ((uint)(9));
- w35.XOptions = ((global::Gtk.AttachOptions)(4));
- w35.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w37 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH1]));
+ w37.TopAttach = ((uint)(10));
+ w37.BottomAttach = ((uint)(11));
+ w37.LeftAttach = ((uint)(9));
+ w37.RightAttach = ((uint)(10));
+ w37.XOptions = ((global::Gtk.AttachOptions)(4));
+ w37.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child tbUI.Gtk.Table+TableChild
this.btnH2 = new global::Gtk.Button();
this.btnH2.WidthRequest = 50;
@@ -683,16 +701,16 @@ namespace Mundus.Views.Windows
this.btnH2.Name = "btnH2";
this.btnH2.UseUnderline = true;
this.btnH2.Relief = ((global::Gtk.ReliefStyle)(1));
- global::Gtk.Image w36 = new global::Gtk.Image();
- this.btnH2.Image = w36;
+ global::Gtk.Image w38 = new global::Gtk.Image();
+ this.btnH2.Image = w38;
this.tbUI.Add(this.btnH2);
- global::Gtk.Table.TableChild w37 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH2]));
- w37.TopAttach = ((uint)(10));
- w37.BottomAttach = ((uint)(11));
- w37.LeftAttach = ((uint)(9));
- w37.RightAttach = ((uint)(10));
- w37.XOptions = ((global::Gtk.AttachOptions)(4));
- w37.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w39 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH2]));
+ w39.TopAttach = ((uint)(10));
+ w39.BottomAttach = ((uint)(11));
+ w39.LeftAttach = ((uint)(10));
+ w39.RightAttach = ((uint)(11));
+ w39.XOptions = ((global::Gtk.AttachOptions)(4));
+ w39.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child tbUI.Gtk.Table+TableChild
this.btnH3 = new global::Gtk.Button();
this.btnH3.WidthRequest = 50;
@@ -701,16 +719,16 @@ namespace Mundus.Views.Windows
this.btnH3.Name = "btnH3";
this.btnH3.UseUnderline = true;
this.btnH3.Relief = ((global::Gtk.ReliefStyle)(1));
- global::Gtk.Image w38 = new global::Gtk.Image();
- this.btnH3.Image = w38;
+ global::Gtk.Image w40 = new global::Gtk.Image();
+ this.btnH3.Image = w40;
this.tbUI.Add(this.btnH3);
- global::Gtk.Table.TableChild w39 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH3]));
- w39.TopAttach = ((uint)(10));
- w39.BottomAttach = ((uint)(11));
- w39.LeftAttach = ((uint)(10));
- w39.RightAttach = ((uint)(11));
- w39.XOptions = ((global::Gtk.AttachOptions)(4));
- w39.YOptions = ((global::Gtk.AttachOptions)(4));
+ global::Gtk.Table.TableChild w41 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH3]));
+ w41.TopAttach = ((uint)(10));
+ w41.BottomAttach = ((uint)(11));
+ w41.LeftAttach = ((uint)(11));
+ w41.RightAttach = ((uint)(12));
+ w41.XOptions = ((global::Gtk.AttachOptions)(4));
+ w41.YOptions = ((global::Gtk.AttachOptions)(4));
// Container child tbUI.Gtk.Table+TableChild
this.btnH4 = new global::Gtk.Button();
this.btnH4.WidthRequest = 50;
@@ -719,28 +737,10 @@ namespace Mundus.Views.Windows
this.btnH4.Name = "btnH4";
this.btnH4.UseUnderline = true;
this.btnH4.Relief = ((global::Gtk.ReliefStyle)(1));
- global::Gtk.Image w40 = new global::Gtk.Image();
- this.btnH4.Image = w40;
- this.tbUI.Add(this.btnH4);
- global::Gtk.Table.TableChild w41 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH4]));
- w41.TopAttach = ((uint)(10));
- w41.BottomAttach = ((uint)(11));
- w41.LeftAttach = ((uint)(11));
- w41.RightAttach = ((uint)(12));
- w41.XOptions = ((global::Gtk.AttachOptions)(4));
- w41.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child tbUI.Gtk.Table+TableChild
- this.btnH5 = new global::Gtk.Button();
- this.btnH5.WidthRequest = 50;
- this.btnH5.HeightRequest = 50;
- this.btnH5.CanFocus = true;
- this.btnH5.Name = "btnH5";
- this.btnH5.UseUnderline = true;
- this.btnH5.Relief = ((global::Gtk.ReliefStyle)(1));
global::Gtk.Image w42 = new global::Gtk.Image();
- this.btnH5.Image = w42;
- this.tbUI.Add(this.btnH5);
- global::Gtk.Table.TableChild w43 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH5]));
+ this.btnH4.Image = w42;
+ this.tbUI.Add(this.btnH4);
+ global::Gtk.Table.TableChild w43 = ((global::Gtk.Table.TableChild)(this.tbUI[this.btnH4]));
w43.TopAttach = ((uint)(10));
w43.BottomAttach = ((uint)(11));
w43.LeftAttach = ((uint)(12));
@@ -2962,11 +2962,11 @@ namespace Mundus.Views.Windows
this.btnI11.Clicked += new global::System.EventHandler(this.OnBtnI11Clicked);
this.btnI10.Clicked += new global::System.EventHandler(this.OnBtnI10Clicked);
this.btnI1.Clicked += new global::System.EventHandler(this.OnBtnI1Clicked);
- this.btnH5.Clicked += new global::System.EventHandler(this.OnBtnH5Clicked);
- this.btnH4.Clicked += new global::System.EventHandler(this.OnBtnH4Clicked);
- this.btnH3.Clicked += new global::System.EventHandler(this.OnBtnH3Clicked);
- this.btnH2.Clicked += new global::System.EventHandler(this.OnBtnH2Clicked);
- this.btnH1.Clicked += new global::System.EventHandler(this.OnBtnH1Clicked);
+ this.btnH4.Clicked += new global::System.EventHandler(this.OnBtnH5Clicked);
+ this.btnH3.Clicked += new global::System.EventHandler(this.OnBtnH4Clicked);
+ this.btnH2.Clicked += new global::System.EventHandler(this.OnBtnH3Clicked);
+ this.btnH1.Clicked += new global::System.EventHandler(this.OnBtnH2Clicked);
+ this.btnH.Clicked += new global::System.EventHandler(this.OnBtnH1Clicked);
this.btnG5.Clicked += new global::System.EventHandler(this.OnBtnG5Clicked);
this.btnG4.Clicked += new global::System.EventHandler(this.OnBtnG4Clicked);
this.btnG3.Clicked += new global::System.EventHandler(this.OnBtnG3Clicked);
diff --git a/Mundus/gtk-gui/generated.cs b/Mundus/gtk-gui/generated.cs
index 82ce78e..59f6ad5 100644
--- a/Mundus/gtk-gui/generated.cs
+++ b/Mundus/gtk-gui/generated.cs
@@ -14,12 +14,16 @@ namespace Stetic
global::Gtk.IconFactory w1 = new global::Gtk.IconFactory();
global::Gtk.IconSet w2 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.Land.Ground.grass.png"));
w1.Add("grass", w2);
- global::Gtk.IconSet w3 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.blank.jpg"));
- w1.Add("blank", w3);
- global::Gtk.IconSet w4 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.Land.Items.boulder.png"));
- w1.Add("boulder", w4);
- global::Gtk.IconSet w5 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.player.png"));
- w1.Add("player", w5);
+ global::Gtk.IconSet w3 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.Land.Items.boulder.png"));
+ w1.Add("boulder", w3);
+ global::Gtk.IconSet w4 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.player.png"));
+ w1.Add("player", w4);
+ global::Gtk.IconSet w5 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.Blanks.blank.png"));
+ w1.Add("blank", w5);
+ global::Gtk.IconSet w6 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.Blanks.blank_hand.png"));
+ w1.Add("blank_hand", w6);
+ global::Gtk.IconSet w7 = new global::Gtk.IconSet(global::Gdk.Pixbuf.LoadFromResource("Mundus.Icons.Blanks.blank_gear.png"));
+ w1.Add("blank_gear", w7);
w1.AddDefault();
}
}
diff --git a/Mundus/gtk-gui/gui.stetic b/Mundus/gtk-gui/gui.stetic
index d103fc5..d33a8c7 100644
--- a/Mundus/gtk-gui/gui.stetic
+++ b/Mundus/gtk-gui/gui.stetic
@@ -12,11 +12,6 @@
<property name="Image">resource:Mundus.Icons.Land.Ground.grass.png</property>
</source>
</icon-set>
- <icon-set id="blank">
- <source>
- <property name="Image">resource:Mundus.Icons.blank.jpg</property>
- </source>
- </icon-set>
<icon-set id="boulder">
<source>
<property name="Image">resource:Mundus.Icons.Land.Items.boulder.png</property>
@@ -27,6 +22,21 @@
<property name="Image">resource:Mundus.Icons.player.png</property>
</source>
</icon-set>
+ <icon-set id="blank">
+ <source>
+ <property name="Image">resource:Mundus.Icons.Blanks.blank.png</property>
+ </source>
+ </icon-set>
+ <icon-set id="blank_hand">
+ <source>
+ <property name="Image">resource:Mundus.Icons.Blanks.blank_hand.png</property>
+ </source>
+ </icon-set>
+ <icon-set id="blank_gear">
+ <source>
+ <property name="Image">resource:Mundus.Icons.Blanks.blank_gear.png</property>
+ </source>
+ </icon-set>
</icon-factory>
<widget class="Gtk.Window" id="Mundus.Views.Windows.NewGameWindow" design-size="581 275">
<property name="MemberName" />
@@ -1671,7 +1681,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Button" id="btnH1">
+ <widget class="Gtk.Button" id="btnH">
<property name="MemberName" />
<property name="WidthRequest">50</property>
<property name="HeightRequest">50</property>
@@ -1699,7 +1709,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Button" id="btnH2">
+ <widget class="Gtk.Button" id="btnH1">
<property name="MemberName" />
<property name="WidthRequest">50</property>
<property name="HeightRequest">50</property>
@@ -1727,7 +1737,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Button" id="btnH3">
+ <widget class="Gtk.Button" id="btnH2">
<property name="MemberName" />
<property name="WidthRequest">50</property>
<property name="HeightRequest">50</property>
@@ -1755,7 +1765,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Button" id="btnH4">
+ <widget class="Gtk.Button" id="btnH3">
<property name="MemberName" />
<property name="WidthRequest">50</property>
<property name="HeightRequest">50</property>
@@ -1783,7 +1793,7 @@
</packing>
</child>
<child>
- <widget class="Gtk.Button" id="btnH5">
+ <widget class="Gtk.Button" id="btnH4">
<property name="MemberName" />
<property name="WidthRequest">50</property>
<property name="HeightRequest">50</property>
@@ -2519,6 +2529,7 @@
<property name="Type">TextAndIcon</property>
<property name="Label" translatable="yes" />
<property name="UseUnderline">True</property>
+ <signal name="Clicked" handler="OnBtnIG1Clicked" />
</widget>
<packing>
<property name="TopAttach">14</property>