feat: add opacity slider

This commit is contained in:
Anna
2022-01-15 16:07:44 -05:00
parent d669ba8db0
commit 2d7039deae
3 changed files with 23 additions and 1 deletions
+9
View File
@@ -96,6 +96,8 @@ internal sealed class ChatLog : IUiComponent {
- ImGui.GetStyle().ItemSpacing.Y * 4;
}
private unsafe ImGuiViewport* _lastViewport;
public unsafe void Draw() {
var flags = ImGuiWindowFlags.None;
if (!this.Ui.Plugin.Config.CanMove) {
@@ -110,11 +112,18 @@ internal sealed class ChatLog : IUiComponent {
flags |= ImGuiWindowFlags.NoTitleBar;
}
if (this._lastViewport == ImGuiHelpers.MainViewport.NativePtr) {
ImGui.SetNextWindowBgAlpha(this.Ui.Plugin.Config.WindowAlpha);
}
if (!ImGui.Begin($"{this.Ui.Plugin.Name}##chat", flags)) {
this._lastViewport = ImGui.GetWindowViewport().NativePtr;
ImGui.End();
return;
}
this._lastViewport = ImGui.GetWindowViewport().NativePtr;
var currentTab = this.Ui.Plugin.Config.SidebarTabView
? this.DrawTabSidebar()
: this.DrawTabBar();