feat: try scaling and hiding ui on screenshot
This commit is contained in:
parent
2aa3120a58
commit
d5f8cd8457
38
Command.cs
38
Command.cs
|
@ -1,4 +1,7 @@
|
||||||
using Dalamud.Game.Command;
|
using Dalamud.Game.Command;
|
||||||
|
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
||||||
|
using FFXIVClientStructs.FFXIV.Client.System.Framework;
|
||||||
|
using FFXIVClientStructs.FFXIV.Client.UI;
|
||||||
|
|
||||||
namespace Screenie;
|
namespace Screenie;
|
||||||
|
|
||||||
|
@ -16,6 +19,18 @@ internal class Command : IDisposable {
|
||||||
this.Plugin.CommandManager.RemoveHandler(CommandName);
|
this.Plugin.CommandManager.RemoveHandler(CommandName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static unsafe void SetUiVisibility(bool wantVisible) {
|
||||||
|
var atkModule = Framework.Instance()->GetUiModule()->GetRaptureAtkModule();
|
||||||
|
var hidden = atkModule->RaptureAtkUnitManager.Flags.HasFlag(RaptureAtkModuleFlags.UiHidden);
|
||||||
|
if (wantVisible && hidden) {
|
||||||
|
atkModule->SetUiVisibility(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!wantVisible && !hidden) {
|
||||||
|
atkModule->SetUiVisibility(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void OnCommand(string command, string arguments) {
|
private void OnCommand(string command, string arguments) {
|
||||||
// TODO: eventually be able to do like /screenie --no-ui --format png
|
// TODO: eventually be able to do like /screenie --no-ui --format png
|
||||||
// etc.
|
// etc.
|
||||||
|
@ -24,6 +39,27 @@ internal class Command : IDisposable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Plugin.SaveScreenshot();
|
unsafe {
|
||||||
|
var device = Device.Instance();
|
||||||
|
var oldWidth = device->Width;
|
||||||
|
var oldHeight = device->Height;
|
||||||
|
|
||||||
|
device->NewWidth = 3840;
|
||||||
|
device->NewHeight = 2160;
|
||||||
|
device->RequestResolutionChange = 1;
|
||||||
|
|
||||||
|
SetUiVisibility(false);
|
||||||
|
|
||||||
|
this.Plugin.Framework.RunOnTick(() => {
|
||||||
|
this.Plugin.SaveScreenshot();
|
||||||
|
|
||||||
|
this.Plugin.Framework.RunOnTick(() => {
|
||||||
|
SetUiVisibility(true);
|
||||||
|
device->NewWidth = oldWidth;
|
||||||
|
device->NewHeight = oldHeight;
|
||||||
|
device->RequestResolutionChange = 1;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue