From 50f0ebee533425d67284c4c0568dcfed0a569126 Mon Sep 17 00:00:00 2001 From: Ian C Date: Wed, 1 Jul 2020 23:11:51 +0000 Subject: Added initial code point lists and added to interface. --- SpriteEd/CodePoints.cs | 222 ++++++++++++++++ SpriteEd/Main.storyboard | 498 +----------------------------------- SpriteEd/SpriteEd.csproj | 1 + SpriteEd/ViewController.cs | 14 +- SpriteEd/ViewController.designer.cs | 8 + 5 files changed, 245 insertions(+), 498 deletions(-) create mode 100644 SpriteEd/CodePoints.cs diff --git a/SpriteEd/CodePoints.cs b/SpriteEd/CodePoints.cs new file mode 100644 index 0000000..3bcef29 --- /dev/null +++ b/SpriteEd/CodePoints.cs @@ -0,0 +1,222 @@ +// SpriteEd - Simple sprite editor +// Copyright 2020 Ian Cowburn +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +using System; +using System.Collections.Generic; + +namespace SpriteEd +{ + public static class CodePoints + { + public static readonly Dictionary Ascii = new Dictionary() + { + {32, "Space"}, + {33, "!"}, + {34, "\""}, + {35, "#"}, + {36, "$"}, + {37, "%"}, + {38, "&"}, + {39, "'"}, + {40, "("}, + {41, ")"}, + {42, "*"}, + {43, "+"}, + {44, ","}, + {45, "-"}, + {46, "."}, + {47, "/"}, + {48, "0"}, + {49, "1"}, + {50, "2"}, + {51, "3"}, + {52, "4"}, + {53, "5"}, + {54, "6"}, + {55, "7"}, + {56, "8"}, + {57, "9"}, + {58, ":"}, + {59, ";"}, + {60, "<"}, + {61, "="}, + {62, ">"}, + {63, "?"}, + {64, "@"}, + {65, "A"}, + {66, "B"}, + {67, "C"}, + {68, "D"}, + {69, "E"}, + {70, "F"}, + {71, "G"}, + {72, "H"}, + {73, "I"}, + {74, "J"}, + {75, "K"}, + {76, "L"}, + {77, "M"}, + {78, "N"}, + {79, "O"}, + {80, "P"}, + {81, "Q"}, + {82, "R"}, + {83, "S"}, + {84, "T"}, + {85, "U"}, + {86, "V"}, + {87, "W"}, + {88, "X"}, + {89, "Y"}, + {90, "Z"}, + {91, "["}, + {92, "\\"}, + {93, "]"}, + {94, "^"}, + {95, "_"}, + {96, "`"}, + {97, "a"}, + {98, "b"}, + {99, "c"}, + {100, "d"}, + {101, "e"}, + {102, "f"}, + {103, "g"}, + {104, "h"}, + {105, "i"}, + {106, "j"}, + {107, "k"}, + {108, "l"}, + {109, "m"}, + {110, "n"}, + {111, "o"}, + {112, "p"}, + {113, "q"}, + {114, "r"}, + {115, "s"}, + {116, "t"}, + {117, "u"}, + {118, "v"}, + {119, "w"}, + {120, "x"}, + {121, "y"}, + {122, "z"}, + {123, "{"}, + {124, "|"}, + {125, "}"}, + {126, "~"} + }; + + public static readonly Dictionary C64 = new Dictionary() + { + {0, "@"}, + {1, "a"}, + {2, "b"}, + {3, "c"}, + {4, "d"}, + {5, "e"}, + {6, "f"}, + {7, "g"}, + {8, "h"}, + {9, "i"}, + {10, "j"}, + {11, "k"}, + {12, "l"}, + {13, "m"}, + {14, "n"}, + {15, "o"}, + {16, "p"}, + {17, "q"}, + {18, "r"}, + {19, "s"}, + {20, "t"}, + {21, "u"}, + {22, "v"}, + {23, "w"}, + {24, "x"}, + {25, "y"}, + {26, "z"}, + {27, "["}, + {28, "`"}, + {29, "]"}, + {30, "^"}, + {31, "\\"}, + {32, " "}, + {33, "!"}, + {34, "\""}, + {35, "#"}, + {36, "$"}, + {37, "%"}, + {38, "&"}, + {39, "'"}, + {40, "("}, + {41, ")"}, + {42, "*"}, + {43, "+"}, + {44, ","}, + {45, "-"}, + {46, "."}, + {47, "/"}, + {48, "0"}, + {49, "1"}, + {50, "2"}, + {51, "3"}, + {52, "4"}, + {53, "5"}, + {54, "6"}, + {55, "7"}, + {56, "8"}, + {57, "9"}, + {58, ":"}, + {59, ";"}, + {60, "<"}, + {61, "="}, + {62, ">"}, + {63, "?"}, + {65, "A"}, + {66, "B"}, + {67, "C"}, + {68, "D"}, + {69, "E"}, + {70, "F"}, + {71, "G"}, + {72, "H"}, + {73, "I"}, + {74, "J"}, + {75, "K"}, + {76, "L"}, + {77, "M"}, + {78, "N"}, + {79, "O"}, + {80, "P"}, + {81, "Q"}, + {82, "R"}, + {83, "S"}, + {84, "T"}, + {85, "U"}, + {86, "V"}, + {87, "W"}, + {88, "X"}, + {89, "Y"}, + {90, "Z"}, + {91, "{"}, + {92, "|"}, + {93, "}"}, + {94, "~"}, + {100, "_"} + }; + } +} diff --git a/SpriteEd/Main.storyboard b/SpriteEd/Main.storyboard index f63c659..096251c 100644 --- a/SpriteEd/Main.storyboard +++ b/SpriteEd/Main.storyboard @@ -103,18 +103,6 @@ - - - - - - - - - - - - @@ -127,11 +115,6 @@ - - - - - @@ -148,486 +131,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -820,6 +323,7 @@ + diff --git a/SpriteEd/SpriteEd.csproj b/SpriteEd/SpriteEd.csproj index 5a8d003..0e58c25 100644 --- a/SpriteEd/SpriteEd.csproj +++ b/SpriteEd/SpriteEd.csproj @@ -85,6 +85,7 @@ + diff --git a/SpriteEd/ViewController.cs b/SpriteEd/ViewController.cs index fe8aa79..7abceff 100644 --- a/SpriteEd/ViewController.cs +++ b/SpriteEd/ViewController.cs @@ -15,7 +15,7 @@ // along with this program. If not, see . // using System; - +using System.Collections.Generic; using AppKit; using Foundation; @@ -25,6 +25,7 @@ namespace SpriteEd { private Palette m_Palette; private SpriteSet m_SpriteSet; + private Dictionary m_CodeSet; public ViewController(IntPtr handle) : base(handle) { @@ -52,6 +53,8 @@ namespace SpriteEd m_SpriteEdit.Sprite = m_SpriteSet[(byte)m_SpriteNumber.IntValue]; m_SpriteEdit.Mode = NSSpriteEdit.DrawingMode.Point; + m_CodeSet = CodePoints.C64; + OnColourStepper(m_ColourStepper); OnSpriteStepper(m_SpriteStepper); } @@ -77,6 +80,15 @@ namespace SpriteEd { m_SpriteNumber.IntValue = stepper.IntValue; m_SpriteEdit.Sprite = m_SpriteSet[(byte)stepper.IntValue]; + + if (m_CodeSet.ContainsKey(stepper.IntValue)) + { + m_CodeLabel.StringValue = m_CodeSet[stepper.IntValue]; + } + else + { + m_CodeLabel.StringValue = String.Empty; + } } } diff --git a/SpriteEd/ViewController.designer.cs b/SpriteEd/ViewController.designer.cs index 2de4b18..032ae7f 100644 --- a/SpriteEd/ViewController.designer.cs +++ b/SpriteEd/ViewController.designer.cs @@ -12,6 +12,9 @@ namespace SpriteEd [Register ("ViewController")] partial class ViewController { + [Outlet] + AppKit.NSTextField m_CodeLabel { get; set; } + [Outlet] AppKit.NSTextField m_ColourLabel { get; set; } @@ -70,6 +73,11 @@ namespace SpriteEd m_SpriteStepper.Dispose (); m_SpriteStepper = null; } + + if (m_CodeLabel != null) { + m_CodeLabel.Dispose (); + m_CodeLabel = null; + } } } } -- cgit v1.2.3