Skip to content

Commit

Permalink
fix loot window visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
foglio1024 committed Nov 18, 2023
1 parent c789803 commit c692da9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public bool AutoPassItemsBlacklistMode

public LootDistributionWindowSettings()
{
_visible = true;
_visible = false;
_enabled = true;
_autoDim = true;
_showAlways = true;
Expand Down
10 changes: 6 additions & 4 deletions TCC.Core/UI/WindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ static async Task LoadWindows()
PerfMonitor = await b10.GetWindow();
ViewModels.PerfMonitorVM = await b10.GetViewModel();

var b11 = new TccWidgetBuilder<LootDistributionWindow, LootDistributionViewModel>(App.Settings.LootDistributionWindowSettings);
LootDistributionWindow = await b11.GetWindow();
ViewModels.LootDistributionVM = await b11.GetViewModel();


FlightDurationWindow = new FlightDurationWindow(ViewModels.FlightGaugeVM);
if (FlightDurationWindow.WindowSettings?.Enabled == true) FlightDurationWindow.Show();

Expand All @@ -143,8 +148,6 @@ static async Task LoadWindows()

LfgListWindow = new LfgListWindow(ViewModels.LfgVM);

LootDistributionWindow = new LootDistributionWindow(ViewModels.LootDistributionVM);

ViewModels.PlayerMenuVM = new PlayerMenuViewModel();

ChatManager.Start();
Expand Down Expand Up @@ -177,7 +180,6 @@ public static class ViewModels
static CivilUnrestViewModel? _civilUnrestVm;
static LfgListViewModel? _lfgVm;
static FlightGaugeViewModel? _flightGaugeVm;
static LootDistributionViewModel? _lootDistributionVm;

public static CooldownWindowViewModel CooldownsVM { get; set; } = null!;
public static CharacterWindowViewModel CharacterVM { get; set; } = null!;
Expand All @@ -194,6 +196,6 @@ public static class ViewModels
public static CivilUnrestViewModel CivilUnrestVM => _civilUnrestVm ??= new CivilUnrestViewModel(App.Settings.CivilUnrestWindowSettings);
public static LfgListViewModel LfgVM => _lfgVm ??= new LfgListViewModel(App.Settings.LfgWindowSettings);
public static FlightGaugeViewModel FlightGaugeVM => _flightGaugeVm ??= new FlightGaugeViewModel(App.Settings.FlightGaugeWindowSettings);
public static LootDistributionViewModel LootDistributionVM => _lootDistributionVm ??= new LootDistributionViewModel(App.Settings.LootDistributionWindowSettings);
public static LootDistributionViewModel LootDistributionVM { get; set; } = null!;
}
}
7 changes: 5 additions & 2 deletions TCC.Core/UI/Windows/LootDistributionWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using System.Runtime;
using System.Windows;
using TCC.ViewModels;

namespace TCC.UI.Windows;
Expand All @@ -17,8 +18,10 @@ public LootDistributionWindow(LootDistributionViewModel vm)
BoundaryRef = Boundary;
MainContent = WindowContent;
Init(_vm.Settings!);

_vm.Settings!.Visible = false;
}

protected override void OnLoaded(object sender, RoutedEventArgs e)
{
base.OnLoaded(sender, e);
Expand Down
2 changes: 1 addition & 1 deletion TCC.Core/Utilities/TccUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public static string ChatChannelToName(ChatChannel ch)
{
ChatChannel.PartyNotice => "Notice",
ChatChannel.RaidNotice => "Notice",
ChatChannel.GuildAdvertising => "G. Ad",
ChatChannel.GuildAdvertising => "PvP",
ChatChannel.Megaphone => "Megaphone",
ChatChannel.Private1 => ChatManager.Instance.PrivateChannels[0].Name,
ChatChannel.Private2 => ChatManager.Instance.PrivateChannels[1].Name,
Expand Down
5 changes: 4 additions & 1 deletion TCC.Core/ViewModels/LootDistributionViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,10 @@ void OnAskBiddingRareItem(S_ASK_BIDDING_RARE_ITEM m)
ItemInDistribution.Index = m.Index;
_commitDelay.Start();

if (_settings.AutoShowUponRoll) _settings.Visible = true;
if (_settings.AutoShowUponRoll)
{
_settings.Visible = true;
}
}

/// <summary>
Expand Down

0 comments on commit c692da9

Please sign in to comment.