Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions MareSynchronos/MareConfiguration/Configurations/MareConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,13 @@ public class MareConfig : IMareConfiguration
public bool ExtraChatTags { get; set; } = false;

public bool MareAPI { get; set; } = true;

public bool CompactUiAllowDocking { get; set; } = false;

public bool CompactUiSizeOverwrite { get; set; } = false;
//Vector2 didnt work, CBA to make it so just ignore this...
public int CompactUiMinWidth { get; set; } = 300;
public int CompactUiMinHeight { get; set; } = 400;
public int CompactUiMaxWidth { get; set; } = 600;
public int CompactUiMaxHeight { get; set; } = 2000;
}
27 changes: 21 additions & 6 deletions MareSynchronos/UI/CompactUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,29 @@ public CompactUi(ILogger<CompactUi> logger, UiSharedService uiShared, MareConfig
Mediator.Subscribe<DownloadStartedMessage>(this, (msg) => _currentDownloads[msg.DownloadId] = msg.DownloadStatus);
Mediator.Subscribe<DownloadFinishedMessage>(this, (msg) => _currentDownloads.TryRemove(msg.DownloadId, out _));

Flags |= ImGuiWindowFlags.NoDocking;
//Sneaking this in here cause i want it.
if (!_configService.Current.CompactUiAllowDocking)
{
Flags |= ImGuiWindowFlags.NoDocking;
}

// changed min size
SizeConstraints = new WindowSizeConstraints()
//Leaving condition in for now with overwrite defaulting to off since it could cause issues i havent experienced yet
if (_configService.Current.CompactUiSizeOverwrite)
{
MinimumSize = new Vector2(500, 400),
MaximumSize = new Vector2(600, 2000),
};
SizeConstraints = new WindowSizeConstraints()
{
MinimumSize = new Vector2(_configService.Current.CompactUiMinWidth, _configService.Current.CompactUiMinHeight),
MaximumSize = new Vector2(_configService.Current.CompactUiMaxWidth, _configService.Current.CompactUiMaxHeight),
};
}
else
{
SizeConstraints = new WindowSizeConstraints()
{
MinimumSize = new Vector2(350, 400),
MaximumSize = new Vector2(600, 2000),
};
}
}

protected override void DrawInternal()
Expand Down
35 changes: 35 additions & 0 deletions MareSynchronos/UI/SettingsUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,41 @@ private void DrawGeneral()
}
_uiShared.DrawHelpText("Will show profiles that have the NSFW tag enabled");

_uiShared.BigText("Experimental UI Settings");
UiSharedService.ColorTextWrapped("Any changes in this category require a plugin restart to take effect.", ImGuiColors.DalamudYellow);

var _CompactUiSizeOverwrite = _configService.Current.CompactUiSizeOverwrite;
if (ImGui.Checkbox("Enable custom size constraints for the main window", ref _CompactUiSizeOverwrite))
{
_configService.Current.CompactUiSizeOverwrite = _CompactUiSizeOverwrite;
_configService.Save();
}

var compactUiMinWidth = _configService.Current.CompactUiMinWidth;
var compactUiMinHeight = _configService.Current.CompactUiMinHeight;
if (ImGui.DragIntRange2("UI Min Size (W/H)", ref compactUiMinWidth, ref compactUiMinHeight, 1f, 100, 2000))
{
_configService.Current.CompactUiMinWidth = compactUiMinWidth;
_configService.Current.CompactUiMinHeight = compactUiMinHeight;
_configService.Save();
}

var compactUiMaxWidth = _configService.Current.CompactUiMaxWidth;
var compactUiMaxHeight = _configService.Current.CompactUiMaxHeight;
if (ImGui.DragIntRange2("UI Max Size (W/H)", ref compactUiMaxWidth, ref compactUiMaxHeight, 1f, 100, 4000))
{
_configService.Current.CompactUiMaxWidth = compactUiMaxWidth;
_configService.Current.CompactUiMaxHeight = compactUiMaxHeight;
_configService.Save();
}

var _compactUiAllowDocking = _configService.Current.CompactUiAllowDocking;
if (ImGui.Checkbox("Enable docking", ref _compactUiAllowDocking))
{
_configService.Current.CompactUiAllowDocking = _compactUiAllowDocking;
_configService.Save();
}

ImGui.Separator();

var disableOptionalPluginWarnings = _configService.Current.DisableOptionalPluginWarnings;
Expand Down
Loading