Merge branch '2.0.2-Location' of https://git.lightless-sync.org/Lightless-Sync/LightlessClient into 2.0.2-Location

This commit is contained in:
defnotken
2025-12-27 21:17:32 -06:00
12 changed files with 6 additions and 224 deletions

View File

@@ -37,7 +37,6 @@ public class DrawUserPair
private readonly UiSharedService _uiSharedService;
private readonly PlayerPerformanceConfigService _performanceConfigService;
private readonly LightlessConfigService _configService;
private readonly LocationShareService _locationShareService;
private readonly CharaDataManager _charaDataManager;
private readonly PairLedger _pairLedger;
private float _menuWidth = -1;
@@ -58,7 +57,6 @@ public class DrawUserPair
UiSharedService uiSharedService,
PlayerPerformanceConfigService performanceConfigService,
LightlessConfigService configService,
LocationShareService locationShareService,
CharaDataManager charaDataManager,
PairLedger pairLedger)
{
@@ -76,7 +74,6 @@ public class DrawUserPair
_uiSharedService = uiSharedService;
_performanceConfigService = performanceConfigService;
_configService = configService;
_locationShareService = locationShareService;
_charaDataManager = charaDataManager;
_pairLedger = pairLedger;
}
@@ -219,17 +216,6 @@ public class DrawUserPair
_ = _apiController.UserSetPairPermissions(new UserPermissionsDto(_pair.UserData, permissions));
}
UiSharedService.AttachToolTip("Changes VFX sync permissions with this user." + (individual ? individualText : string.Empty));
var isShareingLocation = _pair.UserPair!.OwnPermissions.IsSharingLocation();
string isShareingLocationText = isShareingLocation ? "Disable location sharing" : "Enable location sharing";
var isShareingLocationIcon = isShareingLocation ? FontAwesomeIcon.StopCircle : FontAwesomeIcon.Globe;
if (_uiSharedService.IconTextButton(isShareingLocationIcon, isShareingLocationText, _menuWidth, true))
{
var permissions = _pair.UserPair.OwnPermissions;
permissions.SetShareLocation(!isShareingLocation);
_ = _apiController.UserSetPairPermissions(new UserPermissionsDto(_pair.UserData, permissions));
}
UiSharedService.AttachToolTip("Changes location sharing permissions with this user." + (individual ? individualText : string.Empty));
}
private void DrawIndividualMenu()
@@ -581,7 +567,6 @@ public class DrawUserPair
: UiSharedService.TooltipSeparator + "Hold CTRL to enable preferred permissions while pausing." + Environment.NewLine + "This will leave this pair paused even if unpausing syncshells including this pair."))
: "Resume pairing with " + _pair.UserData.AliasOrUID);
//Location sharing
if (_pair.IsPaired)
{
var individualSoundsDisabled = (_pair.UserPair?.OwnPermissions.IsDisableSounds() ?? false) || (_pair.UserPair?.OtherPermissions.IsDisableSounds() ?? false);
@@ -589,66 +574,6 @@ public class DrawUserPair
var individualVFXDisabled = (_pair.UserPair?.OwnPermissions.IsDisableVFX() ?? false) || (_pair.UserPair?.OtherPermissions.IsDisableVFX() ?? false);
var individualIsSticky = _pair.UserPair!.OwnPermissions.IsSticky();
var individualIcon = individualIsSticky ? FontAwesomeIcon.ArrowCircleUp : FontAwesomeIcon.InfoCircle;
var shareLocationIcon = FontAwesomeIcon.Globe;
var shareLocation = _pair.UserPair?.OwnPermissions.IsSharingLocation() ?? false;
var shareLocationOther = _pair.UserPair?.OtherPermissions.IsSharingLocation() ?? false;
var shareColor = shareLocation switch
{
true when shareLocationOther => UIColors.Get("LightlessGreen"),
false when shareLocationOther => UIColors.Get("LightlessBlue"),
_ => UIColors.Get("LightlessYellow"),
};
if (shareLocation || shareLocationOther)
{
currentRightSide -= (_uiSharedService.GetIconSize(shareLocationIcon).X + spacingX);
ImGui.SameLine(currentRightSide);
using (ImRaii.PushColor(ImGuiCol.Text, shareColor, shareLocation || shareLocationOther))
_uiSharedService.IconText(shareLocationIcon);
if (ImGui.IsItemHovered())
{
ImGui.BeginTooltip();
if (shareLocationOther)
{
var location = _locationShareService.GetUserLocation(_pair.UserPair!.User.UID);
if (_pair.IsOnline)
{
if (!string.IsNullOrEmpty(location))
{
_uiSharedService.IconText(FontAwesomeIcon.LocationArrow);
ImGui.SameLine();
ImGui.TextUnformatted(location);
}
else
{
ImGui.TextUnformatted("Location info not updated, reconnect or waiting for zone-changing.");
}
}
else
{
ImGui.TextUnformatted("User not onlineㄟ( ▔, ▔ )ㄏ");
}
}
else
{
ImGui.TextUnformatted("NOT Sharing location with you.(⊙x⊙;)");
}
ImGui.Separator();
if (shareLocation)
{
ImGui.TextUnformatted("Sharing your location.ヾ(•ω•`)o");
}
else
{
ImGui.TextUnformatted("NOT sharing your location.(´。_。`)");
}
ImGui.EndTooltip();
}
}
if (individualAnimDisabled || individualSoundsDisabled || individualVFXDisabled || individualIsSticky)
{