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:
@@ -131,7 +131,6 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
bool disableSounds = perm.IsDisableSounds();
|
||||
bool disableAnims = perm.IsDisableAnimations();
|
||||
bool disableVfx = perm.IsDisableVFX();
|
||||
bool shareLocation = perm.IsSharingLocation();
|
||||
|
||||
if ((_groupFullInfoDto.GroupPermissions.IsPreferDisableAnimations() != disableAnims
|
||||
|| _groupFullInfoDto.GroupPermissions.IsPreferDisableSounds() != disableSounds
|
||||
@@ -165,13 +164,6 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
_ = _apiController.GroupChangeIndividualPermissionState(new(_groupFullInfoDto.Group, new(_apiController.UID), perm));
|
||||
ImGui.CloseCurrentPopup();
|
||||
}
|
||||
|
||||
if (_uiSharedService.IconTextButton(!shareLocation ? FontAwesomeIcon.Globe : FontAwesomeIcon.StopCircle, !shareLocation ? "Share your location to all users in Syncshell" : "STOP Share your location to all users in Syncshell", menuWidth, true))
|
||||
{
|
||||
perm.SetShareLocation(!shareLocation);
|
||||
_ = _apiController.GroupChangeIndividualPermissionState(new(_groupFullInfoDto.Group, new(_apiController.UID), perm));
|
||||
ImGui.CloseCurrentPopup();
|
||||
}
|
||||
|
||||
if (IsModerator || IsOwner)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,6 @@ public class DrawEntityFactory
|
||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||
private readonly LightlessConfigService _configService;
|
||||
private readonly UiSharedService _uiSharedService;
|
||||
private readonly LocationShareService _locationShareService;
|
||||
private readonly PlayerPerformanceConfigService _playerPerformanceConfigService;
|
||||
private readonly CharaDataManager _charaDataManager;
|
||||
private readonly SelectTagForPairUi _selectTagForPairUi;
|
||||
@@ -53,7 +52,6 @@ public class DrawEntityFactory
|
||||
ServerConfigurationManager serverConfigurationManager,
|
||||
LightlessConfigService configService,
|
||||
UiSharedService uiSharedService,
|
||||
LocationShareService locationShareService,
|
||||
PlayerPerformanceConfigService playerPerformanceConfigService,
|
||||
CharaDataManager charaDataManager,
|
||||
SelectTagForSyncshellUi selectTagForSyncshellUi,
|
||||
@@ -73,7 +71,6 @@ public class DrawEntityFactory
|
||||
_serverConfigurationManager = serverConfigurationManager;
|
||||
_configService = configService;
|
||||
_uiSharedService = uiSharedService;
|
||||
_locationShareService = locationShareService;
|
||||
_playerPerformanceConfigService = playerPerformanceConfigService;
|
||||
_charaDataManager = charaDataManager;
|
||||
_selectTagForSyncshellUi = selectTagForSyncshellUi;
|
||||
@@ -165,7 +162,6 @@ public class DrawEntityFactory
|
||||
_uiSharedService,
|
||||
_playerPerformanceConfigService,
|
||||
_configService,
|
||||
_locationShareService,
|
||||
_charaDataManager,
|
||||
_pairLedger);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ public class PermissionWindowUI : WindowMediatorSubscriberBase
|
||||
var disableSounds = _ownPermissions.IsDisableSounds();
|
||||
var disableAnimations = _ownPermissions.IsDisableAnimations();
|
||||
var disableVfx = _ownPermissions.IsDisableVFX();
|
||||
var shareLocation = _ownPermissions.IsSharingLocation();
|
||||
var style = ImGui.GetStyle();
|
||||
var indentSize = ImGui.GetFrameHeight() + style.ItemSpacing.X;
|
||||
|
||||
@@ -71,7 +70,6 @@ public class PermissionWindowUI : WindowMediatorSubscriberBase
|
||||
var otherDisableSounds = otherPerms.IsDisableSounds();
|
||||
var otherDisableAnimations = otherPerms.IsDisableAnimations();
|
||||
var otherDisableVFX = otherPerms.IsDisableVFX();
|
||||
var otherShareLocation = otherPerms.IsSharingLocation();
|
||||
|
||||
using (ImRaii.PushIndent(indentSize, false))
|
||||
{
|
||||
@@ -126,24 +124,6 @@ public class PermissionWindowUI : WindowMediatorSubscriberBase
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.Text(Pair.UserData.AliasOrUID + " has " + (!otherDisableVFX ? "not " : string.Empty) + "disabled VFX sync with you");
|
||||
}
|
||||
|
||||
if (ImGui.Checkbox("Enable location Sharing", ref shareLocation))
|
||||
{
|
||||
_ownPermissions.SetShareLocation(shareLocation);
|
||||
}
|
||||
_uiSharedService.DrawHelpText("Enable location sharing will only effect your side." + UiSharedService.TooltipSeparator
|
||||
+ "Note: this is NOT bidirectional, you can choose to share even others dont share with you.");
|
||||
using (ImRaii.PushIndent(indentSize, false))
|
||||
{
|
||||
_uiSharedService.BooleanToColoredIcon(shareLocation, false);
|
||||
ImGui.SameLine();
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.Text((!shareLocation ? "Not" : string.Empty) + "sharing location with " + Pair.UserData.AliasOrUID + " .");
|
||||
|
||||
#if DEBUG
|
||||
_uiSharedService.BooleanToColoredIcon(otherShareLocation, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
ImGuiHelpers.ScaledDummy(0.5f);
|
||||
ImGui.Separator();
|
||||
|
||||
Reference in New Issue
Block a user