Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
Added a custom title bar with language button
Browse files Browse the repository at this point in the history
  • Loading branch information
Nats-ji committed Jan 26, 2021
1 parent 0b73d00 commit 3f28f15
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mods/braindance_protocol/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ end)
registerForEvent("onDraw", function()
if drawWindow then
CPS.setThemeBegin()
drawWindow = ImGui.Begin(i18n("window_title"), true, ImGuiWindowFlags.NoResize)
CPS.styleBegin("WindowPadding", 5, 5)
drawWindow = ImGui.Begin(i18n("window_title"), true, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoTitleBar)
ImGui.SetWindowSize(400, 620)
ImGui.SetWindowPos(wWidth-600, wHeight/2-180, ImGuiCond.FirstUseEver)
if ImGui.Button(i18n("button_language")) then
ImGui.AlignTextToFramePadding()
ImGui.Text(i18n("window_title"))
ImGui.SameLine(390-ImGui.CalcTextSize(i18n("button_language")))
ImGui.Text(i18n("button_language"))
if ImGui.IsItemClicked() then
ImGui.OpenPopup("Language")
end
if ImGui.BeginPopup("Language") then
Expand All @@ -65,6 +70,8 @@ registerForEvent("onDraw", function()
end
ImGui.EndPopup()
end
local Childx, Childy = ImGui.GetContentRegionAvail()
ImGui.BeginChild("List", Childx+6, Childy)
for i in pairs(protocols.Parents) do
if i <= 2 then ImGui.SetNextItemOpen(true, ImGuiCond.FirstUseEver) end
CPS.colorBegin("Text" , color.white)
Expand Down Expand Up @@ -105,7 +112,9 @@ registerForEvent("onDraw", function()
ImGui.Unindent(3)
end
end
ImGui.EndChild()
ImGui.End()
CPS.styleEnd(1)
CPS.setThemeEnd()
end
end)
Expand Down

0 comments on commit 3f28f15

Please sign in to comment.