Permalink
Browse files

dark editor theme

  • Loading branch information...
movAX13h committed Oct 20, 2017
1 parent cb64629 commit d84b8e8e0b842dee6a5bc8f5820ba41d120f6452

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -4,11 +4,9 @@
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using System.Threading;
using P8Coder.Core;
using P8Coder.Utils;
using System.Runtime.InteropServices;
using System.Threading;
namespace P8Coder
{
@@ -27,29 +25,45 @@ public partial class CoderForm : Form
private SpritesheetForm spritesheetForm;
private MapForm mapForm;
private bool darkTheme = false;
struct Pico8ApiHelp
{
public string Name;
public string Code;
public string Description;
}
#region DLL imports
[DllImport("User32.dll")]
static extern int SetForegroundWindow(IntPtr point);
//[DllImport("user32.dll")]
//public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
#endregion
public CoderForm()
{
InitializeComponent();
Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
readPico8API();
darkSyntaxColors(false);
}
private void darkSyntaxColors(bool state)
{
darkTheme = state;
if (state)
{
luaCodeEditor.BackColor = Color.FromArgb(255, 30, 30, 30);
luaCodeEditor.ForeColor = Color.White;
luaCodeEditor.LineNumberColor = Color.FromArgb(255, 43, 145, 175);
luaCodeEditor.IndentBackColor = Color.FromArgb(255, 30, 30, 30);
luaCodeEditor.TextAreaBorder = FastColoredTextBoxNS.TextAreaBorderType.Single;
luaCodeEditor.TextAreaBorderColor = Color.FromArgb(255, 63, 63, 70);
}
else
{
luaCodeEditor.BackColor = Color.White;
luaCodeEditor.ForeColor = Color.Black;
luaCodeEditor.LineNumberColor = Color.Teal;
luaCodeEditor.IndentBackColor = Color.WhiteSmoke;
luaCodeEditor.TextAreaBorder = FastColoredTextBoxNS.TextAreaBorderType.Single;
luaCodeEditor.TextAreaBorderColor = Color.Silver;
}
}
private void CoderForm_Shown(object sender, EventArgs e)
@@ -667,5 +681,9 @@ private void pico8LaunchSettingsBtn_Click(object sender, EventArgs e)
f.ShowDialog(this);
}
private void themeSwitchBtn_Click(object sender, EventArgs e)
{
darkSyntaxColors(!darkTheme);
}
}
}
@@ -12,12 +12,12 @@ public class SyntaxHighlighter : IDisposable
{
//styles
protected static readonly Platform platformType = PlatformType.GetOperationSystemPlatform();
public readonly Style BlueBoldStyle = new TextStyle(Brushes.Blue, null, FontStyle.Bold);
public readonly Style BlueStyle = new TextStyle(Brushes.Blue, null, FontStyle.Regular);
public readonly Style BlueBoldStyle = new TextStyle(new SolidBrush(Color.FromArgb(255, 57, 135, 214)), null, FontStyle.Bold);
public readonly Style BlueStyle = new TextStyle(new SolidBrush(Color.FromArgb(255, 57, 135, 214)), null, FontStyle.Regular);
public readonly Style BoldStyle = new TextStyle(null, null, FontStyle.Bold | FontStyle.Underline);
public readonly Style BrownStyle = new TextStyle(Brushes.Brown, null, FontStyle.Italic);
public readonly Style GrayStyle = new TextStyle(Brushes.Gray, null, FontStyle.Regular);
public readonly Style GreenStyle = new TextStyle(Brushes.Green, null, FontStyle.Italic);
public readonly Style GrayStyle = new TextStyle(Brushes.Gray, null, FontStyle.Italic);
public readonly Style GreenStyle = new TextStyle(Brushes.Green, null, FontStyle.Regular);
public readonly Style MagentaStyle = new TextStyle(Brushes.Magenta, null, FontStyle.Regular);
public readonly Style MaroonStyle = new TextStyle(Brushes.Maroon, null, FontStyle.Regular);
public readonly Style RedStyle = new TextStyle(Brushes.Red, null, FontStyle.Regular);
@@ -614,10 +614,10 @@ public void InitStyleSchema(Language lang)
break;
case Language.Lua:
StringStyle = BrownStyle;
CommentStyle = GreenStyle;
CommentStyle = GrayStyle;
NumberStyle = MagentaStyle;
KeywordStyle = BlueBoldStyle;
FunctionsStyle = MaroonStyle;
FunctionsStyle = GreenStyle;
break;
case Language.PHP:
StringStyle = RedStyle;
View
@@ -224,6 +224,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="p8coder.ico" />
<None Include="Resources\theme.png" />
<None Include="Resources\Save_6530.png" />
<None Include="Resources\pico8params.png" />
<None Include="Resources\pico8-api.png" />
@@ -33,4 +33,4 @@
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -124,6 +124,9 @@
<data name="colors1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\colors1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Save_6530" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Save_6530.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pico8params" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pico8params.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -157,7 +160,7 @@
<data name="code" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\code.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Save_6530" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Save_6530.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="theme" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\theme.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
View
Binary file not shown.
View
@@ -5,7 +5,7 @@ P8Coder is a handy little tool that replaces the lua code in pico-8 cartridges (
It allows to group functions (any code actually) that belong to the same entity/unit in your game and lets you have functions (any kind of code sections) as tabs.
![codehints](screenshots/p8coder.png "P8Coder")
![codehints](screenshots/p8coderdark.png "P8Coder dark editor mode")
When writing to the cartridge it concatenates all code to one large lua code block as you would have when writing the cart directly in the p8 file or in pico-8.
@@ -47,8 +47,8 @@ If you're looking for other tools for pico-8, check the [awesome-PICO-8](https:/
P8Coder overwrites all lua code of the cartridge you select! Everything else (gfx/map/sfx/music) remains untouched.
## Download
- Binary (v1.2) from author server: http://thrill-project.com/archiv/coding/P8Coder.zip (147kb)
- NOTE: to upgrade from v1.0 or 1.1, simply replace the old exe with the new one
- Binary (v1.3) from author server: http://thrill-project.com/archiv/coding/P8Coder.zip (147kb)
- Upgrade: replace the old exe with the new one
## Source code
- C# .NET4.5, VisualStudio 15 (2017) solution
@@ -57,6 +57,10 @@ P8Coder overwrites all lua code of the cartridge you select! Everything else (gf
## Change Log
- **1.3** - 2017-10-20
- minor bugfixes
- dark editor mode and toggle button
- **1.2** - 2017-10-02
- pico-8 launch parameters dialog
- button to save spritesheet to png
View
Binary file not shown.

0 comments on commit d84b8e8

Please sign in to comment.