Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f383c3ebe | ||
|
|
5dfd859542 | ||
|
|
beb737b267 | ||
|
|
68c0bf1334 | ||
|
|
05daa59e40 | ||
|
|
c3a6f2c88d | ||
|
|
dc0265f614 | ||
|
|
ba0e1cea08 | ||
|
|
1dea9b713e | ||
|
|
23c57aedc4 |
182
.gitea/lightless-tag-and-release.yml
Normal file
182
.gitea/lightless-tag-and-release.yml
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
name: Tag and Release Lightless
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
PLUGIN_NAME: LightlessSync
|
||||||
|
DOTNET_VERSION: 9.x
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tag-and-release:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Lightless
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Setup .NET 9 SDK
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: 9.x
|
||||||
|
|
||||||
|
- name: Download Dalamud
|
||||||
|
run: |
|
||||||
|
cd /
|
||||||
|
mkdir -p root/.xlcore/dalamud/Hooks/dev
|
||||||
|
curl -O https://goatcorp.github.io/dalamud-distrib/stg/latest.zip
|
||||||
|
unzip latest.zip -d /root/.xlcore/dalamud/Hooks/dev
|
||||||
|
|
||||||
|
- name: Lets Build Lightless!
|
||||||
|
run: |
|
||||||
|
dotnet restore
|
||||||
|
dotnet build --configuration Release --no-restore
|
||||||
|
dotnet publish --configuration Release --no-build
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
id: package_version
|
||||||
|
uses: KageKirin/get-csproj-version@v0
|
||||||
|
with:
|
||||||
|
file: LightlessSync/LightlessSync.csproj
|
||||||
|
|
||||||
|
- name: Display version
|
||||||
|
run: |
|
||||||
|
echo "Version: ${{ steps.package_version.outputs.version }}"
|
||||||
|
|
||||||
|
- name: Prepare Lightless Client
|
||||||
|
run: |
|
||||||
|
PUBLISH_PATH="/workspace/Lightless-Sync/LightlessClient/LightlessSync/bin/x64/Release/publish/"
|
||||||
|
if [ -d "$PUBLISH_PATH" ]; then
|
||||||
|
rm -rf "$PUBLISH_PATH"
|
||||||
|
echo "Removed $PUBLISH_PATH"
|
||||||
|
else
|
||||||
|
echo "$PUBLISH_PATH does not exist, nothing to remove."
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p output
|
||||||
|
(cd /workspace/Lightless-Sync/LightlessClient/LightlessSync/bin/x64/Release/ && zip -r $OLDPWD/output/LightlessClient.zip *)
|
||||||
|
|
||||||
|
- name: Create Git tag if not exists
|
||||||
|
run: |
|
||||||
|
tag="${{ steps.package_version.outputs.version }}"
|
||||||
|
git fetch --tags
|
||||||
|
if ! git tag -l "$tag" | grep -q "$tag"; then
|
||||||
|
echo "Tag $tag does not exist. Creating and pushing..."
|
||||||
|
git config user.name "GitHub Action"
|
||||||
|
git config user.email "action@github.com"
|
||||||
|
git tag "$tag"
|
||||||
|
git push origin "$tag"
|
||||||
|
else
|
||||||
|
echo "Tag $tag already exists. Skipping tag creation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
run: |
|
||||||
|
echo "=== Searching for existing release ${{ steps.package_version.outputs.version }}==="
|
||||||
|
|
||||||
|
release_id=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
"https://git.lightless-sync.org/api/v1/repos/${GITHUB_REPOSITORY}/releases/tags/${{ steps.package_version.outputs.version }}" | jq -r .id)
|
||||||
|
|
||||||
|
if [ "$release_id" != "null" ]; then
|
||||||
|
echo "=== Deleting existing release ${{ steps.package_version.outputs.version }}==="
|
||||||
|
curl -X DELETE -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
"https://git.lightless-sync.org/api/v1/repos/${GITHUB_REPOSITORY}/releases/$release_id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== Creating new release ${{ steps.package_version.outputs.version }}==="
|
||||||
|
response=$(
|
||||||
|
curl --fail-with-body -X POST \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
-d '{
|
||||||
|
"tag_name": "${{ steps.package_version.outputs.version }}",
|
||||||
|
"name": "${{ steps.package_version.outputs.version }}",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false
|
||||||
|
}' \
|
||||||
|
"https://git.lightless-sync.org/api/v1/repos/${GITHUB_REPOSITORY}/releases"
|
||||||
|
)
|
||||||
|
|
||||||
|
release_id=$(echo "$response" | jq -r .id)
|
||||||
|
echo "release_id=$release_id" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Upload Assets to release
|
||||||
|
run: |
|
||||||
|
curl --fail-with-body -s -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
-F "attachment=@output/LightlessClient.zip" \
|
||||||
|
"https://git.lightless-sync.org/api/v1/repos/${GITHUB_REPOSITORY}/releases/${{ steps.create_release.outputs.release_id }}/assets"
|
||||||
|
|
||||||
|
- name: Clone plugin hosting repo
|
||||||
|
run: |
|
||||||
|
mkdir LightlessSyncRepo
|
||||||
|
cd LightlessSyncRepo
|
||||||
|
git clone https://git.lightless-sync.org/${{ gitea.repository_owner }}/LightlessSync.git
|
||||||
|
env:
|
||||||
|
GIT_TERMINAL_PROMPT: 0
|
||||||
|
|
||||||
|
- name: Update plogonmaster.json with version
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.package_version.outputs.version }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
pluginJsonPath="${PLUGIN_NAME}/bin/x64/Release/${PLUGIN_NAME}.json"
|
||||||
|
repoJsonPath="LightlessSyncRepo/LightlessSync/plogonmaster.json"
|
||||||
|
version="${VERSION}"
|
||||||
|
downloadUrl="https://git.lightless-sync.org/${{ gitea.repository_owner }}/LightlessClient/releases/download/$version/LightlessClient.zip"
|
||||||
|
|
||||||
|
# Read plugin JSON
|
||||||
|
pluginJson=$(cat "$pluginJsonPath")
|
||||||
|
internalName=$(jq -r '.InternalName' <<< "$pluginJson")
|
||||||
|
dalamudApiLevel=$(jq -r '.DalamudApiLevel' <<< "$pluginJson")
|
||||||
|
|
||||||
|
# Read repo JSON (force array if not already)
|
||||||
|
repoJsonRaw=$(cat "$repoJsonPath")
|
||||||
|
if echo "$repoJsonRaw" | jq 'type' | grep -q '"array"'; then
|
||||||
|
repoJson="$repoJsonRaw"
|
||||||
|
else
|
||||||
|
repoJson="[$repoJsonRaw]"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Update matching plugin entry
|
||||||
|
updatedRepoJson=$(jq \
|
||||||
|
--arg internalName "$internalName" \
|
||||||
|
--arg dalamudApiLevel "$dalamudApiLevel" \
|
||||||
|
--arg version "$version" \
|
||||||
|
--arg downloadUrl "$downloadUrl" \
|
||||||
|
'
|
||||||
|
map(
|
||||||
|
if .InternalName == $internalName
|
||||||
|
then
|
||||||
|
.DalamudApiLevel = $dalamudApiLevel
|
||||||
|
| .AssemblyVersion = $version
|
||||||
|
| .DownloadLinkInstall = $downloadUrl
|
||||||
|
| .DownloadLinkTesting = $downloadUrl
|
||||||
|
| .DownloadLinkUpdate = $downloadUrl
|
||||||
|
else
|
||||||
|
.
|
||||||
|
end
|
||||||
|
)
|
||||||
|
' <<< "$repoJson")
|
||||||
|
|
||||||
|
# Write back to file
|
||||||
|
echo "$updatedRepoJson" > "$repoJsonPath"
|
||||||
|
# Output the content of the file
|
||||||
|
cat "$repoJsonPath"
|
||||||
|
|
||||||
|
- name: Commit and push to LightlessSync
|
||||||
|
run: |
|
||||||
|
cd LightlessSyncRepo/LightlessSync
|
||||||
|
git config user.name "github-actions"
|
||||||
|
git config user.email "github-actions@github.com"
|
||||||
|
git add .
|
||||||
|
git diff-index --quiet HEAD || git commit -m "Update ${{ env.PLUGIN_NAME }} to ${{ steps.package_version.outputs.version }}"
|
||||||
|
git push https://x-access-token:${{ secrets.AUTOMATION_TOKEN }}@git.lightless-sync.org/${{ gitea.repository_owner }}/LightlessSync.git HEAD:main
|
||||||
56
.github/workflows/lightless-tag-and-release.yml
vendored
56
.github/workflows/lightless-tag-and-release.yml
vendored
@@ -82,3 +82,59 @@ jobs:
|
|||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
files: output/LightlessClient.zip
|
files: output/LightlessClient.zip
|
||||||
|
|
||||||
|
- name: Clone plugin hosting repo
|
||||||
|
run: |
|
||||||
|
mkdir LightlessSyncRepo
|
||||||
|
cd LightlessSyncRepo
|
||||||
|
git clone https://github.com/${{ github.repository_owner }}/LightlessSync.git
|
||||||
|
env:
|
||||||
|
GIT_TERMINAL_PROMPT: 0
|
||||||
|
|
||||||
|
- name: Update plogonmaster.json with version
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.package_version.outputs.version }}
|
||||||
|
run: |
|
||||||
|
$pluginJsonPath = "${{ env.PLUGIN_NAME }}/bin/x64/Release/${{ env.PLUGIN_NAME }}.json"
|
||||||
|
$pluginJson = Get-Content $pluginJsonPath | ConvertFrom-Json
|
||||||
|
$repoJsonPath = "LightlessSyncRepo/LightlessSync/plogonmaster.json"
|
||||||
|
$repoJsonRaw = Get-Content $repoJsonPath -Raw
|
||||||
|
$repoJson = $repoJsonRaw | ConvertFrom-Json
|
||||||
|
$version = $env:VERSION
|
||||||
|
$downloadUrl = "https://github.com/${{ github.repository_owner }}/LightlessClient/releases/download/$version/LightlessClient.zip"
|
||||||
|
|
||||||
|
if (-not ($repoJson -is [System.Collections.IEnumerable])) {
|
||||||
|
$repoJson = @($repoJson)
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($plugin in $repoJson) {
|
||||||
|
if ($plugin.InternalName -eq $pluginJson.InternalName) {
|
||||||
|
$plugin.DalamudApiLevel = $pluginJson.DalamudApiLevel
|
||||||
|
$plugin.AssemblyVersion = $version
|
||||||
|
$plugin.DownloadLinkInstall = $downloadUrl
|
||||||
|
$plugin.DownloadLinkTesting = $downloadUrl
|
||||||
|
$plugin.DownloadLinkUpdate = $downloadUrl
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$repoJson | ConvertTo-Json -Depth 100 | Set-Content $repoJsonPath
|
||||||
|
|
||||||
|
# Convert to JSON and force array brackets if necessary
|
||||||
|
$repoJsonString = $repoJson | ConvertTo-Json -Depth 100
|
||||||
|
|
||||||
|
# If the output is not an array, wrap it manually
|
||||||
|
if ($repoJsonString.Trim().StartsWith('{')) {
|
||||||
|
$repoJsonString = "[$repoJsonString]"
|
||||||
|
}
|
||||||
|
|
||||||
|
$repoJsonString | Set-Content $repoJsonPath
|
||||||
|
|
||||||
|
- name: Commit and push to LightlessSync
|
||||||
|
run: |
|
||||||
|
cd LightlessSyncRepo/LightlessSync
|
||||||
|
git config user.name "github-actions"
|
||||||
|
git config user.email "github-actions@github.com"
|
||||||
|
git add .
|
||||||
|
git commit -m "Update ${{ env.PLUGIN_NAME }} to ${{ steps.package_version.outputs.version }}"
|
||||||
|
git push https://x-access-token:${{ secrets.LIGHTLESS_TOKEN }}@github.com/${{ github.repository_owner }}/LightlessSync.git HEAD:main
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ public sealed class IpcCallerMoodles : IIpcCaller
|
|||||||
|
|
||||||
_moodlesApiVersion = pi.GetIpcSubscriber<int>("Moodles.Version");
|
_moodlesApiVersion = pi.GetIpcSubscriber<int>("Moodles.Version");
|
||||||
_moodlesOnChange = pi.GetIpcSubscriber<IPlayerCharacter, object>("Moodles.StatusManagerModified");
|
_moodlesOnChange = pi.GetIpcSubscriber<IPlayerCharacter, object>("Moodles.StatusManagerModified");
|
||||||
_moodlesGetStatus = pi.GetIpcSubscriber<nint, string>("Moodles.GetStatusManagerByPtr");
|
_moodlesGetStatus = pi.GetIpcSubscriber<nint, string>("Moodles.GetStatusManagerByPtrV2");
|
||||||
_moodlesSetStatus = pi.GetIpcSubscriber<nint, string, object>("Moodles.SetStatusManagerByPtr");
|
_moodlesSetStatus = pi.GetIpcSubscriber<nint, string, object>("Moodles.SetStatusManagerByPtrV2");
|
||||||
_moodlesRevertStatus = pi.GetIpcSubscriber<nint, object>("Moodles.ClearStatusManagerByPtr");
|
_moodlesRevertStatus = pi.GetIpcSubscriber<nint, object>("Moodles.ClearStatusManagerByPtrV2");
|
||||||
|
|
||||||
_moodlesOnChange.Subscribe(OnMoodlesChange);
|
_moodlesOnChange.Subscribe(OnMoodlesChange);
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ public sealed class IpcCallerMoodles : IIpcCaller
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
APIAvailable = _moodlesApiVersion.InvokeFunc() == 1;
|
APIAvailable = _moodlesApiVersion.InvokeFunc() == 3;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,12 +30,12 @@ public sealed class IpcCallerPetNames : IIpcCaller
|
|||||||
_dalamudUtil = dalamudUtil;
|
_dalamudUtil = dalamudUtil;
|
||||||
_lightlessMediator = lightlessMediator;
|
_lightlessMediator = lightlessMediator;
|
||||||
|
|
||||||
_petnamesReady = pi.GetIpcSubscriber<object>("PetRenamer.Ready");
|
_petnamesReady = pi.GetIpcSubscriber<object>("PetRenamer.OnReady");
|
||||||
_petnamesDisposing = pi.GetIpcSubscriber<object>("PetRenamer.Disposing");
|
_petnamesDisposing = pi.GetIpcSubscriber<object>("PetRenamer.OnDisposing");
|
||||||
_apiVersion = pi.GetIpcSubscriber<(uint, uint)>("PetRenamer.ApiVersion");
|
_apiVersion = pi.GetIpcSubscriber<(uint, uint)>("PetRenamer.ApiVersion");
|
||||||
_enabled = pi.GetIpcSubscriber<bool>("PetRenamer.Enabled");
|
_enabled = pi.GetIpcSubscriber<bool>("PetRenamer.IsEnabled");
|
||||||
|
|
||||||
_playerDataChanged = pi.GetIpcSubscriber<string, object>("PetRenamer.PlayerDataChanged");
|
_playerDataChanged = pi.GetIpcSubscriber<string, object>("PetRenamer.OnPlayerDataChanged");
|
||||||
_getPlayerData = pi.GetIpcSubscriber<string>("PetRenamer.GetPlayerData");
|
_getPlayerData = pi.GetIpcSubscriber<string>("PetRenamer.GetPlayerData");
|
||||||
_setPlayerData = pi.GetIpcSubscriber<string, object>("PetRenamer.SetPlayerData");
|
_setPlayerData = pi.GetIpcSubscriber<string, object>("PetRenamer.SetPlayerData");
|
||||||
_clearPlayerData = pi.GetIpcSubscriber<ushort, object>("PetRenamer.ClearPlayerData");
|
_clearPlayerData = pi.GetIpcSubscriber<ushort, object>("PetRenamer.ClearPlayerData");
|
||||||
@@ -56,7 +56,7 @@ public sealed class IpcCallerPetNames : IIpcCaller
|
|||||||
APIAvailable = _enabled?.InvokeFunc() ?? false;
|
APIAvailable = _enabled?.InvokeFunc() ?? false;
|
||||||
if (APIAvailable)
|
if (APIAvailable)
|
||||||
{
|
{
|
||||||
APIAvailable = _apiVersion?.InvokeFunc() is { Item1: 3, Item2: >= 1 };
|
APIAvailable = _apiVersion?.InvokeFunc() is { Item1: 4, Item2: >= 0 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using LightlessSync.LightlessConfiguration.Configurations;
|
using LightlessSync.LightlessConfiguration.Configurations;
|
||||||
using LightlessSync.LightlessConfiguration;
|
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
@@ -13,6 +13,8 @@ public class LightlessConfig : ILightlessConfiguration
|
|||||||
public bool EnableDtrEntry { get; set; } = false;
|
public bool EnableDtrEntry { get; set; } = false;
|
||||||
public bool ShowUidInDtrTooltip { get; set; } = true;
|
public bool ShowUidInDtrTooltip { get; set; } = true;
|
||||||
public bool PreferNoteInDtrTooltip { get; set; } = false;
|
public bool PreferNoteInDtrTooltip { get; set; } = false;
|
||||||
|
public bool IsNameplateColorsEnabled { get; set; } = false;
|
||||||
|
public DtrEntry.Colors NameplateColors { get; set; } = new(Foreground: 0xE69138u, Glow: 0xFFBA47u);
|
||||||
public bool UseColorsInDtr { get; set; } = true;
|
public bool UseColorsInDtr { get; set; } = true;
|
||||||
public DtrEntry.Colors DtrColorsDefault { get; set; } = default;
|
public DtrEntry.Colors DtrColorsDefault { get; set; } = default;
|
||||||
public DtrEntry.Colors DtrColorsNotConnected { get; set; } = new(Glow: 0x0428FFu);
|
public DtrEntry.Colors DtrColorsNotConnected { get; set; } = new(Glow: 0x0428FFu);
|
||||||
@@ -60,4 +62,6 @@ public class LightlessConfig : ILightlessConfiguration
|
|||||||
public int Version { get; set; } = 1;
|
public int Version { get; set; } = 1;
|
||||||
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
|
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
|
||||||
public bool UseFocusTarget { get; set; } = false;
|
public bool UseFocusTarget { get; set; } = false;
|
||||||
|
public bool overrideFriendColor { get; set; } = false;
|
||||||
|
public bool overridePartyColor { get; set; } = false;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using LightlessSync.API.Data.Enum;
|
using LightlessSync.API.Data.Enum;
|
||||||
using LightlessSync.LightlessConfiguration.Configurations;
|
|
||||||
|
|
||||||
namespace LightlessSync.LightlessConfiguration.Configurations;
|
namespace LightlessSync.LightlessConfiguration.Configurations;
|
||||||
|
|
||||||
@@ -151,6 +151,7 @@ public class LightlessPlugin : MediatorSubscriberBase, IHostedService
|
|||||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<TransientResourceManager>();
|
_runtimeServiceScope.ServiceProvider.GetRequiredService<TransientResourceManager>();
|
||||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<VisibleUserDataDistributor>();
|
_runtimeServiceScope.ServiceProvider.GetRequiredService<VisibleUserDataDistributor>();
|
||||||
_runtimeServiceScope.ServiceProvider.GetRequiredService<NotificationService>();
|
_runtimeServiceScope.ServiceProvider.GetRequiredService<NotificationService>();
|
||||||
|
_runtimeServiceScope.ServiceProvider.GetRequiredService<NameplateService>();
|
||||||
|
|
||||||
#if !DEBUG
|
#if !DEBUG
|
||||||
if (_lightlessConfigService.Current.LogLevel != LogLevel.Information)
|
if (_lightlessConfigService.Current.LogLevel != LogLevel.Information)
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Authors></Authors>
|
<Authors></Authors>
|
||||||
<Company></Company>
|
<Company></Company>
|
||||||
<Version>1.11.2</Version>
|
<Version>1.11.5</Version>
|
||||||
<Description></Description>
|
<Description></Description>
|
||||||
<Copyright></Copyright>
|
<Copyright></Copyright>
|
||||||
<PackageProjectUrl>https://github.com/Light-Public-Syncshells/LightlessClient</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/Light-Public-Syncshells/LightlessClient</PackageProjectUrl>
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using LightlessSync.PlayerData.Handlers;
|
|||||||
using LightlessSync.Services;
|
using LightlessSync.Services;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using CharacterData = LightlessSync.PlayerData.Data.CharacterData;
|
|
||||||
|
|
||||||
namespace LightlessSync.PlayerData.Factories;
|
namespace LightlessSync.PlayerData.Factories;
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase
|
|||||||
Mediator.Publish(new EventMessage(new Event(PlayerName, Pair.UserData, nameof(PairHandler),
|
Mediator.Publish(new EventMessage(new Event(PlayerName, Pair.UserData, nameof(PairHandler),
|
||||||
EventSeverity.Informational, text)));
|
EventSeverity.Informational, text)));
|
||||||
Mediator.Publish(new RefreshUiMessage());
|
Mediator.Publish(new RefreshUiMessage());
|
||||||
|
Mediator.Publish(new VisibilityChange());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public class Pair
|
|||||||
public long LastAppliedDataTris { get; set; } = -1;
|
public long LastAppliedDataTris { get; set; } = -1;
|
||||||
public long LastAppliedApproximateVRAMBytes { get; set; } = -1;
|
public long LastAppliedApproximateVRAMBytes { get; set; } = -1;
|
||||||
public string Ident => _onlineUserIdentDto?.Ident ?? string.Empty;
|
public string Ident => _onlineUserIdentDto?.Ident ?? string.Empty;
|
||||||
|
public uint PlayerCharacterId => CachedPlayer?.PlayerCharacterId ?? uint.MaxValue;
|
||||||
|
|
||||||
public UserData UserData => UserPair.User;
|
public UserData UserData => UserPair.User;
|
||||||
|
|
||||||
@@ -71,8 +72,8 @@ public class Pair
|
|||||||
Name = openProfileSeString,
|
Name = openProfileSeString,
|
||||||
OnClicked = (a) => _mediator.Publish(new ProfileOpenStandaloneMessage(this)),
|
OnClicked = (a) => _mediator.Publish(new ProfileOpenStandaloneMessage(this)),
|
||||||
UseDefaultPrefix = false,
|
UseDefaultPrefix = false,
|
||||||
PrefixChar = 'M',
|
PrefixChar = 'L',
|
||||||
PrefixColor = 526
|
PrefixColor = 708
|
||||||
});
|
});
|
||||||
|
|
||||||
args.AddMenuItem(new MenuItem()
|
args.AddMenuItem(new MenuItem()
|
||||||
@@ -80,8 +81,8 @@ public class Pair
|
|||||||
Name = reapplyDataSeString,
|
Name = reapplyDataSeString,
|
||||||
OnClicked = (a) => ApplyLastReceivedData(forced: true),
|
OnClicked = (a) => ApplyLastReceivedData(forced: true),
|
||||||
UseDefaultPrefix = false,
|
UseDefaultPrefix = false,
|
||||||
PrefixChar = 'M',
|
PrefixChar = 'L',
|
||||||
PrefixColor = 526
|
PrefixColor = 708
|
||||||
});
|
});
|
||||||
|
|
||||||
args.AddMenuItem(new MenuItem()
|
args.AddMenuItem(new MenuItem()
|
||||||
@@ -89,8 +90,8 @@ public class Pair
|
|||||||
Name = changePermissions,
|
Name = changePermissions,
|
||||||
OnClicked = (a) => _mediator.Publish(new OpenPermissionWindow(this)),
|
OnClicked = (a) => _mediator.Publish(new OpenPermissionWindow(this)),
|
||||||
UseDefaultPrefix = false,
|
UseDefaultPrefix = false,
|
||||||
PrefixChar = 'M',
|
PrefixChar = 'L',
|
||||||
PrefixColor = 526
|
PrefixColor = 708
|
||||||
});
|
});
|
||||||
|
|
||||||
args.AddMenuItem(new MenuItem()
|
args.AddMenuItem(new MenuItem()
|
||||||
@@ -98,8 +99,8 @@ public class Pair
|
|||||||
Name = cyclePauseState,
|
Name = cyclePauseState,
|
||||||
OnClicked = (a) => _mediator.Publish(new CyclePauseMessage(UserData)),
|
OnClicked = (a) => _mediator.Publish(new CyclePauseMessage(UserData)),
|
||||||
UseDefaultPrefix = false,
|
UseDefaultPrefix = false,
|
||||||
PrefixChar = 'M',
|
PrefixChar = 'L',
|
||||||
PrefixColor = 526
|
PrefixColor = 708
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game;
|
||||||
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Interface.ImGuiFileDialog;
|
using Dalamud.Interface.ImGuiFileDialog;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
@@ -12,6 +13,7 @@ using LightlessSync.PlayerData.Factories;
|
|||||||
using LightlessSync.PlayerData.Pairs;
|
using LightlessSync.PlayerData.Pairs;
|
||||||
using LightlessSync.PlayerData.Services;
|
using LightlessSync.PlayerData.Services;
|
||||||
using LightlessSync.Services;
|
using LightlessSync.Services;
|
||||||
|
using LightlessSync.Services.CharaData;
|
||||||
using LightlessSync.Services.Events;
|
using LightlessSync.Services.Events;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using LightlessSync.Services.ServerConfiguration;
|
using LightlessSync.Services.ServerConfiguration;
|
||||||
@@ -28,8 +30,6 @@ using Microsoft.Extensions.Logging;
|
|||||||
using NReco.Logging.File;
|
using NReco.Logging.File;
|
||||||
using System.Net.Http.Headers;
|
using System.Net.Http.Headers;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using LightlessSync.Services.CharaData;
|
|
||||||
using Dalamud.Game;
|
|
||||||
|
|
||||||
namespace LightlessSync;
|
namespace LightlessSync;
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
IFramework framework, IObjectTable objectTable, IClientState clientState, ICondition condition, IChatGui chatGui,
|
IFramework framework, IObjectTable objectTable, IClientState clientState, ICondition condition, IChatGui chatGui,
|
||||||
IGameGui gameGui, IDtrBar dtrBar, IPluginLog pluginLog, ITargetManager targetManager, INotificationManager notificationManager,
|
IGameGui gameGui, IDtrBar dtrBar, IPluginLog pluginLog, ITargetManager targetManager, INotificationManager notificationManager,
|
||||||
ITextureProvider textureProvider, IContextMenu contextMenu, IGameInteropProvider gameInteropProvider, IGameConfig gameConfig,
|
ITextureProvider textureProvider, IContextMenu contextMenu, IGameInteropProvider gameInteropProvider, IGameConfig gameConfig,
|
||||||
ISigScanner sigScanner)
|
ISigScanner sigScanner, INamePlateGui namePlateGui)
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(pluginInterface.ConfigDirectory.FullName))
|
if (!Directory.Exists(pluginInterface.ConfigDirectory.FullName))
|
||||||
Directory.CreateDirectory(pluginInterface.ConfigDirectory.FullName);
|
Directory.CreateDirectory(pluginInterface.ConfigDirectory.FullName);
|
||||||
@@ -130,6 +130,7 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
s.GetRequiredService<CharaDataManager>(),
|
s.GetRequiredService<CharaDataManager>(),
|
||||||
s.GetRequiredService<LightlessMediator>()));
|
s.GetRequiredService<LightlessMediator>()));
|
||||||
collection.AddSingleton<SelectPairForTagUi>();
|
collection.AddSingleton<SelectPairForTagUi>();
|
||||||
|
collection.AddSingleton<RenameTagUi>();
|
||||||
collection.AddSingleton((s) => new EventAggregator(pluginInterface.ConfigDirectory.FullName,
|
collection.AddSingleton((s) => new EventAggregator(pluginInterface.ConfigDirectory.FullName,
|
||||||
s.GetRequiredService<ILogger<EventAggregator>>(), s.GetRequiredService<LightlessMediator>()));
|
s.GetRequiredService<ILogger<EventAggregator>>(), s.GetRequiredService<LightlessMediator>()));
|
||||||
collection.AddSingleton((s) => new DalamudUtilService(s.GetRequiredService<ILogger<DalamudUtilService>>(),
|
collection.AddSingleton((s) => new DalamudUtilService(s.GetRequiredService<ILogger<DalamudUtilService>>(),
|
||||||
@@ -228,6 +229,8 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<LightlessConfigService>(), s.GetRequiredService<DalamudUtilService>(),
|
s.GetRequiredService<CacheMonitor>(), s.GetRequiredService<FileDialogManager>(), s.GetRequiredService<LightlessConfigService>(), s.GetRequiredService<DalamudUtilService>(),
|
||||||
pluginInterface, textureProvider, s.GetRequiredService<Dalamud.Localization>(), s.GetRequiredService<ServerConfigurationManager>(), s.GetRequiredService<TokenProvider>(),
|
pluginInterface, textureProvider, s.GetRequiredService<Dalamud.Localization>(), s.GetRequiredService<ServerConfigurationManager>(), s.GetRequiredService<TokenProvider>(),
|
||||||
s.GetRequiredService<LightlessMediator>()));
|
s.GetRequiredService<LightlessMediator>()));
|
||||||
|
collection.AddScoped((s) => new NameplateService(s.GetRequiredService<ILogger<NameplateService>>(), s.GetRequiredService<LightlessConfigService>(), namePlateGui, clientState,
|
||||||
|
s.GetRequiredService<PairManager>(), s.GetRequiredService<LightlessMediator>()));
|
||||||
|
|
||||||
collection.AddHostedService(p => p.GetRequiredService<ConfigurationSaveService>());
|
collection.AddHostedService(p => p.GetRequiredService<ConfigurationSaveService>());
|
||||||
collection.AddHostedService(p => p.GetRequiredService<LightlessMediator>());
|
collection.AddHostedService(p => p.GetRequiredService<LightlessMediator>());
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace LightlessSync.Services.CharaData
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace LightlessSync.Services.CharaData
|
|
||||||
{
|
{
|
||||||
internal class CharaDataTogetherManager
|
internal class CharaDataTogetherManager
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using Lumina.Excel.Sheets;
|
|
||||||
using LightlessSync.API.Dto.CharaData;
|
using LightlessSync.API.Dto.CharaData;
|
||||||
|
using Lumina.Excel.Sheets;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using Lumina.Data.Files;
|
using LightlessSync.API.Data;
|
||||||
using LightlessSync.API.Data;
|
|
||||||
using LightlessSync.API.Data.Enum;
|
using LightlessSync.API.Data.Enum;
|
||||||
using LightlessSync.FileCache;
|
using LightlessSync.FileCache;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using LightlessSync.UI;
|
using LightlessSync.UI;
|
||||||
using LightlessSync.Utils;
|
using LightlessSync.Utils;
|
||||||
|
using Lumina.Data.Files;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace LightlessSync.Services;
|
namespace LightlessSync.Services;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Dalamud.Game;
|
using Dalamud.Game.ClientState.Conditions;
|
||||||
using Dalamud.Game.ClientState.Conditions;
|
|
||||||
using Dalamud.Game.ClientState.Objects;
|
using Dalamud.Game.ClientState.Objects;
|
||||||
using Dalamud.Game.ClientState.Objects.SubKinds;
|
using Dalamud.Game.ClientState.Objects.SubKinds;
|
||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
@@ -10,13 +9,13 @@ using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
|||||||
using FFXIVClientStructs.FFXIV.Client.Game.Control;
|
using FFXIVClientStructs.FFXIV.Client.Game.Control;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||||
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
||||||
using Lumina.Excel.Sheets;
|
|
||||||
using LightlessSync.API.Dto.CharaData;
|
using LightlessSync.API.Dto.CharaData;
|
||||||
using LightlessSync.Interop;
|
using LightlessSync.Interop;
|
||||||
using LightlessSync.LightlessConfiguration;
|
using LightlessSync.LightlessConfiguration;
|
||||||
using LightlessSync.PlayerData.Handlers;
|
using LightlessSync.PlayerData.Handlers;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using LightlessSync.Utils;
|
using LightlessSync.Utils;
|
||||||
|
using Lumina.Excel.Sheets;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|||||||
80
LightlessSync/Services/LightlessProfileManager.cs
Normal file
80
LightlessSync/Services/LightlessProfileManager.cs
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -93,5 +93,7 @@ public record GPoseLobbyReceiveCharaData(CharaDataDownloadDto CharaDataDownloadD
|
|||||||
public record GPoseLobbyReceivePoseData(UserData UserData, PoseData PoseData) : MessageBase;
|
public record GPoseLobbyReceivePoseData(UserData UserData, PoseData PoseData) : MessageBase;
|
||||||
public record GPoseLobbyReceiveWorldData(UserData UserData, WorldData WorldData) : MessageBase;
|
public record GPoseLobbyReceiveWorldData(UserData UserData, WorldData WorldData) : MessageBase;
|
||||||
public record OpenCharaDataHubWithFilterMessage(UserData UserData) : MessageBase;
|
public record OpenCharaDataHubWithFilterMessage(UserData UserData) : MessageBase;
|
||||||
|
|
||||||
|
public record VisibilityChange : MessageBase;
|
||||||
#pragma warning restore S2094
|
#pragma warning restore S2094
|
||||||
#pragma warning restore MA0048 // File name must match type name
|
#pragma warning restore MA0048 // File name must match type name
|
||||||
91
LightlessSync/Services/NameplateService.cs
Normal file
91
LightlessSync/Services/NameplateService.cs
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
using Dalamud.Game.ClientState.Objects.Enums;
|
||||||
|
using Dalamud.Game.Gui.NamePlate;
|
||||||
|
using Dalamud.Game.Text.SeStringHandling;
|
||||||
|
using Dalamud.Plugin.Services;
|
||||||
|
using Dalamud.Utility;
|
||||||
|
using LightlessSync.LightlessConfiguration;
|
||||||
|
using LightlessSync.PlayerData.Pairs;
|
||||||
|
using LightlessSync.Services.Mediator;
|
||||||
|
using LightlessSync.UI;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
namespace LightlessSync.Services;
|
||||||
|
|
||||||
|
public class NameplateService : DisposableMediatorSubscriberBase
|
||||||
|
{
|
||||||
|
private readonly LightlessConfigService _configService;
|
||||||
|
private readonly IClientState _clientState;
|
||||||
|
private readonly INamePlateGui _namePlateGui;
|
||||||
|
private readonly PairManager _pairManager;
|
||||||
|
|
||||||
|
public NameplateService(ILogger<NameplateService> logger,
|
||||||
|
LightlessConfigService configService,
|
||||||
|
INamePlateGui namePlateGui,
|
||||||
|
IClientState clientState,
|
||||||
|
PairManager pairManager,
|
||||||
|
LightlessMediator lightlessMediator) : base(logger, lightlessMediator)
|
||||||
|
{
|
||||||
|
_configService = configService;
|
||||||
|
_namePlateGui = namePlateGui;
|
||||||
|
_clientState = clientState;
|
||||||
|
_pairManager = pairManager;
|
||||||
|
_namePlateGui.OnNamePlateUpdate += OnNamePlateUpdate;
|
||||||
|
_namePlateGui.RequestRedraw();
|
||||||
|
Mediator.Subscribe<VisibilityChange>(this, (_) => _namePlateGui.RequestRedraw());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnNamePlateUpdate(INamePlateUpdateContext context, IReadOnlyList<INamePlateUpdateHandler> handlers)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!_configService.Current.IsNameplateColorsEnabled && !_clientState.IsPvPExcludingDen) return;
|
||||||
|
var visibleUsersIds = _pairManager.GetOnlineUserPairs().Where(u => u.IsVisible && u.PlayerCharacterId != uint.MaxValue).Select(u => (ulong)u.PlayerCharacterId).ToHashSet();
|
||||||
|
var colors = _configService.Current.NameplateColors;
|
||||||
|
|
||||||
|
foreach (var handler in handlers)
|
||||||
|
{
|
||||||
|
var playerCharacter = handler.PlayerCharacter;
|
||||||
|
if (playerCharacter == null) { continue; }
|
||||||
|
var isInParty = playerCharacter.StatusFlags.HasFlag(StatusFlags.PartyMember);
|
||||||
|
var isFriend = playerCharacter.StatusFlags.HasFlag(StatusFlags.Friend);
|
||||||
|
bool partyColorAllowed = (_configService.Current.overridePartyColor && isInParty);
|
||||||
|
bool friendColorAllowed = (_configService.Current.overrideFriendColor && isFriend);
|
||||||
|
|
||||||
|
if (visibleUsersIds.Contains(handler.GameObjectId) &&
|
||||||
|
!(
|
||||||
|
(isInParty && !partyColorAllowed) ||
|
||||||
|
(isFriend && !friendColorAllowed)
|
||||||
|
))
|
||||||
|
{
|
||||||
|
handler.NameParts.TextWrap = CreateTextWrap(colors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestRedraw()
|
||||||
|
{
|
||||||
|
_namePlateGui.RequestRedraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static (SeString, SeString) CreateTextWrap(DtrEntry.Colors color)
|
||||||
|
{
|
||||||
|
var left = new Lumina.Text.SeStringBuilder();
|
||||||
|
var right = new Lumina.Text.SeStringBuilder();
|
||||||
|
|
||||||
|
left.PushColorRgba(color.Foreground);
|
||||||
|
right.PopColor();
|
||||||
|
|
||||||
|
left.PushEdgeColorRgba(color.Glow);
|
||||||
|
right.PopEdgeColor();
|
||||||
|
|
||||||
|
return (left.ToReadOnlySeString().ToDalamudString(), right.ToReadOnlySeString().ToDalamudString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
base.Dispose(disposing);
|
||||||
|
_namePlateGui.OnNamePlateUpdate -= OnNamePlateUpdate;
|
||||||
|
_namePlateGui.RequestRedraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Colors;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
|
using Dalamud.Interface.Utility;
|
||||||
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using LightlessSync.API.Dto.CharaData;
|
using LightlessSync.API.Dto.CharaData;
|
||||||
using LightlessSync.Services.CharaData.Models;
|
using LightlessSync.Services.CharaData.Models;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
using Dalamud.Interface.Colors;
|
|
||||||
using Dalamud.Interface.Utility.Raii;
|
|
||||||
using Dalamud.Interface.Utility;
|
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
|
using Dalamud.Interface.Utility;
|
||||||
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace LightlessSync.UI;
|
namespace LightlessSync.UI;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
private readonly PairManager _pairManager;
|
private readonly PairManager _pairManager;
|
||||||
private readonly SelectTagForPairUi _selectGroupForPairUi;
|
private readonly SelectTagForPairUi _selectGroupForPairUi;
|
||||||
private readonly SelectPairForTagUi _selectPairsForGroupUi;
|
private readonly SelectPairForTagUi _selectPairsForGroupUi;
|
||||||
|
private readonly RenameTagUi _renameTagUi;
|
||||||
private readonly IpcManager _ipcManager;
|
private readonly IpcManager _ipcManager;
|
||||||
private readonly ServerConfigurationManager _serverManager;
|
private readonly ServerConfigurationManager _serverManager;
|
||||||
private readonly TopTabMenu _tabMenu;
|
private readonly TopTabMenu _tabMenu;
|
||||||
@@ -56,7 +57,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
|
|
||||||
public CompactUi(ILogger<CompactUi> logger, UiSharedService uiShared, LightlessConfigService configService, ApiController apiController, PairManager pairManager,
|
public CompactUi(ILogger<CompactUi> logger, UiSharedService uiShared, LightlessConfigService configService, ApiController apiController, PairManager pairManager,
|
||||||
ServerConfigurationManager serverManager, LightlessMediator mediator, FileUploadManager fileTransferManager,
|
ServerConfigurationManager serverManager, LightlessMediator mediator, FileUploadManager fileTransferManager,
|
||||||
TagHandler tagHandler, DrawEntityFactory drawEntityFactory, SelectTagForPairUi selectTagForPairUi, SelectPairForTagUi selectPairForTagUi,
|
TagHandler tagHandler, DrawEntityFactory drawEntityFactory, SelectTagForPairUi selectTagForPairUi, SelectPairForTagUi selectPairForTagUi, RenameTagUi renameTagUi,
|
||||||
PerformanceCollectorService performanceCollectorService, IpcManager ipcManager)
|
PerformanceCollectorService performanceCollectorService, IpcManager ipcManager)
|
||||||
: base(logger, mediator, "###LightlessSyncMainUI", performanceCollectorService)
|
: base(logger, mediator, "###LightlessSyncMainUI", performanceCollectorService)
|
||||||
{
|
{
|
||||||
@@ -70,6 +71,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
_drawEntityFactory = drawEntityFactory;
|
_drawEntityFactory = drawEntityFactory;
|
||||||
_selectGroupForPairUi = selectTagForPairUi;
|
_selectGroupForPairUi = selectTagForPairUi;
|
||||||
_selectPairsForGroupUi = selectPairForTagUi;
|
_selectPairsForGroupUi = selectPairForTagUi;
|
||||||
|
_renameTagUi = renameTagUi;
|
||||||
_ipcManager = ipcManager;
|
_ipcManager = ipcManager;
|
||||||
_tabMenu = new TopTabMenu(Mediator, _apiController, _pairManager, _uiSharedService);
|
_tabMenu = new TopTabMenu(Mediator, _apiController, _pairManager, _uiSharedService);
|
||||||
|
|
||||||
@@ -149,10 +151,10 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
var uidTextSize = ImGui.CalcTextSize(unsupported);
|
var uidTextSize = ImGui.CalcTextSize(unsupported);
|
||||||
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMax().X + ImGui.GetWindowContentRegionMin().X) / 2 - uidTextSize.X / 2);
|
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMax().X + ImGui.GetWindowContentRegionMin().X) / 2 - uidTextSize.X / 2);
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextColored(ImGuiColors.DalamudRed, unsupported);
|
ImGui.TextColored(UIColors.Get("DimRed"), unsupported);
|
||||||
}
|
}
|
||||||
UiSharedService.ColorTextWrapped($"Your Lightless Sync installation is out of date, the current version is {ver.Major}.{ver.Minor}.{ver.Build}. " +
|
UiSharedService.ColorTextWrapped($"Your Lightless Sync installation is out of date, the current version is {ver.Major}.{ver.Minor}.{ver.Build}. " +
|
||||||
$"It is highly recommended to keep Lightless Sync up to date. Open /xlplugins and update the plugin.", ImGuiColors.DalamudRed);
|
$"It is highly recommended to keep Lightless Sync up to date. Open /xlplugins and update the plugin.", UIColors.Get("DimRed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_ipcManager.Initialized)
|
if (!_ipcManager.Initialized)
|
||||||
@@ -164,12 +166,12 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
var uidTextSize = ImGui.CalcTextSize(unsupported);
|
var uidTextSize = ImGui.CalcTextSize(unsupported);
|
||||||
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMax().X + ImGui.GetWindowContentRegionMin().X) / 2 - uidTextSize.X / 2);
|
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMax().X + ImGui.GetWindowContentRegionMin().X) / 2 - uidTextSize.X / 2);
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextColored(ImGuiColors.DalamudRed, unsupported);
|
ImGui.TextColored(UIColors.Get("DimRed"), unsupported);
|
||||||
}
|
}
|
||||||
var penumAvailable = _ipcManager.Penumbra.APIAvailable;
|
var penumAvailable = _ipcManager.Penumbra.APIAvailable;
|
||||||
var glamAvailable = _ipcManager.Glamourer.APIAvailable;
|
var glamAvailable = _ipcManager.Glamourer.APIAvailable;
|
||||||
|
|
||||||
UiSharedService.ColorTextWrapped($"One or more Plugins essential for Lightless operation are unavailable. Enable or update following plugins:", ImGuiColors.DalamudRed);
|
UiSharedService.ColorTextWrapped($"One or more Plugins essential for Lightless operation are unavailable. Enable or update following plugins:", UIColors.Get("DimRed"));
|
||||||
using var indent = ImRaii.PushIndent(10f);
|
using var indent = ImRaii.PushIndent(10f);
|
||||||
if (!penumAvailable)
|
if (!penumAvailable)
|
||||||
{
|
{
|
||||||
@@ -185,7 +187,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
using (ImRaii.PushId("header")) DrawUIDHeader();
|
using (ImRaii.PushId("header")) DrawUIDHeader();
|
||||||
ImGui.Separator();
|
_uiSharedService.ColoredSeparator(UIColors.Get("LightlessPurple"), 2f);
|
||||||
using (ImRaii.PushId("serverstatus")) DrawServerStatus();
|
using (ImRaii.PushId("serverstatus")) DrawServerStatus();
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
@@ -198,6 +200,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
using (ImRaii.PushId("transfers")) DrawTransfers();
|
using (ImRaii.PushId("transfers")) DrawTransfers();
|
||||||
_transferPartHeight = ImGui.GetCursorPosY() - pairlistEnd - ImGui.GetTextLineHeight();
|
_transferPartHeight = ImGui.GetCursorPosY() - pairlistEnd - ImGui.GetTextLineHeight();
|
||||||
using (ImRaii.PushId("group-user-popup")) _selectPairsForGroupUi.Draw(_pairManager.DirectPairs);
|
using (ImRaii.PushId("group-user-popup")) _selectPairsForGroupUi.Draw(_pairManager.DirectPairs);
|
||||||
|
using (ImRaii.PushId("group-user-edit")) _renameTagUi.Draw(_pairManager.DirectPairs);
|
||||||
using (ImRaii.PushId("grouping-popup")) _selectGroupForPairUi.Draw();
|
using (ImRaii.PushId("grouping-popup")) _selectGroupForPairUi.Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,7 +287,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextColored(ImGuiColors.DalamudRed, "Not connected to any server");
|
ImGui.TextColored(UIColors.Get("DimRed"), "Not connected to any server");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (printShard)
|
if (printShard)
|
||||||
@@ -587,21 +590,21 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
return _apiController.ServerState switch
|
return _apiController.ServerState switch
|
||||||
{
|
{
|
||||||
ServerState.Connecting => ImGuiColors.DalamudYellow,
|
ServerState.Connecting => UIColors.Get("LightlessYellow"),
|
||||||
ServerState.Reconnecting => ImGuiColors.DalamudRed,
|
ServerState.Reconnecting => UIColors.Get("DimRed"),
|
||||||
ServerState.Connected => UIColors.Get("LightlessPurple"),
|
ServerState.Connected => UIColors.Get("LightlessPurple"),
|
||||||
ServerState.Disconnected => ImGuiColors.DalamudYellow,
|
ServerState.Disconnected => UIColors.Get("LightlessYellow"),
|
||||||
ServerState.Disconnecting => ImGuiColors.DalamudYellow,
|
ServerState.Disconnecting => UIColors.Get("LightlessYellow"),
|
||||||
ServerState.Unauthorized => ImGuiColors.DalamudRed,
|
ServerState.Unauthorized => UIColors.Get("DimRed"),
|
||||||
ServerState.VersionMisMatch => ImGuiColors.DalamudRed,
|
ServerState.VersionMisMatch => UIColors.Get("DimRed"),
|
||||||
ServerState.Offline => ImGuiColors.DalamudRed,
|
ServerState.Offline => UIColors.Get("DimRed"),
|
||||||
ServerState.RateLimited => ImGuiColors.DalamudYellow,
|
ServerState.RateLimited => UIColors.Get("LightlessYellow"),
|
||||||
ServerState.NoSecretKey => ImGuiColors.DalamudYellow,
|
ServerState.NoSecretKey => UIColors.Get("LightlessYellow"),
|
||||||
ServerState.MultiChara => ImGuiColors.DalamudYellow,
|
ServerState.MultiChara => UIColors.Get("LightlessYellow"),
|
||||||
ServerState.OAuthMisconfigured => ImGuiColors.DalamudRed,
|
ServerState.OAuthMisconfigured => UIColors.Get("DimRed"),
|
||||||
ServerState.OAuthLoginTokenStale => ImGuiColors.DalamudRed,
|
ServerState.OAuthLoginTokenStale => UIColors.Get("DimRed"),
|
||||||
ServerState.NoAutoLogon => ImGuiColors.DalamudYellow,
|
ServerState.NoAutoLogon => UIColors.Get("LightlessYellow"),
|
||||||
_ => ImGuiColors.DalamudRed
|
_ => UIColors.Get("DimRed")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,13 +13,15 @@ public class DrawFolderTag : DrawFolderBase
|
|||||||
{
|
{
|
||||||
private readonly ApiController _apiController;
|
private readonly ApiController _apiController;
|
||||||
private readonly SelectPairForTagUi _selectPairForTagUi;
|
private readonly SelectPairForTagUi _selectPairForTagUi;
|
||||||
|
private readonly RenameTagUi _renameTagUi;
|
||||||
|
|
||||||
public DrawFolderTag(string id, IImmutableList<DrawUserPair> drawPairs, IImmutableList<Pair> allPairs,
|
public DrawFolderTag(string id, IImmutableList<DrawUserPair> drawPairs, IImmutableList<Pair> allPairs,
|
||||||
TagHandler tagHandler, ApiController apiController, SelectPairForTagUi selectPairForTagUi, UiSharedService uiSharedService)
|
TagHandler tagHandler, ApiController apiController, SelectPairForTagUi selectPairForTagUi, RenameTagUi renameTagUi, UiSharedService uiSharedService)
|
||||||
: base(id, drawPairs, allPairs, tagHandler, uiSharedService)
|
: base(id, drawPairs, allPairs, tagHandler, uiSharedService)
|
||||||
{
|
{
|
||||||
_apiController = apiController;
|
_apiController = apiController;
|
||||||
_selectPairForTagUi = selectPairForTagUi;
|
_selectPairForTagUi = selectPairForTagUi;
|
||||||
|
_renameTagUi = renameTagUi;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool RenderIfEmpty => _id switch
|
protected override bool RenderIfEmpty => _id switch
|
||||||
@@ -100,12 +102,15 @@ public class DrawFolderTag : DrawFolderBase
|
|||||||
protected override void DrawMenu(float menuWidth)
|
protected override void DrawMenu(float menuWidth)
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted("Group Menu");
|
ImGui.TextUnformatted("Group Menu");
|
||||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Users, "Select Pairs", menuWidth, true))
|
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Users, "Select Pairs", menuWidth, isInPopup: true))
|
||||||
{
|
{
|
||||||
_selectPairForTagUi.Open(_id);
|
_selectPairForTagUi.Open(_id);
|
||||||
}
|
}
|
||||||
UiSharedService.AttachToolTip("Select Individual Pairs for this Pair Group");
|
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Edit, "Rename Pair Group", menuWidth, isInPopup: true))
|
||||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Trash, "Delete Pair Group", menuWidth, true) && UiSharedService.CtrlPressed())
|
{
|
||||||
|
_renameTagUi.Open(_id);
|
||||||
|
}
|
||||||
|
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Trash, "Delete Pair Group", menuWidth, isInPopup: true) && UiSharedService.CtrlPressed())
|
||||||
{
|
{
|
||||||
_tagHandler.RemoveTag(_id);
|
_tagHandler.RemoveTag(_id);
|
||||||
}
|
}
|
||||||
|
|||||||
93
LightlessSync/UI/Components/RenameTagUi.cs
Normal file
93
LightlessSync/UI/Components/RenameTagUi.cs
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface.Utility;
|
||||||
|
using Dalamud.Interface.Utility.Raii;
|
||||||
|
using LightlessSync.PlayerData.Pairs;
|
||||||
|
using LightlessSync.UI.Handlers;
|
||||||
|
|
||||||
|
using System.Numerics;
|
||||||
|
|
||||||
|
namespace LightlessSync.UI.Components;
|
||||||
|
|
||||||
|
public class RenameTagUi
|
||||||
|
{
|
||||||
|
private readonly TagHandler _tagHandler;
|
||||||
|
private readonly UiSharedService _uiSharedService;
|
||||||
|
private string _desiredName = string.Empty;
|
||||||
|
private bool _opened = false;
|
||||||
|
private HashSet<string> _peopleInGroup = new(StringComparer.Ordinal);
|
||||||
|
private bool _show = false;
|
||||||
|
private string _tag = string.Empty;
|
||||||
|
|
||||||
|
public RenameTagUi(TagHandler tagHandler, UiSharedService uiSharedService)
|
||||||
|
{
|
||||||
|
_tagHandler = tagHandler;
|
||||||
|
_uiSharedService = uiSharedService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Draw(List<Pair> pairs)
|
||||||
|
{
|
||||||
|
var workHeight = ImGui.GetMainViewport().WorkSize.Y / ImGuiHelpers.GlobalScale;
|
||||||
|
var minSize = new Vector2(300, workHeight < 110 ? workHeight : 110) * ImGuiHelpers.GlobalScale;
|
||||||
|
var maxSize = new Vector2(300, 110) * ImGuiHelpers.GlobalScale;
|
||||||
|
|
||||||
|
var popupName = $"Renaming Group {_tag}";
|
||||||
|
|
||||||
|
if (!_show)
|
||||||
|
{
|
||||||
|
_opened = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_show && !_opened)
|
||||||
|
{
|
||||||
|
ImGui.SetNextWindowSize(minSize);
|
||||||
|
UiSharedService.CenterNextWindow(minSize.X, minSize.Y, ImGuiCond.Always);
|
||||||
|
ImGui.OpenPopup(popupName);
|
||||||
|
_opened = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.SetNextWindowSizeConstraints(minSize, maxSize);
|
||||||
|
if (ImGui.BeginPopupModal(popupName, ref _show, ImGuiWindowFlags.Popup | ImGuiWindowFlags.Modal))
|
||||||
|
{
|
||||||
|
ImGui.TextUnformatted($"Renaming {_tag}");
|
||||||
|
|
||||||
|
ImGui.InputTextWithHint("##desiredname", "Enter new group name", ref _desiredName, 255, ImGuiInputTextFlags.None);
|
||||||
|
using (ImRaii.Disabled(string.IsNullOrEmpty(_desiredName)))
|
||||||
|
{
|
||||||
|
if (_uiSharedService.IconTextButton(Dalamud.Interface.FontAwesomeIcon.Plus, "Rename Group"))
|
||||||
|
{
|
||||||
|
RenameTag(pairs, _tag, _desiredName);
|
||||||
|
_show = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui.EndPopup();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_show = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Open(string tag)
|
||||||
|
{
|
||||||
|
_peopleInGroup = _tagHandler.GetOtherUidsForTag(tag);
|
||||||
|
_tag = tag;
|
||||||
|
_desiredName = "";
|
||||||
|
_show = true;
|
||||||
|
}
|
||||||
|
public void RenameTag(List<Pair> pairs, string oldTag, string newTag)
|
||||||
|
{
|
||||||
|
//Removal of old tag
|
||||||
|
_tagHandler.RemoveTag(oldTag);
|
||||||
|
|
||||||
|
//Creation of new tag and adding of old group pairs in new one.
|
||||||
|
_tagHandler.AddTag(newTag);
|
||||||
|
foreach (Pair pair in pairs)
|
||||||
|
{
|
||||||
|
var isInTag = _peopleInGroup.Contains(pair.UserData.UID);
|
||||||
|
if (isInTag)
|
||||||
|
{
|
||||||
|
_tagHandler.AddTagToPairedUid(pair.UserData.UID, newTag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -169,7 +169,7 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
|||||||
var dlProgressPercent = transferredBytes / (double)totalBytes;
|
var dlProgressPercent = transferredBytes / (double)totalBytes;
|
||||||
drawList.AddRectFilled(dlBarStart,
|
drawList.AddRectFilled(dlBarStart,
|
||||||
dlBarEnd with { X = dlBarStart.X + (float)(dlProgressPercent * dlBarWidth) },
|
dlBarEnd with { X = dlBarStart.X + (float)(dlProgressPercent * dlBarWidth) },
|
||||||
UiSharedService.Color(50, 205, 50, transparency), 1);
|
UiSharedService.Color(173, 138, 245, transparency), 1);
|
||||||
|
|
||||||
if (_configService.Current.TransferBarsShowText)
|
if (_configService.Current.TransferBarsShowText)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,11 +23,12 @@ public class DrawEntityFactory
|
|||||||
private readonly PlayerPerformanceConfigService _playerPerformanceConfigService;
|
private readonly PlayerPerformanceConfigService _playerPerformanceConfigService;
|
||||||
private readonly CharaDataManager _charaDataManager;
|
private readonly CharaDataManager _charaDataManager;
|
||||||
private readonly SelectTagForPairUi _selectTagForPairUi;
|
private readonly SelectTagForPairUi _selectTagForPairUi;
|
||||||
|
private readonly RenameTagUi _renameTagUi;
|
||||||
private readonly TagHandler _tagHandler;
|
private readonly TagHandler _tagHandler;
|
||||||
private readonly IdDisplayHandler _uidDisplayHandler;
|
private readonly IdDisplayHandler _uidDisplayHandler;
|
||||||
|
|
||||||
public DrawEntityFactory(ILogger<DrawEntityFactory> logger, ApiController apiController, IdDisplayHandler uidDisplayHandler,
|
public DrawEntityFactory(ILogger<DrawEntityFactory> logger, ApiController apiController, IdDisplayHandler uidDisplayHandler,
|
||||||
SelectTagForPairUi selectTagForPairUi, LightlessMediator mediator,
|
SelectTagForPairUi selectTagForPairUi, RenameTagUi renameTagUi, LightlessMediator mediator,
|
||||||
TagHandler tagHandler, SelectPairForTagUi selectPairForTagUi,
|
TagHandler tagHandler, SelectPairForTagUi selectPairForTagUi,
|
||||||
ServerConfigurationManager serverConfigurationManager, UiSharedService uiSharedService,
|
ServerConfigurationManager serverConfigurationManager, UiSharedService uiSharedService,
|
||||||
PlayerPerformanceConfigService playerPerformanceConfigService, CharaDataManager charaDataManager)
|
PlayerPerformanceConfigService playerPerformanceConfigService, CharaDataManager charaDataManager)
|
||||||
@@ -36,6 +37,7 @@ public class DrawEntityFactory
|
|||||||
_apiController = apiController;
|
_apiController = apiController;
|
||||||
_uidDisplayHandler = uidDisplayHandler;
|
_uidDisplayHandler = uidDisplayHandler;
|
||||||
_selectTagForPairUi = selectTagForPairUi;
|
_selectTagForPairUi = selectTagForPairUi;
|
||||||
|
_renameTagUi = renameTagUi;
|
||||||
_mediator = mediator;
|
_mediator = mediator;
|
||||||
_tagHandler = tagHandler;
|
_tagHandler = tagHandler;
|
||||||
_selectPairForTagUi = selectPairForTagUi;
|
_selectPairForTagUi = selectPairForTagUi;
|
||||||
@@ -58,8 +60,8 @@ public class DrawEntityFactory
|
|||||||
Dictionary<Pair, List<GroupFullInfoDto>> filteredPairs,
|
Dictionary<Pair, List<GroupFullInfoDto>> filteredPairs,
|
||||||
IImmutableList<Pair> allPairs)
|
IImmutableList<Pair> allPairs)
|
||||||
{
|
{
|
||||||
return new(tag, filteredPairs.Select(u => CreateDrawPair(tag, u.Key, u.Value, null)).ToImmutableList(),
|
return new(tag, filteredPairs.Select(u => CreateDrawPair(tag, u.Key, u.Value, currentGroup: null)).ToImmutableList(),
|
||||||
allPairs, _tagHandler, _apiController, _selectPairForTagUi, _uiSharedService);
|
allPairs, _tagHandler, _apiController, _selectPairForTagUi, _renameTagUi, _uiSharedService);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DrawUserPair CreateDrawPair(string id, Pair user, List<GroupFullInfoDto> groups, GroupFullInfoDto? currentGroup)
|
public DrawUserPair CreateDrawPair(string id, Pair user, List<GroupFullInfoDto> groups, GroupFullInfoDto? currentGroup)
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ using Dalamud.Interface.Utility;
|
|||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using LightlessSync.FileCache;
|
using LightlessSync.FileCache;
|
||||||
using LightlessSync.Localization;
|
|
||||||
using LightlessSync.LightlessConfiguration;
|
using LightlessSync.LightlessConfiguration;
|
||||||
using LightlessSync.LightlessConfiguration.Models;
|
using LightlessSync.LightlessConfiguration.Models;
|
||||||
|
using LightlessSync.Localization;
|
||||||
using LightlessSync.Services;
|
using LightlessSync.Services;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using LightlessSync.Services.ServerConfiguration;
|
using LightlessSync.Services.ServerConfiguration;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class PermissionWindowUI : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
_ownPermissions.SetDisableAnimations(disableAnimations);
|
_ownPermissions.SetDisableAnimations(disableAnimations);
|
||||||
}
|
}
|
||||||
_uiSharedService.DrawHelpText("Disabling sounds will remove all animations synced with this user on both sides." + UiSharedService.TooltipSeparator
|
_uiSharedService.DrawHelpText("Disabling animations will remove all animations synced with this user on both sides." + UiSharedService.TooltipSeparator
|
||||||
+ "Note: this is bidirectional, either user disabling animation sync will stop animation sync on both sides.");
|
+ "Note: this is bidirectional, either user disabling animation sync will stop animation sync on both sides.");
|
||||||
using (ImRaii.PushIndent(indentSize, false))
|
using (ImRaii.PushIndent(indentSize, false))
|
||||||
{
|
{
|
||||||
@@ -116,7 +116,7 @@ public class PermissionWindowUI : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
_ownPermissions.SetDisableVFX(disableVfx);
|
_ownPermissions.SetDisableVFX(disableVfx);
|
||||||
}
|
}
|
||||||
_uiSharedService.DrawHelpText("Disabling sounds will remove all VFX synced with this user on both sides." + UiSharedService.TooltipSeparator
|
_uiSharedService.DrawHelpText("Disabling VFX will remove all VFX synced with this user on both sides." + UiSharedService.TooltipSeparator
|
||||||
+ "Note: this is bidirectional, either user disabling VFX sync will stop VFX sync on both sides.");
|
+ "Note: this is bidirectional, either user disabling VFX sync will stop VFX sync on both sides.");
|
||||||
using (ImRaii.PushIndent(indentSize, false))
|
using (ImRaii.PushIndent(indentSize, false))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||||
private readonly UiSharedService _uiShared;
|
private readonly UiSharedService _uiShared;
|
||||||
private readonly IProgress<(int, int, FileCacheEntity)> _validationProgress;
|
private readonly IProgress<(int, int, FileCacheEntity)> _validationProgress;
|
||||||
|
private readonly NameplateService _nameplateService;
|
||||||
private (int, int, FileCacheEntity) _currentProgress;
|
private (int, int, FileCacheEntity) _currentProgress;
|
||||||
private bool _deleteAccountPopupModalShown = false;
|
private bool _deleteAccountPopupModalShown = false;
|
||||||
private bool _deleteFilesPopupModalShown = false;
|
private bool _deleteFilesPopupModalShown = false;
|
||||||
@@ -77,7 +78,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
FileCacheManager fileCacheManager,
|
FileCacheManager fileCacheManager,
|
||||||
FileCompactor fileCompactor, ApiController apiController,
|
FileCompactor fileCompactor, ApiController apiController,
|
||||||
IpcManager ipcManager, CacheMonitor cacheMonitor,
|
IpcManager ipcManager, CacheMonitor cacheMonitor,
|
||||||
DalamudUtilService dalamudUtilService, HttpClient httpClient) : base(logger, mediator, "Lightless Sync Settings", performanceCollector)
|
DalamudUtilService dalamudUtilService, HttpClient httpClient,
|
||||||
|
NameplateService nameplateService) : base(logger, mediator, "Lightless Sync Settings", performanceCollector)
|
||||||
{
|
{
|
||||||
_configService = configService;
|
_configService = configService;
|
||||||
_pairManager = pairManager;
|
_pairManager = pairManager;
|
||||||
@@ -94,6 +96,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
_fileCompactor = fileCompactor;
|
_fileCompactor = fileCompactor;
|
||||||
_uiShared = uiShared;
|
_uiShared = uiShared;
|
||||||
|
_nameplateService = nameplateService;
|
||||||
AllowClickthrough = false;
|
AllowClickthrough = false;
|
||||||
AllowPinning = false;
|
AllowPinning = false;
|
||||||
_validationProgress = new Progress<(int, int, FileCacheEntity)>(v => _currentProgress = v);
|
_validationProgress = new Progress<(int, int, FileCacheEntity)>(v => _currentProgress = v);
|
||||||
@@ -111,6 +114,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
Mediator.Subscribe<CharacterDataCreatedMessage>(this, (msg) => LastCreatedCharacterData = msg.CharacterData);
|
Mediator.Subscribe<CharacterDataCreatedMessage>(this, (msg) => LastCreatedCharacterData = msg.CharacterData);
|
||||||
Mediator.Subscribe<DownloadStartedMessage>(this, (msg) => _currentDownloads[msg.DownloadId] = msg.DownloadStatus);
|
Mediator.Subscribe<DownloadStartedMessage>(this, (msg) => _currentDownloads[msg.DownloadId] = msg.DownloadStatus);
|
||||||
Mediator.Subscribe<DownloadFinishedMessage>(this, (msg) => _currentDownloads.TryRemove(msg.DownloadId, out _));
|
Mediator.Subscribe<DownloadFinishedMessage>(this, (msg) => _currentDownloads.TryRemove(msg.DownloadId, out _));
|
||||||
|
_nameplateService = nameplateService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CharacterData? LastCreatedCharacterData { private get; set; }
|
public CharacterData? LastCreatedCharacterData { private get; set; }
|
||||||
@@ -210,7 +214,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
private void DrawCurrentTransfers()
|
private void DrawCurrentTransfers()
|
||||||
{
|
{
|
||||||
_lastTab = "Transfers";
|
_lastTab = "Transfers";
|
||||||
_uiShared.BigText("Transfer Settings");
|
_uiShared.UnderlinedBigText("Transfer Settings", UIColors.Get("LightlessBlue"));
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
int maxParallelDownloads = _configService.Current.ParallelDownloads;
|
int maxParallelDownloads = _configService.Current.ParallelDownloads;
|
||||||
bool useAlternativeUpload = _configService.Current.UseAlternativeFileUpload;
|
bool useAlternativeUpload = _configService.Current.UseAlternativeFileUpload;
|
||||||
@@ -259,7 +264,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_uiShared.DrawHelpText("This will attempt to upload files in one go instead of a stream. Typically not necessary to enable. Use if you have upload issues.");
|
_uiShared.DrawHelpText("This will attempt to upload files in one go instead of a stream. Typically not necessary to enable. Use if you have upload issues.");
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
_uiShared.BigText("Transfer UI");
|
_uiShared.UnderlinedBigText("Transfer UI", UIColors.Get("LightlessBlue"));
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
bool showTransferWindow = _configService.Current.ShowTransferWindow;
|
bool showTransferWindow = _configService.Current.ShowTransferWindow;
|
||||||
if (ImGui.Checkbox("Show separate transfer window", ref showTransferWindow))
|
if (ImGui.Checkbox("Show separate transfer window", ref showTransferWindow))
|
||||||
@@ -396,7 +402,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
_uiShared.BigText("Current Transfers");
|
_uiShared.UnderlinedBigText("Current Transfers", UIColors.Get("LightlessBlue"));
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
if (ImGui.BeginTabBar("TransfersTabBar"))
|
if (ImGui.BeginTabBar("TransfersTabBar"))
|
||||||
{
|
{
|
||||||
@@ -557,7 +564,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
_lastTab = "Debug";
|
_lastTab = "Debug";
|
||||||
|
|
||||||
_uiShared.BigText("Debug");
|
_uiShared.UnderlinedBigText("Debug", UIColors.Get("LightlessYellow"));
|
||||||
|
ImGuiHelpers.ScaledDummy(10);
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (LastCreatedCharacterData != null && ImGui.TreeNode("Last created character data"))
|
if (LastCreatedCharacterData != null && ImGui.TreeNode("Last created character data"))
|
||||||
{
|
{
|
||||||
@@ -617,13 +625,15 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
_uiShared.DrawHelpText("Having modified game files will still mark your logs with UNSUPPORTED and you will not receive support, message shown or not." + UiSharedService.TooltipSeparator
|
_uiShared.DrawHelpText("Having modified game files will still mark your logs with UNSUPPORTED and you will not receive support, message shown or not." + UiSharedService.TooltipSeparator
|
||||||
+ "Keeping LOD enabled can lead to more crashes. Use at your own risk.");
|
+ "Keeping LOD enabled can lead to more crashes. Use at your own risk.");
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessYellow"), 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawFileStorageSettings()
|
private void DrawFileStorageSettings()
|
||||||
{
|
{
|
||||||
_lastTab = "FileCache";
|
_lastTab = "FileCache";
|
||||||
|
|
||||||
_uiShared.BigText("Export MCDF");
|
_uiShared.UnderlinedBigText("Export MCDF", UIColors.Get("LightlessBlue"));
|
||||||
|
|
||||||
ImGuiHelpers.ScaledDummy(10);
|
ImGuiHelpers.ScaledDummy(10);
|
||||||
|
|
||||||
@@ -642,7 +652,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
ImGuiHelpers.ScaledDummy(5);
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
_uiShared.BigText("Storage");
|
_uiShared.UnderlinedBigText("Storage", UIColors.Get("LightlessBlue"));
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
UiSharedService.TextWrapped("Lightless stores downloaded files from paired people permanently. This is to improve loading performance and requiring less downloads. " +
|
UiSharedService.TextWrapped("Lightless stores downloaded files from paired people permanently. This is to improve loading performance and requiring less downloads. " +
|
||||||
"The storage governs itself by clearing data beyond the set storage size. Please set the storage size accordingly. It is not necessary to manually clear the storage.");
|
"The storage governs itself by clearing data beyond the set storage size. Please set the storage size accordingly. It is not necessary to manually clear the storage.");
|
||||||
@@ -755,6 +766,9 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
ImGuiHelpers.ScaledDummy(new Vector2(10, 10));
|
ImGuiHelpers.ScaledDummy(new Vector2(10, 10));
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Storage Validation", UIColors.Get("LightlessYellow")))
|
||||||
|
{
|
||||||
UiSharedService.TextWrapped("File Storage validation can make sure that all files in your local Lightless Storage are valid. " +
|
UiSharedService.TextWrapped("File Storage validation can make sure that all files in your local Lightless Storage are valid. " +
|
||||||
"Run the validation before you clear the Storage for no reason. " + Environment.NewLine +
|
"Run the validation before you clear the Storage for no reason. " + Environment.NewLine +
|
||||||
"This operation, depending on how many files you have in your storage, can take a while and will be CPU and drive intensive.");
|
"This operation, depending on how many files you have in your storage, can take a while and will be CPU and drive intensive.");
|
||||||
@@ -794,9 +808,15 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessYellow"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
ImGuiHelpers.ScaledDummy(new Vector2(10, 10));
|
if (_uiShared.MediumTreeNode("Storage Clearing", UIColors.Get("DimRed")))
|
||||||
|
{
|
||||||
ImGui.TextUnformatted("To clear the local storage accept the following disclaimer");
|
ImGui.TextUnformatted("To clear the local storage accept the following disclaimer");
|
||||||
ImGui.Indent();
|
ImGui.Indent();
|
||||||
ImGui.Checkbox("##readClearCache", ref _readClearCache);
|
ImGui.Checkbox("##readClearCache", ref _readClearCache);
|
||||||
@@ -823,6 +843,10 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
if (!_readClearCache)
|
if (!_readClearCache)
|
||||||
ImGui.EndDisabled();
|
ImGui.EndDisabled();
|
||||||
ImGui.Unindent();
|
ImGui.Unindent();
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("DimRed"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawGeneral()
|
private void DrawGeneral()
|
||||||
@@ -836,7 +860,12 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
//UiSharedService.FontText("Experimental", _uiShared.UidFont);
|
//UiSharedService.FontText("Experimental", _uiShared.UidFont);
|
||||||
//ImGui.Separator();
|
//ImGui.Separator();
|
||||||
|
|
||||||
|
_uiShared.UnderlinedBigText("General Settings", UIColors.Get("LightlessBlue"));
|
||||||
|
ImGui.Dummy(new Vector2(10));
|
||||||
_uiShared.BigText("Notes");
|
_uiShared.BigText("Notes");
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Import & Export", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
if (_uiShared.IconTextButton(FontAwesomeIcon.StickyNote, "Export all your user notes to clipboard"))
|
if (_uiShared.IconTextButton(FontAwesomeIcon.StickyNote, "Export all your user notes to clipboard"))
|
||||||
{
|
{
|
||||||
ImGui.SetClipboardText(UiSharedService.GetNotes(_pairManager.DirectPairs.UnionBy(_pairManager.GroupPairs.SelectMany(p => p.Value), p => p.UserData, UserDataComparer.Instance).ToList()));
|
ImGui.SetClipboardText(UiSharedService.GetNotes(_pairManager.DirectPairs.UnionBy(_pairManager.GroupPairs.SelectMany(p => p.Value), p => p.UserData, UserDataComparer.Instance).ToList()));
|
||||||
@@ -860,8 +889,15 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
UiSharedService.ColorTextWrapped("Attempt to import notes from clipboard failed. Check formatting and try again", ImGuiColors.DalamudRed);
|
UiSharedService.ColorTextWrapped("Attempt to import notes from clipboard failed. Check formatting and try again", ImGuiColors.DalamudRed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
var openPopupOnAddition = _configService.Current.OpenPopupOnAdd;
|
var openPopupOnAddition = _configService.Current.OpenPopupOnAdd;
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Popup & Auto Fill", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
if (ImGui.Checkbox("Open Notes Popup on user addition", ref openPopupOnAddition))
|
if (ImGui.Checkbox("Open Notes Popup on user addition", ref openPopupOnAddition))
|
||||||
{
|
{
|
||||||
_configService.Current.OpenPopupOnAdd = openPopupOnAddition;
|
_configService.Current.OpenPopupOnAdd = openPopupOnAddition;
|
||||||
@@ -877,8 +913,14 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
_uiShared.DrawHelpText("This will automatically populate user notes using the first encountered player name if the note was not set prior");
|
_uiShared.DrawHelpText("This will automatically populate user notes using the first encountered player name if the note was not set prior");
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
ImGui.Dummy(new Vector2(10));
|
||||||
_uiShared.BigText("UI");
|
_uiShared.BigText("UI");
|
||||||
|
|
||||||
var showNameInsteadOfNotes = _configService.Current.ShowCharacterNameInsteadOfNotesForVisible;
|
var showNameInsteadOfNotes = _configService.Current.ShowCharacterNameInsteadOfNotesForVisible;
|
||||||
var showVisibleSeparate = _configService.Current.ShowVisibleUsersSeparately;
|
var showVisibleSeparate = _configService.Current.ShowVisibleUsersSeparately;
|
||||||
var showOfflineSeparate = _configService.Current.ShowOfflineUsersSeparately;
|
var showOfflineSeparate = _configService.Current.ShowOfflineUsersSeparately;
|
||||||
@@ -900,6 +942,9 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
var groupInVisible = _configService.Current.ShowSyncshellUsersInVisible;
|
var groupInVisible = _configService.Current.ShowSyncshellUsersInVisible;
|
||||||
var syncshellOfflineSeparate = _configService.Current.ShowSyncshellOfflineUsersSeparately;
|
var syncshellOfflineSeparate = _configService.Current.ShowSyncshellOfflineUsersSeparately;
|
||||||
|
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Behavior", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
if (ImGui.Checkbox("Enable Game Right Click Menu Entries", ref enableRightClickMenu))
|
if (ImGui.Checkbox("Enable Game Right Click Menu Entries", ref enableRightClickMenu))
|
||||||
{
|
{
|
||||||
_configService.Current.EnableRightClickMenus = enableRightClickMenu;
|
_configService.Current.EnableRightClickMenus = enableRightClickMenu;
|
||||||
@@ -960,6 +1005,49 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var nameColorsEnabled = _configService.Current.IsNameplateColorsEnabled;
|
||||||
|
var nameColors = _configService.Current.NameplateColors;
|
||||||
|
var isFriendOverride = _configService.Current.overrideFriendColor;
|
||||||
|
var isPartyOverride = _configService.Current.overridePartyColor;
|
||||||
|
|
||||||
|
if (ImGui.Checkbox("Override name color of visible paired players", ref nameColorsEnabled))
|
||||||
|
{
|
||||||
|
_configService.Current.IsNameplateColorsEnabled = nameColorsEnabled;
|
||||||
|
_configService.Save();
|
||||||
|
_nameplateService.RequestRedraw();
|
||||||
|
}
|
||||||
|
|
||||||
|
using (ImRaii.Disabled(!nameColorsEnabled))
|
||||||
|
{
|
||||||
|
using var indent = ImRaii.PushIndent();
|
||||||
|
if (InputDtrColors("Name color", ref nameColors))
|
||||||
|
{
|
||||||
|
_configService.Current.NameplateColors = nameColors;
|
||||||
|
_configService.Save();
|
||||||
|
_nameplateService.RequestRedraw();
|
||||||
|
}
|
||||||
|
if (ImGui.Checkbox("Override friend color", ref isFriendOverride))
|
||||||
|
{
|
||||||
|
_configService.Current.overrideFriendColor = isFriendOverride;
|
||||||
|
_configService.Save();
|
||||||
|
_nameplateService.RequestRedraw();
|
||||||
|
}
|
||||||
|
if (ImGui.Checkbox("Override party color", ref isPartyOverride))
|
||||||
|
{
|
||||||
|
_configService.Current.overridePartyColor = isPartyOverride;
|
||||||
|
_configService.Save();
|
||||||
|
_nameplateService.RequestRedraw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Pair List", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
if (ImGui.Checkbox("Show separate Visible group", ref showVisibleSeparate))
|
if (ImGui.Checkbox("Show separate Visible group", ref showVisibleSeparate))
|
||||||
{
|
{
|
||||||
_configService.Current.ShowVisibleUsersSeparately = showVisibleSeparate;
|
_configService.Current.ShowVisibleUsersSeparately = showVisibleSeparate;
|
||||||
@@ -1032,6 +1120,13 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_configService.Save();
|
_configService.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
|
if (_uiShared.MediumTreeNode("Profiles", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
if (ImGui.Checkbox("Show Lightless Profiles on Hover", ref showProfiles))
|
if (ImGui.Checkbox("Show Lightless Profiles on Hover", ref showProfiles))
|
||||||
{
|
{
|
||||||
Mediator.Publish(new ClearProfileDataMessage());
|
Mediator.Publish(new ClearProfileDataMessage());
|
||||||
@@ -1064,14 +1159,21 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
_uiShared.DrawHelpText("Will show profiles that have the NSFW tag enabled");
|
_uiShared.DrawHelpText("Will show profiles that have the NSFW tag enabled");
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
ImGui.Dummy(new Vector2(10));
|
||||||
|
_uiShared.BigText("Notifications");
|
||||||
|
|
||||||
var disableOptionalPluginWarnings = _configService.Current.DisableOptionalPluginWarnings;
|
var disableOptionalPluginWarnings = _configService.Current.DisableOptionalPluginWarnings;
|
||||||
var onlineNotifs = _configService.Current.ShowOnlineNotifications;
|
var onlineNotifs = _configService.Current.ShowOnlineNotifications;
|
||||||
var onlineNotifsPairsOnly = _configService.Current.ShowOnlineNotificationsOnlyForIndividualPairs;
|
var onlineNotifsPairsOnly = _configService.Current.ShowOnlineNotificationsOnlyForIndividualPairs;
|
||||||
var onlineNotifsNamedOnly = _configService.Current.ShowOnlineNotificationsOnlyForNamedPairs;
|
var onlineNotifsNamedOnly = _configService.Current.ShowOnlineNotificationsOnlyForNamedPairs;
|
||||||
_uiShared.BigText("Notifications");
|
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Display", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
_uiShared.DrawCombo("Info Notification Display##settingsUi", (NotificationLocation[])Enum.GetValues(typeof(NotificationLocation)), (i) => i.ToString(),
|
_uiShared.DrawCombo("Info Notification Display##settingsUi", (NotificationLocation[])Enum.GetValues(typeof(NotificationLocation)), (i) => i.ToString(),
|
||||||
(i) =>
|
(i) =>
|
||||||
{
|
{
|
||||||
@@ -1108,6 +1210,14 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
+ Environment.NewLine + "'Toast' will show Error toast notifications in the bottom right corner"
|
+ Environment.NewLine + "'Toast' will show Error toast notifications in the bottom right corner"
|
||||||
+ Environment.NewLine + "'Both' will show chat as well as the toast notification");
|
+ Environment.NewLine + "'Both' will show chat as well as the toast notification");
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Toggles", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
if (ImGui.Checkbox("Disable optional plugin warnings", ref disableOptionalPluginWarnings))
|
if (ImGui.Checkbox("Disable optional plugin warnings", ref disableOptionalPluginWarnings))
|
||||||
{
|
{
|
||||||
_configService.Current.DisableOptionalPluginWarnings = disableOptionalPluginWarnings;
|
_configService.Current.DisableOptionalPluginWarnings = disableOptionalPluginWarnings;
|
||||||
@@ -1134,16 +1244,22 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_configService.Save();
|
_configService.Save();
|
||||||
}
|
}
|
||||||
_uiShared.DrawHelpText("Enabling this will only show online notifications (type: Info) for pairs where you have set an individual note.");
|
_uiShared.DrawHelpText("Enabling this will only show online notifications (type: Info) for pairs where you have set an individual note.");
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawPerformance()
|
private void DrawPerformance()
|
||||||
{
|
{
|
||||||
_uiShared.BigText("Performance Settings");
|
_uiShared.UnderlinedBigText("Performance Settings", UIColors.Get("LightlessBlue"));
|
||||||
|
ImGui.Dummy(new Vector2(10));
|
||||||
UiSharedService.TextWrapped("The configuration options here are to give you more informed warnings and automation when it comes to other performance-intensive synced players.");
|
UiSharedService.TextWrapped("The configuration options here are to give you more informed warnings and automation when it comes to other performance-intensive synced players.");
|
||||||
ImGui.Dummy(new Vector2(10));
|
|
||||||
ImGui.Separator();
|
|
||||||
ImGui.Dummy(new Vector2(10));
|
|
||||||
bool showPerformanceIndicator = _playerPerformanceConfigService.Current.ShowPerformanceIndicator;
|
bool showPerformanceIndicator = _playerPerformanceConfigService.Current.ShowPerformanceIndicator;
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Warnings", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
if (ImGui.Checkbox("Show performance indicator", ref showPerformanceIndicator))
|
if (ImGui.Checkbox("Show performance indicator", ref showPerformanceIndicator))
|
||||||
{
|
{
|
||||||
_playerPerformanceConfigService.Current.ShowPerformanceIndicator = showPerformanceIndicator;
|
_playerPerformanceConfigService.Current.ShowPerformanceIndicator = showPerformanceIndicator;
|
||||||
@@ -1193,9 +1309,18 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_uiShared.DrawHelpText("Limit in approximate used triangles from mods to trigger warning or performance indicator on UI." + UiSharedService.TooltipSeparator
|
_uiShared.DrawHelpText("Limit in approximate used triangles from mods to trigger warning or performance indicator on UI." + UiSharedService.TooltipSeparator
|
||||||
+ "Default: 165 thousand");
|
+ "Default: 165 thousand");
|
||||||
}
|
}
|
||||||
ImGui.Dummy(new Vector2(10));
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
|
|
||||||
bool autoPause = _playerPerformanceConfigService.Current.AutoPausePlayersExceedingThresholds;
|
bool autoPause = _playerPerformanceConfigService.Current.AutoPausePlayersExceedingThresholds;
|
||||||
bool autoPauseEveryone = _playerPerformanceConfigService.Current.AutoPausePlayersWithPreferredPermissionsExceedingThresholds;
|
bool autoPauseEveryone = _playerPerformanceConfigService.Current.AutoPausePlayersWithPreferredPermissionsExceedingThresholds;
|
||||||
|
|
||||||
|
if (_uiShared.MediumTreeNode("Auto Pause", UIColors.Get("LightlessPurple")))
|
||||||
|
{
|
||||||
if (ImGui.Checkbox("Automatically pause players exceeding thresholds", ref autoPause))
|
if (ImGui.Checkbox("Automatically pause players exceeding thresholds", ref autoPause))
|
||||||
{
|
{
|
||||||
_playerPerformanceConfigService.Current.AutoPausePlayersExceedingThresholds = autoPause;
|
_playerPerformanceConfigService.Current.AutoPausePlayersExceedingThresholds = autoPause;
|
||||||
@@ -1237,8 +1362,17 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_uiShared.DrawHelpText("When a loading in player and their triangle count exceeds this amount, automatically pauses the synced player." + UiSharedService.TooltipSeparator
|
_uiShared.DrawHelpText("When a loading in player and their triangle count exceeds this amount, automatically pauses the synced player." + UiSharedService.TooltipSeparator
|
||||||
+ "Default: 250 thousand");
|
+ "Default: 250 thousand");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("LightlessPurple"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Separator();
|
||||||
ImGui.Dummy(new Vector2(10));
|
ImGui.Dummy(new Vector2(10));
|
||||||
_uiShared.BigText("Whitelisted UIDs");
|
|
||||||
|
_uiShared.UnderlinedBigText("Whitelisted UIDs", UIColors.Get("LightlessBlue"));
|
||||||
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
UiSharedService.TextWrapped("The entries in the list below will be ignored for all warnings and auto pause operations.");
|
UiSharedService.TextWrapped("The entries in the list below will be ignored for all warnings and auto pause operations.");
|
||||||
ImGui.Dummy(new Vector2(10));
|
ImGui.Dummy(new Vector2(10));
|
||||||
ImGui.SetNextItemWidth(200 * ImGuiHelpers.GlobalScale);
|
ImGui.SetNextItemWidth(200 * ImGuiHelpers.GlobalScale);
|
||||||
@@ -1289,7 +1423,11 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_lastTab = "Service Settings";
|
_lastTab = "Service Settings";
|
||||||
if (ApiController.ServerAlive)
|
if (ApiController.ServerAlive)
|
||||||
{
|
{
|
||||||
_uiShared.BigText("Service Actions");
|
_uiShared.UnderlinedBigText("Service Actions", UIColors.Get("LightlessBlue"));
|
||||||
|
|
||||||
|
ImGui.Dummy(new Vector2(10));
|
||||||
|
if (_uiShared.MediumTreeNode("Deletion", UIColors.Get("DimRed")))
|
||||||
|
{
|
||||||
ImGuiHelpers.ScaledDummy(new Vector2(5, 5));
|
ImGuiHelpers.ScaledDummy(new Vector2(5, 5));
|
||||||
if (ImGui.Button("Delete all my files"))
|
if (ImGui.Button("Delete all my files"))
|
||||||
{
|
{
|
||||||
@@ -1364,12 +1502,20 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
UiSharedService.SetScaledWindowSize(325);
|
UiSharedService.SetScaledWindowSize(325);
|
||||||
ImGui.EndPopup();
|
ImGui.EndPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_uiShared.ColoredSeparator(UIColors.Get("DimRed"), 1.5f);
|
||||||
|
ImGui.TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
}
|
}
|
||||||
|
|
||||||
_uiShared.BigText("Service & Character Settings");
|
ImGui.Dummy(new Vector2(10));
|
||||||
ImGuiHelpers.ScaledDummy(new Vector2(5, 5));
|
_uiShared.MediumText("Service & Character Settings", UIColors.Get("LightlessPurple"));
|
||||||
|
ImGui.Dummy(new Vector2(5));
|
||||||
|
|
||||||
var sendCensus = _serverConfigurationManager.SendCensusData;
|
var sendCensus = _serverConfigurationManager.SendCensusData;
|
||||||
|
|
||||||
if (ImGui.Checkbox("Send Statistical Census Data", ref sendCensus))
|
if (ImGui.Checkbox("Send Statistical Census Data", ref sendCensus))
|
||||||
{
|
{
|
||||||
_serverConfigurationManager.SendCensusData = sendCensus;
|
_serverConfigurationManager.SendCensusData = sendCensus;
|
||||||
@@ -1842,6 +1988,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
ImGui.EndTabBar();
|
ImGui.EndTabBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui.Dummy(new Vector2(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _lastSelectedServerIndex = -1;
|
private int _lastSelectedServerIndex = -1;
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ namespace LightlessSync.UI
|
|||||||
private static readonly Dictionary<string, string> HexColors = new(StringComparer.OrdinalIgnoreCase)
|
private static readonly Dictionary<string, string> HexColors = new(StringComparer.OrdinalIgnoreCase)
|
||||||
{
|
{
|
||||||
{ "LightlessPurple", "#ad8af5" },
|
{ "LightlessPurple", "#ad8af5" },
|
||||||
{ "LightlessBlue", "#64c7e8" },
|
{ "LightlessBlue", "#a6c2ff" },
|
||||||
{ "PairBlue", "#4e98b1" },
|
{ "LightlessYellow", "#ffe97a" },
|
||||||
{ "DimRed", "#bd0000" },
|
{ "PairBlue", "#88a2db" },
|
||||||
|
{ "DimRed", "#d44444" },
|
||||||
};
|
};
|
||||||
|
|
||||||
public static Vector4 Get(string name)
|
public static Vector4 Get(string name)
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ using Dalamud.Plugin.Services;
|
|||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using LightlessSync.FileCache;
|
using LightlessSync.FileCache;
|
||||||
using LightlessSync.Interop.Ipc;
|
using LightlessSync.Interop.Ipc;
|
||||||
using LightlessSync.Localization;
|
|
||||||
using LightlessSync.LightlessConfiguration;
|
using LightlessSync.LightlessConfiguration;
|
||||||
using LightlessSync.LightlessConfiguration.Models;
|
using LightlessSync.LightlessConfiguration.Models;
|
||||||
|
using LightlessSync.Localization;
|
||||||
using LightlessSync.PlayerData.Pairs;
|
using LightlessSync.PlayerData.Pairs;
|
||||||
using LightlessSync.Services;
|
using LightlessSync.Services;
|
||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
@@ -114,6 +114,15 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
SizePx = 35
|
SizePx = 35
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
MediumFont = _pluginInterface.UiBuilder.FontAtlas.NewDelegateFontHandle(e =>
|
||||||
|
{
|
||||||
|
e.OnPreBuild(tk => tk.AddDalamudAssetFont(Dalamud.DalamudAsset.NotoSansJpMedium, new()
|
||||||
|
{
|
||||||
|
SizePx = 22,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
GameFont = _pluginInterface.UiBuilder.FontAtlas.NewGameFontHandle(new(GameFontFamilyAndSize.Axis12));
|
GameFont = _pluginInterface.UiBuilder.FontAtlas.NewGameFontHandle(new(GameFontFamilyAndSize.Axis12));
|
||||||
IconFont = _pluginInterface.UiBuilder.IconFontFixedWidthHandle;
|
IconFont = _pluginInterface.UiBuilder.IconFontFixedWidthHandle;
|
||||||
}
|
}
|
||||||
@@ -133,6 +142,8 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
public string PlayerName => _dalamudUtil.GetPlayerName();
|
public string PlayerName => _dalamudUtil.GetPlayerName();
|
||||||
|
|
||||||
public IFontHandle UidFont { get; init; }
|
public IFontHandle UidFont { get; init; }
|
||||||
|
public IFontHandle MediumFont { get; init; }
|
||||||
|
|
||||||
public Dictionary<ushort, string> WorldData => _dalamudUtil.WorldData.Value;
|
public Dictionary<ushort, string> WorldData => _dalamudUtil.WorldData.Value;
|
||||||
public uint WorldId => _dalamudUtil.GetHomeWorldId();
|
public uint WorldId => _dalamudUtil.GetHomeWorldId();
|
||||||
|
|
||||||
@@ -434,6 +445,79 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
FontText(text, UidFont, color);
|
FontText(text, UidFont, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UnderlinedBigText(
|
||||||
|
string text,
|
||||||
|
Vector4? textColor = null,
|
||||||
|
Vector4? underlineColor = null,
|
||||||
|
float underlineThickness = 2f)
|
||||||
|
{
|
||||||
|
using var font = UidFont.Push();
|
||||||
|
|
||||||
|
var drawList = ImGui.GetWindowDrawList();
|
||||||
|
var textSize = ImGui.CalcTextSize(text);
|
||||||
|
var pos = ImGui.GetCursorScreenPos();
|
||||||
|
var text_color = textColor ?? ImGuiColors.DalamudWhite;
|
||||||
|
var line_color = underlineColor ?? text_color;
|
||||||
|
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.Text, text_color);
|
||||||
|
ImGui.TextUnformatted(text);
|
||||||
|
ImGui.PopStyleColor();
|
||||||
|
|
||||||
|
var lineY = pos.Y + textSize.Y + 2f;
|
||||||
|
drawList.AddLine(
|
||||||
|
new Vector2(pos.X, lineY),
|
||||||
|
new Vector2(pos.X + textSize.X, lineY),
|
||||||
|
ImGui.GetColorU32(line_color),
|
||||||
|
underlineThickness * ImGuiHelpers.GlobalScale
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ColoredSeparator(Vector4? color = null, float thickness = 1f, float indent = 0f)
|
||||||
|
{
|
||||||
|
var drawList = ImGui.GetWindowDrawList();
|
||||||
|
var min = ImGui.GetCursorScreenPos();
|
||||||
|
var max = new Vector2(min.X + ImGui.GetContentRegionAvail().X, min.Y);
|
||||||
|
|
||||||
|
min.X += indent;
|
||||||
|
max.X -= indent;
|
||||||
|
|
||||||
|
drawList.AddLine(
|
||||||
|
min,
|
||||||
|
new Vector2(max.X, min.Y),
|
||||||
|
ImGui.GetColorU32(color ?? ImGuiColors.DalamudGrey),
|
||||||
|
thickness * ImGuiHelpers.GlobalScale
|
||||||
|
);
|
||||||
|
|
||||||
|
ImGui.Dummy(new Vector2(0, thickness * ImGuiHelpers.GlobalScale));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void MediumText(string text, Vector4? color = null)
|
||||||
|
{
|
||||||
|
FontText(text, MediumFont, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool MediumTreeNode(string label, Vector4? textColor = null, float lineWidth = 2f, ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags.SpanAvailWidth)
|
||||||
|
{
|
||||||
|
using var font = MediumFont.Push();
|
||||||
|
var lineColor = textColor ?? ImGuiColors.DalamudWhite;
|
||||||
|
|
||||||
|
var textSize = ImGui.CalcTextSize(label);
|
||||||
|
var cursorScreen = ImGui.GetCursorScreenPos();
|
||||||
|
var cursorLocal = ImGui.GetCursorPos();
|
||||||
|
|
||||||
|
ImGui.GetWindowDrawList().AddLine(
|
||||||
|
new Vector2(cursorScreen.X, cursorScreen.Y),
|
||||||
|
new Vector2(cursorScreen.X, cursorScreen.Y + textSize.Y),
|
||||||
|
ImGui.GetColorU32(lineColor),
|
||||||
|
lineWidth * ImGuiHelpers.GlobalScale
|
||||||
|
);
|
||||||
|
|
||||||
|
ImGui.SetCursorPosX(cursorLocal.X + 6f);
|
||||||
|
using var color = ImRaii.PushColor(ImGuiCol.Text, lineColor);
|
||||||
|
|
||||||
|
return ImGui.TreeNodeEx(label, flags);
|
||||||
|
}
|
||||||
|
|
||||||
public void BooleanToColoredIcon(bool value, bool inline = true)
|
public void BooleanToColoredIcon(bool value, bool inline = true)
|
||||||
{
|
{
|
||||||
using var colorgreen = ImRaii.PushColor(ImGuiCol.Text, UIColors.Get("LightlessBlue"), value);
|
using var colorgreen = ImRaii.PushColor(ImGuiCol.Text, UIColors.Get("LightlessBlue"), value);
|
||||||
@@ -1085,6 +1169,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
|
|
||||||
UidFont.Dispose();
|
UidFont.Dispose();
|
||||||
GameFont.Dispose();
|
GameFont.Dispose();
|
||||||
|
MediumFont.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CenterWindow(float width, float height, ImGuiCond cond = ImGuiCond.None)
|
private static void CenterWindow(float width, float height, ImGuiCond cond = ImGuiCond.None)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using LightlessSync.LightlessConfiguration.Models;
|
|||||||
using LightlessSync.Services.Mediator;
|
using LightlessSync.Services.Mediator;
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using static FFXIVClientStructs.FFXIV.Client.Game.UI.MapMarkerData.Delegates;
|
|
||||||
|
|
||||||
namespace LightlessSync.WebAPI;
|
namespace LightlessSync.WebAPI;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using LightlessSync.API.Data;
|
using LightlessSync.API.Data;
|
||||||
using LightlessSync.API.Dto.CharaData;
|
using LightlessSync.API.Dto.CharaData;
|
||||||
using LightlessSync.Services.CharaData.Models;
|
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user