Skip to content

Commit

Permalink
update ImGui.
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Nov 15, 2023
1 parent 51f76f9 commit 5679f3e
Show file tree
Hide file tree
Showing 25 changed files with 3,197 additions and 1,606 deletions.
14 changes: 6 additions & 8 deletions Assets/Script/Dev/Entry.yue
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ footerWindow = threadLoop ->
SetNextWindowPos Vec2 0, height - 50
SetNextWindowBgAlpha 0.35
PushStyleVar "WindowPadding", Vec2(10, 0), -> Begin "Footer", windowFlags, ->
Dummy Vec2 width, 0
Dummy Vec2 width - 20, 0
if changed, showStats = Checkbox zh and "状态" or "Stats", showStats
config.showStats = showStats and 1 or 0
SameLine!
Expand Down Expand Up @@ -661,6 +661,8 @@ urlWindowFlags =
* "NoNav"
* "NoMove"
* "NoScrollWithMouse"
* "AlwaysAutoResize"
* "NoBringToFrontOnFocus"

webStatus = nil
descColor = Color 0xffa1a1a1
Expand All @@ -682,7 +684,6 @@ entryWindow = threadLoop ->
:width, :height = App.visualSize
SetNextWindowBgAlpha 0.5
SetNextWindowPos Vec2(width / 2, height / 2), "Always", Vec2 0.5, 0.5
SetNextWindowSize Vec2(200, 0), "Always"
Begin "Web IDE Connected", urlWindowFlags, ->
TextColored themeColor, "#{zh and '网页 IDE 已连接 ……' or 'Web IDE connected ...'}"
slogon = zh and 'Dorothy 启动!' or 'Dorothy Launch!'
Expand All @@ -694,7 +695,6 @@ entryWindow = threadLoop ->

SetNextWindowBgAlpha 0.85
SetNextWindowPos Vec2(5, height - 120), "Always", Vec2 0, 0
SetNextWindowSize Vec2(245, 0), "Always"
Begin "Web IDE", urlWindowFlags, ->
TextColored themeColor, "#{zh and '网页' or 'Web'} IDE"
url = webStatus?.url ?? zh and '不可用' or 'not available'
Expand All @@ -704,13 +704,11 @@ entryWindow = threadLoop ->
paddingX = math.max 10, fullWidth / 2 - width / 2 - 10
maxColumns = math.max math.floor(width / 200), 1
SetNextWindowPos Vec2.zero
SetNextWindowSize Vec2 fullWidth, 45
SetNextWindowBgAlpha 0.35
SetNextWindowBgAlpha 0
PushStyleVar "WindowPadding", Vec2(10, 0), ->
Begin "Dorothy Dev", windowFlags, ->
Dummy Vec2 fullWidth - 20, 5
Begin "Dorothy Dev", urlWindowFlags, ->
Dummy Vec2 fullWidth - 20, 2
TextColored themeColor, "DOROTHY SSR #{zh and '开发' or 'DEV'}"
Dummy Vec2 fullWidth, 0
SetNextWindowPos Vec2 0, 45
SetNextWindowSize Vec2 fullWidth, height - 95
PushStyleColor "WindowBg", Color(0x0), -> PushStyleVar "WindowPadding", Vec2(paddingX, 10), ->
Expand Down
31 changes: 15 additions & 16 deletions Assets/Script/Lib/Dora/en/ImGui.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,17 @@ local record ImGui
"NoBringToFrontOnFocus"
"AlwaysVerticalScrollbar"
"AlwaysHorizontalScrollbar"
end
enum ChildFlag
""
"Border"
"AlwaysUseWindowPadding"
"ResizeX"
"ResizeY"
"AutoResizeX"
"AutoResizeY"
"AlwaysAutoResize"
"FrameStyle"
end
enum SetCond
""
Expand Down Expand Up @@ -288,14 +298,14 @@ local record ImGui
BeginChild: function(
str_id: string,
size: Vec2,
border: boolean,
windowsFlags: {WindowFlag},
childFlags: {ChildFlag},
windowFlags: {WindowFlag},
inside: function()
)
BeginChild: function(
str_id: string,
size: Vec2,
border: boolean,
childFlags: {ChildFlag},
inside: function()
)
BeginChild: function(
Expand All @@ -310,14 +320,14 @@ local record ImGui
BeginChild: function(
id: integer,
size: Vec2,
border: boolean,
childFlags: {ChildFlag},
windowsFlags: {WindowFlag},
inside: function()
)
BeginChild: function(
id: integer,
size: Vec2,
border: boolean,
childFlags: {ChildFlag},
inside: function()
)
BeginChild: function(
Expand Down Expand Up @@ -437,17 +447,6 @@ local record ImGui
p_open: boolean,
inside: function()
): boolean
BeginChildFrame: function(
id: integer,
size: Vec2,
windowsFlags: {WindowFlag} --[[nil]],
inside: function()
)
BeginChildFrame: function(
id: integer,
size: Vec2,
inside: function()
)

PushStyleColor: function(name: StyleColor, color: Color, inside: function())
PushStyleVar: function(name: StyleVarNum, val: number, inside: function())
Expand Down
31 changes: 15 additions & 16 deletions Assets/Script/Lib/Dora/zh-Hans/ImGui.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,17 @@ local record ImGui
"NoBringToFrontOnFocus"
"AlwaysVerticalScrollbar"
"AlwaysHorizontalScrollbar"
end
enum ChildFlag
""
"Border"
"AlwaysUseWindowPadding"
"ResizeX"
"ResizeY"
"AutoResizeX"
"AutoResizeY"
"AlwaysAutoResize"
"FrameStyle"
end
enum SetCond
""
Expand Down Expand Up @@ -288,14 +298,14 @@ local record ImGui
BeginChild: function(
str_id: string,
size: Vec2,
border: boolean,
windowsFlags: {WindowFlag},
childFlags: {ChildFlag},
windowFlags: {WindowFlag},
inside: function()
)
BeginChild: function(
str_id: string,
size: Vec2,
border: boolean,
childFlags: {ChildFlag},
inside: function()
)
BeginChild: function(
Expand All @@ -310,14 +320,14 @@ local record ImGui
BeginChild: function(
id: integer,
size: Vec2,
border: boolean,
childFlags: {ChildFlag},
windowsFlags: {WindowFlag},
inside: function()
)
BeginChild: function(
id: integer,
size: Vec2,
border: boolean,
childFlags: {ChildFlag},
inside: function()
)
BeginChild: function(
Expand Down Expand Up @@ -437,17 +447,6 @@ local record ImGui
p_open: boolean,
inside: function()
): boolean
BeginChildFrame: function(
id: integer,
size: Vec2,
windowsFlags: {WindowFlag} --[[nil]],
inside: function()
)
BeginChildFrame: function(
id: integer,
size: Vec2,
inside: function()
)

PushStyleColor: function(name: StyleColor, color: Color, inside: function())
PushStyleVar: function(name: StyleVarNum, val: number, inside: function())
Expand Down
4 changes: 2 additions & 2 deletions Source/3rdParty/imgui/imconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@

//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.

//---- Disable all of Dear ImGui or don't implement standard windows/tools.
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowStackToolWindow() will be empty (this was called IMGUI_DISABLE_METRICS_WINDOW before 1.88).
//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowIDStackToolWindow() will be empty.

//---- Don't implement some functions to reduce linkage requirements.
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
Expand Down
Loading

0 comments on commit 5679f3e

Please sign in to comment.