6
6
using Dalamud . Interface . Utility ;
7
7
using Dalamud . Memory ;
8
8
using FFXIVClientStructs . FFXIV . Client . Graphics . Kernel ;
9
- using FFXIVClientStructs . FFXIV . Client . UI ;
10
9
using FFXIVClientStructs . FFXIV . Client . UI . Agent ;
10
+ using FFXIVClientStructs . FFXIV . Component . GUI ;
11
11
using ImGuiNET ;
12
12
using SimpleTweaksPlugin . Debugging ;
13
13
using SimpleTweaksPlugin . TweakSystem ;
17
17
namespace SimpleTweaksPlugin . Tweaks ;
18
18
19
19
[ Changelog ( "1.9.7.1" , "Re-added 'Use ReShade' option" ) ]
20
+ [ TweakName ( "Screenshot Improvements" ) ]
21
+ [ TweakDescription ( "Allows taking higher resolution screenshots, Hiding Dalamud & Game UIs and removing the copyright notice from screenshots." ) ]
22
+ [ TweakAuthor ( "NotNite" ) ]
20
23
public unsafe class HighResScreenshots : Tweak {
21
- public override string Name => "Screenshot Improvements" ;
22
- public override string Description => "Allows taking higher resolution screenshots, Hiding Dalamud & Game UIs and removing the copyright notice from screenshots." ;
23
- protected override string Author => "NotNite" ;
24
-
25
24
private nint copyrightShaderAddress ;
26
25
27
26
public class Configs : TweakConfig {
@@ -53,7 +52,7 @@ public class Configs : TweakConfig {
53
52
54
53
private bool updatingReShadeKeybind = false ;
55
54
56
- protected override DrawConfigDelegate DrawConfigTree => ( ref bool hasChanged ) => {
55
+ protected void DrawConfig ( ref bool hasChanged ) {
57
56
ImGui . TextWrapped (
58
57
"This tweak will increase the resolution of screenshots taken in game. It will NOT increase the scale of your HUD/plugin windows." ) ;
59
58
ImGui . TextWrapped ( "Your HUD will appear smaller while the screenshot is processing." ) ;
@@ -145,9 +144,9 @@ public class Configs : TweakConfig {
145
144
ImGui . Unindent ( ) ;
146
145
ImGui . Unindent ( ) ;
147
146
}
148
- } ;
147
+ }
149
148
150
- public override void Setup ( ) {
149
+ protected override void Setup ( ) {
151
150
AddChangelogNewTweak ( "1.8.2.0" ) ;
152
151
AddChangelog ( "1.8.3.0" , "Added option to hide dalamud UI for screenshot." ) ;
153
152
AddChangelog ( "1.8.5.0" , "Added option to hide game UI for screenshots." ) ;
@@ -160,12 +159,12 @@ public override void Setup() {
160
159
protected override void Enable ( ) {
161
160
Config = LoadConfig < Configs > ( ) ?? new Configs ( ) ;
162
161
163
- if ( ! Service . SigScanner . TryScanText ( "49 8B 57 30 45 33 C9" , out copyrightShaderAddress ) ) {
162
+ if ( ! Service . SigScanner . TryScanText ( "48 8B 57 ?? 45 33 C9 48 8B 06 45 33 C0 48 8B CE 48 8B 52 ?? FF 50 ?? 48 8B 06 4C 8D 4C 24 " , out copyrightShaderAddress ) ) {
164
163
copyrightShaderAddress = 0 ;
165
164
}
166
-
165
+
167
166
isInputIDClickedHook ??=
168
- Common . Hook < IsInputIDClickedDelegate > ( "E9 ?? ?? ?? ?? 83 7F 44 02 " , IsInputIDClickedDetour ) ;
167
+ Common . Hook < IsInputIDClickedDelegate > ( "E9 ?? ?? ?? ?? 83 7F ?? ?? 0F 8F ?? ?? ?? ?? BA ?? ?? ?? ?? 48 8B CB " , IsInputIDClickedDetour ) ;
169
168
isInputIDClickedHook ? . Enable ( ) ;
170
169
171
170
base . Enable ( ) ;
@@ -176,7 +175,7 @@ protected override void Enable() {
176
175
private uint oldHeight ;
177
176
private bool isRunning ;
178
177
179
- const int ScreenshotButton = 543 ;
178
+ const int ScreenshotButton = 546 ;
180
179
public bool originalUiVisibility ;
181
180
byte [ ] originalCopyrightBytes = null ;
182
181
// IsInputIDClicked is called from Client::UI::UIInputModule.CheckScreenshotState, which is polled
@@ -212,8 +211,8 @@ private byte IsInputIDClickedDetour(nint a1, int a2) {
212
211
213
212
214
213
if ( Config . HideGameUi ) {
215
- var raptureAtkModule = Framework . Instance ( ) ->GetUiModule ( ) ->GetRaptureAtkModule ( ) ;
216
- originalUiVisibility = ! raptureAtkModule ->RaptureAtkUnitManager . Flags . HasFlag ( RaptureAtkModuleFlags . UiHidden ) ;
214
+ var raptureAtkModule = Framework . Instance ( ) ->GetUIModule ( ) ->GetRaptureAtkModule ( ) ;
215
+ originalUiVisibility = ! raptureAtkModule ->RaptureAtkUnitManager . Flags . HasFlag ( AtkUnitManagerFlags . UiHidden ) ;
217
216
if ( originalUiVisibility ) {
218
217
raptureAtkModule ->SetUiVisibility ( false ) ;
219
218
}
@@ -238,8 +237,8 @@ private byte IsInputIDClickedDetour(nint a1, int a2) {
238
237
Service . Framework . RunOnTick ( ( ) => {
239
238
UIDebug . FreeExclusiveDraw ( ) ;
240
239
if ( Config . HideGameUi ) {
241
- var raptureAtkModule = Framework . Instance ( ) ->GetUiModule ( ) ->GetRaptureAtkModule ( ) ;
242
- if ( originalUiVisibility && raptureAtkModule ->RaptureAtkUnitManager . Flags . HasFlag ( RaptureAtkModuleFlags . UiHidden ) ) {
240
+ var raptureAtkModule = Framework . Instance ( ) ->GetUIModule ( ) ->GetRaptureAtkModule ( ) ;
241
+ if ( originalUiVisibility && raptureAtkModule ->RaptureAtkUnitManager . Flags . HasFlag ( AtkUnitManagerFlags . UiHidden ) ) {
243
242
raptureAtkModule ->SetUiVisibility ( true ) ;
244
243
}
245
244
}
0 commit comments