Skip to content

Commit 3039262

Browse files
author
Nick Daniels
committed
Configurable Default Icon Pattern/Colors
Windowless Emulator Launch
1 parent b05ee2e commit 3039262

7 files changed

Lines changed: 48 additions & 44 deletions

File tree

Nabu.Lib/Network/CommonUI.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
namespace Nabu.Network;public static class CommonUI{ static string[] Phrases = [
2+
//"👁️🚢👿",
3+
"Assimilation in progress",
4+
"Admiral! There be whales here!",
5+
"Ay Sir, I'm working on it!",
6+
"Hey Mr. 🦉",
7+
"Standby for NABUfall",
8+
"Your honor, I object to this preposterous poppycock",
9+
"It works for us now, Comrade",
10+
"Buy Pants",
11+
"2 NABUs and a KayPro walk into a bar...",
12+
"💣 0.015625 MEGA POWER 💣",
13+
"9/10 Doctors would prefer not to endorse this product",
14+
"NABU4Ever!",
15+
"👸Beware the wrath of King NABU 👸",
16+
"☎️ Please stay on the line, your call is important to us ☎️",
17+
"🎵 Never gonna give you up. Never gonna let you down 🎵",
18+
"Excuse me human, can I interest you in this pamphlet on the kingdom of NABU?"
19+
]; public static string Phrase() => Phrases[Random.Shared.Next(0, Phrases.Length)]; public static byte[] BlankIconPattern { get; } = [
20+
//0xFF,0x80,0xA2,0xB2,0xAA,0xA6,0xA2,0x80,
21+
//0x80,0xBE,0xA2,0xAC,0xA2,0xBE,0x80,0xFF,
22+
//0xFF,0x01,0x7D,0x45,0x7D,0x45,0x45,0x01,
23+
//0x01,0x45,0x45,0x45,0x45,0x7D,0x01,0xFF 0xE0,0xC0,0xC0,0x80,0xFF,0x6D,0x2A,0x0A, 0x48,0x6A,0xFF,0x80,0xC0,0xC0,0xE0,0xE0,
24+
0x07,0x03,0x03,0x01,0xFF,0x9A,0xAA,0x9A, 0xAA,0x98,0xFF,0x01,0x03,0x03,0x07,0x07 ]; public static byte[] BlankIconColor { get; } = [
25+
//0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
26+
//0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
27+
//0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
28+
//0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F 0x4F,0x41,0x4E,0x41,0xE1,0xE1,0xE1,0xE1,
29+
0xE1,0xE1,0xE1,0x41,0x4E,0x41,0x4F,0x41, 0x4F,0x41,0x4E,0x41,0xE1,0xE1,0xE1,0xE1, 0xE1,0xE1,0xE1,0x41,0x4E,0x41,0x4F,0x41 ];
30+
public static string BlankIconClrStr { get; } = Convert.ToBase64String(BlankIconColor);
31+
public static string BlankIconPtrnStr { get; } = Convert.ToBase64String(BlankIconPattern);}

Nabu.Lib/Network/NabuNetwork.Sources.cs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Nabu.Lib/Network/NabuNetwork.cs

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,7 @@
1414
using System.Xml;
1515

