config: Update when using hotkey, disable save on enter, always enable inputs

This commit is contained in:
Jade Macho 2025-06-28 18:21:23 +02:00
parent 033ba5f1f0
commit 3831b5f64f
Signed by: 0x0ade
GPG key ID: E1960710FE4FBEEF
4 changed files with 8 additions and 15 deletions

View file

@ -36,6 +36,7 @@ public class Configuration : IPluginConfiguration
public void Save()
{
pluginInterface!.SavePluginConfig(this);
Service.PluginUI.UpdateFromConfig();
}
}

View file

@ -182,7 +182,7 @@ public sealed unsafe class Plugin : IDalamudPlugin
_currentHwnd = (HWND) win->WindowHandle;
#if CRES_CLEAN
#if CRES_CLEAN || true
var _dev_hWnd = (IntPtr*) &dev->hWnd;
var _dev_NewWidth = &dev->NewWidth;
var _dev_NewHeight = &dev->NewHeight;

View file

@ -44,6 +44,11 @@ public sealed class PluginUI : IDisposable
WindowSystem.Draw();
}
public void UpdateFromConfig()
{
_configWindow.UpdateFromConfig();
}
private void ShowConfigWindow()
{
SettingsVisible = true;

View file

@ -130,30 +130,17 @@ public class ConfigWindow : Window, IDisposable
ImGui.Text("Hotkey");
if (!_configIsEnabled)
{
ImGui.BeginDisabled();
}
ImGui.Checkbox("Use scale", ref _configIsScale);
if (_configIsScale)
{
if (ImGui.InputFloat("Scale", ref _configScale, 0.01f, 0.1f, "%.3f", ImGuiInputTextFlags.EnterReturnsTrue))
{
save = true;
}
ImGui.InputFloat("Scale", ref _configScale, 0.01f, 0.1f, "%.3f", ImGuiInputTextFlags.EnterReturnsTrue);
}
else
{
ImGui.InputInt2("Size in pixels", ref _configWH[0]);
}
if (!_configIsEnabled)
{
ImGui.EndDisabled();
}
if (ImGui.BeginCombo("Borderless window workaround", _configDXVKDWMHackMode.ToHumanNameString()))
{
foreach (var mode in Enum.GetValues<DXVKDWMHackMode>())