Skip to content

Commit c435a29

Browse files
committed
Temporarily move name setting to Accessibility tab
1 parent 90ad3b1 commit c435a29

8 files changed

Lines changed: 147 additions & 43 deletions

File tree

.github/workflows/thunderstore.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Thunderstore
2+
on:
3+
push:
4+
branches: [main]
5+
release:
6+
types: released
7+
8+
env:
9+
DOTNET_CLI_TELEMETRY_OPTOUT: true
10+
MSBUILDTERMINALLOGGER: false
11+
DOTNET_VERSION: 9.0.x
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: read
20+
if: ${{ github.event_name == 'push' }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v5
24+
with:
25+
fetch-depth: 0
26+
filter: tree:0
27+
- name: Setup dotnet
28+
uses: actions/setup-dotnet@v5
29+
with:
30+
dotnet-version: ${{ env.DOTNET_VERSION }}
31+
- name: Login to GitHub Packages
32+
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ github.token }} --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --store-password-in-clear-text
33+
- id: build
34+
name: Build project
35+
run: |
36+
dotnet build -c Release
37+
FILE=$(find ${{ github.workspace }}/artifacts/thunderstore -type f -name "*.zip" | head -n 1)
38+
[ -n "$FILE" ] || { echo "Artifact not found!"; exit 1; }
39+
echo "filename=$(basename ${FILE%.*})" >> "$GITHUB_OUTPUT"
40+
echo "file=$FILE" >> "$GITHUB_OUTPUT"
41+
- name: Upload artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: ${{ steps.build.outputs.filename }}
45+
path: ${{ steps.build.outputs.file }}
46+
publish:
47+
name: Publish
48+
runs-on: ubuntu-latest
49+
permissions:
50+
contents: read
51+
packages: read
52+
if: ${{ github.event_name == 'release' && github.action == 'released' }}
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v5
56+
with:
57+
ref: ${{ github.event.release.tag_name }}
58+
fetch-depth: 0
59+
filter: tree:0
60+
- name: Setup .NET
61+
uses: actions/setup-dotnet@v5
62+
with:
63+
dotnet-version: ${{ env.DOTNET_VERSION }}
64+
- name: Login to GitHub Packages
65+
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ github.token }} --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --store-password-in-clear-text
66+
- id: build
67+
name: Build and publish
68+
run: |
69+
dotnet build -c Release -target:PublishTS
70+
FILE=$(find ${{ github.workspace }}/artifacts/thunderstore -type f -name "*.zip" | head -n 1)
71+
[ -n "$FILE" ] || { echo "Artifact not found!"; exit 1; }
72+
echo "filename=$(basename ${FILE%.*})" >> "$GITHUB_OUTPUT"
73+
echo "file=$FILE" >> "$GITHUB_OUTPUT"
74+
- name: Upload artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: ${{ steps.build.outputs.filename }}
78+
path: ${{ steps.build.outputs.file }}

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ All notable changes to this project will be documented here.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
66

7+
## v1.1.0 - October 4th, 2025
8+
9+
### Changed
10+
- Temporarily move name setting to the "Accessibility" tab for better visibility.
11+
712
## v1.0.0 - September 22th, 2025
813

914
### Added
1015
- Ability to set a custom preferred in-game name.
1116
- Integration with the main menu settings for easy customization.
1217
- Localization support for multiple languages.
13-
14-
### Changed
15-
16-
### Fixed

Config.Build.user.props.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- <PeakPluginsDir>$(UserAppDataRoaming)r2modmanPlus-local/PEAK/profiles/$(PeakModProfile)/BepInEx/plugins/</PeakPluginsDir> -->
99
</PropertyGroup>
1010

11-
<Target Name="DeployBuild" AfterTargets="PackageTS" Condition="'$(PublishTS)' != 'true' And '$(ThunderstorePackable)' != 'false'">
11+
<Target Name="DeployBuild" AfterTargets="PackageTS" Condition="'$(PublishTS)' != 'true' And '$(ThunderstorePackable)' != 'false' And '$(CI)' != 'true'">
1212
<Message Text="Deploy $(Configuration) Build -> $(PeakPluginsDir)$(Company)-$(AssemblyTitle)" Importance="High" />
1313
<Error Text="Plugins directory '$([MSBuild]::NormalizeDirectory($(PeakPluginsDir)))' doesn't exist!" Condition="!Exists('$(PeakPluginsDir)')" />
1414
<PropertyGroup>

CustomizableName.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configurat
2424
Directory.Build.targets = Directory.Build.targets
2525
EndProjectSection
2626
EndProject
27+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
28+
ProjectSection(SolutionItems) = preProject
29+
.github\workflows\thunderstore.yml = .github\workflows\thunderstore.yml
30+
EndProjectSection
31+
EndProject
2732
Global
2833
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2934
Debug|Any CPU = Debug|Any CPU
@@ -40,6 +45,7 @@ Global
4045
EndGlobalSection
4146
GlobalSection(NestedProjects) = preSolution
4247
{CD69A637-AC37-4112-8246-BCEDC53747F7} = {E5FE0A78-8301-44C0-8162-531ADDD3B57C}
48+
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {6B147D24-A75D-426C-B4B1-B54E6AA7981D}
4349
EndGlobalSection
4450
GlobalSection(ExtensibilityGlobals) = postSolution
4551
SolutionGuid = {92F6D475-68F0-44D6-A1AF-A28F5948E381}

Directory.Build.targets

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
<Project>
2-
<PropertyGroup>
2+
<PropertyGroup Condition="'$(CI)' != 'true'">
33
<RestoreAdditionalProjectSources>
44
https://nuget.bepinex.dev/v3/index.json;
55
https://nuget.windows10ce.com/nuget/v3/index.json
66
</RestoreAdditionalProjectSources>
77
</PropertyGroup>
8+
9+
<PropertyGroup Condition="'$(CI)' == 'true'">
10+
<RestoreAdditionalProjectSources>
11+
https://nuget.bepinex.dev/v3/index.json;
12+
https://nuget.windows10ce.com/nuget/v3/index.json;
13+
https://nuget.pkg.github.com/adeithe/index.json
14+
</RestoreAdditionalProjectSources>
15+
</PropertyGroup>
816

917
<!-- Modding dependencies -->
1018
<ItemGroup>
@@ -15,12 +23,17 @@
1523
</ItemGroup>
1624

1725
<!-- NuGet fallback stripped game references -->
18-
<ItemGroup Condition="!Exists('$(ManagedDir)')">
26+
<ItemGroup Condition="!Exists('$(ManagedDir)') And '$(CI)' != 'true'">
1927
<PackageReference Include="UnityEngine.Modules" Version="6000.0.36" PrivateAssets="all" />
2028
</ItemGroup>
2129

30+
<!-- NuGet game references for CI/CD -->
31+
<ItemGroup Condition="!Exists('$(ManagedDir)') And '$(CI)' == 'true'">
32+
<PackageReference Include="Adeithe.GameModding.PEAKRef" Version="*" Private="true" PrivateAssets="all" />
33+
</ItemGroup>
34+
2235
<!-- Local game references -->
23-
<ItemGroup Condition="Exists('$(ManagedDir)')">
36+
<ItemGroup Condition="Exists('$(ManagedDir)') And '$(CI)' != 'true'">
2437
<LocalReferences
2538
Include="$(ManagedDir)*.dll"
2639
Exclude="$(ManagedDir)Mono*.dll;$(ManagedDir)netstandard.dll;$(ManagedDir)System*.dll;$(ManagedDir)mscorlib.dll" />

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Allows you to customize what name other scouts see. Updates for everyone, even i
44

55
## Features
66
- Name updates for everyone, even if they don't have the mod installed.
7-
- Customizable in main menu settings. (Main Menu > Settings > General)
7+
- Customizable in main menu settings. (Main Menu > Settings > Accessibility)
88
- Full localization support.
99

1010
## Installation

src/CustomizableName/Components/PreferredNameSetting.cs

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,41 @@
99