1616
namespace Nabu.Network;
17-
public static class CommonUI{ static string[] Phrases = [
18-
//"👁️🚢👿",
19-
"Assimilation in progress",
20-
"Admiral! There be whales here!",
21-
"Ay Sir, I'm working on it!",
22-
"Hey Mr. 🦉",
23-
"Standby for NABUfall",
24-
"Your honor, I object to this preposterous poppycock",
25-
"It works for us now, Comrade",
26-
"Buy Pants",
27-
"2 NABUs and a KayPro walk into a bar...",
28-
"💣 0.015625 MEGA POWER 💣",
29-
"9/10 Doctors would prefer not to endorse this product",
30-
"NABU4Ever!",
31-
"👸Beware the wrath of King NABU 👸",
32-
"☎️ Please stay on the line, your call is important to us ☎️",
33-
"🎵 Never gonna give you up. Never gonna let you down 🎵",
34-
"Excuse me human, can I interest you in this pamphlet on the kingdom of NABU?"
35-
]; public static string Phrase() => Phrases[Random.Shared.Next(0, Phrases.Length)]; public static byte[] BlankIconPattern { get; } = [
36-
//0xFF,0x80,0xA2,0xB2,0xAA,0xA6,0xA2,0x80,
37-
//0x80,0xBE,0xA2,0xAC,0xA2,0xBE,0x80,0xFF,
38-
//0xFF,0x01,0x7D,0x45,0x7D,0x45,0x45,0x01,
39-
//0x01,0x45,0x45,0x45,0x45,0x7D,0x01,0xFF 0xE0,0xC0,0xC0,0x80,0xFF,0x6D,0x2A,0x0A, 0x48,0x6A,0xFF,0x80,0xC0,0xC0,0xE0,0xE0,
40-
0x07,0x03,0x03,0x01,0xFF,0x9A,0xAA,0x9A, 0xAA,0x98,0xFF,0x01,0x03,0x03,0x07,0x07 ]; public static byte[] BlankIconColor { get; } = [
41-
//0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
42-
//0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
43-
//0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
44-
//0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F 0x4F,0x41,0x4E,0x41,0xE1,0xE1,0xE1,0xE1,
45-
0xE1,0xE1,0xE1,0x41,0x4E,0x41,0x4F,0x41, 0x4F,0x41,0x4E,0x41,0xE1,0xE1,0xE1,0xE1, 0xE1,0xE1,0xE1,0x41,0x4E,0x41,0x4F,0x41 ];
46-
public static string BlankIconClrStr { get; } = Convert.ToBase64String(BlankIconColor);
47-
public static string BlankIconPtrnStr { get; } = Convert.ToBase64String(BlankIconPattern);}
17+
4818
public partial class NabuNetwork : NabuBase, INabuNetwork
4919
{
5020
public const string HeadlessSourceName = "headless";
@@ -287,8 +257,8 @@ await Task.Run(async () =>
287257
DefaultPatches,
288258
source.Author ?? Empty,
289259
source.Description ?? Empty,
290-
CommonUI.BlankIconClrStr,
291-
CommonUI.BlankIconPtrnStr,
260+
Settings.DefaultIconColor ?? CommonUI.BlankIconClrStr,
261+
Settings.DefaultIconPattern ?? CommonUI.BlankIconPtrnStr,
292262
isPakMenu: true
293263
));
294264
}
@@ -305,8 +275,8 @@ await Task.Run(async () =>
305275
DefaultPatches,
306276
source.Author ?? Empty,
307277
source.Description ?? Empty,
308-
CommonUI.BlankIconClrStr,
309-
CommonUI.BlankIconPtrnStr
278+
Settings.DefaultIconColor ?? CommonUI.BlankIconClrStr,
279+
Settings.DefaultIconPattern ?? CommonUI.BlankIconPtrnStr
310280
));
311281
}
312282

@@ -360,8 +330,8 @@ await Task.Run(async () =>
360330
DefaultPatches,
361331
source.Author ?? Empty,
362332
Empty,
363-
CommonUI.BlankIconClrStr,
364-
CommonUI.BlankIconPtrnStr
333+
Settings.DefaultIconColor ?? CommonUI.BlankIconClrStr,
334+
Settings.DefaultIconPattern ?? CommonUI.BlankIconPtrnStr
365335
));
366336
}
367337

@@ -391,8 +361,8 @@ from program in from p in package.Programs select p with { }
391361
DefaultPatches,
392362
program.Author ?? source.Author ?? Empty,
393363
program.Description ?? Empty,
394-
program.TileColor ?? CommonUI.BlankIconClrStr,
395-
program.TilePattern ?? CommonUI.BlankIconPtrnStr,
364+
Settings.DefaultIconColor ?? CommonUI.BlankIconClrStr,
365+
Settings.DefaultIconPattern ?? CommonUI.BlankIconPtrnStr,
396366
options: program.Options
397367
)
398368
);

Nabu.Lib/Network/ProcessService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ existing.Key is not null
3434
return null;
3535
}
3636

37-
public CancellationToken Start(string path, bool hidden = false, string[]? verb = null)
37+
public CancellationToken Start(string path, bool hidden = true, string[]? verb = null)
3838
{
3939
if (IsRunning(path) is CancellationTokenSource source and not null)
4040
{

Nabu.Lib/Protocols/RetroNet/RetroNetHeadlessProtocol.cs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

Nabu.Lib/Settings/GlobalSettings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Gry.Caching;
33
using Gry.Settings;
44
using Lgc;
5+
using Nabu.Network;
56
using Nabu.Sources;
67
using Napa;
78
using Newtonsoft.Json;
@@ -98,7 +99,7 @@ public record GlobalSettings : AdapterServerOptions<AdaptorSettings, TCPAdaptorS
9899

99100
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
100101
public List<ProtocolSettings> Protocols { get; set; } = [];
101-
102+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [Setting("Default Icon Pattern", Section = "Headless", Advanced = true, Description = "The default icon pattern for RetroNET headless, as a Base64 string")] public string? DefaultIconPattern { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [Setting("Default Icon Color", Section = "Headless", Advanced = true, Description = "The default icon color for RetroNET headless, as a Base64 string")] public string? DefaultIconColor { get; set; }
102103
//public string? CPMSource { get; set; }
103104
//public string? CPMProgram { get; set; }
104105
}

Nabu.NetSimWeb/appsettings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"EnableJavaScript": false,
2727
"StartEmulatorInHeadlessMode": true,
2828
"PreCacheRemoteSources": true
29+
//"DefaultIconPattern": "4MDAgP9tKgpIav+AwMDg4AcDAwH/mqqaqpj/AQMDBwc=",
30+
//"DefaultIconColor": "T0FOQeHh4eHh4eFBTkFPQU9BTkHh4eHh4eHhQU5BT0E="
2931
},
3032
"Packages": {
3133
"Sources": [

0 commit comments

Comments
 (0)