Skip to content

Commit

Permalink
rem - brk|doc - Removed fancy console writers
Browse files Browse the repository at this point in the history
---

To follow Terminaux's deprecation of the old method-based writers, we've
decided to remove fancy console writers, except those that are really
important.

---

Type: rem
Breaking: True
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Dec 26, 2024
1 parent a23951c commit d982cd2
Show file tree
Hide file tree
Showing 32 changed files with 156 additions and 2,173 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
changes!
-->
<NitrocidModAPIVersionMajor>3.0.27</NitrocidModAPIVersionMajor>
<NitrocidModAPIVersionChangeset>17</NitrocidModAPIVersionChangeset>
<NitrocidModAPIVersionChangeset>18</NitrocidModAPIVersionChangeset>

<!-- The above two properties are to be installed to the file version -->
<NitrocidModAPIVersion>$(NitrocidModAPIVersionMajor).$(NitrocidModAPIVersionChangeset)</NitrocidModAPIVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
using Nitrocid.ConsoleBase.Writers;
using Nitrocid.Languages;
using Nitrocid.Shell.ShellBase.Commands;
using Terminaux.Writer.ConsoleWriters;
using Terminaux.Writer.CyclicWriters;

namespace Nitrocid.Extras.Chemistry.Commands
{
Expand Down Expand Up @@ -54,19 +56,30 @@ public override int Execute(CommandParameters parameters, ref string variableVal
}

// Print information
TextWriters.WriteListEntry(Translate.DoTranslation("Name"), substance.Name, KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Atomic number"), $"{substance.AtomicNumber}", KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Atomic mass"), $"{substance.AtomicMass}", KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Symbol"), substance.Symbol, KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Summary"), substance.Summary, KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Phase"), $"{substance.Phase}", KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Position in the periodic table"), $"{substance.Period}, {substance.Group}", KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Position in coordinates"), $"{substance.PosX} (w: {substance.WPosX}), {substance.PosY} (w: {substance.WPosY})", KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Discoverer"), substance.Discoverer, KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Named by"), substance.NamedBy, KernelColorType.ListEntry, KernelColorType.ListValue);
TextWriters.WriteListEntry(Translate.DoTranslation("Electron configuration"), substance.ElectronConfiguration, KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Name"), substance.Name, KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Atomic number"), $"{substance.AtomicNumber}", KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Atomic mass"), $"{substance.AtomicMass}", KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Symbol"), substance.Symbol, KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Summary"), substance.Summary, KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Phase"), $"{substance.Phase}", KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Position in the periodic table"), $"{substance.Period}, {substance.Group}", KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Position in coordinates"), $"{substance.PosX} (w: {substance.WPosX}), {substance.PosY} (w: {substance.WPosY})", KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Discoverer"), substance.Discoverer, KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Named by"), substance.NamedBy, KernelColorType.ListEntry, KernelColorType.ListValue);
WriteListEntry(Translate.DoTranslation("Electron configuration"), substance.ElectronConfiguration, KernelColorType.ListEntry, KernelColorType.ListValue);
return 0;
}

private void WriteListEntry(string entry, string value, KernelColorType entryColor, KernelColorType valueColor)
{
var listEntry = new ListEntry()
{
Entry = entry,
Value = value,
KeyColor = KernelColorTools.GetColor(entryColor),
ValueColor = KernelColorTools.GetColor(valueColor),
};
TextWriterRaw.WritePlain(listEntry.Render());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using Nitrocid.ConsoleBase.Colors;
using Nitrocid.Languages;
using Terminaux.Writer.ConsoleWriters;
using Terminaux.Writer.FancyWriters;

namespace Nitrocid.Extras.GitShell.Git.Commands
{
Expand Down Expand Up @@ -66,7 +67,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
var renamed = tree.Renamed;

// List the general changes
TextFancyWriters.WriteSeparator(Translate.DoTranslation("General changes in") + $" {GitShellCommon.RepoName}:", KernelColorType.ListTitle);
SeparatorWriterColor.WriteSeparatorColor(Translate.DoTranslation("General changes in") + $" {GitShellCommon.RepoName}:", KernelColorTools.GetColor(KernelColorType.ListTitle));
foreach (var change in modified)
TextWriters.Write($"[M] * {change.Path}", KernelColorType.ListEntry);
foreach (var change in added)
Expand All @@ -82,7 +83,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal

if (doPatch)
{
TextFancyWriters.WriteSeparator(Translate.DoTranslation("Content changes in") + $" {GitShellCommon.RepoName}:", KernelColorType.ListTitle);
SeparatorWriterColor.WriteSeparatorColor(Translate.DoTranslation("Content changes in") + $" {GitShellCommon.RepoName}:", KernelColorTools.GetColor(KernelColorType.ListTitle));
TextWriterColor.Write(patch.Content);
}

Expand Down
2 changes: 1 addition & 1 deletion public/Nitrocid.Templates/templates/KSMod/ModName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ModName : IMod
public string Name { get; set; } = "My Mod";
public string Version { get; set; } = "1.0.0";

public Version MinimumSupportedApiVersion => new(3, 0, 27, 17);
public Version MinimumSupportedApiVersion => new(3, 0, 27, 18);

public ReadOnlyDictionary<string, Delegate> PubliclyAvailableFunctions => null;

Expand Down
Loading

0 comments on commit d982cd2

Please sign in to comment.