diff --git a/internal/app/characters/Albert.go b/internal/app/characters/Albert.go index 6b3251a..46692fe 100644 --- a/internal/app/characters/Albert.go +++ b/internal/app/characters/Albert.go @@ -8,12 +8,12 @@ func Albert() Character { //TODO MAP return Character{ ID: 05, Name: "Albert", - XP: common.Attribute{0x5B0,4,true}, - HP: common.Attribute{0x5B8,2,true}, - Weapon: common.Attribute{0x5C4,1,false}, - Helmet: common.Attribute{0x5C5,1,false}, - Chest: common.Attribute{0x5C6,1,false}, - Boots: common.Attribute{0x5C7,1,false}, - Accessory: common.Attribute{0x5C8,1,false}, + XP: common.Attribute{0x608,4,true}, + HP: common.Attribute{0x610,2,true}, + Weapon: common.Attribute{0x61C,1,false}, + Helmet: common.Attribute{0x61D,1,false}, + Chest: common.Attribute{0x61E,1,false}, + Boots: common.Attribute{0x61F,1,false}, + Accessory: common.Attribute{0x620,1,false}, } } diff --git a/internal/app/characters/Character.go b/internal/app/characters/Character.go index 7a8c8d3..ef92a4c 100644 --- a/internal/app/characters/Character.go +++ b/internal/app/characters/Character.go @@ -16,16 +16,23 @@ type Character struct { Accessory common.Attribute } -func characters() []Character { +func GetCharacters() []Character { return []Character { - Dart(), Shana(), Lavitz(), Rose(), Haschel(), Albert(), - Miranda(), Meru(), Kongol(), + Dart(), Shana(), Lavitz(), Rose(), Haschel(), Albert(), Miranda(), Meru(), Kongol(), } } +func GetCharacterNames() []string { + var r []string + for _, c := range GetCharacters() { + r = append(r, c.Name) + } + return r +} + func GetNameByID(i int) string { r := "" - for _, c := range characters() { + for _, c := range GetCharacters() { if i == c.ID { r = c.Name } @@ -35,7 +42,7 @@ func GetNameByID(i int) string { func GetIDByName(n string) int { r := 0 - for _, c := range characters() { + for _, c := range GetCharacters() { if n == c.Name { r = c.ID } diff --git a/internal/app/characters/Haschel.go b/internal/app/characters/Haschel.go index 74b496e..73f87f3 100644 --- a/internal/app/characters/Haschel.go +++ b/internal/app/characters/Haschel.go @@ -8,12 +8,12 @@ func Haschel() Character { //TODO MAP return Character{ ID: 04, Name: "Haschel", - XP: common.Attribute{0x5B0,4,true}, - HP: common.Attribute{0x5B8,2,true}, - Weapon: common.Attribute{0x5C4,1,false}, - Helmet: common.Attribute{0x5C5,1,false}, - Chest: common.Attribute{0x5C6,1,false}, - Boots: common.Attribute{0x5C7,1,false}, - Accessory: common.Attribute{0x5C8,1,false}, + XP: common.Attribute{0x5DC,4,true}, + HP: common.Attribute{0x5E4,2,true}, + Weapon: common.Attribute{0x5F0,1,false}, + Helmet: common.Attribute{0x5F1,1,false}, + Chest: common.Attribute{0x5F2,1,false}, + Boots: common.Attribute{0x5F3,1,false}, + Accessory: common.Attribute{0x5F4,1,false}, } } diff --git a/internal/app/characters/Kongol.go b/internal/app/characters/Kongol.go index 9dd789b..5c3be18 100644 --- a/internal/app/characters/Kongol.go +++ b/internal/app/characters/Kongol.go @@ -8,12 +8,12 @@ func Kongol() Character { //TODO map return Character{ ID: 07, Name: "Kongol", - XP: common.Attribute{0x5B0,4,true}, - HP: common.Attribute{0x5B8,2,true}, - Weapon: common.Attribute{0x5C4,1,false}, - Helmet: common.Attribute{0x5C5,1,false}, - Chest: common.Attribute{0x5C6,1,false}, - Boots: common.Attribute{0x5C7,1,false}, - Accessory: common.Attribute{0x5C8,1,false}, + XP: common.Attribute{0x660,4,true}, + HP: common.Attribute{0x668,2,true}, + Weapon: common.Attribute{0x674,1,false}, + Helmet: common.Attribute{0x675,1,false}, + Chest: common.Attribute{0x676,1,false}, + Boots: common.Attribute{0x677,1,false}, + Accessory: common.Attribute{0x678,1,false}, } } diff --git a/internal/app/characters/Meru.go b/internal/app/characters/Meru.go index e589395..7a7230c 100644 --- a/internal/app/characters/Meru.go +++ b/internal/app/characters/Meru.go @@ -8,12 +8,12 @@ func Meru() Character { //TODO map return Character{ ID: 06, Name: "Meru", - XP: common.Attribute{0x5B0,4,true}, - HP: common.Attribute{0x5B8,2,true}, - Weapon: common.Attribute{0x5C4,1,false}, - Helmet: common.Attribute{0x5C5,1,false}, - Chest: common.Attribute{0x5C6,1,false}, - Boots: common.Attribute{0x5C7,1,false}, - Accessory: common.Attribute{0x5C8,1,false}, + XP: common.Attribute{0x634,4,true}, + HP: common.Attribute{0x63C,2,true}, + Weapon: common.Attribute{0x648,1,false}, + Helmet: common.Attribute{0x649,1,false}, + Chest: common.Attribute{0x64A,1,false}, + Boots: common.Attribute{0x64B,1,false}, + Accessory: common.Attribute{0x64C,1,false}, } } diff --git a/internal/app/characters/Miranda.go b/internal/app/characters/Miranda.go index 36ed853..0896ec0 100644 --- a/internal/app/characters/Miranda.go +++ b/internal/app/characters/Miranda.go @@ -8,12 +8,12 @@ func Miranda() Character { //TODO Map return Character{ ID: 8, Name: "Miranda", - XP: common.Attribute{0x5B0,4,true}, - HP: common.Attribute{0x5B8,2,true}, - Weapon: common.Attribute{0x5C4,1,false}, - Helmet: common.Attribute{0x5C5,1,false}, - Chest: common.Attribute{0x5C6,1,false}, - Boots: common.Attribute{0x5C7,1,false}, - Accessory: common.Attribute{0x5C8,1,false}, + XP: common.Attribute{0x68C,4,true}, + HP: common.Attribute{0x694,2,true}, + Weapon: common.Attribute{0x6A0,1,false}, + Helmet: common.Attribute{0x6A1,1,false}, + Chest: common.Attribute{0x6A2,1,false}, + Boots: common.Attribute{0x6A3,1,false}, + Accessory: common.Attribute{0x6A4,1,false}, } } diff --git a/internal/app/common/Positions.go b/internal/app/common/Positions.go new file mode 100644 index 0000000..71ae234 --- /dev/null +++ b/internal/app/common/Positions.go @@ -0,0 +1,22 @@ +package common + +func First() Attribute { + return Attribute{0x288,1,false} +} +func FirstDisplay() Attribute { + return Attribute{0x188,1,false} +} + +func Second() Attribute { + return Attribute{0x28C,1,false} +} +func SecondDisplay() Attribute { + return Attribute{0x18C,1,false} +} + +func Third() Attribute { + return Attribute{0x290,1,false} +} +func ThirdDisplay() Attribute { + return Attribute{0x190,1,false} +} \ No newline at end of file diff --git a/internal/app/ui/Form.go b/internal/app/ui/Form.go index 8c8ff88..5e05b8e 100644 --- a/internal/app/ui/Form.go +++ b/internal/app/ui/Form.go @@ -22,13 +22,6 @@ var meru = characters.Meru() var kongol = characters.Kongol() var miranda = characters.Miranda() -var pos1 = common.Attribute{0x288,1, false} -var pos1Display = common.Attribute{0x188,1, false} -var pos2 = common.Attribute{0x28C,1, false} -var pos2Display = common.Attribute{0x18C,1, false} -var pos3 = common.Attribute{0x290,1, false} -var pos3Display = common.Attribute{0x190,1, false} - func createCharSelect(i inventory.Inventory, a common.Attribute, s *storage.Slot) *widget.Select { r := widget.NewSelect(i.GetVals(), func(v string) { s.SetValueAtLocation(a, i.GetIDByVal(v)) @@ -47,13 +40,9 @@ func createPosSelect(n []string, a common.Attribute, ad common.Attribute, s *sto } func createPartyForm(s *storage.Slot) *fyne.Container { - names := []string{ - dart.Name, shana.Name, lavitz.Name, rose.Name, haschel.Name, - albert.Name, meru.Name, kongol.Name, miranda.Name, - } - s1 := createPosSelect(names, pos1, pos1Display, s) - s2 := createPosSelect(names, pos2, pos2Display, s) - s3 := createPosSelect(names, pos3, pos3Display, s) + s1 := createPosSelect(characters.GetCharacterNames(), common.First(), common.FirstDisplay(), s) + s2 := createPosSelect(characters.GetCharacterNames(), common.Second(), common.SecondDisplay(), s) + s3 := createPosSelect(characters.GetCharacterNames(), common.Third(), common.ThirdDisplay(), s) return fyne.NewContainerWithLayout(layout.NewHBoxLayout(), widget.NewLabel("Party"), s1, s2, s3) } @@ -90,9 +79,19 @@ func CreateForm(slot *storage.Slot, card *storage.Card, w fyne.Window) *fyne.Con createCharacterBox(box3, lavitz, inventory.Spears(), slot) box4 := widget.NewVBox() createCharacterBox(box4, rose, inventory.Daggers(), slot) + box5 := widget.NewVBox() + createCharacterBox(box5, haschel, inventory.Knuckles(), slot) + box6 := widget.NewVBox() + createCharacterBox(box6, albert, inventory.Spears(), slot) + box7 := widget.NewVBox() + createCharacterBox(box7, meru, inventory.Maces(), slot) + box8 := widget.NewVBox() + createCharacterBox(box8, kongol, inventory.Axes(), slot) + box9 := widget.NewVBox() + createCharacterBox(box9, miranda, inventory.Bows(), slot) - chars := fyne.NewContainerWithLayout(layout.NewGridLayout(4), - box1, box2, box3, box4) + chars := fyne.NewContainerWithLayout(layout.NewGridLayout(9), + box1, box2, box3, box4, box5, box6, box7, box8, box9) submit := fyne.NewContainerWithLayout(layout.NewHBoxLayout(), form)