Skip to content

Commit

Permalink
Reworks dt1widget makeSubtileFlags to use dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrucee committed Jun 8, 2021
1 parent 9a54b5c commit 28bf6c1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hswidget/dt1widget/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
)

const (
comboW = 280
gridMaxWidth = 160
gridMaxHeight = 80
gridDivisionsXY = 5
Expand Down Expand Up @@ -579,13 +580,18 @@ func (p *widget) SetTileGroup(tileGroup int32) {
}

func (p *widget) makeSubtileFlags(state *widgetState, tile *d2dt1.Tile) giu.Layout {
subtileFlagList := make([]string, 0)

for i := int32(0); i <= 7; i++ {
subtileFlagList = append(subtileFlagList, subTileString(i))
}

if tile.Height < 0 {
tile.Height *= -1
}

return giu.Layout{
giu.SliderInt("Subtile Type", &state.controls.subtileFlag, 0, 7),
giu.Label(subTileString(state.controls.subtileFlag)),
giu.Combo("##"+p.id+"SubtileList", subtileFlagList[state.subtileFlag], subtileFlagList, &state.subtileFlag).Size(comboW),
giu.Label("Edit:"),
giu.Custom(func() {
for y := 0; y < gridDivisionsXY; y++ {
Expand Down

0 comments on commit 28bf6c1

Please sign in to comment.