Play around with menus some more

We now display the buttons in Main.mnu, but a lot remains unknown.
This commit is contained in:
2019-10-09 00:41:41 +01:00
parent e46a5f194f
commit 0320743b30
3 changed files with 111 additions and 20 deletions

View File

@@ -16,8 +16,9 @@ type Record struct {
Id int
Type int
FontType int
Active bool
SpriteId int
SpriteId []int
X int
Y int
Desc string
@@ -161,7 +162,14 @@ func (r *Record) Toplevel() *Record {
}
func setProperty(r *Record, k, v string) {
vSplit := strings.Split(v, ",")
vInt, _ := strconv.Atoi(v)
vSplitInt := make([]int, len(vSplit))
for i, subV := range vSplit {
vSplitInt[i], _ = strconv.Atoi(subV)
}
switch k {
case "MENUID", "SUBMENUID":
r.Id = vInt
@@ -170,13 +178,15 @@ func setProperty(r *Record, k, v string) {
case "ACTIVE":
r.Active = (vInt != 0)
case "SPRITEID":
r.SpriteId = vInt
r.SpriteId = vSplitInt
case "X-CORD":
r.X = vInt
case "Y-CORD":
r.Y = vInt
case "DESC":
r.Desc = v
case "FONTTYPE":
r.FontType = vInt
default:
r.properties[k] = v
}