added all past projects

This commit is contained in:
Hannes
2017-11-10 00:13:57 +01:00
parent 5f63f0c599
commit 8c94608805
1391 changed files with 109456 additions and 0 deletions

BIN
C#_Mono/UI/.vs/UI/v14/.suo Normal file

Binary file not shown.

20
C#_Mono/UI/UI.sln Normal file
View File

@@ -0,0 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UI", "UI\UI.csproj", "{C8A34B07-5506-435E-BD12-2C6E477E2EC5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C8A34B07-5506-435E-BD12-2C6E477E2EC5}.Debug|x86.ActiveCfg = Debug|x86
{C8A34B07-5506-435E-BD12-2C6E477E2EC5}.Debug|x86.Build.0 = Debug|x86
{C8A34B07-5506-435E-BD12-2C6E477E2EC5}.Release|x86.ActiveCfg = Release|x86
{C8A34B07-5506-435E-BD12-2C6E477E2EC5}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = UI\UI.csproj
EndGlobalSection
EndGlobal

16
C#_Mono/UI/UI.userprefs Normal file
View File

@@ -0,0 +1,16 @@
<Properties>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
<MonoDevelop.Ide.Workbench ActiveDocument="UI/UI/Button.cs">
<Files>
<File FileName="UI/Game1.cs" Line="1" Column="1" />
<File FileName="UI/DemoToolBox.cs" Line="1" Column="1" />
<File FileName="UI/UI/ToolWindow.cs" Line="1" Column="1" />
<File FileName="UI/UI/UIElement.cs" Line="1" Column="1" />
<File FileName="UI/UI/Button.cs" Line="39" Column="1" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
</Properties>

View File

@@ -0,0 +1,17 @@
using System;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace UI
{
public class DemoToolBox : ToolWindow
{
Button submit;
public DemoToolBox (Vector2 pos, Vector2 size) : base(pos,size)
{
submit = new Button (offset, new Rectangle (10, 10, 100, 20), Color.Gray, 2, Color.Black);
uiElements.Add(submit);
}
}
}

91
C#_Mono/UI/UI/Game1.cs Normal file
View File

@@ -0,0 +1,91 @@
#region Using Statements
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Input;
#endregion
namespace UI
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class Game1 : Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
DemoToolBox t;
public Game1 ()
{
graphics = new GraphicsDeviceManager (this);
Content.RootDirectory = "Content";
graphics.IsFullScreen = false;
}
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize ()
{
// TODO: Add your initialization logic here
base.Initialize ();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent ()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch (GraphicsDevice);
//TODO: use this.Content to load your game content here
t = new DemoToolBox(Vector2.Zero, new Vector2(640, 480));
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update (GameTime gameTime)
{
// For Mobile devices, this logic will close the Game when the Back button is pressed
if (GamePad.GetState (PlayerIndex.One).Buttons.Back == ButtonState.Pressed) {
Exit ();
}
t.Update();
// TODO: Add your update logic here
base.Update (gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw (GameTime gameTime)
{
graphics.GraphicsDevice.Clear (Color.CornflowerBlue);
//TODO: Add your drawing code here
//spriteBatch.Begin();
// b.Draw(graphics.GraphicsDevice, spriteBatch);
//spriteBatch.End();
t.DrawStatic(GraphicsDevice, spriteBatch);
base.Draw (gameTime);
}
}
}

BIN
C#_Mono/UI/UI/Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

24
C#_Mono/UI/UI/Program.cs Normal file
View File

@@ -0,0 +1,24 @@
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
#endregion
namespace UI
{
static class Program
{
private static Game1 game;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main ()
{
game = new Game1 ();
game.Run ();
}
}
}

View File

@@ -0,0 +1,27 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("UI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("hannes")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.0")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

60
C#_Mono/UI/UI/UI.csproj Normal file
View File

@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C8A34B07-5506-435E-BD12-2C6E477E2EC5}</ProjectGuid>
<ProjectTypeGuids>{9B831FEF-F496-498F-9FE8-180DA5CB4258};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>UI</RootNamespace>
<MonoGamePlatform>Linux</MonoGamePlatform>
<AssemblyName>UI</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="MonoGame.Framework" />
</ItemGroup>
<ItemGroup>
<Compile Include="Game1.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UI\Button.cs" />
<Compile Include="UI\SolidColorTexture.cs" />
<Compile Include="UI\ToolWindow.cs" />
<Compile Include="UI\MouseManager.cs" />
<Compile Include="DemoToolBox.cs" />
<Compile Include="UI\UIElement.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Icon.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Content\" />
<Folder Include="UI\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,38 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace UI
{
public class Button : UIElement
{
protected Color hColor {
get{ return new Color(Color.Black, 60); }}
protected Color innerColor;
protected int borderSize;
public Button (Vector2 offset, Rectangle b, Color c, int borderThickness, Color bColor): base(offset, b, bColor)
{
innerColor = c;
borderSize = borderThickness;
}
public override void Update()
{
base.Update();
}
public override void Draw(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch)
{
base.Draw(graphicsDevice, spriteBatch);
var texture = new SolidColorTexture(graphicsDevice, innerColor);
var hTexture = new SolidColorTexture(graphicsDevice, hColor);
Rectangle inner = new Rectangle(bound.X + borderSize, bound.Y + borderSize , bound.Width - 2*borderSize, bound.Height - 2* borderSize);
spriteBatch.Draw(texture, inner, Color.White);
if(bound.Contains(m.MousePosition))
spriteBatch.Draw(hTexture, inner, Color.White);
}
}
}

