Skip to content

Commit

Permalink
upd - prt - Updated to Terminaux 5.0
Browse files Browse the repository at this point in the history
---

Type: upd
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/2
  • Loading branch information
AptiviCEO committed Aug 28, 2024
1 parent 16e3d9a commit 18596ba
Show file tree
Hide file tree
Showing 110 changed files with 967 additions and 1,130 deletions.
2 changes: 1 addition & 1 deletion Nitrocid.sln
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nitrocid.Extras.Ssh", "publ
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Generators", "Generators", "{E403EE05-8642-4496-8897-CBD762D7670B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nitrocid.Generators.KnownAddons", "private\Nitrocid.Generators\Nitrocid.Generators.KnownAddons\Nitrocid.Generators.KnownAddons.csproj", "{E1B8ED9D-541A-4D9E-AAF5-2671114E179B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nitrocid.Generators.KnownAddons", "private\Nitrocid.Generators\Nitrocid.Generators.KnownAddons\Nitrocid.Generators.KnownAddons.csproj", "{E1B8ED9D-541A-4D9E-AAF5-2671114E179B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion private/Nitrocid.LocaleCheck/Nitrocid.LocaleCheck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Terminaux" Version="4.3.6" />
<PackageReference Include="Terminaux" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Nitrocid.LocaleTools\Nitrocid.LocaleTools.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion private/Nitrocid.LocaleClean/Nitrocid.LocaleClean.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Terminaux" Version="4.3.6" />
<PackageReference Include="Terminaux" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Nitrocid.LocaleTools\Nitrocid.LocaleTools.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion private/Nitrocid.LocaleTrim/Nitrocid.LocaleTrim.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Terminaux" Version="4.3.6" />
<PackageReference Include="Terminaux" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Nitrocid.LocaleTools\Nitrocid.LocaleTools.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions private/Nitrocid.Tests/Nitrocid.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@

<ItemGroup>
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="Terminaux" Version="4.3.6" />
<PackageReference Include="Textify.Offline.Json" Version="1.11.0" />
<PackageReference Include="Terminaux" Version="5.0.0" />
<PackageReference Include="Textify.Offline.Json" Version="1.11.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
using Terminaux.Reader;
using Terminaux.Base.Buffered;
using System.Text;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Amusements.Amusements.Games
{
Expand Down Expand Up @@ -171,7 +172,7 @@ static void ResetAll()
{
// Wait for the input
winner = 0;
var input = TermReader.ReadKey().Key;
var input = Input.ReadKey().Key;
switch (input)
{
case ConsoleKey.UpArrow:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
using Terminaux.Reader;
using Terminaux.Base.Buffered;
using Terminaux.Inputs.Styles.Infobox;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Amusements.Amusements.Games
{
Expand Down Expand Up @@ -198,7 +199,7 @@ public static void InitializeHangman(HangmanDifficulty difficulty, HangmanWordDi
else
{
// Wait for character
var input = TermReader.ReadKey();
var input = Input.ReadKey();
var inputChar = input.KeyChar;
if (RandomWord.Contains(inputChar))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using Nitrocid.Kernel.Debugging;
using Terminaux.Reader;
using Nitrocid.Kernel.Configuration;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Amusements.Amusements.Games
{
Expand Down Expand Up @@ -104,7 +105,7 @@ public static void InitializeMeteor(bool simulation = false, bool dodge = false)
if (ConsoleWrapper.KeyAvailable)
{
// Read the key and handle it
Keypress = TermReader.ReadKey();
Keypress = Input.ReadKey();
HandleKeypress(Keypress.Key, dodge);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using Nitrocid.ConsoleBase.Colors;
using Terminaux.Writer.FancyWriters;
using Terminaux.Colors.Data;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Amusements.Amusements.Games
{
Expand Down Expand Up @@ -227,7 +228,7 @@ public static void InitializePong()
// Move the ball according to the mode
if (ConsoleWrapper.KeyAvailable)
{
var Pressed = TermReader.ReadKey().Key;
var Pressed = Input.ReadKey().Key;
switch (Pressed)
{
case ConsoleKey.DownArrow:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using Nitrocid.Kernel.Debugging;
using Terminaux.Reader;
using Nitrocid.Kernel.Configuration;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Amusements.Amusements.Games
{
Expand Down Expand Up @@ -104,7 +105,7 @@ public static void InitializeShipDuet(bool simulation = false)
if (ConsoleWrapper.KeyAvailable)
{
// Read the key and handle it
Keypress = TermReader.ReadKey();
Keypress = Input.ReadKey();
HandleKeypress(Keypress.Key);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
using System.Text;
using Terminaux.Sequences.Builder.Types;
using Nitrocid.Languages;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Amusements.Amusements.Games
{
Expand Down Expand Up @@ -278,7 +279,7 @@ public static void InitializeSnaker(bool Simulation)
// User pressed the arrow button to move the snake
if (ConsoleWrapper.KeyAvailable)
{
var Pressed = TermReader.ReadKey().Key;
var Pressed = Input.ReadKey().Key;
switch (Pressed)
{
case ConsoleKey.DownArrow:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using Nitrocid.Languages;
using Textify.General;
using Terminaux.Reader;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Amusements.Amusements.Games
{
Expand Down Expand Up @@ -140,7 +141,7 @@ public static void InitializeSpeedPress(SpeedPressDifficulty Difficulty, int Cus
// Prompt user for character
TextWriterColor.Write(Translate.DoTranslation("Current character:") + " {0}", SelectedChar);
TextWriters.Write("> ", false, KernelColorType.Input);
var (result, provided) = TermReader.ReadKeyTimeout(false, TimeSpan.FromMilliseconds(SpeedTimeout));
var (result, provided) = Input.ReadKeyTimeout(false, TimeSpan.FromMilliseconds(SpeedTimeout));
WrittenChar = result;
TextWriterRaw.Write();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
using Terminaux.Base;
using Terminaux.Colors.Data;
using Terminaux.Reader;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Amusements.Amusements.Games
{
Expand All @@ -52,7 +53,7 @@ public static void InitializeWordle(bool orig = false, WordleWordDifficulty word
RenderBoxes(RandomWord, maxGuesses, currentTries);

// Let the user decide the character
var pressedChar = TermReader.ReadKey();
var pressedChar = Input.ReadKey();
switch (pressedChar.Key)
{
case ConsoleKey.Escape:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<!-- Extras.Amusements addon Platform Information End -->

<ItemGroup>
<PackageReference Include="Textify.Offline.Data.Analysis" Version="1.11.0" />
<PackageReference Include="Textify.Offline.Data.Analysis" Version="1.11.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using System.Threading;
using Terminaux.Base;
using Terminaux.Reader;
using Terminaux.Inputs;

namespace Nitrocid.Extras.BassBoom.Commands
{
Expand Down Expand Up @@ -105,7 +106,7 @@ public override int Execute(CommandParameters parameters, ref string variableVal
{
if (ConsoleWrapper.KeyAvailable)
{
var key = TermReader.ReadKey();
var key = Input.ReadKey();
if (key.Key == ConsoleKey.Q)
PlaybackTools.Stop();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
using Terminaux.Base.Buffered;
using Terminaux.Base.Extensions;
using Terminaux.Inputs;
using Terminaux.Inputs.Styles;
using Terminaux.Inputs.Styles.Infobox;

namespace Nitrocid.Extras.BassBoom.Player
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
using Terminaux.Base.Extensions;
using Nitrocid.Languages;
using BassBoom.Basolia.Exceptions;
using Terminaux.Inputs.Styles;

namespace Nitrocid.Extras.BassBoom.Player
{
Expand All @@ -59,7 +60,7 @@ internal static void OpenEqualizer(Screen screen)
ScreenTools.Render();

// Handle the keystroke
var keystroke = TermReader.ReadKey();
var keystroke = Input.ReadKey();
HandleKeypress(keystroke);
}
catch (BasoliaException bex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using Terminaux.Base.Extensions;
using Terminaux.Colors.Data;
using Terminaux.Inputs;
using Terminaux.Inputs.Styles;
using Terminaux.Inputs.Styles.Infobox;
using Terminaux.Writer.ConsoleWriters;
using Terminaux.Writer.FancyWriters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
using Terminaux.Inputs;
using Nitrocid.Languages;
using BassBoom.Basolia.Exceptions;
using Terminaux.Inputs.Styles;

namespace Nitrocid.Extras.BassBoom.Player
{
Expand Down Expand Up @@ -107,7 +108,7 @@ public static void PlayerLoop()
// Handle the keystroke
if (ConsoleWrapper.KeyAvailable)
{
var keystroke = TermReader.ReadKey();
var keystroke = Input.ReadKey();
if (PlaybackTools.Playing)
HandleKeypressPlayMode(keystroke, playerScreen);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
using Terminaux.Inputs;
using Nitrocid.Languages;
using BassBoom.Basolia.Exceptions;
using Terminaux.Inputs.Styles;

namespace Nitrocid.Extras.BassBoom.Player
{
Expand Down Expand Up @@ -98,7 +99,7 @@ public static void RadioLoop()
// Handle the keystroke
if (ConsoleWrapper.KeyAvailable)
{
var keystroke = TermReader.ReadKey();
var keystroke = Input.ReadKey();
if (PlaybackTools.Playing)
HandleKeypressPlayMode(keystroke, radioScreen);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
using Terminaux.Base.Extensions;
using Nitrocid.Kernel.Time.Renderers;
using System.Collections.Generic;
using Terminaux.Inputs;

namespace Nitrocid.Extras.Calendar.Calendar
{
Expand Down Expand Up @@ -103,7 +104,7 @@ internal static void OpenInteractive(int Year, int Month, int Day, CalendarTypes

// Wait for a keypress
ScreenTools.Render(screen);
var keypress = TermReader.ReadKey();
var keypress = Input.ReadKey();
HandleKeypress(keypress, ref state);

// Reset, in case selection changed
Expand Down Expand Up @@ -140,11 +141,11 @@ private static void RenderKeybindings(ref Screen screen)
{
DebugWriter.WriteDebug(DebugLevel.I, "Drawing binding {0} with description {1}...", GetBindingKeyShortcut(binding, false), binding.Name);
bindingsBuilder.Append(
$"{InteractiveTuiStatus.KeyBindingOptionColor.VTSequenceForeground}" +
$"{InteractiveTuiStatus.OptionBackgroundColor.VTSequenceBackground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiKeyBindingOption).VTSequenceForeground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiOptionBackground).VTSequenceBackground}" +
GetBindingKeyShortcut(binding, false) +
$"{InteractiveTuiStatus.OptionForegroundColor.VTSequenceForeground}" +
$"{InteractiveTuiStatus.BackgroundColor.VTSequenceBackground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiOptionForeground).VTSequenceForeground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiBackground).VTSequenceBackground}" +
$" {(binding._localizable ? Translate.DoTranslation(binding.Name) : binding.Name)} "
);
}
Expand All @@ -154,8 +155,8 @@ private static void RenderKeybindings(ref Screen screen)
DebugWriter.WriteDebug(DebugLevel.I, "Bailing because of no space...");
bindingsBuilder.Append(
$"{CsiSequences.GenerateCsiCursorPosition(ConsoleWrapper.WindowWidth - 2, ConsoleWrapper.WindowHeight)}" +
$"{InteractiveTuiStatus.KeyBindingOptionColor.VTSequenceForeground}" +
$"{InteractiveTuiStatus.OptionBackgroundColor.VTSequenceBackground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiKeyBindingOption).VTSequenceForeground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiOptionBackground).VTSequenceBackground}" +
" K "
);
break;
Expand All @@ -174,7 +175,7 @@ private static void RenderStatus(ref Screen screen)
{
var builder = new StringBuilder();
builder.Append(
$"{InteractiveTuiStatus.ForegroundColor.VTSequenceForeground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiForeground).VTSequenceForeground}" +
$"{KernelColorTools.GetColor(KernelColorType.Background).VTSequenceBackground}" +
$"{TextWriterWhereColor.RenderWhere(status + ConsoleClearing.GetClearLineToRightSequence(), 0, 0)}"
);
Expand All @@ -198,7 +199,7 @@ private static void RenderViewBox(ref Screen screen)
// Render the box
builder.Append(
$"{InteractiveTuiStatus.PaneSeparatorColor.VTSequenceForeground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiPaneSeparator).VTSequenceForeground}" +
$"{KernelColorTools.GetColor(KernelColorType.Background).VTSequenceBackground}" +
$"{BorderColor.RenderBorderPlain(0, SeparatorMinimumHeight, SeparatorConsoleWidthInterior, SeparatorMaximumHeightInterior)}"
);
Expand Down Expand Up @@ -277,7 +278,7 @@ private static void RenderCalendar((int Year, int Month, int Day, CalendarTypes
var foreground =
IsToday ? KernelColorTools.GetColor(KernelColorType.TodayDay) :
IsWeekend ? KernelColorTools.GetColor(KernelColorType.WeekendDay) :
InteractiveTuiStatus.ForegroundColor;
KernelColorTools.GetColor(KernelColorType.TuiForeground);
// Know where and how to put the day number
foreach (ReminderInfo Reminder in ReminderManager.Reminders)
Expand Down Expand Up @@ -365,7 +366,7 @@ private static void RenderCalendar((int Year, int Month, int Day, CalendarTypes
var foreground =
IsToday ? KernelColorTools.GetColor(KernelColorType.TodayDay) :
IsWeekend ? KernelColorTools.GetColor(KernelColorType.WeekendDay) :
InteractiveTuiStatus.ForegroundColor;
KernelColorTools.GetColor(KernelColorType.TuiForeground);
// Know where and how to put the reminders and events
foreach (ReminderInfo Reminder in ReminderManager.Reminders)
Expand Down Expand Up @@ -434,7 +435,7 @@ private static void RenderCalendar((int Year, int Month, int Day, CalendarTypes
// Finalize everything
builder.Append(
$"{InteractiveTuiStatus.ForegroundColor.VTSequenceForeground}" +
$"{KernelColorTools.GetColor(KernelColorType.TuiForeground).VTSequenceForeground}" +
$"{background.VTSequenceBackground}"
);
return builder.ToString();
Expand Down Expand Up @@ -509,7 +510,7 @@ private static (int Year, int Month, int Day, CalendarTypes calendar) RenderKeyb
$"{section}{CharManager.NewLine}" +
$"{new string('=', section.Length)}{CharManager.NewLine}{CharManager.NewLine}" +
$"{string.Join('\n', bindingRepresentations)}"
, InteractiveTuiStatus.BoxForegroundColor, InteractiveTuiStatus.BoxBackgroundColor);
, KernelColorTools.GetColor(KernelColorType.TuiBoxForeground), KernelColorTools.GetColor(KernelColorType.TuiBoxBackground));
return state;
}

Expand Down
Loading

0 comments on commit 18596ba

Please sign in to comment.