Skip to content

Commit

Permalink
Merge pull request #134 from SneakyTactician/Crafting
Browse files Browse the repository at this point in the history
Crafting
  • Loading branch information
TBye101 authored May 7, 2019
2 parents c08966c + 55062d0 commit 563c82c
Show file tree
Hide file tree
Showing 400 changed files with 5,762 additions and 2,497 deletions.
Binary file added Assets/Graphics/Tiles and Objects/WoodPlank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ SneakyTactician <[email protected]>
*Removed Serilog dependency
*Inventories are now baked in for creatures
*Increased camera performance, 100x100 worlds are possible (~22 fps)
*Now putting core game content in the "Magical Life Core" mod
*Task manager rewrite to be more intelligent, offer more options for dynamic dependencies
*Crafting is now supported
*Protobuf-net inheritance and surrogates are now automatically handled
*Mods are now supported, and when found will be loaded

#### GUI
*Tilling dirt is now available from the in game GUI
Expand All @@ -20,10 +25,12 @@ SneakyTactician <[email protected]>
*Added the new log texture
*Skills/creature window now has an inventory tab
*Zooming out now supported
*Added the Action Bar

#### Bugs
*Fixed PineTree class property Name's value
*Fixed mined stones not disappering
*Surround sound now functions like it should

---

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@
/processorParam:TextureFormat=Color
/build:Logo/MonoGameLogo.png

#begin Banks/Master_Bank.bank
/copy:Banks/Master_Bank.bank

#begin Banks/Master_Bank.strings.bank
/copy:Banks/Master_Bank.strings.bank

#begin GUI/ListBoxItemBackground.png
/importer:TextureImporter
/processor:TextureProcessor
Expand Down Expand Up @@ -562,3 +556,81 @@
/processorParam:TextureFormat=Color
/build:Textures/Tile/TilledDirt.png

#begin Banks/Master_Bank.bank
/copy:Banks/Master_Bank.bank

#begin Banks/Master_Bank.strings.bank
/copy:Banks/Master_Bank.strings.bank

#begin Textures/Items/WoodPlank.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:Textures/Items/WoodPlank.png

#begin Textures/Items/Food/CornEar.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:Textures/Items/Food/CornEar.png

#begin Textures/Resource/Plants/Crops/CornFullGrowth.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:Textures/Resource/Plants/Crops/CornFullGrowth.png

#begin Textures/Resource/Plants/Crops/CornGrowth1.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:Textures/Resource/Plants/Crops/CornGrowth1.png

#begin Textures/Resource/Plants/Crops/CornGrowth2.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:Textures/Resource/Plants/Crops/CornGrowth2.png

#begin Textures/Resource/Plants/Crops/CornSeedling.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:Textures/Resource/Plants/Crops/CornSeedling.png

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions MLGUIWindows/FriendAssemblies.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("MagicalLifeAPITest")]
[assembly: InternalsVisibleTo("MagicalLifeClientStandard")]
[assembly: InternalsVisibleTo("MagicalLifeDedicatedServerCore")]
[assembly: InternalsVisibleTo("MagicalLifeAPIStandard")]
[assembly: InternalsVisibleTo("MagicalLifeModdingAPI")]
[assembly: InternalsVisibleTo("MagicalLifeServerStandard")]
[assembly: InternalsVisibleTo("MagicalLifeSettingsStandard")]

namespace MagicalLifeGUIWindows
{
/// <summary>
/// Used to control who has access to internal members of this assembly.
/// </summary>
public class FriendAssemblies
{
}
}
15 changes: 15 additions & 0 deletions MLGUIWindows/GUI/Action Menu/ActionMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace MagicalLifeGUIWindows.GUI.Action_Menu
{
/// <summary>
/// The action menu on the right side of the screen, when the correct key is pressed.
/// </summary>
public static class ActionMenu
{
public static ActionMenuContainer AMenu { get; } = new ActionMenuContainer(true);

internal static void Initialize()
{
MenuHandler.DisplayMenu(AMenu);
}
}
}
50 changes: 50 additions & 0 deletions MLGUIWindows/GUI/Action Menu/ActionMenuContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using MagicalLifeAPI.Asset;
using MagicalLifeAPI.Crafting;
using MagicalLifeAPI.DataTypes;
using MagicalLifeAPI.Registry.Recipe;
using MagicalLifeAPI.World.Base;
using MagicalLifeGUIWindows.GUI.Reusable;
using MagicalLifeGUIWindows.GUI.Reusable.Collections;
using Microsoft.Xna.Framework;
using MonoGUI.Game.Custom;
using System.Collections.Generic;

namespace MagicalLifeGUIWindows.GUI.Action_Menu
{
/// <summary>
/// The action menu container.
/// </summary>
public class ActionMenuContainer : GuiContainer
{
public MonoGrid ActionGrid { get; set; }

public ActionMenuContainer(bool visible) : base(TextureLoader.GUIMenuBackground, ActionMenuLayout.ActionMenuLocation, false)
{
this.Visible = visible;

this.ActionGrid = new MonoGrid(new Point2D(32, 32), ActionMenuLayout.ActionGridBounds, int.MaxValue,
true, TextureLoader.FontMainMenuFont12x, 5);
this.PopulateActionGrid();

this.Controls.Add(this.ActionGrid);
}

private void PopulateActionGrid()
{
Rectangle zero = new Rectangle(0, 0, 32, 32);
foreach (KeyValuePair<Item, List<IRecipe>> item in RecipeRegistry.ItemToRecipe)
{
foreach (IRecipe item2 in item.Value)
{
RenderableImage recipeImage = new RenderableIRecipe(zero, item2.GetDisplayTextureID(), true, item2);
this.ActionGrid.Add(recipeImage);
}
}
}

public override string GetTextureName()
{
return TextureLoader.GUIMenuBackground;
}
}
}
47 changes: 47 additions & 0 deletions MLGUIWindows/GUI/Action Menu/ActionMenuLayout.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using MagicalLifeAPI.Filing;
using Microsoft.Xna.Framework;

