-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
59 lines (47 loc) · 1.25 KB
/
main.go
File metadata and controls
59 lines (47 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"log"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"r6-replay-recorder/database"
"r6-replay-recorder/parser"
"r6-replay-recorder/ui"
)
func main() {
// 1. Initialize Database
log.Println("Initializing database...")
db, err := database.New()
if err != nil {
log.Fatal("Failed to initialize database:", err)
}
defer db.Close()
log.Println("Database initialized")
// 2. Initialize App
log.Println("Creating app...")
a := app.New()
// 3. Apply custom SiegeScope theme
log.Println("Applying theme...")
a.Settings().SetTheme(&ui.SiegeScopeTheme{})
log.Println("Theme applied")
// 4. Create window
log.Println("Creating window...")
w := a.NewWindow("SiegeScope")
// 5. Create parser and UI
log.Println("Creating parser and UI...")
p := parser.New(db)
u := ui.New(w, db, p)
// 6. Build and set content
log.Println("Building UI...")
content := u.Build()
log.Println("Setting content...")
w.SetContent(container.NewMax(content))
// 7. Resize and show
log.Println("Resizing window...")
w.Resize(fyne.NewSize(1500, 750))
log.Println("Showing window - app should stay open now...")
w.ShowAndRun()
// 8. Cleanup (only runs after window closes)
u.StopWatcher()
log.Println("SiegeScope closed.")
}