Skip to content

Commit

Permalink
fixing up a lot of things with mech summary and adding settings
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevinTeacutter committed Feb 13, 2024
1 parent 84f18df commit 20f6fa8
Show file tree
Hide file tree
Showing 38 changed files with 2,358 additions and 2,348 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build:
go build -ldflags "\
-H windowsgui \
-s -w \
-X github.com/trevinteacutter/mwo-helper/pkg/build.Build=v0.1.0 \
-X github.com/trevinteacutter/mwo-helper/pkg/build.Build=v0.1.1 \
-X github.com/trevinteacutter/mwo-helper/pkg/build.Commit=$(git rev-parse HEAD) \
-X github.com/trevinteacutter/mwo-helper/pkg/build.Date=Never \
-X github.com/trevinteacutter/mwo-helper/pkg/build.Runtime=$(go version | awk '{print $3;}') \
Expand Down
1,079 changes: 0 additions & 1,079 deletions Untitled spreadsheet - Sheet1.csv

This file was deleted.

114 changes: 0 additions & 114 deletions Untitled spreadsheet - Sheet2.csv

This file was deleted.

31 changes: 31 additions & 0 deletions cmd/prototype/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package main

import (
"flag"
"log"
"os"

"gioui.org/app"
"gioui.org/unit"

"github.com/trevinteacutter/mwo-helper/internal/cmd/prototype"
)

func main() {
flag.Parse()

go func() {
window := app.NewWindow(
app.Title("MWNext Prototype"),
app.Size(unit.Dp(1280), unit.Dp(720)),
)

if err := helper.Loop(window); err != nil {
log.Panic(err)
}

os.Exit(0)
}()

app.Main()
}
20 changes: 3 additions & 17 deletions internal/cmd/helper/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ import (
"gioui.org/text"
"gioui.org/widget/material"

"github.com/trevinteacutter/mwo-helper/pkg/pages"
"github.com/trevinteacutter/mwo-helper/pkg/pages/about"
"github.com/trevinteacutter/mwo-helper/pkg/pages/home"
"github.com/trevinteacutter/mwo-helper/pkg/pages/matches"
"github.com/trevinteacutter/mwo-helper/pkg/pages/series"
"github.com/trevinteacutter/mwo-helper/pkg/pages/settings"
"github.com/trevinteacutter/mwo-helper/pkg/helper"
)

func Loop(window *app.Window) error {
Expand All @@ -27,16 +22,7 @@ func Loop(window *app.Window) error {

var ops op.Ops

router := pages.NewRouter()
router.Register(0, home.New())
// router.Register(1, teams.New())
// router.Register(2, pilots.New())
router.Register(1, series.New())
router.Register(2, matches.New())
// router.Register(5, isc.New())
// router.Register(6, wc.New())
router.Register(3, settings.New())
router.Register(4, about.New())
ui := helper.New()

for {
switch event := window.NextEvent().(type) {
Expand All @@ -45,7 +31,7 @@ func Loop(window *app.Window) error {
case system.FrameEvent:
gtx := layout.NewContext(&ops, event)

router.Layout(gtx, theme)
ui.Layout(gtx, theme)
event.Frame(gtx.Ops)
}
}
Expand Down
38 changes: 38 additions & 0 deletions internal/cmd/prototype/cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package helper

import (
"gioui.org/app"
"gioui.org/font/gofont"
"gioui.org/io/system"
"gioui.org/layout"
"gioui.org/op"
"gioui.org/text"
"gioui.org/widget/material"

"github.com/trevinteacutter/mwo-helper/pkg/prototype"
)

func Loop(window *app.Window) error {
// database := Load()
//
// defer database.Close()

theme := material.NewTheme()
theme.Shaper = text.NewShaper(text.WithCollection(gofont.Collection()))

var ops op.Ops

ui := prototype.New()

for {
switch event := window.NextEvent().(type) {
case system.DestroyEvent:
return event.Err
case system.FrameEvent:
gtx := layout.NewContext(&ops, event)

ui.Layout(gtx, theme)
event.Frame(gtx.Ops)
}
}
}
6 changes: 3 additions & 3 deletions pkg/pages/about/page.go → pkg/helper/pages/about/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import (

"github.com/trevinteacutter/mwo-helper/pkg/applayout"
"github.com/trevinteacutter/mwo-helper/pkg/build"
"github.com/trevinteacutter/mwo-helper/pkg/helper/pages"
"github.com/trevinteacutter/mwo-helper/pkg/icon"
"github.com/trevinteacutter/mwo-helper/pkg/pages"
)

var _ pages.Page = (*Page)(nil)

// Page holds the state for a page demonstrating the features of
// the AppBar component.
type Page struct {
Expand All @@ -23,8 +25,6 @@ func New() *Page {
return &Page{}
}

var _ pages.Page = &Page{}

func (p *Page) Actions() []component.AppBarAction {
return []component.AppBarAction{}
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/pages/home/page.go → pkg/helper/pages/home/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import (
"gioui.org/widget/material"
"gioui.org/x/component"

"github.com/trevinteacutter/mwo-helper/pkg/helper/pages"
"github.com/trevinteacutter/mwo-helper/pkg/icon"
"github.com/trevinteacutter/mwo-helper/pkg/pages"
)

var _ pages.Page = (*Page)(nil)

// Page holds the state for a page demonstrating the features of
// the AppBar component.
type Page struct{}
Expand All @@ -18,8 +20,6 @@ func New() *Page {
return &Page{}
}

var _ pages.Page = &Page{}

func (p *Page) Actions() []component.AppBarAction {
return []component.AppBarAction{}
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/pages/isc/page.go → pkg/helper/pages/isc/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"gioui.org/x/component"

"github.com/trevinteacutter/mwo-helper/pkg/applayout"
"github.com/trevinteacutter/mwo-helper/pkg/helper/pages"
"github.com/trevinteacutter/mwo-helper/pkg/icon"
"github.com/trevinteacutter/mwo-helper/pkg/pages"
)

var _ pages.Page = (*Page)(nil)

// Page holds the state for a page demonstrating the features of
// the AppBar component.
type Page struct {
Expand All @@ -20,8 +22,6 @@ func New() *Page {
return &Page{}
}

var _ pages.Page = &Page{}

func (p *Page) Actions() []component.AppBarAction {
return []component.AppBarAction{}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"gioui.org/widget/material"
"github.com/go-resty/resty/v2"

"github.com/trevinteacutter/mwo-helper/pkg/helper/settings"
"github.com/trevinteacutter/mwo-helper/pkg/mwo/api"
"github.com/trevinteacutter/mwo-helper/pkg/settings"
)

type Input struct {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import (
"gioui.org/widget/material"
"gioui.org/x/component"

"github.com/trevinteacutter/mwo-helper/pkg/helper/pages"
"github.com/trevinteacutter/mwo-helper/pkg/icon"
"github.com/trevinteacutter/mwo-helper/pkg/mwo/api"
"github.com/trevinteacutter/mwo-helper/pkg/pages"
)

var _ pages.Page = (*Page)(nil)

// Page holds the state for a page demonstrating the features of
// the AppBar component.
type Page struct {
Expand All @@ -29,8 +31,6 @@ func New() *Page {
}
}

var _ pages.Page = &Page{}

func (p *Page) Actions() []component.AppBarAction {
return []component.AppBarAction{}
}
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 20f6fa8

Please sign in to comment.