ncmdump-gui/main.go

56 lines
1.1 KiB
Go
Raw Normal View History

2024-11-26 14:28:46 +08:00
package main
import (
"embed"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
2025-02-01 19:23:17 +08:00
"github.com/wailsapp/wails/v2/pkg/options/mac"
2025-02-01 17:42:29 +08:00
"git.taurusxin.com/taurusxin/ncmdump-gui/utils"
2024-11-26 14:28:46 +08:00
)
//go:embed all:frontend/dist
var assets embed.FS
func main() {
// Create an instance of the app structure
app := NewApp()
2025-02-01 17:42:29 +08:00
config_manager, err := utils.NewConfigManager("config.json")
if err != nil {
return
}
2024-11-26 14:28:46 +08:00
// Create application with options
2025-02-01 17:42:29 +08:00
err = wails.Run(&options.App{
2024-11-26 14:28:46 +08:00
Title: "ncmdump-gui",
2024-11-26 19:40:57 +08:00
Width: 750,
Height: 500,
2024-11-26 14:28:46 +08:00
AssetServer: &assetserver.Options{
Assets: assets,
},
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
OnStartup: app.startup,
Bind: []interface{}{
app,
2025-02-01 17:42:29 +08:00
config_manager,
2024-11-26 14:28:46 +08:00
},
2025-02-01 12:11:13 +08:00
DragAndDrop: &options.DragAndDrop{
2025-02-01 19:23:17 +08:00
EnableFileDrop: true,
2025-02-01 12:11:13 +08:00
DisableWebViewDrop: true,
},
2025-02-01 19:23:17 +08:00
Mac: &mac.Options{
About: &mac.AboutInfo{
Title: "ncmdump-gui",
Message: "Copyright © 2025 TaurusXin",
},
},
2024-11-26 14:28:46 +08:00
})
if err != nil {
println("Error:", err.Error())
}
}