From 1378c37df2be4aa7b6b635852fe4a8e8695c670a Mon Sep 17 00:00:00 2001 From: gucio321 Date: Sun, 25 Jul 2021 19:23:15 +0200 Subject: [PATCH] giu: change ianling/giu -> AllenDang/giu; fix build errors --- go.mod | 6 ++- go.sum | 19 +++++++ hsapp/app.go | 4 +- hsapp/menubar.go | 2 +- hsapp/setup.go | 7 +-- hscommon/editorwindow.go | 2 +- hscommon/main_menu_updater.go | 2 +- hscommon/renderable.go | 2 +- hscommon/textureloader.go | 2 +- hscommon/toolwindow.go | 2 +- hswidget/animdatawidget/state.go | 2 +- hswidget/animdatawidget/widget.go | 10 ++-- hswidget/cofwidget/state.go | 2 +- hswidget/cofwidget/widget.go | 7 ++- hswidget/custom_widgets.go | 8 +-- hswidget/dc6widget/state.go | 2 +- hswidget/dc6widget/widget.go | 10 ++-- hswidget/dccwidget/state.go | 2 +- hswidget/dccwidget/widget.go | 6 +-- hswidget/ds1widget/state.go | 2 +- hswidget/ds1widget/widget.go | 53 ++++++++----------- hswidget/dt1widget/state.go | 2 +- hswidget/dt1widget/tile_type_image.go | 2 +- .../tiletypeimage/tile_type_image.go | 2 +- hswidget/dt1widget/widget.go | 26 ++++----- hswidget/fonttablewidget/state.go | 2 +- hswidget/fonttablewidget/widget.go | 22 ++++---- hswidget/palettegrideditorwidget/state.go | 2 +- hswidget/palettegrideditorwidget/widget.go | 2 +- hswidget/palettegridwidget/state.go | 2 +- hswidget/palettegridwidget/widget.go | 4 +- .../palettemapwidget/palette_transform.go | 2 +- hswidget/palettemapwidget/state.go | 2 +- hswidget/palettemapwidget/widget.go | 9 ++-- hswidget/popupconfirm.go | 2 +- hswidget/selectpalettewidget/widget.go | 4 +- hswidget/stringtablewidget/state.go | 2 +- hswidget/stringtablewidget/widget.go | 16 +++--- hswindow/hsdialog/dialog.go | 2 +- .../hsdialog/hsaboutdialog/aboutdialog.go | 46 +++++++++------- .../hspreferencesdialog/preferencesdialog.go | 12 ++--- .../projectpropertiesdialog.go | 18 +++---- hswindow/hseditor/editor.go | 2 +- .../hsanimdataeditor/animation_data_editor.go | 2 +- hswindow/hseditor/hscofeditor/cof_editor.go | 2 +- hswindow/hseditor/hsdc6editor/dc6_editor.go | 2 +- hswindow/hseditor/hsdcceditor/dcc_editor.go | 2 +- hswindow/hseditor/hsds1editor/ds1_editor.go | 2 +- hswindow/hseditor/hsdt1editor/dt1_editor.go | 2 +- hswindow/hseditor/hsfonteditor/fonteditor.go | 8 +-- .../hsfonttableeditor/font_table_editor.go | 2 +- .../hspaletteeditor/palette_editor.go | 2 +- .../hspalettemapeditor/palette_map_editor.go | 2 +- .../hseditor/hssoundeditor/soundeditor.go | 2 +- .../string_table_editor.go | 2 +- hswindow/hseditor/hstexteditor/texteditor.go | 10 ++-- hswindow/hstoolwindow/hsconsole/console.go | 10 ++-- .../hstoolwindow/hsmpqexplorer/mpqexplorer.go | 6 +-- .../hsprojectexplorer/projectexplorer.go | 10 ++-- hswindow/window.go | 2 +- 60 files changed, 209 insertions(+), 194 deletions(-) diff --git a/go.mod b/go.mod index 62fcb8f9..3022b76a 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,14 @@ module github.com/OpenDiablo2/HellSpawner go 1.16 require ( + github.com/AllenDang/giu v0.5.6-0.20210730102924-9c164998fd21 + github.com/AllenDang/imgui-go v1.12.1-0.20210730064543-c33ee0f359ce github.com/OpenDiablo2/OpenDiablo2 v0.0.0-20210514222603-a688d660a0f7 github.com/OpenDiablo2/dialog v0.0.0-20201230220514-26162241209f github.com/TheTitanrain/w32 v0.0.0-20200114052255-2654d97dbd3d // indirect github.com/enriquebris/goconcurrentqueue v0.6.0 github.com/faiface/beep v1.0.2 - github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb + github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be github.com/go-resty/resty/v2 v2.6.0 // indirect github.com/gravestench/osinfo v0.0.0-20210525170338-34eb1ac010f7 github.com/hajimehoshi/oto v0.7.1 // indirect @@ -23,7 +25,7 @@ require ( github.com/russross/blackfriday v1.6.0 github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect golang.org/x/exp v0.0.0-20210526181343-b47a03e3048a // indirect - golang.org/x/image v0.0.0-20210504121937-7319ad40d33e // indirect + golang.org/x/image v0.0.0-20210504121937-7319ad40d33e golang.org/x/mobile v0.0.0-20210527171505-7e972142eb43 // indirect golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b // indirect diff --git a/go.sum b/go.sum index 595c75b9..a06b26e4 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,19 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/AllenDang/giu v0.5.4 h1:OuSgcTZYH9buug1yWsJAvUr57aQwiJK7hjk+JYtv4tM= +github.com/AllenDang/giu v0.5.4/go.mod h1:1CyOLkJREGGWFVx+p2z5+1KMhY3H7Zbl8gQ/huzThsI= +github.com/AllenDang/giu v0.5.5-0.20210721024449-fe0ecd71ecfc h1:uPmPkLBQn8RJOnSBKtLUOmo4KncGrizxNRu10melUNE= +github.com/AllenDang/giu v0.5.5-0.20210721024449-fe0ecd71ecfc/go.mod h1:KD5FYC1xLfIZCT/zvv/9IVeB6nP/nxIyFT4Mr1jTP9Y= +github.com/AllenDang/giu v0.5.6-0.20210730102924-9c164998fd21 h1:iV42A2Tz2mjpSxB8b1B5FERppLSjFjJa7cJA3hLioq4= +github.com/AllenDang/giu v0.5.6-0.20210730102924-9c164998fd21/go.mod h1:sowdXWQy74aTDOtrM2u/NMlis5j7xjtHcrbc+IkrmwU= +github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8 h1:dKZMqib/yUDoCFigmz2agG8geZ/e3iRq304/KJXqKyw= +github.com/AllenDang/go-findfont v0.0.0-20200702051237-9f180485aeb8/go.mod h1:b4uuDd0s6KRIPa84cEEchdQ9ICh7K0OryZHbSzMca9k= +github.com/AllenDang/imgui-go v1.12.1-0.20210509113325-c0e4c78e7a88 h1:dXpshnNwPl+QjFOiJNFlQrtOz1oA565EO9FUseKvlhU= +github.com/AllenDang/imgui-go v1.12.1-0.20210509113325-c0e4c78e7a88/go.mod h1:+pYwstqlGGlU2lI1FREPlVAKP2nwV+bNhAlMrbQynhQ= +github.com/AllenDang/imgui-go v1.12.1-0.20210705114549-6427330995d6 h1:fuI1UbQPfEDF1LwGH97otFeb+9ni8sXcbDpxmAxQCkY= +github.com/AllenDang/imgui-go v1.12.1-0.20210705114549-6427330995d6/go.mod h1:+pYwstqlGGlU2lI1FREPlVAKP2nwV+bNhAlMrbQynhQ= +github.com/AllenDang/imgui-go v1.12.1-0.20210730064543-c33ee0f359ce h1:/7+xVnxn5sTeKHy78zFsMxG/n7duZ28b5woDlIB0Dnk= +github.com/AllenDang/imgui-go v1.12.1-0.20210730064543-c33ee0f359ce/go.mod h1:+pYwstqlGGlU2lI1FREPlVAKP2nwV+bNhAlMrbQynhQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/JoshVarga/blast v0.0.0-20180421040937-681c804fb9f0 h1:tDnuU0igiBiQFjsvq1Bi7DpoUjqI76VVvW045vpeFeM= @@ -31,6 +45,8 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb h1:T6gaWBvRzJjuOrdCtg8fXXjKai2xSDqWTcKFUPuw8Tw= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be h1:vEIVIuBApEBQTEJt19GfhoU+zFSV+sNTa9E9FdnRYfk= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-restruct/restruct v1.2.0-alpha h1:2Lp474S/9660+SJjpVxoKuWX09JsXHSrdV7Nv3/gkvc= github.com/go-restruct/restruct v1.2.0-alpha/go.mod h1:KqrpKpn4M8OLznErihXTGLlsXFGeLxHUrLRRI/1YjGk= github.com/go-resty/resty/v2 v2.3.0/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= @@ -77,6 +93,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08/go.mod h1:NXg0ArsFk0Y01623LgUqoqcouGDB+PwCCQlrwrG6xJ4= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -105,6 +122,8 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.21.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM= github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= +github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= +github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo= github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM= diff --git a/hsapp/app.go b/hsapp/app.go index 1c1df836..0615411d 100644 --- a/hsapp/app.go +++ b/hsapp/app.go @@ -8,8 +8,8 @@ import ( "sync" "time" - g "github.com/ianling/giu" - "github.com/ianling/imgui-go" + g "github.com/AllenDang/giu" + "github.com/AllenDang/imgui-go" "github.com/OpenDiablo2/dialog" "github.com/go-gl/glfw/v3.3/glfw" diff --git a/hsapp/menubar.go b/hsapp/menubar.go index 4a9441a4..4e89b8f8 100644 --- a/hsapp/menubar.go +++ b/hsapp/menubar.go @@ -8,9 +8,9 @@ import ( "runtime" "strings" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" "github.com/gravestench/osinfo" - g "github.com/ianling/giu" "github.com/pkg/browser" "github.com/OpenDiablo2/HellSpawner/hscommon" diff --git a/hsapp/setup.go b/hsapp/setup.go index a9511af4..2df6c94f 100644 --- a/hsapp/setup.go +++ b/hsapp/setup.go @@ -12,8 +12,8 @@ import ( "github.com/faiface/beep" "github.com/faiface/beep/speaker" - g "github.com/ianling/giu" - "github.com/ianling/imgui-go" + g "github.com/AllenDang/giu" + "github.com/AllenDang/imgui-go" "github.com/OpenDiablo2/HellSpawner/hswindow/hseditor/hsds1editor" "github.com/OpenDiablo2/HellSpawner/hswindow/hseditor/hsdt1editor" @@ -77,7 +77,8 @@ func (a *App) setup() (err error) { } func (a *App) setupMasterWindow() { - a.masterWindow = g.NewMasterWindow(baseWindowTitle, baseWindowW, baseWindowH, 0, a.setupFonts) + a.masterWindow = g.NewMasterWindow(baseWindowTitle, baseWindowW, baseWindowH, 0) + a.setupFonts() bgColor := a.determineBackgroundColor() a.masterWindow.SetBgColor(bgColor) diff --git a/hscommon/editorwindow.go b/hscommon/editorwindow.go index 0150a90e..48f644a4 100644 --- a/hscommon/editorwindow.go +++ b/hscommon/editorwindow.go @@ -1,7 +1,7 @@ package hscommon import ( - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsstate" ) diff --git a/hscommon/main_menu_updater.go b/hscommon/main_menu_updater.go index 3b95c38b..4385afcf 100644 --- a/hscommon/main_menu_updater.go +++ b/hscommon/main_menu_updater.go @@ -1,6 +1,6 @@ package hscommon -import "github.com/ianling/giu" +import "github.com/AllenDang/giu" // MainMenuUpdater represents main menu updater type MainMenuUpdater interface { diff --git a/hscommon/renderable.go b/hscommon/renderable.go index 53b271a6..42da9cbd 100644 --- a/hscommon/renderable.go +++ b/hscommon/renderable.go @@ -1,6 +1,6 @@ package hscommon -import "github.com/ianling/giu" +import "github.com/AllenDang/giu" // Renderable represents renderable objects type Renderable interface { diff --git a/hscommon/textureloader.go b/hscommon/textureloader.go index d3f2f6d0..444ba01e 100644 --- a/hscommon/textureloader.go +++ b/hscommon/textureloader.go @@ -12,7 +12,7 @@ import ( "github.com/enriquebris/goconcurrentqueue" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" ) // TextureLoadRequestItem represents texture request item diff --git a/hscommon/toolwindow.go b/hscommon/toolwindow.go index 53d5c22e..ded0e27e 100644 --- a/hscommon/toolwindow.go +++ b/hscommon/toolwindow.go @@ -1,7 +1,7 @@ package hscommon import ( - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsstate" ) diff --git a/hswidget/animdatawidget/state.go b/hswidget/animdatawidget/state.go index 5d57f884..e23c9eb7 100644 --- a/hswidget/animdatawidget/state.go +++ b/hswidget/animdatawidget/state.go @@ -4,7 +4,7 @@ import ( "fmt" "sort" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hsassets" ) diff --git a/hswidget/animdatawidget/widget.go b/hswidget/animdatawidget/widget.go index 34e91d1b..1666620c 100644 --- a/hswidget/animdatawidget/widget.go +++ b/hswidget/animdatawidget/widget.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2animdata" @@ -100,7 +100,7 @@ func (p *widget) buildAnimationsList() { giu.Layout{ p.makeSearchLayout(), giu.Separator(), - giu.Child("##"+p.id+"keyList").Border(false). + giu.Child().Border(false). Size(listW, listH). Layout(giu.Layout{ giu.Custom(func() { @@ -157,13 +157,13 @@ func (p *widget) buildViewRecordLayout() { }), giu.Row( giu.Label("Frames per direction: "), - giu.InputInt("##"+p.id+"recordFramesPerDirection", &fpd).Size(inputIntW).OnChange(func() { + giu.InputInt(&fpd).Size(inputIntW).OnChange(func() { record.SetFramesPerDirection(uint32(fpd)) }), ), giu.Row( giu.Label("Speed: "), - giu.InputInt("##"+p.id+"recordSpeed", &speed).Size(inputIntW).OnChange(func() { + giu.InputInt(&speed).Size(inputIntW).OnChange(func() { record.SetSpeed(uint16(speed)) }), ), @@ -208,7 +208,7 @@ func (p *widget) makeSearchLayout() giu.Layout { return giu.Layout{ giu.Label("Search or type new entry name:"), - giu.InputText("##"+p.id+"newEntryName", &state.Name).Size(listW).OnChange(func() { + giu.InputText(&state.Name).Size(listW).OnChange(func() { // formatting state.Name = strings.ToUpper(state.Name) state.Name = strings.ReplaceAll(state.Name, " ", "") diff --git a/hswidget/cofwidget/state.go b/hswidget/cofwidget/state.go index e114a4cf..0f4d7e28 100644 --- a/hswidget/cofwidget/state.go +++ b/hswidget/cofwidget/state.go @@ -3,7 +3,7 @@ package cofwidget import ( "fmt" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2cof" diff --git a/hswidget/cofwidget/widget.go b/hswidget/cofwidget/widget.go index 445420d9..cc4f42b8 100644 --- a/hswidget/cofwidget/widget.go +++ b/hswidget/cofwidget/widget.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2cof" @@ -76,11 +76,11 @@ func (p *widget) makeViewerLayout() giu.Layout { state := p.getState() return giu.Layout{ - giu.TabBar("COFViewerTabs").Layout(giu.Layout{ + giu.TabBar().TabItems( giu.TabItem("Animation").Layout(p.makeAnimationTab(state)), giu.TabItem("Layer").Layout(p.makeLayerTab(state)), giu.TabItem("Priority").Layout(p.makePriorityTab(state)), - }), + ), } } @@ -109,7 +109,6 @@ func (p *widget) makeAnimationTab(state *widgetState) giu.Layout { speedLabel := giu.Label(strSpeed) speedInput := hswidget.MakeInputInt( - "##"+p.id+"CovViewerSpeedValue", speedInputW, &p.cof.Speed, setSpeed, diff --git a/hswidget/custom_widgets.go b/hswidget/custom_widgets.go index a9cba32e..54ee6a3e 100644 --- a/hswidget/custom_widgets.go +++ b/hswidget/custom_widgets.go @@ -4,8 +4,8 @@ import ( "fmt" "math" - "github.com/ianling/giu" - "github.com/ianling/imgui-go" + "github.com/AllenDang/giu" + "github.com/AllenDang/imgui-go" "github.com/OpenDiablo2/HellSpawner/hsassets" "github.com/OpenDiablo2/HellSpawner/hscommon" @@ -167,7 +167,7 @@ func SetByteToInt(input int32, output *byte) { // MakeInputInt creates input intager using POINTER given // additionally, for byte checks, if value smaller than 255 -func MakeInputInt(id string, width int32, output interface{}, optionalCB func()) *giu.InputIntWidget { +func MakeInputInt(width int32, output interface{}, optionalCB func()) *giu.InputIntWidget { var input int32 switch o := output.(type) { case *byte: @@ -178,7 +178,7 @@ func MakeInputInt(id string, width int32, output interface{}, optionalCB func()) panic(fmt.Sprintf("MakeInputInt: invalid value type %T given", o)) } - return giu.InputInt(id, &input).Size(float32(width)).OnChange(func() { + return giu.InputInt(&input).Size(float32(width)).OnChange(func() { switch o := output.(type) { case *byte: SetByteToInt(input, o) diff --git a/hswidget/dc6widget/state.go b/hswidget/dc6widget/state.go index 27b64608..bd4f49ab 100644 --- a/hswidget/dc6widget/state.go +++ b/hswidget/dc6widget/state.go @@ -7,7 +7,7 @@ import ( "log" "time" - "github.com/ianling/giu" + "github.com/AllenDang/giu" gim "github.com/ozankasikci/go-image-merge" "github.com/OpenDiablo2/HellSpawner/hscommon/hsutil" diff --git a/hswidget/dc6widget/widget.go b/hswidget/dc6widget/widget.go index 18ab41e8..4a4e862c 100644 --- a/hswidget/dc6widget/widget.go +++ b/hswidget/dc6widget/widget.go @@ -6,9 +6,9 @@ import ( "log" "time" + "github.com/AllenDang/giu" + "github.com/AllenDang/imgui-go" "github.com/OpenDiablo2/dialog" - "github.com/ianling/giu" - "github.com/ianling/imgui-go" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2dc6" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface" @@ -156,7 +156,7 @@ func (p *widget) makePlayerLayout(state *widgetState) giu.Layout { giu.Combo("##"+p.id+"PlayModeList", playModeList[state.PlayMode], playModeList, &pm).OnChange(func() { state.PlayMode = animationPlayMode(pm) }).Size(comboW), - giu.InputInt("Tick time##"+p.id+"PlayTickTime", &state.TickTime).Size(inputIntW).OnChange(func() { + giu.InputInt(&state.TickTime).Label("Tick time").Size(inputIntW).OnChange(func() { state.ticker.Reset(time.Second * time.Duration(state.TickTime) / miliseconds) }), hswidget.PlayPauseButton("##"+p.id+"PlayPauseAnimation", &state.IsPlaying, p.textureLoader). @@ -175,10 +175,10 @@ func (p *widget) makeTiledViewLayout(state *widgetState) giu.Layout { return giu.Layout{ giu.Row( giu.Label("Tiled view:"), - giu.InputInt("Width##"+p.id+"tiledWidth", &state.Width).Size(inputIntW).OnChange(func() { + giu.InputInt(&state.Width).Label("Width").Size(inputIntW).OnChange(func() { p.recalculateTiledViewHeight(state) }), - giu.InputInt("Height##"+p.id+"tiledHeight", &state.Height).Size(inputIntW).OnChange(func() { + giu.InputInt(&state.Height).Label("Height").Size(inputIntW).OnChange(func() { p.recalculateTiledViewWidth(state) }), ), diff --git a/hswidget/dccwidget/state.go b/hswidget/dccwidget/state.go index 385eaefb..1370841e 100644 --- a/hswidget/dccwidget/state.go +++ b/hswidget/dccwidget/state.go @@ -6,7 +6,7 @@ import ( "image/color" "time" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsutil" ) diff --git a/hswidget/dccwidget/widget.go b/hswidget/dccwidget/widget.go index 6c209561..0c59472c 100644 --- a/hswidget/dccwidget/widget.go +++ b/hswidget/dccwidget/widget.go @@ -6,9 +6,9 @@ import ( "log" "time" + "github.com/AllenDang/giu" + "github.com/AllenDang/imgui-go" "github.com/OpenDiablo2/dialog" - "github.com/ianling/giu" - "github.com/ianling/imgui-go" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2dcc" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface" @@ -138,7 +138,7 @@ func (p *widget) makePlayerLayout(state *widgetState) giu.Layout { giu.Combo("##"+p.id+"PlayModeList", playModeList[state.PlayMode], playModeList, &pm).OnChange(func() { state.PlayMode = animationPlayMode(pm) }).Size(comboW), - giu.InputInt("Tick time##"+p.id+"PlayTickTime", &state.TickTime).Size(inputIntW).OnChange(func() { + giu.InputInt(&state.TickTime).Label("Tick time").Size(inputIntW).OnChange(func() { state.ticker.Reset(time.Second * time.Duration(state.TickTime) / miliseconds) }), hswidget.PlayPauseButton("##"+p.id+"PlayPauseAnimation", &state.IsPlaying, p.textureLoader). diff --git a/hswidget/ds1widget/state.go b/hswidget/ds1widget/state.go index 8e799cea..c011d84b 100644 --- a/hswidget/ds1widget/state.go +++ b/hswidget/ds1widget/state.go @@ -3,7 +3,7 @@ package ds1widget import ( "fmt" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hsassets" "github.com/OpenDiablo2/HellSpawner/hswidget" diff --git a/hswidget/ds1widget/widget.go b/hswidget/ds1widget/widget.go index a49914ba..d505c5ca 100644 --- a/hswidget/ds1widget/widget.go +++ b/hswidget/ds1widget/widget.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2math/d2vector" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2path" @@ -81,7 +81,7 @@ func (p *widget) Build() { func (p *widget) makeViewerLayout() giu.Layout { state := p.getState() - tabs := giu.Layout{ + tabs := []*giu.TabItemWidget{ giu.TabItem("Files").Layout(p.makeFilesLayout()), giu.TabItem("Objects").Layout(p.makeObjectsLayout(state)), giu.TabItem("Tiles").Layout(p.makeTilesTabLayout(state)), @@ -94,7 +94,7 @@ func (p *widget) makeViewerLayout() giu.Layout { return giu.Layout{ p.makeDataLayout(), giu.Separator(), - giu.TabBar("##TabBar_ds1_" + p.id).Layout(tabs), + giu.TabBar().TabItems(tabs...), } } @@ -109,7 +109,7 @@ func (p *widget) makeDataLayout() giu.Layout { l := giu.Layout{ giu.Row( giu.Label("Version: "), - giu.InputInt("##"+p.id+"version", &version).Size(inputIntW).OnChange(func() { + giu.InputInt(&version).Size(inputIntW).OnChange(func() { state.confirmDialog = hswidget.NewPopUpConfirmDialog( "##"+p.id+"confirmVersionChange", "Are you sure, you want to change DS1 Version?", @@ -132,7 +132,7 @@ func (p *widget) makeDataLayout() giu.Layout { giu.Label("Size:"), giu.Row( giu.Label("\tWidth: "), - giu.InputInt("##"+p.id+"width", &w).Size(inputIntW).OnChange(func() { + giu.InputInt(&w).Size(inputIntW).OnChange(func() { state.confirmDialog = hswidget.NewPopUpConfirmDialog( "##"+p.id+"confirmWidthChange", "Are you really sure, you want to change size of DS1 tiles?", @@ -151,7 +151,7 @@ func (p *widget) makeDataLayout() giu.Layout { ), giu.Row( giu.Label("\tHeight: "), - giu.InputInt("##"+p.id+"height", &h).Size(inputIntW).OnChange(func() { + giu.InputInt(&h).Size(inputIntW).OnChange(func() { state.confirmDialog = hswidget.NewPopUpConfirmDialog( "##"+p.id+"confirmWidthChange", "Are you really sure, you want to change size of DS1 tiles?", @@ -221,7 +221,7 @@ func (p *widget) makeAddFileLayout() giu.Layout { return giu.Layout{ giu.Label("File path:"), - giu.InputText("##"+p.id+"newFilePath", &state.NewFilePath).Size(filePathW), + giu.InputText(&state.NewFilePath).Size(filePathW), giu.Separator(), giu.Row( giu.Button("Add##"+p.id+"addFileAdd").Size(saveCancelButtonW, saveCancelButtonH).OnClick(func() { @@ -298,7 +298,6 @@ func (p *widget) makeObjectLayout(state *widgetState) giu.Layout { giu.Row( giu.Label("Type: "), hswidget.MakeInputInt( - "##"+p.id+"objType", inputIntW, &obj.Type, nil, @@ -307,7 +306,6 @@ func (p *widget) makeObjectLayout(state *widgetState) giu.Layout { giu.Row( giu.Label("ID: "), hswidget.MakeInputInt( - "##"+p.id+"objID", inputIntW, &obj.ID, nil, @@ -317,7 +315,6 @@ func (p *widget) makeObjectLayout(state *widgetState) giu.Layout { giu.Row( giu.Label("\tX: "), hswidget.MakeInputInt( - "##"+p.id+"objX", inputIntW, &obj.X, nil, @@ -326,7 +323,6 @@ func (p *widget) makeObjectLayout(state *widgetState) giu.Layout { giu.Row( giu.Label("\tY: "), hswidget.MakeInputInt( - "##"+p.id+"objY", inputIntW, &obj.Y, nil, @@ -335,7 +331,6 @@ func (p *widget) makeObjectLayout(state *widgetState) giu.Layout { giu.Row( giu.Label("Flags: 0x"), hswidget.MakeInputInt( - "##"+p.id+"objFlags", inputIntW, &obj.Flags, nil, @@ -359,23 +354,23 @@ func (p *widget) makeAddObjectLayout() giu.Layout { return giu.Layout{ giu.Row( giu.Label("Type: "), - giu.InputInt("##"+p.id+"AddObjectType", &state.addObjectState.ObjType).Size(inputIntW), + giu.InputInt(&state.addObjectState.ObjType).Size(inputIntW), ), giu.Row( giu.Label("ID: "), - giu.InputInt("##"+p.id+"AddObjectID", &state.addObjectState.ObjID).Size(inputIntW), + giu.InputInt(&state.addObjectState.ObjID).Size(inputIntW), ), giu.Row( giu.Label("X: "), - giu.InputInt("##"+p.id+"AddObjectX", &state.addObjectState.ObjX).Size(inputIntW), + giu.InputInt(&state.addObjectState.ObjX).Size(inputIntW), ), giu.Row( giu.Label("Y: "), - giu.InputInt("##"+p.id+"AddObjectY", &state.addObjectState.ObjY).Size(inputIntW), + giu.InputInt(&state.addObjectState.ObjY).Size(inputIntW), ), giu.Row( giu.Label("Flags: "), - giu.InputInt("##"+p.id+"AddObjectFlags", &state.addObjectState.ObjFlags).Size(inputIntW), + giu.InputInt(&state.addObjectState.ObjFlags).Size(inputIntW), ), giu.Separator(), giu.Row( @@ -432,7 +427,7 @@ func (p *widget) makePathLayout(state *widgetState, obj *d2ds1.Object) giu.Layou return giu.Layout{ giu.Label("Path Points:"), - giu.Table("").FastMode(true).Rows(rowWidgets...), + giu.Table().FastMode(true).Rows(rowWidgets...), } } @@ -473,12 +468,12 @@ func (p *widget) makeTilesTabLayout(state *widgetState) giu.Layout { l, giu.SliderInt("Tile X", &state.ds1Controls.TileX, 0, int32(p.ds1.Width()-1)), giu.SliderInt("Tile Y", &state.ds1Controls.TileY, 0, int32(p.ds1.Height()-1)), - giu.TabBar("##TabBar_ds1_tiles"+p.id).Layout(giu.Layout{ + giu.TabBar().TabItems( p.makeTilesGroupLayout(state, tx, ty, d2ds1.FloorLayerGroup), p.makeTilesGroupLayout(state, tx, ty, d2ds1.WallLayerGroup), p.makeTilesGroupLayout(state, tx, ty, d2ds1.ShadowLayerGroup), p.makeTilesGroupLayout(state, tx, ty, d2ds1.SubstitutionLayerGroup), - }), + ), ) return l @@ -486,7 +481,7 @@ func (p *widget) makeTilesTabLayout(state *widgetState) giu.Layout { // makeTilesGroupLayout creates a tileS group layout // used in makeTilesTabLayout -func (p *widget) makeTilesGroupLayout(state *widgetState, x, y int, t d2ds1.LayerGroupType) giu.Layout { +func (p *widget) makeTilesGroupLayout(state *widgetState, x, y int, t d2ds1.LayerGroupType) *giu.TabItemWidget { l := giu.Layout{} group := p.ds1.GetLayersGroup(t) numRecords := len(*group) @@ -552,7 +547,7 @@ func (p *widget) makeTilesGroupLayout(state *widgetState, x, y int, t d2ds1.Laye l = append(l, p.makeTileLayout((*group)[*recordIdx].Tile(x, y), t)) } - return giu.Layout{giu.TabItem(t.String()).Layout(giu.Layout{ + return giu.TabItem(t.String()).Layout(giu.Layout{ l, giu.Separator(), giu.Custom(func() { @@ -565,7 +560,7 @@ func (p *widget) makeTilesGroupLayout(state *widgetState, x, y int, t d2ds1.Laye } giu.Row(l...).Build() }), - })} + }) } // makeTileLayout creates a single tile's layout @@ -577,7 +572,7 @@ func (p *widget) makeTileLayout(record *d2ds1.Tile, t d2ds1.LayerGroupType) giu. return giu.Layout{ giu.Row( giu.Label("Substitute value: "), - giu.InputInt("##"+p.id+"subUnknown", &unknown32).Size(inputIntW).OnChange(func() { + giu.InputInt(&unknown32).Size(inputIntW).OnChange(func() { record.Substitution = uint32(unknown32) }), ), @@ -589,7 +584,6 @@ func (p *widget) makeTileLayout(record *d2ds1.Tile, t d2ds1.LayerGroupType) giu. giu.Row( giu.Label("Prop1: "), hswidget.MakeInputInt( - "##"+p.id+"floorProp1", inputIntW, &record.Prop1, nil, @@ -598,7 +592,6 @@ func (p *widget) makeTileLayout(record *d2ds1.Tile, t d2ds1.LayerGroupType) giu. giu.Row( giu.Label("Sequence: "), hswidget.MakeInputInt( - "##"+p.id+"floorSequence", inputIntW, &record.Sequence, nil, @@ -607,7 +600,6 @@ func (p *widget) makeTileLayout(record *d2ds1.Tile, t d2ds1.LayerGroupType) giu. giu.Row( giu.Label("Unknown1: "), hswidget.MakeInputInt( - "##"+p.id+"floorUnknown1", inputIntW, &record.Unknown1, nil, @@ -616,7 +608,6 @@ func (p *widget) makeTileLayout(record *d2ds1.Tile, t d2ds1.LayerGroupType) giu. giu.Row( giu.Label("Style: "), hswidget.MakeInputInt( - "##"+p.id+"floorStyle", inputIntW, &record.Style, nil, @@ -625,7 +616,6 @@ func (p *widget) makeTileLayout(record *d2ds1.Tile, t d2ds1.LayerGroupType) giu. giu.Row( giu.Label("Unknown2: "), hswidget.MakeInputInt( - "##"+p.id+"floorUnknown2", inputIntW, &record.Unknown2, nil, @@ -652,7 +642,6 @@ func (p *widget) makeTileLayout(record *d2ds1.Tile, t d2ds1.LayerGroupType) giu. giu.Row( giu.Label("Zero: "), hswidget.MakeInputInt( - "##"+p.id+"wallZero", inputIntW, &record.Zero, nil, @@ -729,11 +718,11 @@ func (p *widget) makeAddPathLayout() giu.Layout { giu.Label("Vector:"), giu.Row( giu.Label("\tX: "), - giu.InputInt("##"+p.id+"newPathX", &state.addPathState.PathX).Size(inputIntW), + giu.InputInt(&state.addPathState.PathX).Size(inputIntW), ), giu.Row( giu.Label("\tY: "), - giu.InputInt("##"+p.id+"newPathY", &state.addPathState.PathY).Size(inputIntW), + giu.InputInt(&state.addPathState.PathY).Size(inputIntW), ), giu.Separator(), giu.Row( diff --git a/hswidget/dt1widget/state.go b/hswidget/dt1widget/state.go index 4c25887f..1ca19061 100644 --- a/hswidget/dt1widget/state.go +++ b/hswidget/dt1widget/state.go @@ -3,7 +3,7 @@ package dt1widget import ( "fmt" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2dt1" ) diff --git a/hswidget/dt1widget/tile_type_image.go b/hswidget/dt1widget/tile_type_image.go index 8a7edc33..eda61fc4 100644 --- a/hswidget/dt1widget/tile_type_image.go +++ b/hswidget/dt1widget/tile_type_image.go @@ -1,7 +1,7 @@ package dt1widget import ( - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hswidget/dt1widget/tiletypeimage" diff --git a/hswidget/dt1widget/tiletypeimage/tile_type_image.go b/hswidget/dt1widget/tiletypeimage/tile_type_image.go index afbd28fa..0c6d05d2 100644 --- a/hswidget/dt1widget/tiletypeimage/tile_type_image.go +++ b/hswidget/dt1widget/tiletypeimage/tile_type_image.go @@ -6,7 +6,7 @@ import ( "golang.org/x/image/colornames" - "github.com/ianling/giu" + "github.com/AllenDang/giu" ) const ( diff --git a/hswidget/dt1widget/widget.go b/hswidget/dt1widget/widget.go index 0f988f3c..7231d5ef 100644 --- a/hswidget/dt1widget/widget.go +++ b/hswidget/dt1widget/widget.go @@ -11,7 +11,7 @@ import ( "golang.org/x/image/colornames" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2dt1" @@ -101,11 +101,11 @@ func (p *widget) Build() { giu.Separator(), p.makeTileDisplay(state, tile), giu.Separator(), - giu.TabBar("##TabBar_dt1_" + p.id).Layout(giu.Layout{ + giu.TabBar().TabItems( giu.TabItem("Info").Layout(p.makeTileInfoTab(tile)), giu.TabItem("Material").Layout(p.makeMaterialTab(tile)), giu.TabItem("Subtile Flags").Layout(p.makeSubtileFlags(state, tile)), - }), + ), }.Build() } @@ -457,7 +457,7 @@ func (p *widget) makeTileInfoTab(tile *d2dt1.Tile) giu.Layout { tileTypeInfo := giu.Layout{ giu.Row( giu.Label("Type: "), - giu.InputInt("##"+p.id+"tileTypeInt", &tile.Type).Size(inputIntW), + giu.InputInt(&tile.Type).Size(inputIntW), giu.Combo("##"+p.id+"tileTypeList", tileTypeList[tileTypeIdx], tileTypeList, &tile.Type), ), } @@ -477,11 +477,11 @@ func (p *widget) makeTileInfoTab(tile *d2dt1.Tile) giu.Layout { return giu.Layout{ giu.Row( - giu.InputInt("##"+p.id+"inputWidth", &w).Size(inputIntW).OnChange(func() { + giu.InputInt(&w).Size(inputIntW).OnChange(func() { tile.Width = w }), giu.Label(" x "), - giu.InputInt("##"+p.id+"winputHeight", &h).Size(inputIntW).OnChange(func() { + giu.InputInt(&h).Size(inputIntW).OnChange(func() { tile.Height = h }), giu.Label("pixels"), @@ -490,13 +490,13 @@ func (p *widget) makeTileInfoTab(tile *d2dt1.Tile) giu.Layout { giu.Row( giu.Label("Direction: "), - giu.InputInt("##"+p.id+"tileDirection", &tile.Direction).Size(inputIntW), + giu.InputInt(&tile.Direction).Size(inputIntW), ), spacer, giu.Row( giu.Label("RoofHeight:"), - giu.InputInt("##"+p.id+"roofHeight", &roofHeight).Size(inputIntW).OnChange(func() { + giu.InputInt(&roofHeight).Size(inputIntW).OnChange(func() { tile.RoofHeight = int16(roofHeight) }), ), @@ -508,19 +508,19 @@ func (p *widget) makeTileInfoTab(tile *d2dt1.Tile) giu.Layout { giu.Row( giu.Label("Style:"), - giu.InputInt("##"+p.id+"style", &tile.Style).Size(inputIntW), + giu.InputInt(&tile.Style).Size(inputIntW), ), spacer, giu.Row( giu.Label("Sequence:"), - giu.InputInt("##"+p.id+"sequence", &tile.Sequence).Size(inputIntW), + giu.InputInt(&tile.Sequence).Size(inputIntW), ), spacer, giu.Row( giu.Label("RarityFrameIndex:"), - giu.InputInt("##"+p.id+"rarityFrameIndex", &tile.RarityFrameIndex).Size(inputIntW), + giu.InputInt(&tile.RarityFrameIndex).Size(inputIntW), ), } } @@ -528,7 +528,7 @@ func (p *widget) makeTileInfoTab(tile *d2dt1.Tile) giu.Layout { func (p *widget) makeMaterialTab(tile *d2dt1.Tile) giu.Layout { return giu.Layout{ giu.Label("Material Flags"), - giu.Table("##"+p.id+"materialFlags").FastMode(true). + giu.Table().FastMode(true). Rows(giu.TableRow( giu.Checkbox("Other", &tile.MaterialFlags.Other), giu.Checkbox("Water", &tile.MaterialFlags.Water), @@ -638,7 +638,7 @@ func (p *widget) makeSubTilePreview(tile *d2dt1.Tile, state *widgetState) giu.La if hasFlag { const circleRadius = 3 // px - canvas.AddCircle(flagPoint, circleRadius, col, 1) + canvas.AddCircle(flagPoint, circleRadius, col, 1, 1) } } diff --git a/hswidget/fonttablewidget/state.go b/hswidget/fonttablewidget/state.go index 23c7c4ed..75d73431 100644 --- a/hswidget/fonttablewidget/state.go +++ b/hswidget/fonttablewidget/state.go @@ -3,7 +3,7 @@ package fonttablewidget import ( "fmt" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hsassets" ) diff --git a/hswidget/fonttablewidget/widget.go b/hswidget/fonttablewidget/widget.go index e8bb6a7e..d8f00cdc 100644 --- a/hswidget/fonttablewidget/widget.go +++ b/hswidget/fonttablewidget/widget.go @@ -6,7 +6,7 @@ import ( "log" "sort" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2font" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2font/d2fontglyph" @@ -104,8 +104,8 @@ func (p *widget) makeTableLayout() giu.Layout { state.Mode = modeAddItem }), giu.Separator(), - giu.Child("##" + p.id + "tableArea").Border(false).Layout(giu.Layout{ - giu.Table("##" + p.id + "table").FastMode(true).Rows(rows...), + giu.Child().Border(false).Layout(giu.Layout{ + giu.Table().FastMode(true).Rows(rows...), }), } } @@ -146,11 +146,11 @@ func (p *widget) makeGlyphLayout(r rune) *giu.TableRowWidget { }), giu.Label(string(r)), ), - giu.InputInt("##"+p.id+"width"+string(r), &width32).Size(inputIntW).OnChange(func() { + giu.InputInt(&width32).Size(inputIntW).OnChange(func() { h := p.fontTable.Glyphs[r].Height() p.fontTable.Glyphs[r].SetSize(int(width32), h) }), - giu.InputInt("##"+p.id+"height"+string(r), &height32).Size(inputIntW).OnChange(func() { + giu.InputInt(&height32).Size(inputIntW).OnChange(func() { w := p.fontTable.Glyphs[r].Width() p.fontTable.Glyphs[r].SetSize(w, int(height32)) }), @@ -214,7 +214,7 @@ func (p *widget) makeEditRuneLayout() giu.Layout { giu.Label("Edit rune:"), giu.Row( giu.Label("Rune: "), - giu.InputText("##"+p.id+"editRuneRune", &r).Size(inputIntW).OnChange(func() { + giu.InputText(&r).Size(inputIntW).OnChange(func() { if len(r) > 0 { state.EditRuneState.EditedRune = int32(r[0]) } @@ -222,7 +222,7 @@ func (p *widget) makeEditRuneLayout() giu.Layout { ), giu.Row( giu.Label("Int: "), - giu.InputInt("##"+p.id+"editRuneInt", &state.EditRuneState.EditedRune).Size(inputIntW), + giu.InputInt(&state.EditRuneState.EditedRune).Size(inputIntW), ), giu.Separator(), giu.Row( @@ -281,7 +281,7 @@ func (p *widget) makeAddItemLayout() giu.Layout { giu.Label("Rune: "), // if user put here more then one letter, // second and further letters will be skipped - giu.InputText("##"+p.id+"addItemRune", &r).Size(inputIntW).OnChange(func() { + giu.InputText(&r).Size(inputIntW).OnChange(func() { if r == "" { state.AddItemState.NewRune = 0 @@ -293,15 +293,15 @@ func (p *widget) makeAddItemLayout() giu.Layout { ), giu.Row( giu.Label("Int: "), - giu.InputInt("##"+p.id+"addItemRuneInt", &state.AddItemState.NewRune).Size(inputIntW), + giu.InputInt(&state.AddItemState.NewRune).Size(inputIntW), ), giu.Row( giu.Label("Width: "), - giu.InputInt("##"+p.id+"addItemWidth", &state.AddItemState.Width).Size(inputIntW), + giu.InputInt(&state.AddItemState.Width).Size(inputIntW), ), giu.Row( giu.Label("Height: "), - giu.InputInt("##"+p.id+"addItemHeight", &state.AddItemState.Height).Size(inputIntW), + giu.InputInt(&state.AddItemState.Height).Size(inputIntW), ), giu.Separator(), giu.Row( diff --git a/hswidget/palettegrideditorwidget/state.go b/hswidget/palettegrideditorwidget/state.go index d6accfb8..c169736f 100644 --- a/hswidget/palettegrideditorwidget/state.go +++ b/hswidget/palettegrideditorwidget/state.go @@ -4,7 +4,7 @@ import ( "fmt" "image/color" - "github.com/ianling/giu" + "github.com/AllenDang/giu" ) type widgetMode int32 diff --git a/hswidget/palettegrideditorwidget/widget.go b/hswidget/palettegrideditorwidget/widget.go index 809d1e90..1743d18c 100644 --- a/hswidget/palettegrideditorwidget/widget.go +++ b/hswidget/palettegrideditorwidget/widget.go @@ -4,7 +4,7 @@ import ( "encoding/json" "log" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hscommon" "github.com/OpenDiablo2/HellSpawner/hscommon/hsutil" diff --git a/hswidget/palettegridwidget/state.go b/hswidget/palettegridwidget/state.go index 465d1220..687b537c 100644 --- a/hswidget/palettegridwidget/state.go +++ b/hswidget/palettegridwidget/state.go @@ -5,7 +5,7 @@ import ( "image" "image/color" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsutil" ) diff --git a/hswidget/palettegridwidget/widget.go b/hswidget/palettegridwidget/widget.go index cd2ca6cb..63b9e633 100644 --- a/hswidget/palettegridwidget/widget.go +++ b/hswidget/palettegridwidget/widget.go @@ -3,7 +3,7 @@ package palettegridwidget import ( "image" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hscommon" ) @@ -78,7 +78,7 @@ func (p *PaletteGridWidget) Build() { idx := cellY*gridHeight + cellX - if giu.IsWindowFocused() && giu.IsMouseClicked(giu.MouseButtonLeft) { + if giu.IsWindowFocused(giu.FocusedFlagsNone) && giu.IsMouseClicked(giu.MouseButtonLeft) { p.onClick(idx) p.rebuildImage() } diff --git a/hswidget/palettemapwidget/palette_transform.go b/hswidget/palettemapwidget/palette_transform.go index 4d33e6e5..4846f82a 100644 --- a/hswidget/palettemapwidget/palette_transform.go +++ b/hswidget/palettemapwidget/palette_transform.go @@ -3,7 +3,7 @@ package palettemapwidget import ( "fmt" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2pl2" diff --git a/hswidget/palettemapwidget/state.go b/hswidget/palettemapwidget/state.go index 3630a4a5..2030c50b 100644 --- a/hswidget/palettemapwidget/state.go +++ b/hswidget/palettemapwidget/state.go @@ -3,7 +3,7 @@ package palettemapwidget import ( "fmt" - "github.com/ianling/giu" + "github.com/AllenDang/giu" ) type widgetMode int diff --git a/hswidget/palettemapwidget/widget.go b/hswidget/palettemapwidget/widget.go index 0dedf02d..932143c6 100644 --- a/hswidget/palettemapwidget/widget.go +++ b/hswidget/palettemapwidget/widget.go @@ -4,8 +4,7 @@ import ( "encoding/json" "log" - "github.com/ianling/giu" - "github.com/ianling/imgui-go" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2pl2" @@ -95,8 +94,8 @@ func (p *widget) buildViewer(state *widgetState) { } layout := giu.Layout{ - giu.Child("left").Size(w1, h1).Layout(left), - giu.Child("right").Size(w2, h2).Layout(right), + giu.Child().Size(w1, h1).Layout(left), + giu.Child().Size(w2, h2).Layout(right), } layout.Build() @@ -176,7 +175,7 @@ func (p *widget) buildEditor(state *widgetState) { }) labelColor := hsutil.Color(p.pl2.BasePalette.Colors[indices[state.Idx]].RGBA()) giu.Layout{ - giu.Style().SetColor(imgui.StyleColorText, labelColor).To( + giu.Style().SetColor(giu.StyleColorText, labelColor).To( giu.Label("Select color from base palette"), ), grid, diff --git a/hswidget/popupconfirm.go b/hswidget/popupconfirm.go index a1aabb1f..5f747615 100644 --- a/hswidget/popupconfirm.go +++ b/hswidget/popupconfirm.go @@ -3,7 +3,7 @@ package hswidget import ( "log" - "github.com/ianling/giu" + "github.com/AllenDang/giu" ) const ( diff --git a/hswidget/selectpalettewidget/widget.go b/hswidget/selectpalettewidget/widget.go index 2274e5f5..3fef8d93 100644 --- a/hswidget/selectpalettewidget/widget.go +++ b/hswidget/selectpalettewidget/widget.go @@ -4,7 +4,7 @@ import ( "log" "path/filepath" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2dat" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface" @@ -107,7 +107,7 @@ func (p *SelectPaletteWidget) Build() { isOpen := true giu.Layout{ giu.PopupModal("##" + p.id + "popUpSelectPalette").IsOpen(&isOpen).Layout(giu.Layout{ - giu.Child("##"+p.id+"popUpSelectPaletteChildWidget").Size(paletteSelectW, paletteSelectH).Layout(giu.Layout{ + giu.Child().Size(paletteSelectW, paletteSelectH).Layout(giu.Layout{ p.projectExplorer.GetProjectTreeNodes(), giu.Layout(p.mpqExplorer.GetMpqTreeNodes()), giu.Separator(), diff --git a/hswidget/stringtablewidget/state.go b/hswidget/stringtablewidget/state.go index 8732b580..4bab2b16 100644 --- a/hswidget/stringtablewidget/state.go +++ b/hswidget/stringtablewidget/state.go @@ -4,7 +4,7 @@ import ( "fmt" "sort" - "github.com/ianling/giu" + "github.com/AllenDang/giu" ) type widgetMode int32 diff --git a/hswidget/stringtablewidget/widget.go b/hswidget/stringtablewidget/widget.go index 9daa28c5..0d424719 100644 --- a/hswidget/stringtablewidget/widget.go +++ b/hswidget/stringtablewidget/widget.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2tbl" ) @@ -88,8 +88,8 @@ func (p *widget) buildTableLayout() { return } giu.Layout{ - giu.Child("##" + p.id + "tableArea").Border(false).Layout(giu.Layout{ - giu.Table("##" + p.id + "table").FastMode(true).Rows(rows...), + giu.Child().Border(false).Layout(giu.Layout{ + giu.Table().FastMode(true).Rows(rows...), }), }.Build() }), @@ -126,7 +126,7 @@ func (p *widget) makeSearchSection() giu.Layout { if !state.NumOnly { giu.Row( giu.Label("Search:"), - giu.InputText("##"+p.id+"search", &state.Search), + giu.InputText(&state.Search), ).Build() } }), @@ -149,7 +149,7 @@ func (p *widget) buildAddEditLayout() { if state.Editable { giu.Row( - p.makeKeyField("##"+p.id+"addEditKey"), + p.makeKeyField(), checkbox, ).Build() } else { @@ -157,7 +157,7 @@ func (p *widget) buildAddEditLayout() { } }), giu.Label("Value:"), - giu.InputTextMultiline("##"+p.id+"addEditValue", &state.Value), + giu.InputTextMultiline(&state.Value), giu.Separator(), giu.Row( giu.Custom(func() { @@ -195,10 +195,10 @@ func (p *widget) buildAddEditLayout() { }.Build() } -func (p *widget) makeKeyField(id string) giu.Widget { +func (p *widget) makeKeyField() giu.Widget { state := p.getState() - return giu.InputText(id, &state.Key).OnChange(func() { + return giu.InputText(&state.Key).OnChange(func() { p.formatKey(&state.Key) p.updateValueText() }) diff --git a/hswindow/hsdialog/dialog.go b/hswindow/hsdialog/dialog.go index 3093a8cd..4636c11b 100644 --- a/hswindow/hsdialog/dialog.go +++ b/hswindow/hsdialog/dialog.go @@ -2,7 +2,7 @@ package hsdialog import ( - "github.com/ianling/giu" + "github.com/AllenDang/giu" ) // Dialog represents HellSpawner's dialog diff --git a/hswindow/hsdialog/hsaboutdialog/aboutdialog.go b/hswindow/hsdialog/hsaboutdialog/aboutdialog.go index f7b83b97..e20d379f 100644 --- a/hswindow/hsdialog/hsaboutdialog/aboutdialog.go +++ b/hswindow/hsdialog/hsaboutdialog/aboutdialog.go @@ -6,8 +6,8 @@ import ( "io/ioutil" "strings" - g "github.com/ianling/giu" - "github.com/ianling/imgui-go" + g "github.com/AllenDang/giu" + "github.com/AllenDang/imgui-go" "github.com/jaytaylor/html2text" "github.com/russross/blackfriday" @@ -93,31 +93,37 @@ func (a *AboutDialog) Build() { a.IsOpen(&a.Visible).Layout( g.Row( g.Image(a.logo).Size(mainWindowW, mainWindowH), - g.Child("AboutHellSpawnerLayout").Size(mainLayoutW, mainLayoutH).Layout( - g.Style().SetColor(imgui.StyleColorText, colorWhite).To( - g.Label("HellSpawner").Font(&a.titleFont), - g.Label("The OpenDiablo 2 Toolset").Font(&a.regularFont), - g.Label("Local Build").Font(&a.fixedFont), + g.Child().Size(mainLayoutW, mainLayoutH).Layout( + g.Style().SetColor(g.StyleColorText, colorWhite).To( + g.Custom(func() { imgui.PushFont(a.titleFont) }), + g.Label("HellSpawner"), + g.Custom(func() { imgui.PopFont() }), + g.Custom(func() { imgui.PushFont(a.regularFont) }), + g.Label("The OpenDiablo 2 Toolset"), + g.Custom(func() { imgui.PopFont() }), + g.Custom(func() { imgui.PushFont(a.fixedFont) }), + g.Label("Local Build"), + g.Custom(func() { imgui.PopFont() }), ), g.Separator(), - g.TabBar("AboutHellSpawnerTabBar").Flags(g.TabBarFlagsNoCloseWithMiddleMouseButton).Layout( + g.TabBar().Flags(g.TabBarFlagsNoCloseWithMiddleMouseButton).TabItems( g.TabItem("README##AboutHellSpawner").Layout( - g.Custom(func() { g.PushFont(a.fixedFont) }), - g.InputTextMultiline("##AboutHellSpawnerReadme", &a.readme). - Size(-1, -1).Flags(g.InputTextFlags_ReadOnly|g.InputTextFlags_NoHorizontalScroll), - g.Custom(func() { g.PopFont() }), + g.Custom(func() { imgui.PushFont(a.fixedFont) }), + g.InputTextMultiline(&a.readme). + Size(-1, -1).Flags(g.InputTextFlagsReadOnly|g.InputTextFlagsNoHorizontalScroll), + g.Custom(func() { imgui.PopFont() }), ), g.TabItem("Credits##AboutHellSpawner").Layout( - g.Custom(func() { g.PushFont(a.fixedFont) }), - g.InputTextMultiline("##AboutHellSpawnerCredits", &a.credits). - Size(-1, -1).Flags(g.InputTextFlags_ReadOnly|g.InputTextFlags_NoHorizontalScroll), - g.Custom(func() { g.PopFont() }), + g.Custom(func() { imgui.PushFont(a.fixedFont) }), + g.InputTextMultiline(&a.credits). + Size(-1, -1).Flags(g.InputTextFlagsReadOnly|g.InputTextFlagsNoHorizontalScroll), + g.Custom(func() { imgui.PopFont() }), ), g.TabItem("Licenses##AboutHellSpawner").Layout( - g.Custom(func() { g.PushFont(a.fixedFont) }), - g.InputTextMultiline("##AboutHellSpawnerLicense", &a.license). - Size(-1, -1).Flags(g.InputTextFlags_ReadOnly|g.InputTextFlags_NoHorizontalScroll), - g.Custom(func() { g.PopFont() }), + g.Custom(func() { imgui.PushFont(a.fixedFont) }), + g.InputTextMultiline(&a.license). + Size(-1, -1).Flags(g.InputTextFlagsReadOnly|g.InputTextFlagsNoHorizontalScroll), + g.Custom(func() { imgui.PopFont() }), ), ), ), diff --git a/hswindow/hsdialog/hspreferencesdialog/preferencesdialog.go b/hswindow/hsdialog/hspreferencesdialog/preferencesdialog.go index bcb53c50..a5508bc1 100644 --- a/hswindow/hsdialog/hspreferencesdialog/preferencesdialog.go +++ b/hswindow/hsdialog/hspreferencesdialog/preferencesdialog.go @@ -4,8 +4,8 @@ package hspreferencesdialog import ( "image/color" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" - g "github.com/ianling/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsenum" "github.com/OpenDiablo2/HellSpawner/hscommon/hsutil" @@ -52,22 +52,22 @@ func (p *PreferencesDialog) Build() { locale := int32(p.config.Locale) p.IsOpen(&p.Visible).Layout( - g.Child("PreferencesLayout").Size(mainWindowW, mainWindowH).Layout( + g.Child().Size(mainWindowW, mainWindowH).Layout( g.Label("Auxiliary MPQ Path"), g.Row( - g.InputText("##AppPreferencesAuxMPQPath", &p.config.AuxiliaryMpqPath).Size(textboxSize).Flags(g.InputTextFlags_ReadOnly), + g.InputText(&p.config.AuxiliaryMpqPath).Size(textboxSize).Flags(g.InputTextFlagsReadOnly), g.Button("...##AppPreferencesAuxMPQPathBrowse").Size(btnW, btnH).OnClick(p.onBrowseAuxMpqPathClicked), ), g.Separator(), g.Label("External MPQ listfile Path"), g.Row( - g.InputText("##AppPreferencesListfilePath", &p.config.ExternalListFile).Size(textboxSize).Flags(g.InputTextFlags_ReadOnly), + g.InputText(&p.config.ExternalListFile).Size(textboxSize).Flags(g.InputTextFlagsReadOnly), g.Button("...##AppPreferencesListfilePathBrowse").Size(btnW, btnH).OnClick(p.onBrowseExternalListfileClicked), ), g.Separator(), g.Label("Abyss Engine Path"), g.Row( - g.InputText("##AppPreferencesAbyssEnginePath", &p.config.AbyssEnginePath).Size(textboxSize).Flags(g.InputTextFlags_ReadOnly), + g.InputText(&p.config.AbyssEnginePath).Size(textboxSize).Flags(g.InputTextFlagsReadOnly), g.Button("...##AppPreferencesAbyssEnginePathBrowse").Size(btnW, btnH).OnClick(p.onBrowseAbyssEngineClicked), ), g.Separator(), @@ -79,7 +79,7 @@ func (p *PreferencesDialog) Build() { g.Layout{ g.Label("Log file path"), g.Row( - g.InputText("##AppPreferencesLogFilePath", &p.config.LogFilePath).Size(textboxSize).Flags(g.InputTextFlags_ReadOnly), + g.InputText(&p.config.LogFilePath).Size(textboxSize).Flags(g.InputTextFlagsReadOnly), g.Button("...##AppPreferencesLogFilePathBrowse").Size(btnW, btnH).OnClick(p.onBrowseLogFilePathClicked), ), }.Build() diff --git a/hswindow/hsdialog/hsprojectpropertiesdialog/projectpropertiesdialog.go b/hswindow/hsdialog/hsprojectpropertiesdialog/projectpropertiesdialog.go index ff5dc2b7..9329d7ef 100644 --- a/hswindow/hsdialog/hsprojectpropertiesdialog/projectpropertiesdialog.go +++ b/hswindow/hsdialog/hsprojectpropertiesdialog/projectpropertiesdialog.go @@ -12,9 +12,9 @@ import ( "github.com/OpenDiablo2/HellSpawner/hsconfig" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" - "github.com/ianling/imgui-go" + "github.com/AllenDang/imgui-go" "github.com/OpenDiablo2/HellSpawner/hsassets" "github.com/OpenDiablo2/HellSpawner/hscommon/hsproject" @@ -92,7 +92,7 @@ func (p *ProjectPropertiesDialog) Build() { canSave := len(strings.TrimSpace(p.project.ProjectName)) > 0 p.IsOpen(&p.mpqSelectDialogVisible).Layout( - g.Child("ProjectPropertiesSelectAuxMPQDialogLayout").Size(mainWindowW, mainWindowH).Layout( + g.Child().Size(mainWindowW, mainWindowH).Layout( g.Custom(func() { addMPQ := func(i int) { p.mpqsToAdd = append(p.mpqsToAdd, i) @@ -167,17 +167,17 @@ func (p *ProjectPropertiesDialog) Build() { if !p.mpqSelectDialogVisible { p.IsOpen(&p.Visible).Layout( g.Row( - g.Child("ProjectPropertiesLayout").Size(mpqSelectW, mpqSelectH).Layout( + g.Child().Size(mpqSelectW, mpqSelectH).Layout( g.Label("Project Name:"), - g.InputText("##ProjectPropertiesDialogProjectName", &p.project.ProjectName).Size(inputTextSize), + g.InputText(&p.project.ProjectName).Size(inputTextSize), g.Label("Description:"), - g.InputTextMultiline("##ProjectPropertiesDialogDescription", &p.project.Description).Size(descriptionW, descriptionH), + g.InputTextMultiline(&p.project.Description).Size(descriptionW, descriptionH), g.Label("Author:"), - g.InputText("##ProjectPropertiesDialogAuthor", &p.project.Author).Size(inputTextSize), + g.InputText(&p.project.Author).Size(inputTextSize), ), - g.Child("ProjectPropertiesLayout2").Size(mpqSelectW, mpqSelectH).Layout( + g.Child().Size(mpqSelectW, mpqSelectH).Layout( g.Label("Auxiliary MPQs:"), - g.Child("ProjectPropertiesAuxMpqLayoutGroup").Border(false).Size(mpqGroupW, mpqGroupH).Layout( + g.Child().Border(false).Size(mpqGroupW, mpqGroupH).Layout( g.Custom(func() { imgui.PushStyleColor(imgui.StyleColorButton, imgui.Vec4{}) imgui.PushStyleColor(imgui.StyleColorBorder, imgui.Vec4{}) diff --git a/hswindow/hseditor/editor.go b/hswindow/hseditor/editor.go index d1e07990..037cd3a7 100644 --- a/hswindow/hseditor/editor.go +++ b/hswindow/hseditor/editor.go @@ -6,7 +6,7 @@ import ( "fmt" "log" - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsproject" diff --git a/hswindow/hseditor/hsanimdataeditor/animation_data_editor.go b/hswindow/hseditor/hsanimdataeditor/animation_data_editor.go index fadec68d..123bd5d2 100644 --- a/hswindow/hseditor/hsanimdataeditor/animation_data_editor.go +++ b/hswindow/hseditor/hsanimdataeditor/animation_data_editor.go @@ -4,8 +4,8 @@ package hsanimdataeditor import ( "fmt" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" - g "github.com/ianling/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2animdata" diff --git a/hswindow/hseditor/hscofeditor/cof_editor.go b/hswindow/hseditor/hscofeditor/cof_editor.go index 00bf15df..7caca477 100644 --- a/hswindow/hseditor/hscofeditor/cof_editor.go +++ b/hswindow/hseditor/hscofeditor/cof_editor.go @@ -4,8 +4,8 @@ package hscofeditor import ( "fmt" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" - g "github.com/ianling/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2cof" diff --git a/hswindow/hseditor/hsdc6editor/dc6_editor.go b/hswindow/hseditor/hsdc6editor/dc6_editor.go index 8aca6290..0e4be3f5 100644 --- a/hswindow/hseditor/hsdc6editor/dc6_editor.go +++ b/hswindow/hseditor/hsdc6editor/dc6_editor.go @@ -4,8 +4,8 @@ package hsdc6editor import ( "fmt" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" - g "github.com/ianling/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2dc6" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface" diff --git a/hswindow/hseditor/hsdcceditor/dcc_editor.go b/hswindow/hseditor/hsdcceditor/dcc_editor.go index b6385d96..9b2d031f 100644 --- a/hswindow/hseditor/hsdcceditor/dcc_editor.go +++ b/hswindow/hseditor/hsdcceditor/dcc_editor.go @@ -4,7 +4,7 @@ package hsdcceditor import ( "fmt" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" diff --git a/hswindow/hseditor/hsds1editor/ds1_editor.go b/hswindow/hseditor/hsds1editor/ds1_editor.go index eb0c487c..01ea4bca 100644 --- a/hswindow/hseditor/hsds1editor/ds1_editor.go +++ b/hswindow/hseditor/hsds1editor/ds1_editor.go @@ -4,8 +4,8 @@ package hsds1editor import ( "fmt" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" - g "github.com/ianling/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsproject" diff --git a/hswindow/hseditor/hsdt1editor/dt1_editor.go b/hswindow/hseditor/hsdt1editor/dt1_editor.go index ee246748..489d056c 100644 --- a/hswindow/hseditor/hsdt1editor/dt1_editor.go +++ b/hswindow/hseditor/hsdt1editor/dt1_editor.go @@ -4,7 +4,7 @@ package hsdt1editor import ( "fmt" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" diff --git a/hswindow/hseditor/hsfonteditor/fonteditor.go b/hswindow/hseditor/hsfonteditor/fonteditor.go index f650a2c5..ebf2c5dc 100644 --- a/hswindow/hseditor/hsfonteditor/fonteditor.go +++ b/hswindow/hseditor/hsfonteditor/fonteditor.go @@ -4,8 +4,8 @@ package hsfonteditor import ( "fmt" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" - g "github.com/ianling/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsfiletypes/hsfont" "github.com/OpenDiablo2/HellSpawner/hscommon/hsproject" @@ -59,19 +59,19 @@ func (e *FontEditor) Build() { Layout(g.Layout{ g.Label("DC6 Path"), g.Row( - g.InputText("##FontEditorDC6Path", &e.SpriteFile).Size(pathSize).Flags(g.InputTextFlags_ReadOnly), + g.InputText(&e.SpriteFile).Size(pathSize).Flags(g.InputTextFlagsReadOnly), g.Button("...##FontEditorDC6Browse").Size(browseW, browseH).OnClick(e.onBrowseDC6PathClicked), ), g.Separator(), g.Label("TBL Path"), g.Row( - g.InputText("##FontEditorTBLPath", &e.TableFile).Size(pathSize).Flags(g.InputTextFlags_ReadOnly), + g.InputText(&e.TableFile).Size(pathSize).Flags(g.InputTextFlagsReadOnly), g.Button("...##FontEditorTBLBrowse").Size(browseW, browseH).OnClick(e.onBrowseTBLPathClicked), ), g.Separator(), g.Label("PL2 Path"), g.Row( - g.InputText("##FontEditorPL2Path", &e.PaletteFile).Size(pathSize).Flags(g.InputTextFlags_ReadOnly), + g.InputText(&e.PaletteFile).Size(pathSize).Flags(g.InputTextFlagsReadOnly), g.Button("...##FontEditorPL2Browse").Size(browseW, browseH).OnClick(e.onBrowsePL2PathClicked), ), }) diff --git a/hswindow/hseditor/hsfonttableeditor/font_table_editor.go b/hswindow/hseditor/hsfonttableeditor/font_table_editor.go index 97c3d33b..0d65593f 100644 --- a/hswindow/hseditor/hsfonttableeditor/font_table_editor.go +++ b/hswindow/hseditor/hsfonttableeditor/font_table_editor.go @@ -6,7 +6,7 @@ import ( "github.com/OpenDiablo2/dialog" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2font" diff --git a/hswindow/hseditor/hspaletteeditor/palette_editor.go b/hswindow/hseditor/hspaletteeditor/palette_editor.go index 9f77f284..5bdde1bd 100644 --- a/hswindow/hseditor/hspaletteeditor/palette_editor.go +++ b/hswindow/hseditor/hspaletteeditor/palette_editor.go @@ -6,7 +6,7 @@ import ( "github.com/OpenDiablo2/dialog" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2dat" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2interface" diff --git a/hswindow/hseditor/hspalettemapeditor/palette_map_editor.go b/hswindow/hseditor/hspalettemapeditor/palette_map_editor.go index dd822566..2cb6cbf0 100644 --- a/hswindow/hseditor/hspalettemapeditor/palette_map_editor.go +++ b/hswindow/hseditor/hspalettemapeditor/palette_map_editor.go @@ -4,7 +4,7 @@ package hspalettemapeditor import ( "fmt" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" diff --git a/hswindow/hseditor/hssoundeditor/soundeditor.go b/hswindow/hseditor/hssoundeditor/soundeditor.go index 73963764..eaa782ba 100644 --- a/hswindow/hseditor/hssoundeditor/soundeditor.go +++ b/hswindow/hseditor/hssoundeditor/soundeditor.go @@ -21,7 +21,7 @@ import ( "github.com/OpenDiablo2/HellSpawner/hswidget" "github.com/OpenDiablo2/HellSpawner/hswindow/hseditor" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" ) const ( diff --git a/hswindow/hseditor/hsstringtableeditor/string_table_editor.go b/hswindow/hseditor/hsstringtableeditor/string_table_editor.go index 7d07e09b..6844a687 100644 --- a/hswindow/hseditor/hsstringtableeditor/string_table_editor.go +++ b/hswindow/hseditor/hsstringtableeditor/string_table_editor.go @@ -4,7 +4,7 @@ package hsstringtableeditor import ( "fmt" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" diff --git a/hswindow/hseditor/hstexteditor/texteditor.go b/hswindow/hseditor/hstexteditor/texteditor.go index b2c450a3..3547a69c 100644 --- a/hswindow/hseditor/hstexteditor/texteditor.go +++ b/hswindow/hseditor/hstexteditor/texteditor.go @@ -5,7 +5,7 @@ import ( "log" "strings" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/dialog" @@ -97,15 +97,15 @@ func (e *TextEditor) Build() { if !e.tableView { e.IsOpen(&e.Visible). Layout( - g.InputTextMultiline("", &e.text). - Flags(g.InputTextFlags_AllowTabInput), + g.InputTextMultiline(&e.text). + Flags(g.InputTextFlagsAllowTabInput), ) } else { e.IsOpen(&e.Visible). Flags(g.WindowFlagsHorizontalScrollbar). Layout( - g.Child("").Border(false).Size(float32(e.columns*tableViewModW), 0).Layout( - g.Table("").FastMode(true).Freeze(0, 1).Rows(e.tableRows...), + g.Child().Border(false).Size(float32(e.columns*tableViewModW), 0).Layout( + g.Table().FastMode(true).Freeze(0, 1).Rows(e.tableRows...), ), ) } diff --git a/hswindow/hstoolwindow/hsconsole/console.go b/hswindow/hstoolwindow/hsconsole/console.go index 5b81275c..17b317af 100644 --- a/hswindow/hstoolwindow/hsconsole/console.go +++ b/hswindow/hstoolwindow/hsconsole/console.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - g "github.com/ianling/giu" - "github.com/ianling/imgui-go" + g "github.com/AllenDang/giu" + "github.com/AllenDang/imgui-go" "github.com/OpenDiablo2/HellSpawner/hscommon/hsstate" "github.com/OpenDiablo2/HellSpawner/hswindow/hstoolwindow" @@ -45,11 +45,11 @@ func (c *Console) Build() { c.IsOpen(&c.Visible). Layout(g.Layout{ g.Custom(func() { - g.PushFont(c.fontFixed) + imgui.PushFont(c.fontFixed) }), - g.InputTextMultiline("", &c.outputText). + g.InputTextMultiline(&c.outputText). Size(lineW, lineH). - Flags(g.InputTextFlags_ReadOnly | g.InputTextFlags_NoUndoRedo), + Flags(g.InputTextFlagsReadOnly | g.InputTextFlagsNoUndoRedo), g.Custom(func() { g.PopFont() }), diff --git a/hswindow/hstoolwindow/hsmpqexplorer/mpqexplorer.go b/hswindow/hstoolwindow/hsmpqexplorer/mpqexplorer.go index 027f8e20..34b4d0ab 100644 --- a/hswindow/hstoolwindow/hsmpqexplorer/mpqexplorer.go +++ b/hswindow/hstoolwindow/hsmpqexplorer/mpqexplorer.go @@ -10,7 +10,7 @@ import ( "strings" "sync" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2mpq" @@ -98,7 +98,7 @@ func (m *MPQExplorer) Build() { m.IsOpen(&m.Visible). Size(mainWindowW, mainWindowH). Layout(g.Layout{ - g.Child("MpqExplorerContent"). + g.Child(). Border(false). Flags(g.WindowFlagsHorizontalScrollbar). Layout(m.GetMpqTreeNodes()...), @@ -147,7 +147,7 @@ func (m *MPQExplorer) renderNodes(pathEntry *hscommon.PathEntry) g.Widget { return g.Layout{ g.Selectable(pathEntry.Name + id), hswidget.OnDoubleClick(func() { m.fileSelectedCallback(pathEntry) }), - g.ContextMenu("Context" + id).Layout(g.Layout{ + g.ContextMenu().Layout(g.Layout{ g.Selectable("Copy to Project").OnClick(func() { m.copyToProject(pathEntry) }), diff --git a/hswindow/hstoolwindow/hsprojectexplorer/projectexplorer.go b/hswindow/hstoolwindow/hsprojectexplorer/projectexplorer.go index d12eb0df..4a25ede6 100644 --- a/hswindow/hstoolwindow/hsprojectexplorer/projectexplorer.go +++ b/hswindow/hstoolwindow/hsprojectexplorer/projectexplorer.go @@ -11,9 +11,9 @@ import ( "github.com/OpenDiablo2/dialog" - "github.com/ianling/imgui-go" + "github.com/AllenDang/imgui-go" - g "github.com/ianling/giu" + g "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hsassets" "github.com/OpenDiablo2/HellSpawner/hscommon" @@ -90,7 +90,7 @@ func (m *ProjectExplorer) Build() { m.makeRefreshButtonLayout(), ) - tree := g.Child("ProjectExplorerProjectTreeContainer"). + tree := g.Child(). Flags(g.WindowFlagsHorizontalScrollbar). Layout(m.GetProjectTreeNodes()) @@ -217,7 +217,7 @@ func (m *ProjectExplorer) createFileTreeItem(pathEntry *hscommon.PathEntry) g.Wi } layout = append(layout, - g.ContextMenu("Context"+id).Layout(g.Layout{ + g.ContextMenu().Layout(g.Layout{ g.MenuItem("Rename").OnClick(func() { m.onRenameFileClicked(pathEntry) }), g.MenuItem("Delete...").OnClick(func() { m.onDeleteFileClicked(pathEntry) }), }), @@ -300,7 +300,7 @@ func (m *ProjectExplorer) createDirectoryTreeItem(pathEntry *hscommon.PathEntry, menuLayout := g.Layout{ g.Custom(func() { imgui.PushID(id) }), - g.ContextMenu("Context").Layout(contextMenuLayout), + g.ContextMenu().Layout(contextMenuLayout), g.Custom(func() { imgui.PopID() }), } diff --git a/hswindow/window.go b/hswindow/window.go index dd2bd967..be2b0742 100644 --- a/hswindow/window.go +++ b/hswindow/window.go @@ -1,7 +1,7 @@ package hswindow import ( - "github.com/ianling/giu" + "github.com/AllenDang/giu" "github.com/OpenDiablo2/HellSpawner/hscommon/hsstate" )