added field for environment variables
This commit is contained in:
@@ -2,5 +2,5 @@
|
|||||||
Icon = "Icon.png"
|
Icon = "Icon.png"
|
||||||
Name = "TurtleSilicon"
|
Name = "TurtleSilicon"
|
||||||
ID = "com.tairasu.turtlesilicon"
|
ID = "com.tairasu.turtlesilicon"
|
||||||
Version = "1.0.6"
|
Version = "1.0.7"
|
||||||
Build = 12
|
Build = 12
|
||||||
|
4
main.go
4
main.go
@@ -14,12 +14,12 @@ import (
|
|||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
)
|
)
|
||||||
|
|
||||||
const appVersion = "1.0.6"
|
const appVersion = "1.0.7"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
myApp := app.NewWithID("com.tairasu.turtlesilicon")
|
myApp := app.NewWithID("com.tairasu.turtlesilicon")
|
||||||
myWindow := myApp.NewWindow("TurtleSilicon v" + appVersion)
|
myWindow := myApp.NewWindow("TurtleSilicon v" + appVersion)
|
||||||
myWindow.Resize(fyne.NewSize(650, 450))
|
myWindow.Resize(fyne.NewSize(650, 500))
|
||||||
myWindow.SetFixedSize(true)
|
myWindow.SetFixedSize(true)
|
||||||
|
|
||||||
// Check for updates
|
// Check for updates
|
||||||
|
@@ -5,13 +5,15 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
|
||||||
"fyne.io/fyne/v2/dialog"
|
|
||||||
"turtlesilicon/pkg/paths" // Corrected import path
|
"turtlesilicon/pkg/paths" // Corrected import path
|
||||||
"turtlesilicon/pkg/utils" // Corrected import path
|
"turtlesilicon/pkg/utils" // Corrected import path
|
||||||
|
|
||||||
|
"fyne.io/fyne/v2"
|
||||||
|
"fyne.io/fyne/v2/dialog"
|
||||||
)
|
)
|
||||||
|
|
||||||
var EnableMetalHud = true // Default to enabled
|
var EnableMetalHud = true // Default to enabled
|
||||||
|
var CustomEnvVars = "" // Custom environment variables
|
||||||
|
|
||||||
func LaunchGame(myWindow fyne.Window) {
|
func LaunchGame(myWindow fyne.Window) {
|
||||||
log.Println("Launch Game button clicked")
|
log.Println("Launch Game button clicked")
|
||||||
@@ -81,9 +83,15 @@ func LaunchGame(myWindow fyne.Window) {
|
|||||||
mtlHudValue = "1"
|
mtlHudValue = "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
shellCmd := fmt.Sprintf(`cd %s && WINEDLLOVERRIDES="d3d9=n,b" MTL_HUD_ENABLED=%s %s %s %s`,
|
// Prepare environment variables
|
||||||
|
envVars := fmt.Sprintf(`WINEDLLOVERRIDES="d3d9=n,b" MTL_HUD_ENABLED=%s`, mtlHudValue)
|
||||||
|
if CustomEnvVars != "" {
|
||||||
|
envVars = CustomEnvVars + " " + envVars
|
||||||
|
}
|
||||||
|
|
||||||
|
shellCmd := fmt.Sprintf(`cd %s && %s %s %s %s`,
|
||||||
utils.QuotePathForShell(paths.TurtlewowPath),
|
utils.QuotePathForShell(paths.TurtlewowPath),
|
||||||
mtlHudValue,
|
envVars,
|
||||||
utils.QuotePathForShell(rosettaExecutable),
|
utils.QuotePathForShell(rosettaExecutable),
|
||||||
utils.QuotePathForShell(wineloader2Path),
|
utils.QuotePathForShell(wineloader2Path),
|
||||||
utils.QuotePathForShell(wowExePath))
|
utils.QuotePathForShell(wowExePath))
|
||||||
|
20
pkg/ui/ui.go
20
pkg/ui/ui.go
@@ -30,6 +30,7 @@ var (
|
|||||||
unpatchTurtleWoWButton *widget.Button
|
unpatchTurtleWoWButton *widget.Button
|
||||||
unpatchCrossOverButton *widget.Button
|
unpatchCrossOverButton *widget.Button
|
||||||
metalHudCheckbox *widget.Check
|
metalHudCheckbox *widget.Check
|
||||||
|
envVarsEntry *widget.Entry
|
||||||
)
|
)
|
||||||
|
|
||||||
func UpdateAllStatuses() {
|
func UpdateAllStatuses() {
|
||||||
@@ -182,6 +183,23 @@ func CreateUI(myWindow fyne.Window) fyne.CanvasObject {
|
|||||||
})
|
})
|
||||||
metalHudCheckbox.SetChecked(launcher.EnableMetalHud)
|
metalHudCheckbox.SetChecked(launcher.EnableMetalHud)
|
||||||
|
|
||||||
|
// Load environment variables from preferences
|
||||||
|
if prefs.EnvironmentVariables != "" {
|
||||||
|
launcher.CustomEnvVars = prefs.EnvironmentVariables
|
||||||
|
}
|
||||||
|
|
||||||
|
envVarsEntry = widget.NewEntry()
|
||||||
|
envVarsEntry.SetPlaceHolder(`Custom environment variables`)
|
||||||
|
envVarsEntry.SetText(launcher.CustomEnvVars)
|
||||||
|
envVarsEntry.OnChanged = func(text string) {
|
||||||
|
launcher.CustomEnvVars = text
|
||||||
|
// Save to preferences
|
||||||
|
prefs, _ := utils.LoadPrefs()
|
||||||
|
prefs.EnvironmentVariables = text
|
||||||
|
utils.SavePrefs(prefs)
|
||||||
|
log.Printf("Environment variables updated: %v", launcher.CustomEnvVars)
|
||||||
|
}
|
||||||
|
|
||||||
patchTurtleWoWButton = widget.NewButton("Patch TurtleWoW", func() {
|
patchTurtleWoWButton = widget.NewButton("Patch TurtleWoW", func() {
|
||||||
patching.PatchTurtleWoW(myWindow, UpdateAllStatuses)
|
patching.PatchTurtleWoW(myWindow, UpdateAllStatuses)
|
||||||
})
|
})
|
||||||
@@ -236,6 +254,8 @@ func CreateUI(myWindow fyne.Window) fyne.CanvasObject {
|
|||||||
pathSelectionForm,
|
pathSelectionForm,
|
||||||
patchOperationsLayout,
|
patchOperationsLayout,
|
||||||
metalHudCheckbox,
|
metalHudCheckbox,
|
||||||
|
widget.NewLabel("Environment Variables:"),
|
||||||
|
envVarsEntry,
|
||||||
container.NewPadded(launchButton),
|
container.NewPadded(launchButton),
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
githubContainer,
|
githubContainer,
|
||||||
|
@@ -10,6 +10,7 @@ type UserPrefs struct {
|
|||||||
SuppressedUpdateVersion string `json:"suppressed_update_version"`
|
SuppressedUpdateVersion string `json:"suppressed_update_version"`
|
||||||
TurtleWoWPath string `json:"turtlewow_path"`
|
TurtleWoWPath string `json:"turtlewow_path"`
|
||||||
CrossOverPath string `json:"crossover_path"`
|
CrossOverPath string `json:"crossover_path"`
|
||||||
|
EnvironmentVariables string `json:"environment_variables"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func getPrefsPath() (string, error) {
|
func getPrefsPath() (string, error) {
|
||||||
|
Reference in New Issue
Block a user