View File

@@ -0,0 +1,48 @@
using System;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
namespace UI
{
public class MouseManager
{
public event EventHandler LeftButtonClicked;
public event EventHandler LeftButtonReleased;
bool leftButtonLastState;
Point lastClickedPos;
public Point LastClickedPos {
get {return lastClickedPos;}}
public Point MousePosition {
get{
MouseState mState = Mouse.GetState();
return new Point(mState.X, mState.Y);
}
}
public MouseManager ()
{
leftButtonLastState = false;
}
public void Update ()
{
//If Clicked
if (Mouse.GetState ().LeftButton == ButtonState.Pressed && !leftButtonLastState) {
if (LeftButtonClicked != null)
LeftButtonClicked(this, null);
leftButtonLastState = true;
lastClickedPos = MousePosition;
}
//If Released
if(Mouse.GetState ().LeftButton == ButtonState.Released && leftButtonLastState)
{
if (LeftButtonReleased != null)
LeftButtonReleased(this, null);
leftButtonLastState = false;
lastClickedPos = Point.Zero;
}
}
}
}

View File

@@ -0,0 +1,38 @@
using System;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
namespace UI
{
public class SolidColorTexture : Texture2D
{
private Color _color;
// Gets or sets the color used to create the texture
public Color Color
{
get { return _color; }
set
{
if (value != _color)
{
_color = value;
SetData<Color>(new Color[] { _color });
}
}
}
public SolidColorTexture(GraphicsDevice graphicsDevice)
: base(graphicsDevice, 1, 1)
{
//default constructor
}
public SolidColorTexture(GraphicsDevice graphicsDevice, Color color)
: base(graphicsDevice, 1, 1)
{
Color = color;
}
}
}

View File

@@ -0,0 +1,60 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
namespace UI
{
public class ToolWindow
{
protected List<UIElement> uiElements;
Button minimizeButton;
int windowBarHeight;
Vector2 pos;
Vector2 size;
Boolean minimized;
protected Vector2 offset;
public ToolWindow (Vector2 pos, Vector2 size)
{
uiElements = new List<UIElement>();
windowBarHeight = 20;
offset = new Vector2(pos.X, pos.Y + windowBarHeight);
minimized = false;
this.pos = pos;
this.size = size;
minimizeButton = new Button(new Vector2(2,2), new Rectangle((int)pos.X, (int) pos.Y, windowBarHeight - 4, windowBarHeight -4), Color.Red, 2, Color.Black);
minimizeButton.Clicked += new EventHandler(minimize);
}
public void Update ()
{
minimizeButton.Update();
foreach (var element in uiElements) {
element.Update();
}
}
public void DrawStatic (GraphicsDevice graphicsDevice, SpriteBatch spriteBatch)
{
var headBarTexture = new SolidColorTexture(graphicsDevice, Color.DarkGray);
var bodyTexture = new SolidColorTexture(graphicsDevice, Color.DimGray);
spriteBatch.Begin();
spriteBatch.Draw(headBarTexture, new Rectangle((int)pos.X, (int)pos.Y, (int)size.X, windowBarHeight), Color.White);
minimizeButton.Draw(graphicsDevice, spriteBatch);
if (!minimized) {
spriteBatch.Draw(bodyTexture, new Rectangle((int)pos.X, (int)pos.Y + windowBarHeight, (int)size.X,(int)size.Y - windowBarHeight), Color.White);
//Draw all UI Elements
foreach (var element in uiElements) {
element.Draw(graphicsDevice, spriteBatch);
}
}
spriteBatch.End();
}
protected void minimize(object sender, EventArgs e)
{
minimized = !minimized;
}
}
}

