-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--- This addon is not ready yet, because Terminaux 6.1.0, which holds necessary changes, is not released yet. As a result, the build will fail. --- Type: imp Breaking: False Doc Required: False Backport Required: False Part: 1/2
- Loading branch information
Showing
9 changed files
with
205 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
public/Nitrocid.Addons/Nitrocid.Extras.Images.Icons/IconsInit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Nitrocid KS Copyright (C) 2018-2025 Aptivi | ||
// | ||
// This file is part of Nitrocid KS | ||
// | ||
// Nitrocid KS 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. | ||
// | ||
// Nitrocid KS 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 <https://www.gnu.org/licenses/>. | ||
// | ||
|
||
using Nitrocid.Kernel.Extensions; | ||
|
||
namespace Nitrocid.Extras.Images.Icons | ||
{ | ||
internal class IconsInit : IAddon | ||
{ | ||
string IAddon.AddonName => | ||
InterAddonTranslations.GetAddonName(KnownAddons.ExtrasImagesIcons); | ||
|
||
ModLoadPriority IAddon.AddonType => ModLoadPriority.Optional; | ||
|
||
void IAddon.FinalizeAddon() | ||
{ } | ||
|
||
void IAddon.StartAddon() | ||
{ } | ||
|
||
void IAddon.StopAddon() | ||
{ } | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
public/Nitrocid.Addons/Nitrocid.Extras.Images.Icons/Nitrocid.Extras.Images.Icons.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<!-- Extras.Images.Icons addon General Information --> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DefineTrace>true</DefineTrace> | ||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
<OutputPath>..\..\Nitrocid\KSBuild\$(TargetFramework)\Addons\Extras.Images.Icons</OutputPath> | ||
<Description>Nitrocid KS Extras - Icons</Description> | ||
<AssemblyTitle>Nitrocid KS Extras - Icons</AssemblyTitle> | ||
<GenerateDocumentationFile>True</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
<!-- Extras.Images.Icons addon General Information End --> | ||
|
||
<!-- Extras.Images.Icons addon Platform Information --> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DefineDebug>true</DefineDebug> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DefineDebug>false</DefineDebug> | ||
<Optimize>true</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\private\Nitrocid.LocaleChecker\Nitrocid.LocaleChecker.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" /> | ||
<ProjectReference Include="..\..\Nitrocid\Nitrocid.csproj" Private="false" /> | ||
</ItemGroup> | ||
<!-- Extras.Images.Icons addon Platform Information End --> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Terminaux.Images.Icons" Version="6.1.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
66 changes: 66 additions & 0 deletions
66
public/Nitrocid.Addons/Nitrocid.Extras.Images.Icons/Tools/IconsTools.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// Nitrocid KS Copyright (C) 2018-2025 Aptivi | ||
// | ||
// This file is part of Nitrocid KS | ||
// | ||
// Nitrocid KS 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. | ||
// | ||
// Nitrocid KS 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 <https://www.gnu.org/licenses/>. | ||
// | ||
|
||
using System.Linq; | ||
using Terminaux.Images.Icons; | ||
using Terminaux.Writer.ConsoleWriters; | ||
|
||
namespace Nitrocid.Extras.Images.Icons.Tools | ||
{ | ||
/// <summary> | ||
/// Tools for the icons | ||
/// </summary> | ||
public static class IconsTools | ||
{ | ||
/// <summary> | ||
/// Gets the icon names | ||
/// </summary> | ||
/// <returns>An array of all icon names</returns> | ||
public static string[] GetIconNames() => | ||
IconsManager.GetIconNames(); | ||
|
||
/// <summary> | ||
/// Checks an icon | ||
/// </summary> | ||
/// <param name="iconName">Icon name</param> | ||
/// <returns>True if this icon is found; false otherwise.</returns> | ||
public static bool HasIcon(string iconName) => | ||
GetIconNames().Contains(iconName); | ||
|
||
/// <summary> | ||
/// Renders the icon to a string that you can print to the console | ||
/// </summary> | ||
/// <param name="iconName">Icon name</param> | ||
/// <param name="width">Width of the resulting icon</param> | ||
/// <param name="height">Height of the resulting icon</param> | ||
/// <param name="left">Zero-based console left position to start writing the icon to</param> | ||
/// <param name="top">Zero-based console top position to start writing the icon to</param> | ||
/// <returns>A string that contains the resulting pixels that you can print to the console using the <see cref="TextWriterRaw.WriteRaw(string, object[])"/> function</returns> | ||
public static string RenderIcon(string iconName, int width, int height, int left, int top) => | ||
IconsManager.RenderIcon(iconName, width, height, left, top); | ||
|
||
/// <summary> | ||
/// Prompts the user for an icon | ||
/// </summary> | ||
/// <param name="initialIcon">Initial icon to use</param> | ||
/// <returns>Selected icon</returns> | ||
public static string PromptForIcons(string initialIcon) => | ||
IconsSelector.PromptForIcons(initialIcon); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters