mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Add Apply Mod Associations button to design header.
This commit is contained in:
parent
a0396ec0e0
commit
5ca0aa403c
2 changed files with 16 additions and 2 deletions
|
|
@ -387,6 +387,8 @@ public class DesignPanel
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
DrawApplyToTarget();
|
DrawApplyToTarget();
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
_modAssociations.DrawApplyButton();
|
||||||
|
ImGui.SameLine();
|
||||||
DrawSaveToDat();
|
DrawSaveToDat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,22 @@ public class ModAssociationsTab
|
||||||
private void DrawApplyAllButton()
|
private void DrawApplyAllButton()
|
||||||
{
|
{
|
||||||
var current = _penumbra.CurrentCollection;
|
var current = _penumbra.CurrentCollection;
|
||||||
if (!ImGuiUtil.DrawDisabledButton($"Try Applying All Associated Mods to {current}##applyAll",
|
if (ImGuiUtil.DrawDisabledButton($"Try Applying All Associated Mods to {current}##applyAll",
|
||||||
new Vector2(ImGui.GetContentRegionAvail().X, 0), string.Empty, current is "<Unavailable>"))
|
new Vector2(ImGui.GetContentRegionAvail().X, 0), string.Empty, current is "<Unavailable>"))
|
||||||
return;
|
ApplyAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DrawApplyButton()
|
||||||
|
{
|
||||||
|
var current = _penumbra.CurrentCollection;
|
||||||
|
if (ImGuiUtil.DrawDisabledButton("Apply Mod Associations", Vector2.Zero,
|
||||||
|
$"Try to apply all associated mod settings to Penumbras current collection {current}",
|
||||||
|
_selector.Selected!.AssociatedMods.Count == 0 || current is "<Unavailable>"))
|
||||||
|
ApplyAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ApplyAll()
|
||||||
|
{
|
||||||
foreach (var (mod, settings) in _selector.Selected!.AssociatedMods)
|
foreach (var (mod, settings) in _selector.Selected!.AssociatedMods)
|
||||||
_penumbra.SetMod(mod, settings);
|
_penumbra.SetMod(mod, settings);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue