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 4a4e5ef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 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,17 @@ func (p *widget) SetTileGroup(tileGroup int32) {
}

func (p *widget) makeSubtileFlags(state *widgetState, tile *d2dt1.Tile) giu.Layout {
subtileFlagList := make([]string, 0)
for i := subTileFlagBlockWalk; i <= subTileFlagUnknown3; i++ {
subtileFlagList = append(subtileFlagList, subTileString(int32(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 4a4e5ef

Please sign in to comment.