@@ -8,9 +8,9 @@ import (
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/paths" // Corrected import path
|
||||
"turtlesilicon/pkg/utils" // Corrected import path
|
||||
"epochsilicon/pkg/debug"
|
||||
"epochsilicon/pkg/paths" // Corrected import path
|
||||
"epochsilicon/pkg/utils" // Corrected import path
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
@@ -109,11 +109,11 @@ func LaunchGame(myWindow fyne.Window) {
|
||||
dialog.ShowError(fmt.Errorf("CrossOver path not set. Please set it in the patcher."), myWindow)
|
||||
return
|
||||
}
|
||||
if paths.TurtlewowPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("TurtleWoW path not set. Please set it in the patcher."), myWindow)
|
||||
if paths.EpochPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("Epoch path not set. Please set it in the patcher."), myWindow)
|
||||
return
|
||||
}
|
||||
if !paths.PatchesAppliedTurtleWoW || !paths.PatchesAppliedCrossOver {
|
||||
if !paths.PatchesAppliedEpoch || !paths.PatchesAppliedCrossOver {
|
||||
confirmed := false
|
||||
dialog.ShowConfirm("Warning", "Not all patches confirmed applied. Continue with launch?", func(c bool) {
|
||||
confirmed = c
|
||||
@@ -132,28 +132,9 @@ func LaunchGame(myWindow fyne.Window) {
|
||||
}
|
||||
gameMutex.Unlock()
|
||||
|
||||
debug.Println("Preparing to launch TurtleSilicon...")
|
||||
debug.Println("Preparing to launch EpochSilicon...")
|
||||
|
||||
// Determine which WoW executable to use based on vanilla-tweaks preference
|
||||
var wowExePath string
|
||||
if EnableVanillaTweaks {
|
||||
if !CheckForWoWTweakedExecutable() {
|
||||
// Show dialog asking if user wants us to apply vanilla-tweaks
|
||||
HandleVanillaTweaksRequest(myWindow, func() {
|
||||
// After successful patching, continue with launch using the tweaked executable
|
||||
wowTweakedExePath := GetWoWTweakedExecutablePath()
|
||||
if wowTweakedExePath != "" {
|
||||
continueLaunch(myWindow, wowTweakedExePath)
|
||||
} else {
|
||||
dialog.ShowError(fmt.Errorf("failed to find WoW-tweaked.exe after patching"), myWindow)
|
||||
}
|
||||
})
|
||||
return // Exit early since dialog will handle the continuation
|
||||
}
|
||||
wowExePath = GetWoWTweakedExecutablePath()
|
||||
} else {
|
||||
wowExePath = filepath.Join(paths.TurtlewowPath, "WoW.exe")
|
||||
}
|
||||
wowExePath := filepath.Join(paths.EpochPath, "Project-Epoch.exe")
|
||||
|
||||
// Continue with normal launch process
|
||||
continueLaunch(myWindow, wowExePath)
|
||||
@@ -161,12 +142,12 @@ func LaunchGame(myWindow fyne.Window) {
|
||||
|
||||
// continueLaunch continues the game launch process with the specified executable
|
||||
func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
||||
rosettaInTurtlePath := filepath.Join(paths.TurtlewowPath, "rosettax87")
|
||||
rosettaExecutable := filepath.Join(rosettaInTurtlePath, "rosettax87")
|
||||
rosettaInEpochPath := filepath.Join(paths.EpochPath, "rosettax87")
|
||||
rosettaExecutable := filepath.Join(rosettaInEpochPath, "rosettax87")
|
||||
wineloader2Path := filepath.Join(paths.CrossoverPath, "Contents", "SharedSupport", "CrossOver", "CrossOver-Hosted Application", "wineloader2")
|
||||
|
||||
if !utils.PathExists(rosettaExecutable) {
|
||||
dialog.ShowError(fmt.Errorf("rosetta executable not found at %s. Ensure TurtleWoW patching was successful", rosettaExecutable), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("rosetta executable not found at %s. Ensure Epoch patching was successful", rosettaExecutable), myWindow)
|
||||
return
|
||||
}
|
||||
if !utils.PathExists(wineloader2Path) {
|
||||
@@ -174,13 +155,13 @@ func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
||||
return
|
||||
}
|
||||
if !utils.PathExists(wowExePath) {
|
||||
dialog.ShowError(fmt.Errorf("WoW executable not found at %s. Ensure your TurtleWoW directory is correct", wowExePath), myWindow)
|
||||
dialog.ShowError(fmt.Errorf("WoW executable not found at %s. Ensure your Epoch directory is correct", wowExePath), myWindow)
|
||||
return
|
||||
}
|
||||
|
||||
// Auto-delete WDB directory if enabled
|
||||
if AutoDeleteWdb {
|
||||
wdbPath := filepath.Join(paths.TurtlewowPath, "WDB")
|
||||
wdbPath := filepath.Join(paths.EpochPath, "WDB")
|
||||
if utils.DirExists(wdbPath) {
|
||||
debug.Printf("Auto-deleting WDB directory: %s", wdbPath)
|
||||
if err := os.RemoveAll(wdbPath); err != nil {
|
||||
@@ -197,8 +178,8 @@ func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
||||
// Since RosettaX87 service is already running, we can directly launch WoW
|
||||
debug.Println("RosettaX87 service is running. Proceeding to launch WoW.")
|
||||
|
||||
if paths.CrossoverPath == "" || paths.TurtlewowPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("CrossOver path or TurtleWoW path is not set. Cannot launch WoW."), myWindow)
|
||||
if paths.CrossoverPath == "" || paths.EpochPath == "" {
|
||||
dialog.ShowError(fmt.Errorf("CrossOver path or Epoch path is not set. Cannot launch WoW."), myWindow)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -214,7 +195,7 @@ func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
||||
}
|
||||
|
||||
shellCmd := fmt.Sprintf(`cd %s && %s %s %s %s`,
|
||||
utils.QuotePathForShell(paths.TurtlewowPath),
|
||||
utils.QuotePathForShell(paths.EpochPath),
|
||||
envVars,
|
||||
utils.QuotePathForShell(rosettaExecutable),
|
||||
utils.QuotePathForShell(wineloader2Path),
|
||||
|
Reference in New Issue
Block a user