Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Toolbar/menu actions, background colour setting
Browse files Browse the repository at this point in the history
  • Loading branch information
LogicAndTrick committed Jul 25, 2013
1 parent 74b8e3d commit 72b71d3
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 7 deletions.
12 changes: 11 additions & 1 deletion Sledge.Editor/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,22 @@ private void Subscribe()
Mediator.Subscribe(EditorMediator.TextureSelected, this);
Mediator.Subscribe(EditorMediator.ToolSelected, this);

Mediator.Subscribe(EditorMediator.OpenWebsite, this);
Mediator.Subscribe(EditorMediator.CheckForUpdates, this);
Mediator.Subscribe(EditorMediator.About, this);
}

private void OpenWebsite(string url)
{
Process.Start(url);
}

private void About()
{
throw new Exception("THIS IS AN EXCEPTION!");
using (var ad = new AboutDialog())
{
ad.ShowDialog();
}
}

public static void FileNew()
Expand Down
2 changes: 1 addition & 1 deletion Sledge.Editor/Menu/MenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private static void AddDefault()
Add("Tools", new SimpleMenuBuilder("Group", HotkeysMediator.GroupingGroup) { Image = Resources.Menu_Group, IsVisible = mapOpen, IsActive = itemsSelected, ShowInToolStrip = true });
Add("Tools", new SimpleMenuBuilder("Ungroup", HotkeysMediator.GroupingUngroup) { Image = Resources.Menu_Ungroup, IsVisible = mapOpen, IsActive = itemsSelected, ShowInToolStrip = true });
Add("Tools", new MenuSplitter { IsVisible = mapOpen, ShowInToolStrip = true });
Add("Tools", new SimpleMenuBuilder("Cordon Tool", HotkeysMediator.ToggleCordon) { Image = Resources.Menu_Cordon, IsVisible = mapOpen, IsChecked = () => mapOpen() && DocumentManager.CurrentDocument.Map.Cordon, ShowInToolStrip = true });
Add("Tools", new SimpleMenuBuilder("Enable Cordon", HotkeysMediator.ToggleCordon) { Image = Resources.Menu_Cordon, IsVisible = mapOpen, IsChecked = () => mapOpen() && DocumentManager.CurrentDocument.Map.Cordon, ShowInToolStrip = true });
Add("Tools", new MenuSplitter { IsVisible = mapOpen });
Add("Tools", new SimpleMenuBuilder("Tie to Entity", HotkeysMediator.TieToEntity) { Image = Resources.Menu_TieToEntity, IsVisible = mapOpen, IsActive = itemsSelected });
Add("Tools", new SimpleMenuBuilder("Move to World", HotkeysMediator.TieToWorld) { Image = Resources.Menu_TieToWorld, IsVisible = mapOpen, IsActive = itemsSelected });
Expand Down
6 changes: 1 addition & 5 deletions Sledge.Editor/Milestones.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

Priorities
Bugs
Background colour setting not applying
Recent files menu not opening recent files
Windows 7 recent file jump list not opening files
Enhancements
(Empty)
Features
Check for updates (needed for alpha!)
On startup
Cordon compile
Finish the menu/toolbar actions
Recent files menu -> open files

Post-Alpha Priorities
TDI
Expand Down
9 changes: 9 additions & 0 deletions Sledge.Editor/Sledge.Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@
<DependentUpon>TextureApplicationForm.cs</DependentUpon>
</Compile>
<Compile Include="Tools\TransformationTools\TransformationTool.cs" />
<Compile Include="UI\AboutDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\AboutDialog.Designer.cs">
<DependentUpon>AboutDialog.cs</DependentUpon>
</Compile>
<Compile Include="UI\CheckForProblemsDialog.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -394,6 +400,9 @@
<DependentUpon>TextureApplicationForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\AboutDialog.resx">
<DependentUpon>AboutDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\AngleControl.resx">
<DependentUpon>AngleControl.cs</DependentUpon>
</EmbeddedResource>
Expand Down
82 changes: 82 additions & 0 deletions Sledge.Editor/UI/AboutDialog.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Sledge.Editor/UI/AboutDialog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Sledge.Editor.UI
{
public partial class AboutDialog : Form
{
public AboutDialog()
{
InitializeComponent();

InfoLabel.Text = "Sledge " + FileVersionInfo.GetVersionInfo(typeof(Editor).Assembly.Location).FileVersion + "\n"
+ "Created by Daniel Walder - http://logic-and-trick.com \n"
+ "Open source software - http://github.com/LogicAndTrick/sledge";
}
}
}
120 changes: 120 additions & 0 deletions Sledge.Editor/UI/AboutDialog.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
3 changes: 3 additions & 0 deletions Sledge.Editor/UI/ViewportManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Windows.Forms;
using OpenTK;
using OpenTK.Graphics.OpenGL;
using Sledge.Graphics.Helpers;
using Sledge.Graphics.Renderables;
using Sledge.UI;
Expand Down Expand Up @@ -105,6 +106,7 @@ private static Viewport3D Create3D()
};
viewport.MakeCurrent();
GraphicsHelper.InitGL3D();
GL.ClearColor(Sledge.Settings.Grid.Background);
viewport.Listeners.Add(new Camera3DViewportListener(viewport));
viewport.Listeners.Add(new ToolViewportListener(viewport));
return viewport;
Expand All @@ -118,6 +120,7 @@ private static Viewport2D Create2D(Viewport2D.ViewDirection direction)
};
viewport.MakeCurrent();
GraphicsHelper.InitGL2D();
GL.ClearColor(Sledge.Settings.Grid.Background);
viewport.Listeners.Add(new Camera2DViewportListener(viewport));
viewport.Listeners.Add(new Grid2DEventListener(viewport));
viewport.Listeners.Add(new ToolViewportListener(viewport));
Expand Down

0 comments on commit 72b71d3

Please sign in to comment.