1010
namespace CustomizableName.Components {
1111
internal class PreferredNameSetting: StringSetting, IExposedSetting, IConditionalSetting {
12-
private readonly GameObject uiCell;
12+
private static bool initialized = false;
1313

14-
private PreferredNameSetting() : base() {
15-
uiCell = Object.Instantiate(SingletonAsset<InputCellMapper>.Instance.FloatSettingCell);
14+
private PreferredNameSetting() : base() {}
15+
16+
public override void Load(ISettingsSaveLoad loader) {
17+
Value = Plugin.Config.PreferredName.Value ?? "";
18+
}
19+
20+
public override void Save(ISettingsSaveLoad saver) {
21+
Plugin.Config.DisplayName = Value.Trim();
22+
}
23+
24+
public override void ApplyValue() { }
25+
26+
protected override string GetDefaultValue() {
27+
return "";
28+
}
29+
30+
public string GetDisplayName() {
31+
return "PREFERREDNAMESETTING";
32+
}
33+
34+
public string GetCategory() {
35+
return "Accessibility";
36+
}
37+
38+
public bool ShouldShow() {
39+
return !PhotonNetwork.InRoom;
40+
}
41+
42+
public override GameObject GetSettingUICell() {
43+
GameObject existing = GameObject.Find("PreferredNameInputCell");
44+
if(existing != null) return existing;
45+
46+
GameObject uiCell = Object.Instantiate(SingletonAsset<InputCellMapper>.Instance.FloatSettingCell);
1647
uiCell.name = "PreferredNameInputCell";
1748

1849
FloatSettingUI old = uiCell.GetComponent<FloatSettingUI>();
@@ -22,6 +53,9 @@ private PreferredNameSetting() : base() {
2253
Object.DestroyImmediate(old.slider.gameObject);
2354
Object.DestroyImmediate(old);
2455

56+
ui.disable = PhotonNetwork.InRoom;
57+
ui.inputField.readOnly = ui.disable;
58+
ui.inputField.interactable = !ui.disable;
2559
ui.inputField.characterValidation = TMP_InputField.CharacterValidation.None;
2660
ui.inputField.characterLimit = 24;
2761
ui.inputField.contentType = TMP_InputField.ContentType.Standard;
@@ -39,40 +73,11 @@ private PreferredNameSetting() : base() {
3973
label.fontSize = label.fontSizeMin = label.fontSizeMax = 24f;
4074
label.alignment = TextAlignmentOptions.MidlineLeft;
4175
}
42-
Object.DontDestroyOnLoad(uiCell);
43-
}
44-
45-
public override void Load(ISettingsSaveLoad loader) {
46-
Value = Plugin.Config.PreferredName.Value ?? "";
47-
}
48-
49-
public override void Save(ISettingsSaveLoad saver) {
50-
Plugin.Config.DisplayName = Value.Trim();
51-
}
52-
53-
public override void ApplyValue() {}
54-
55-
public override GameObject GetSettingUICell() {
5676
return uiCell;
5777
}
5878

59-
protected override string GetDefaultValue() {
60-
return "";
61-
}
62-
63-
public string GetDisplayName() {
64-
return "PREFERREDNAMESETTING";
65-
}
66-
67-
public string GetCategory() {
68-
return "General";
69-
}
70-
71-
public bool ShouldShow() {
72-
return !PhotonNetwork.InRoom;
73-
}
74-
7579
internal static void Initialize(Transform parent) {
80+
if(initialized) return;
7681
TranslationKey i18n = MenuAPI.CreateLocalization("PREFERREDNAMESETTING")
7782
.AddLocalization("Preferred Name", LocalizedText.Language.English)
7883
.AddLocalization("Nom préféré", LocalizedText.Language.French)
@@ -90,6 +95,7 @@ internal static void Initialize(Transform parent) {
9095
.AddLocalization("Preferowana nazwa", LocalizedText.Language.Polish)
9196
.AddLocalization("Tercih edilen isim", LocalizedText.Language.Turkish);
9297
SettingsHandler.Instance.AddSetting(new PreferredNameSetting());
98+
initialized = true;
9399
}
94100
}
95101
}

src/CustomizableName/CustomizableName.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<PluginAuthor>Adeithe</PluginAuthor>
4-
<PluginVersion>1.0.0</PluginVersion>
4+
<PluginVersion>1.1.0</PluginVersion>
55
<PluginName>CustomizableName</PluginName>
66
<PluginID>Adeithe.Peak.CustomizableName</PluginID>
77

0 commit comments

Comments
 (0)