Skip to content

Commit

Permalink
remove PushID from project properties; update giu to its master
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Dec 3, 2024
1 parent fe62953 commit 040d98a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gucio321/HellSpawner
go 1.23.3

require (
github.com/AllenDang/giu v0.11.1-0.20241127193319-4536adce5d46
github.com/AllenDang/giu v0.11.1-0.20241203162551-c97a82224d5b
github.com/OpenDiablo2/OpenDiablo2 v0.0.0-20210514222603-a688d660a0f7
github.com/OpenDiablo2/dialog v0.0.0-20201230220514-26162241209f
github.com/enriquebris/goconcurrentqueue v0.6.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ github.com/AllenDang/giu v0.11.1-0.20241126223035-127b1890fcfb h1:xKJeQlfbd95nbY
github.com/AllenDang/giu v0.11.1-0.20241126223035-127b1890fcfb/go.mod h1:sxKZ1fD18qc57i2xLMVCfgvljeDntFPDpuheF29orNw=
github.com/AllenDang/giu v0.11.1-0.20241127193319-4536adce5d46 h1:+sGvyKihHGE0odVsLH8j6V2CfDysXQNdB/OdMewY60w=
github.com/AllenDang/giu v0.11.1-0.20241127193319-4536adce5d46/go.mod h1:sxKZ1fD18qc57i2xLMVCfgvljeDntFPDpuheF29orNw=
github.com/AllenDang/giu v0.11.1-0.20241203162551-c97a82224d5b h1:uk7yN6QDkaserJC5m3QOAWQOb01/dPDpPjuHJ5/B1oM=
github.com/AllenDang/giu v0.11.1-0.20241203162551-c97a82224d5b/go.mod h1:sxKZ1fD18qc57i2xLMVCfgvljeDntFPDpuheF29orNw=
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.20221124025851-59b862ca5a0c h1:kiXjH0n0KzOpvhgy3nDFkPmKfg4A+QWsEOwxwWy6yuI=
Expand Down
19 changes: 3 additions & 16 deletions pkg/window/popup/projectproperties/projectpropertiesdialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
package projectproperties

import (
"fmt"
"github.com/gucio321/HellSpawner/pkg/app/assets"
"github.com/gucio321/HellSpawner/pkg/app/config"
"log"
"path/filepath"
"strconv"
"strings"

"github.com/gucio321/HellSpawner/pkg/app/assets"
"github.com/gucio321/HellSpawner/pkg/app/config"

"github.com/gucio321/HellSpawner/pkg/common"

g "github.com/AllenDang/giu"
Expand Down Expand Up @@ -191,37 +191,24 @@ func (p *Dialog) Build() {
}

g.Row(
g.Custom(func() {
imgui.PushIDStr(fmt.Sprintf("ProjectPropertiesAddAuxMpqRemove_%d", currentIdx))
}),

g.ImageButton(p.removeIconTexture).Size(imgBtnW, imgBtnH).OnClick(func() {
copy(p.project.AuxiliaryMPQs[currentIdx:], p.project.AuxiliaryMPQs[currentIdx+1:])
p.project.AuxiliaryMPQs = p.project.AuxiliaryMPQs[:len(p.project.AuxiliaryMPQs)-1]
}),
g.Custom(func() {
imgui.PopID()
imgui.PushIDStr(fmt.Sprintf("ProjectPropertiesAddAuxMpqDown_%d", currentIdx))
}),
g.ImageButton(p.downIconTexture).Size(imgBtnW, imgBtnH).OnClick(func() {
if currentIdx < len(p.project.AuxiliaryMPQs)-1 {
p.project.AuxiliaryMPQs[currentIdx],
p.project.AuxiliaryMPQs[currentIdx+1] = p.project.AuxiliaryMPQs[currentIdx+1],
p.project.AuxiliaryMPQs[currentIdx]
}
}),
g.Custom(func() {
imgui.PopID()
imgui.PushIDStr(fmt.Sprintf("ProjectPropertiesAddAuxMpqUp_%d", currentIdx))
}),
g.ImageButton(p.upIconTexture).Size(imgBtnW, imgBtnH).OnClick(func() {
if currentIdx > 0 {
p.project.AuxiliaryMPQs[currentIdx-1],
p.project.AuxiliaryMPQs[currentIdx] = p.project.AuxiliaryMPQs[currentIdx],
p.project.AuxiliaryMPQs[currentIdx-1]
}
}),
g.Custom(func() { imgui.PopID() }),
g.Dummy(dummyW, dummyH),
g.Label(p.project.AuxiliaryMPQs[idx]),
).Build()
Expand Down

0 comments on commit 040d98a

Please sign in to comment.