Skip to content

Commit 1ec7924

Browse files
committed
Updaties
1 parent 2352bd4 commit 1ec7924

8 files changed

Lines changed: 39 additions & 3 deletions

File tree

AutoRetainer/AutoRetainer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using ECommons.ExcelServices.TerritoryEnumeration;
2323
using ECommons.EzIpcManager;
2424
using ECommons.EzSharedDataManager;
25+
using ECommons.GameFunctions;
2526
using ECommons.GameHelpers;
2627
using ECommons.IPC;
2728
using ECommons.IPC.Subscribers;

AutoRetainer/Modules/Multi/MultiMode.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using ECommons.Events;
1313
using ECommons.ExcelServices.TerritoryEnumeration;
1414
using ECommons.EzSharedDataManager;
15+
using ECommons.GameFunctions;
1516
using ECommons.GameHelpers;
1617
using ECommons.Throttlers;
1718
using FFXIVClientStructs.FFXIV.Client.Game;
@@ -159,6 +160,15 @@ internal static void Tick()
159160
{
160161
if(EzThrottler.Throttle("MultiNotify", 15000)) Utils.NotifyIfLifestreamIsNotInstalled("Multi Mode");
161162
ValidateAutoAfkSettings();
163+
var shouldDisableRender = C.MultiDisableRender && (!C.MultiDisableRenderNightModeOnly || C.NightMode) && (!C.MultiDisableRenderOnlyInactive || TerraFX.Interop.Windows.Windows.IsIconic((TerraFX.Interop.Windows.HWND)(*ECommonsMain.MainWindowHandle)) || CSFramework.Instance()->WindowInactive);
164+
if(shouldDisableRender)
165+
{
166+
RenderDisableManager.PlaceRequest();
167+
}
168+
else
169+
{
170+
RenderDisableManager.RemoveRequest();
171+
}
162172
if(!Svc.ClientState.IsLoggedIn && TryGetAddonByName<AtkUnitBase>("Title", out _) && !P.TaskManager.IsBusy)
163173
{
164174
LastLogin = 0;
@@ -383,6 +393,10 @@ internal static void Tick()
383393
}
384394
}
385395
}
396+
else
397+
{
398+
RenderDisableManager.RemoveRequest();
399+
}
386400
}
387401

388402
internal static bool CanExpertDeliver()

AutoRetainer/PluginData/Config.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ public bool ShouldSerializeEnableAutoGCHandin()
155155
public bool ExitOnSubCompletion = false;
156156
public int ExitOnSubCompletionTime = 60;
157157

158+
public bool MultiDisableRender = false;
159+
public bool MultiDisableRenderNightModeOnly = false;
160+
public bool MultiDisableRenderOnlyInactive = true;
161+
158162
internal bool DontReassign
159163
{
160164
get

AutoRetainer/UI/NeoUI/!Definitions/NeoWindow.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public sealed class NeoWindow : Window
2323
new MultiModeContingency(),
2424
new CharaOrder(),
2525
new MultiModeFPSLimiter(),
26+
new MultiModeDisableRender(),
2627
new MultiModeLockout(),
2728

2829
..ConfigFileSystemHelpers.CreateInstancesOf<InventoryManagementBase>(),
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace AutoRetainer.UI.NeoUI.MultiModeEntries;
6+
7+
public class MultiModeDisableRender : NeoUIEntry
8+
{
9+
public override string Path => "Multi Mode/Disable Render";
10+
11+
public override NuiBuilder Builder => new NuiBuilder()
12+
.Section("Disable Render")
13+
.Checkbox("Disable Render when in Multi Mode", () => ref C.MultiDisableRender, "Disables world rendering while in Multi Mode.")
14+
.Checkbox("Only when in Night Mode", () => ref C.MultiDisableRenderNightModeOnly)
15+
.Checkbox("Only when window is not active", () => ref C.MultiDisableRenderOnlyInactive);
16+
}

0 commit comments

Comments
 (0)