namespace MagicalLifeGUIWindows.GUI.Action_Menu
{
/// <summary>
/// Positioning data for the action menu.
/// </summary>
public static class ActionMenuLayout
{
/// <summary>
/// The dimensions of the action menu.
/// </summary>
public static Rectangle ActionMenuLocation
{
get
{
switch ((Resolution)SettingsManager.WindowSettings.Settings.Resolution)
{
case Resolution._2560x1440:
return ActionMenuLayout2560x1440.ActionMenuLocation;

default:
return ActionMenuLayout1920x1080.ActionMenuLocation;
}
}
}

/// <summary>
/// The dimensions of the actual grid containing the action items.
/// </summary>
public static Rectangle ActionGridBounds
{
get
{
switch ((Resolution)SettingsManager.WindowSettings.Settings.Resolution)
{
case Resolution._2560x1440:
return ActionMenuLayout2560x1440.ActionGridBounds;

default:
return ActionMenuLayout1920x1080.ActionGridBounds;
}
}
}
}
}
13 changes: 13 additions & 0 deletions MLGUIWindows/GUI/Action Menu/ActionMenuLayout1920x1080.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.Xna.Framework;

namespace MagicalLifeGUIWindows.GUI.Action_Menu
{
/// <summary>
/// Holds positioning information for the action menu.
/// </summary>
public static class ActionMenuLayout1920x1080
{
public static readonly Rectangle ActionMenuLocation = new Rectangle(1710, 0, 210, 1080);
public static readonly Rectangle ActionGridBounds = new Rectangle(0, 0, 210, 1080);
}
}
13 changes: 13 additions & 0 deletions MLGUIWindows/GUI/Action Menu/ActionMenuLayout2560x1440.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.Xna.Framework;

namespace MagicalLifeGUIWindows.GUI.Action_Menu
{
/// <summary>
/// Holds positioning information for the action menu.
/// </summary>
public static class ActionMenuLayout2560x1440
{
public static readonly Rectangle ActionMenuLocation = new Rectangle(2350, 0, 210, 1440);
public static readonly Rectangle ActionGridBounds = new Rectangle(0, 0, 210, 1440);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using MagicalLifeAPI.Asset;
using MagicalLifeGUIWindows.GUI.Reusable;
using MagicalLifeGUIWindows.Properties;
using MonoGame.Extended.Input.InputListeners;

namespace MagicalLifeGUIWindows.GUI.Character_Menu.Buttons
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using MagicalLifeAPI.Asset;
using MagicalLifeGUIWindows.GUI.Reusable;
using MagicalLifeGUIWindows.Properties;
using MonoGame.Extended.Input.InputListeners;

namespace MagicalLifeGUIWindows.GUI.Character_Menu.Buttons
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using MagicalLifeGUIWindows.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;

namespace MagicalLifeGUIWindows.GUI.Character_Menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using MagicalLifeGUIWindows.GUI.Reusable;
using MagicalLifeGUIWindows.Properties;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Input.InputListeners;

namespace MagicalLifeGUIWindows.GUI.In
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using MagicalLifeAPI.Asset;
using MagicalLifeAPI.Error.InternalExceptions;
using MagicalLifeAPI.Networking;
using MagicalLifeAPI.Sound;
using MagicalLifeAPI.World.Data;
using MagicalLifeGUIWindows.GUI.Reusable;
using MagicalLifeGUIWindows.Properties;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Input.InputListeners;
using System;

namespace MagicalLifeGUIWindows.GUI.In
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using MagicalLifeGUIWindows.GUI.Save;
using MagicalLifeGUIWindows.Properties;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Input.InputListeners;

namespace MagicalLifeGUIWindows.GUI.In
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
using MagicalLifeGUIWindows.GUI.Settings_Menu;
using MagicalLifeGUIWindows.Properties;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MagicalLifeGUIWindows.GUI.In_Game_Escape_Menu.Buttons
{
Expand Down Expand Up @@ -42,4 +37,4 @@ private void OpenSettingsMenu()
InGameEscapeMenu.menu.PopupChild(SettingsGameMenu.Menu);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public class InGameEscapeMenuContainer : GuiContainer

public SettingsButton Settings { get; private set; } = new SettingsButton();

public InGameEscapeMenuContainer() : base(TextureLoader.GUIMenuBackground, RenderInfo.FullScreenWindow, false)
public InGameEscapeMenuContainer()
: base(TextureLoader.GUIMenuBackground, RenderInfo.FullScreenWindow, false)
{
this.Controls.Add(this.Quit);
this.Controls.Add(this.Save);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ public static class InGameEscapeMenuLayout1920x1080
public static readonly int SettingsButtonY = 540;

public static readonly int BackButtonY = 610;


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using MagicalLifeAPI.Entity.AI.Task;
using MagicalLifeGUIWindows.GUI.Reusable;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Input.InputListeners;

namespace MagicalLifeGUIWindows.GUI.In
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using MagicalLifeAPI.Entity.AI.Task;
using MagicalLifeGUIWindows.GUI.Reusable;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Input.InputListeners;

namespace MagicalLifeGUIWindows.GUI.In
{
Expand Down
Loading

0 comments on commit 563c82c

Please sign in to comment.