From f769adfee6fc7585269f2a0f39a52bfe3c5183bb Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 26 Jan 2025 11:21:26 +0100 Subject: [PATCH] Client changes, now uses rex model --- rex_client/go.mod | 2 +- rex_client/main.go | 53 ++++++---------------------------------------- 2 files changed, 8 insertions(+), 47 deletions(-) diff --git a/rex_client/go.mod b/rex_client/go.mod index 64472a2..0912fe9 100644 --- a/rex_client/go.mod +++ b/rex_client/go.mod @@ -1,4 +1,4 @@ -module rexforge +module rex_client go 1.23.4 diff --git a/rex_client/main.go b/rex_client/main.go index 6f9b059..8acea0c 100644 --- a/rex_client/main.go +++ b/rex_client/main.go @@ -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)