View File

@@ -0,0 +1,12 @@
using System;
namespace UI
{
public class UICamera
{
public UICamera ()
{
}
}
}

View File

@@ -0,0 +1,47 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace UI
{
public class UIElement
{
protected MouseManager m;
protected Rectangle bound;
protected Color color;
public event EventHandler Clicked;
public UIElement (Vector2 offset ,Rectangle b, Color c)
{
m = new MouseManager();
m.LeftButtonClicked += new EventHandler(click);
color = c;
bound = new Rectangle((int)(b.X + offset.X), (int)(b.Y + offset.Y), b.Width, b.Height);
}
public virtual void Update ()
{
m.Update();
}
public virtual void Draw(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch)
{
var texture = new SolidColorTexture(graphicsDevice, color);
spriteBatch.Draw(texture, bound, Color.White);
}
private void click (object sender, EventArgs e)
{
if (Clicked != null && bound.Contains (m.MousePosition)) {
onClick();
Clicked (this, null);
}
}
public virtual void onClick()
{
//Should be overidden by UI Elements
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,14 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
</configuration>

Binary file not shown.

View File

@@ -0,0 +1,29 @@
<configuration>
<dllmap dll="SDL.dll" os="windows" target="SDL.dll"/>
<dllmap dll="SDL.dll" os="osx" target="/Library/Frameworks/SDL.framework/SDL" />
<dllmap dll="SDL.dll" os="!windows,osx" target="libSDL-1.2.so.0"/>
<dllmap dll="SDL_image.dll" os="windows" target="SDL_image.dll"/>
<dllmap dll="SDL_image.dll" os="osx" target="/Library/Frameworks/SDL_image.framework/SDL_image" />
<dllmap dll="SDL_image.dll" os="!windows,osx" target="libSDL_image-1.2.so.0" />
<dllmap dll="SDL_mixer.dll" os="windows" target="SDL_mixer.dll"/>
<dllmap dll="SDL_mixer.dll" os="osx" target="/Library/Frameworks/SDL_mixer.framework/SDL_mixer" />
<dllmap dll="SDL_mixer.dll" os="!windows,osx" target="libSDL_mixer-1.2.so.0" />
<dllmap dll="SDL_ttf.dll" os="windows" target="SDL_ttf.dll"/>
<dllmap dll="SDL_ttf.dll" os="osx" target="/Library/Frameworks/SDL_ttf.framework/SDL_ttf" />
<dllmap dll="SDL_ttf.dll" os="!windows,osx" target="libSDL_ttf-2.0.so.0" />
<dllmap dll="SDL_net.dll" os="windows" target="SDL_net.dll"/>
<dllmap dll="SDL_net.dll" os="osx" target="/Library/Frameworks/SDL_net.framework/SDL_net" />
<dllmap dll="SDL_net.dll" os="!windows,osx" target="libSDL_net-1.2.so.0" />
<dllmap dll="smpeg.dll" os="windows" target="smpeg.dll"/>
<dllmap dll="smpeg.dll" os="osx" target="/Library/Frameworks/smpeg.framework/smpeg" />
<dllmap dll="smpeg.dll" os="!windows,osx" target="libsmpeg-0.4.so.0" />
<dllmap dll="SDL_gfx.dll" os="windows" target="SDL_gfx.dll"/>
<dllmap dll="SDL_gfx.dll" os="osx" target="/Library/Frameworks/SDL_gfx.framework/SDL_gfx" />
<dllmap dll="SDL_gfx.dll" os="!windows,osx" target="libSDL_gfx.so.13" />
</configuration>

Binary file not shown.

Binary file not shown.

BIN
C#_Mono/UI/UpgradeLog.htm Normal file

Binary file not shown.