Client changes, now uses rex model
This commit is contained in:
parent
7b4fb82ab7
commit
f769adfee6
2 changed files with 8 additions and 47 deletions
|
@ -1,4 +1,4 @@
|
|||
module rexforge
|
||||
module rex_client
|
||||
|
||||
go 1.23.4
|
||||
|
||||
|
|
|
@ -11,63 +11,24 @@ import (
|
|||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
// Define your custom struct
|
||||
type MyStruct struct {
|
||||
Name string
|
||||
}
|
||||
model "rex_model"
|
||||
)
|
||||
|
||||
//go:generate sh -c "printf %s $(git rev-parse --short HEAD) > commit.txt"
|
||||
//go:embed commit.txt
|
||||
var git_rev string
|
||||
|
||||
// Download method for the struct
|
||||
func (s *MyStruct) Download() {
|
||||
fmt.Printf("Downloading %s...\n", s.Name)
|
||||
}
|
||||
|
||||
var myList = []MyStruct{
|
||||
{"AtlasLoot"},
|
||||
{"Bartender4"},
|
||||
{"Deadly Boss Mods"},
|
||||
{"Details! Damage Meter"},
|
||||
{"WeakAuras"},
|
||||
{"ElvUI"},
|
||||
{"BigWigs"},
|
||||
{"Recount"},
|
||||
{"GatherMate2"},
|
||||
{"TomTom"},
|
||||
{"Questie"},
|
||||
{"TradeSkillMaster"},
|
||||
{"HandyNotes"},
|
||||
{"Bagnon"},
|
||||
{"Threat Plates"},
|
||||
{"GTFO"},
|
||||
{"Plater Nameplates"},
|
||||
{"Rarity"},
|
||||
{"Pawn"},
|
||||
{"Auctioneer"},
|
||||
{"Shadowed Unit Frames"},
|
||||
{"SexyMap"},
|
||||
{"TidyPlates"},
|
||||
{"MoveAnything"},
|
||||
{"Postal"},
|
||||
{"OmniCC"},
|
||||
{"Leatrix Plus"},
|
||||
{"SimulationCraft"},
|
||||
{"VuhDo"},
|
||||
{"KuiNameplates"},
|
||||
}
|
||||
|
||||
func main() {
|
||||
a := app.New()
|
||||
w := a.NewWindow(fmt.Sprintf("RexForge %s", strings.ToUpper(git_rev)))
|
||||
w.Resize(fyne.NewSize(900, 600))
|
||||
|
||||
addons := model.AddonIndex
|
||||
|
||||
list := widget.NewList(
|
||||
func() int {
|
||||
return len(myList)
|
||||
return len(addons)
|
||||
},
|
||||
func() fyne.CanvasObject {
|
||||
btn := widget.NewButton("", func() {})
|
||||
|
@ -79,11 +40,11 @@ func main() {
|
|||
o.(*fyne.Container).RemoveAll()
|
||||
|
||||
btn := widget.NewButtonWithIcon("Download", theme.DownloadIcon(), func() {
|
||||
myList[i].Download()
|
||||
fmt.Println("Downloading: " + addons[i])
|
||||
})
|
||||
btn.Importance = widget.LowImportance
|
||||
|
||||
label := widget.NewLabel(myList[i].Name)
|
||||
label := widget.NewLabel(addons[i])
|
||||
|
||||
row := container.NewBorder(nil, nil, label, btn)
|
||||
o.(*fyne.Container).Add(row)
|
||||
|
|
Loading…
Add table
Reference in a new issue