rip out turtle specific options
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (push) Has been cancelled
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (push) Has been cancelled
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -14,7 +13,6 @@ import (
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
@@ -43,17 +41,6 @@ func createOptionsComponents() {
|
||||
})
|
||||
showTerminalCheckbox.SetChecked(prefs.ShowTerminalNormally)
|
||||
|
||||
vanillaTweaksCheckbox = widget.NewCheck("Enable vanilla-tweaks", func(checked bool) {
|
||||
launcher.EnableVanillaTweaks = checked
|
||||
// Save to preferences
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.EnableVanillaTweaks = checked
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Vanilla-tweaks enabled: %v", launcher.EnableVanillaTweaks)
|
||||
})
|
||||
vanillaTweaksCheckbox.SetChecked(prefs.EnableVanillaTweaks)
|
||||
launcher.EnableVanillaTweaks = prefs.EnableVanillaTweaks
|
||||
|
||||
autoDeleteWdbCheckbox = widget.NewCheck("Auto-delete WDB directory on launch", func(checked bool) {
|
||||
launcher.AutoDeleteWdb = checked
|
||||
// Save to preferences
|
||||
@@ -65,41 +52,9 @@ func createOptionsComponents() {
|
||||
autoDeleteWdbCheckbox.SetChecked(prefs.AutoDeleteWdb)
|
||||
launcher.AutoDeleteWdb = prefs.AutoDeleteWdb
|
||||
|
||||
// Create recommended settings button with help icon
|
||||
applyRecommendedSettingsButton = widget.NewButton("Apply recommended settings", func() {
|
||||
err := launcher.ApplyRecommendedSettings()
|
||||
if err != nil {
|
||||
debug.Printf("Failed to apply recommended settings: %v", err)
|
||||
// Show error dialog if we have a window reference
|
||||
if currentWindow != nil {
|
||||
dialog.ShowError(fmt.Errorf("failed to apply recommended settings: %v", err), currentWindow)
|
||||
}
|
||||
} else {
|
||||
debug.Printf("Successfully applied recommended settings")
|
||||
// Show success dialog if we have a window reference
|
||||
if currentWindow != nil {
|
||||
dialog.ShowInformation("Success", "Recommended graphics settings have been applied", currentWindow)
|
||||
}
|
||||
// Update button state
|
||||
updateRecommendedSettingsButton()
|
||||
}
|
||||
})
|
||||
applyRecommendedSettingsButton.Importance = widget.MediumImportance
|
||||
|
||||
// Create help button for recommended settings
|
||||
recommendedSettingsHelpButton = widget.NewButton("?", func() {
|
||||
showRecommendedSettingsHelpPopup()
|
||||
})
|
||||
recommendedSettingsHelpButton.Importance = widget.MediumImportance
|
||||
// Initialize button state
|
||||
updateRecommendedSettingsButton()
|
||||
|
||||
// Create Wine registry Option-as-Alt buttons and status
|
||||
createWineRegistryComponents()
|
||||
|
||||
// Create graphics settings components
|
||||
createGraphicsSettingsComponents()
|
||||
|
||||
// Load environment variables from preferences
|
||||
if prefs.EnvironmentVariables != "" {
|
||||
launcher.CustomEnvVars = prefs.EnvironmentVariables
|
||||
@@ -120,11 +75,11 @@ func createOptionsComponents() {
|
||||
|
||||
// createPatchingButtons creates all patching-related buttons
|
||||
func createPatchingButtons(myWindow fyne.Window) {
|
||||
patchTurtleWoWButton = widget.NewButton("Patch TurtleWoW", func() {
|
||||
patching.PatchTurtleWoW(myWindow, UpdateAllStatuses)
|
||||
patchTurtleWoWButton = widget.NewButton("Patch Epoch", func() {
|
||||
patching.PatchEpoch(myWindow, UpdateAllStatuses)
|
||||
})
|
||||
unpatchTurtleWoWButton = widget.NewButton("Unpatch TurtleWoW", func() {
|
||||
patching.UnpatchTurtleWoW(myWindow, UpdateAllStatuses)
|
||||
unpatchTurtleWoWButton = widget.NewButton("Unpatch Epoch", func() {
|
||||
patching.UnpatchEpoch(myWindow, UpdateAllStatuses)
|
||||
})
|
||||
patchCrossOverButton = widget.NewButton("Patch CrossOver", func() {
|
||||
patching.PatchCrossOver(myWindow, UpdateAllStatuses)
|
||||
@@ -484,187 +439,3 @@ func showRecommendedSettingsHelpPopup() {
|
||||
|
||||
helpPopup.Show()
|
||||
}
|
||||
|
||||
// createGraphicsSettingsComponents creates all graphics settings checkboxes and buttons
|
||||
func createGraphicsSettingsComponents() {
|
||||
// Load preferences for initial values
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
|
||||
// Create Reduce Terrain Distance setting with help button
|
||||
reduceTerrainDistanceCheckbox = widget.NewCheck("", func(checked bool) {
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.ReduceTerrainDistance = checked
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Reduce terrain distance: %v", checked)
|
||||
updateApplyGraphicsSettingsButton()
|
||||
})
|
||||
reduceTerrainDistanceCheckbox.SetChecked(prefs.ReduceTerrainDistance)
|
||||
|
||||
reduceTerrainDistanceHelpButton = widget.NewButton("?", func() {
|
||||
showGraphicsSettingHelpPopup("Reduce Terrain Distance", "Sets the draw distance to the lowest setting. This will drastically increase your FPS", "High Performance Impact")
|
||||
})
|
||||
reduceTerrainDistanceHelpButton.Importance = widget.MediumImportance
|
||||
|
||||
// Create Set Multisample to 2x setting with help button
|
||||
setMultisampleTo2xCheckbox = widget.NewCheck("", func(checked bool) {
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.SetMultisampleTo2x = checked
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Set multisample to 2x: %v", checked)
|
||||
updateApplyGraphicsSettingsButton()
|
||||
})
|
||||
setMultisampleTo2xCheckbox.SetChecked(prefs.SetMultisampleTo2x)
|
||||
|
||||
setMultisampleTo2xHelpButton = widget.NewButton("?", func() {
|
||||
showGraphicsSettingHelpPopup("Set Multisample to 2x", "Might reduce your FPS slightly on lower end machines, but makes sure the portraits load properly.", "Medium Performance Impact")
|
||||
})
|
||||
setMultisampleTo2xHelpButton.Importance = widget.MediumImportance
|
||||
|
||||
// Create Set Shadow LOD to 0 setting with help button
|
||||
setShadowLOD0Checkbox = widget.NewCheck("", func(checked bool) {
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.SetShadowLOD0 = checked
|
||||
|
||||
// Track if user manually disabled this setting
|
||||
if !checked {
|
||||
prefs.UserDisabledShadowLOD = true
|
||||
} else {
|
||||
prefs.UserDisabledShadowLOD = false
|
||||
}
|
||||
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Set shadow LOD to 0: %v (user manually changed)", checked)
|
||||
updateApplyGraphicsSettingsButton()
|
||||
})
|
||||
setShadowLOD0Checkbox.SetChecked(prefs.SetShadowLOD0)
|
||||
|
||||
setShadowLOD0HelpButton = widget.NewButton("?", func() {
|
||||
showGraphicsSettingHelpPopup("Set Shadow LOD to 0", "Turns off all shadows. This will give you ~10% more FPS.", "High Performance Impact")
|
||||
})
|
||||
setShadowLOD0HelpButton.Importance = widget.MediumImportance
|
||||
|
||||
// Create Enable libSiliconPatch setting with help button
|
||||
libSiliconPatchCheckbox = widget.NewCheck("", func(checked bool) {
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
prefs.EnableLibSiliconPatch = checked
|
||||
|
||||
// Track if user manually disabled this setting
|
||||
if !checked {
|
||||
prefs.UserDisabledLibSiliconPatch = true
|
||||
} else {
|
||||
prefs.UserDisabledLibSiliconPatch = false
|
||||
}
|
||||
|
||||
utils.SavePrefs(prefs)
|
||||
debug.Printf("Enable libSiliconPatch: %v (user manually changed)", checked)
|
||||
updateApplyGraphicsSettingsButton()
|
||||
})
|
||||
libSiliconPatchCheckbox.SetChecked(prefs.EnableLibSiliconPatch)
|
||||
|
||||
libSiliconPatchHelpButton = widget.NewButton("?", func() {
|
||||
showGraphicsSettingHelpPopup("Enable libSiliconPatch", "Hooks into the WoW process and replaces slow X87 instructions with SSE2 instructions that Rosetta can translate much quicker, resulting in an increase in FPS (2x or more). May potentially cause graphical bugs.", "Very High Performance Impact")
|
||||
})
|
||||
libSiliconPatchHelpButton.Importance = widget.MediumImportance
|
||||
|
||||
applyGraphicsSettingsButton = widget.NewButton("Apply Graphics Settings", func() {
|
||||
err := patching.ApplyGraphicsSettings(currentWindow)
|
||||
if err != nil {
|
||||
debug.Printf("Failed to apply graphics settings: %v", err)
|
||||
if currentWindow != nil {
|
||||
dialog.ShowError(fmt.Errorf("failed to apply graphics settings: %v", err), currentWindow)
|
||||
}
|
||||
} else {
|
||||
debug.Printf("Successfully applied graphics settings")
|
||||
if currentWindow != nil {
|
||||
dialog.ShowInformation("Success", "Graphics settings have been applied", currentWindow)
|
||||
}
|
||||
// Refresh checkboxes to reflect current state
|
||||
refreshGraphicsSettingsCheckboxes()
|
||||
}
|
||||
})
|
||||
applyGraphicsSettingsButton.Importance = widget.MediumImportance
|
||||
|
||||
// Initialize button state
|
||||
updateApplyGraphicsSettingsButton()
|
||||
}
|
||||
|
||||
// updateApplyGraphicsSettingsButton updates the state of the apply graphics settings button
|
||||
func updateApplyGraphicsSettingsButton() {
|
||||
if applyGraphicsSettingsButton == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Always enable the button since we need to handle both adding and removing settings
|
||||
applyGraphicsSettingsButton.Enable()
|
||||
applyGraphicsSettingsButton.SetText("Apply Changes")
|
||||
}
|
||||
|
||||
// refreshGraphicsSettingsCheckboxes updates the checkbox states from current preferences
|
||||
func refreshGraphicsSettingsCheckboxes() {
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
|
||||
if reduceTerrainDistanceCheckbox != nil {
|
||||
reduceTerrainDistanceCheckbox.SetChecked(prefs.ReduceTerrainDistance)
|
||||
}
|
||||
if setMultisampleTo2xCheckbox != nil {
|
||||
setMultisampleTo2xCheckbox.SetChecked(prefs.SetMultisampleTo2x)
|
||||
}
|
||||
if setShadowLOD0Checkbox != nil {
|
||||
setShadowLOD0Checkbox.SetChecked(prefs.SetShadowLOD0)
|
||||
}
|
||||
if libSiliconPatchCheckbox != nil {
|
||||
libSiliconPatchCheckbox.SetChecked(prefs.EnableLibSiliconPatch)
|
||||
}
|
||||
|
||||
// Update the apply button state
|
||||
updateApplyGraphicsSettingsButton()
|
||||
}
|
||||
|
||||
// showGraphicsSettingHelpPopup shows a help popup for a specific graphics setting
|
||||
func showGraphicsSettingHelpPopup(title, description, impact string) {
|
||||
if currentWindow == nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Create help content
|
||||
helpTitle := widget.NewRichTextFromMarkdown("# " + title)
|
||||
|
||||
descriptionLabel := widget.NewLabel(description)
|
||||
descriptionLabel.Wrapping = fyne.TextWrapWord
|
||||
|
||||
impactLabel := widget.NewLabel(impact)
|
||||
impactLabel.TextStyle = fyne.TextStyle{Bold: true}
|
||||
|
||||
// Create OK button
|
||||
okButton := widget.NewButton("OK", func() {
|
||||
// This will be set when the popup is created
|
||||
})
|
||||
okButton.Importance = widget.MediumImportance
|
||||
|
||||
// Create help content container
|
||||
helpContentContainer := container.NewVBox(
|
||||
container.NewCenter(helpTitle),
|
||||
widget.NewSeparator(),
|
||||
descriptionLabel,
|
||||
widget.NewSeparator(),
|
||||
impactLabel,
|
||||
widget.NewSeparator(),
|
||||
container.NewCenter(okButton),
|
||||
)
|
||||
|
||||
// Calculate popup size
|
||||
windowSize := currentWindow.Content().Size()
|
||||
popupWidth := windowSize.Width * 2 / 3
|
||||
popupHeight := windowSize.Height / 2
|
||||
|
||||
// Create the help popup
|
||||
helpPopup := widget.NewModalPopUp(container.NewPadded(helpContentContainer), currentWindow.Canvas())
|
||||
helpPopup.Resize(fyne.NewSize(popupWidth, popupHeight))
|
||||
|
||||
// Set the OK button action to hide the help popup
|
||||
okButton.OnTapped = func() {
|
||||
helpPopup.Hide()
|
||||
}
|
||||
|
||||
helpPopup.Show()
|
||||
}
|
||||
|
@@ -64,8 +64,8 @@ func createPathSelectionForm(myWindow fyne.Window) *widget.Form {
|
||||
paths.SelectCrossOverPath(myWindow, crossoverPathLabel, UpdateAllStatuses)
|
||||
}), crossoverPathLabel)),
|
||||
widget.NewFormItem("TurtleWoW Path:", container.NewBorder(nil, nil, nil, widget.NewButton("Set/Change", func() {
|
||||
paths.SelectTurtleWoWPath(myWindow, turtlewowPathLabel, UpdateAllStatuses)
|
||||
}), turtlewowPathLabel)),
|
||||
paths.SelectTurtleWoWPath(myWindow, epochPathLabel, UpdateAllStatuses)
|
||||
}), epochPathLabel)),
|
||||
)
|
||||
|
||||
return pathSelectionForm
|
||||
@@ -76,7 +76,7 @@ func createPatchOperationsLayout() fyne.CanvasObject {
|
||||
patchOperationsLayout := container.NewVBox(
|
||||
widget.NewSeparator(),
|
||||
container.NewGridWithColumns(4,
|
||||
widget.NewLabel("TurtleWoW Patch:"), turtlewowStatusLabel, patchTurtleWoWButton, unpatchTurtleWoWButton,
|
||||
widget.NewLabel("TurtleWoW Patch:"), epochStatusLabel, patchTurtleWoWButton, unpatchTurtleWoWButton,
|
||||
),
|
||||
container.NewGridWithColumns(4,
|
||||
widget.NewLabel("CrossOver Patch:"), crossoverStatusLabel, patchCrossOverButton, unpatchCrossOverButton,
|
||||
|
@@ -13,8 +13,6 @@ import (
|
||||
|
||||
"howett.net/plist"
|
||||
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/patching"
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/utils"
|
||||
)
|
||||
@@ -25,17 +23,6 @@ func showOptionsPopup() {
|
||||
return
|
||||
}
|
||||
|
||||
// Check graphics settings presence and update preferences before showing UI
|
||||
patching.CheckGraphicsSettingsPresence()
|
||||
|
||||
// Load graphics settings from Config.wtf and update preferences
|
||||
if err := patching.LoadGraphicsSettingsFromConfig(); err != nil {
|
||||
debug.Printf("Warning: failed to load graphics settings from Config.wtf: %v", err)
|
||||
}
|
||||
|
||||
// Refresh checkbox states to reflect current settings
|
||||
refreshGraphicsSettingsCheckboxes()
|
||||
|
||||
// Create General tab content
|
||||
generalTitle := widget.NewLabel("General Settings")
|
||||
generalTitle.TextStyle = fyne.TextStyle{Bold: true}
|
||||
@@ -51,57 +38,6 @@ func showOptionsPopup() {
|
||||
container.NewBorder(nil, nil, nil, container.NewHBox(enableOptionAsAltButton, disableOptionAsAltButton), optionAsAltStatusLabel),
|
||||
)
|
||||
|
||||
// Create Graphics tab content
|
||||
graphicsTitle := widget.NewLabel("Graphics Settings")
|
||||
graphicsTitle.TextStyle = fyne.TextStyle{Bold: true}
|
||||
|
||||
graphicsDescription := widget.NewLabel("Select graphics settings to apply to Config.wtf:")
|
||||
graphicsDescription.TextStyle = fyne.TextStyle{Italic: true}
|
||||
|
||||
// Create bold text labels for each setting
|
||||
terrainLabel := widget.NewLabel("Reduce Terrain Distance")
|
||||
terrainLabel.TextStyle = fyne.TextStyle{Bold: true}
|
||||
|
||||
multisampleLabel := widget.NewLabel("Set Multisample to 2x")
|
||||
multisampleLabel.TextStyle = fyne.TextStyle{Bold: true}
|
||||
|
||||
shadowLabel := widget.NewLabel("Set Shadow LOD to 0")
|
||||
shadowLabel.TextStyle = fyne.TextStyle{Bold: true}
|
||||
|
||||
libSiliconPatchLabel := widget.NewLabel("Enable libSiliconPatch")
|
||||
libSiliconPatchLabel.TextStyle = fyne.TextStyle{Bold: true}
|
||||
|
||||
// Create setting rows with help buttons between checkbox and label
|
||||
terrainRow := container.NewHBox(
|
||||
reduceTerrainDistanceCheckbox,
|
||||
reduceTerrainDistanceHelpButton,
|
||||
terrainLabel)
|
||||
multisampleRow := container.NewHBox(
|
||||
setMultisampleTo2xCheckbox,
|
||||
setMultisampleTo2xHelpButton,
|
||||
multisampleLabel)
|
||||
shadowRow := container.NewHBox(
|
||||
setShadowLOD0Checkbox,
|
||||
setShadowLOD0HelpButton,
|
||||
shadowLabel)
|
||||
libSiliconPatchRow := container.NewHBox(
|
||||
libSiliconPatchCheckbox,
|
||||
libSiliconPatchHelpButton,
|
||||
libSiliconPatchLabel)
|
||||
|
||||
graphicsContainer := container.NewVBox(
|
||||
graphicsTitle,
|
||||
widget.NewSeparator(),
|
||||
graphicsDescription,
|
||||
widget.NewSeparator(),
|
||||
terrainRow,
|
||||
multisampleRow,
|
||||
shadowRow,
|
||||
libSiliconPatchRow,
|
||||
widget.NewSeparator(),
|
||||
container.NewCenter(applyGraphicsSettingsButton),
|
||||
)
|
||||
|
||||
// Create Environment Variables tab content
|
||||
envVarsTitle := widget.NewLabel("Environment Variables")
|
||||
envVarsTitle.TextStyle = fyne.TextStyle{Bold: true}
|
||||
@@ -114,7 +50,6 @@ func showOptionsPopup() {
|
||||
// Create tabs
|
||||
tabs := container.NewAppTabs(
|
||||
container.NewTabItem("General", container.NewScroll(generalContainer)),
|
||||
container.NewTabItem("Graphics", container.NewScroll(graphicsContainer)),
|
||||
container.NewTabItem("Environment", container.NewScroll(envVarsContainer)),
|
||||
)
|
||||
|
||||
@@ -223,9 +158,9 @@ func showTroubleshootingPopup() {
|
||||
|
||||
// --- Delete WDB Directory ---
|
||||
wdbDeleteButton = widget.NewButton("Delete", func() {
|
||||
wdbPath := filepath.Join(paths.TurtlewowPath, "WDB")
|
||||
wdbPath := filepath.Join(paths.EpochPath, "WDB")
|
||||
if !utils.DirExists(wdbPath) {
|
||||
dialog.ShowInformation("WDB Not Found", "No WDB directory found in your TurtleWoW folder.", currentWindow)
|
||||
dialog.ShowInformation("WDB Not Found", "No WDB directory found in your Epoch folder.", currentWindow)
|
||||
return
|
||||
}
|
||||
dialog.NewConfirm("Delete WDB Directory", "Are you sure you want to delete the WDB directory? This will remove all cached data. No important data will be lost.", func(confirm bool) {
|
||||
@@ -244,7 +179,7 @@ func showTroubleshootingPopup() {
|
||||
wineDeleteButton = widget.NewButton("Delete", func() {
|
||||
homeDir, _ := os.UserHomeDir()
|
||||
userWine := filepath.Join(homeDir, ".wine")
|
||||
turtleWine := filepath.Join(paths.TurtlewowPath, ".wine")
|
||||
turtleWine := filepath.Join(paths.EpochPath, ".wine")
|
||||
msg := "Are you sure you want to delete the following Wine prefixes?\n\n- " + userWine + "\n- " + turtleWine + "\n\nThis cannot be undone."
|
||||
dialog.NewConfirm("Delete Wine Prefixes", msg, func(confirm bool) {
|
||||
if confirm {
|
||||
@@ -255,7 +190,7 @@ func showTroubleshootingPopup() {
|
||||
return
|
||||
}
|
||||
if err2 != nil && !os.IsNotExist(err2) {
|
||||
dialog.ShowError(fmt.Errorf("Failed to delete TurtleWoW/.wine: %v", err2), currentWindow)
|
||||
dialog.ShowError(fmt.Errorf("Failed to delete Epoch/.wine: %v", err2), currentWindow)
|
||||
return
|
||||
}
|
||||
dialog.ShowInformation("Wine Prefixes Deleted", "Wine prefixes deleted successfully.", currentWindow)
|
||||
@@ -288,11 +223,11 @@ func showTroubleshootingPopup() {
|
||||
troubleshootingCloseButton = widget.NewButton("Close", func() {})
|
||||
|
||||
popupContent := container.NewBorder(
|
||||
nil, // top
|
||||
nil, // top
|
||||
container.NewCenter(troubleshootingCloseButton), // bottom
|
||||
nil, // left
|
||||
nil, // right
|
||||
container.NewPadded(scrollContainer), // center
|
||||
nil, // left
|
||||
nil, // right
|
||||
container.NewPadded(scrollContainer), // center
|
||||
)
|
||||
|
||||
windowSize := currentWindow.Content().Size()
|
||||
|
@@ -6,7 +6,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"turtlesilicon/pkg/patching"
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/service"
|
||||
"turtlesilicon/pkg/utils"
|
||||
@@ -23,7 +22,7 @@ var (
|
||||
// UpdateAllStatuses updates all UI components based on current application state
|
||||
func UpdateAllStatuses() {
|
||||
updateCrossoverStatus()
|
||||
updateTurtleWoWStatus()
|
||||
updateEpochStatus()
|
||||
updatePlayButtonState()
|
||||
updateServiceStatus()
|
||||
|
||||
@@ -76,20 +75,20 @@ func updateCrossoverStatus() {
|
||||
crossoverStatusLabel.Refresh()
|
||||
}
|
||||
|
||||
// updateTurtleWoWStatus updates TurtleWoW path and patch status
|
||||
func updateTurtleWoWStatus() {
|
||||
if paths.TurtlewowPath == "" {
|
||||
turtlewowPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not set", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
paths.PatchesAppliedTurtleWoW = false // Reset if path is cleared
|
||||
// updateEpochStatus updates TurtleWoW path and patch status
|
||||
func updateEpochStatus() {
|
||||
if paths.EpochPath == "" {
|
||||
epochPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not set", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
paths.PatchesAppliedEpoch = false // Reset if path is cleared
|
||||
} else {
|
||||
turtlewowPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: paths.TurtlewowPath, Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
|
||||
epochPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: paths.EpochPath, Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
|
||||
|
||||
// Check if all required files exist
|
||||
winerosettaDllPath := filepath.Join(paths.TurtlewowPath, "winerosetta.dll")
|
||||
d3d9DllPath := filepath.Join(paths.TurtlewowPath, "d3d9.dll")
|
||||
libSiliconPatchDllPath := filepath.Join(paths.TurtlewowPath, "libSiliconPatch.dll")
|
||||
rosettaX87DirPath := filepath.Join(paths.TurtlewowPath, "rosettax87")
|
||||
dllsTextFile := filepath.Join(paths.TurtlewowPath, "dlls.txt")
|
||||
winerosettaDllPath := filepath.Join(paths.EpochPath, "winerosetta.dll")
|
||||
d3d9DllPath := filepath.Join(paths.EpochPath, "d3d9.dll")
|
||||
libSiliconPatchDllPath := filepath.Join(paths.EpochPath, "libSiliconPatch.dll")
|
||||
rosettaX87DirPath := filepath.Join(paths.EpochPath, "rosettax87")
|
||||
dllsTextFile := filepath.Join(paths.EpochPath, "dlls.txt")
|
||||
rosettaX87ExePath := filepath.Join(rosettaX87DirPath, "rosettax87")
|
||||
libRuntimeRosettaX87Path := filepath.Join(rosettaX87DirPath, "libRuntimeRosettax87")
|
||||
|
||||
@@ -99,13 +98,8 @@ func updateTurtleWoWStatus() {
|
||||
contentStr := string(fileContent)
|
||||
winerosettaPresent := strings.Contains(contentStr, "winerosetta.dll")
|
||||
|
||||
// Check if libSiliconPatch should be present based on user preference
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
libSiliconPatchRequired := prefs.EnableLibSiliconPatch
|
||||
libSiliconPatchPresent := strings.Contains(contentStr, "libSiliconPatch.dll")
|
||||
|
||||
// Validate dlls.txt: winerosetta must be present, libSiliconPatch based on setting
|
||||
if winerosettaPresent && (!libSiliconPatchRequired || libSiliconPatchPresent) {
|
||||
if winerosettaPresent {
|
||||
dllsFileValid = true
|
||||
}
|
||||
}
|
||||
@@ -114,29 +108,21 @@ func updateTurtleWoWStatus() {
|
||||
// Check if patched files have the correct size (matches bundled versions)
|
||||
winerosettaDllCorrectSize := utils.CompareFileWithBundledResource(winerosettaDllPath, "winerosetta/winerosetta.dll")
|
||||
d3d9DllCorrectSize := utils.CompareFileWithBundledResource(d3d9DllPath, "winerosetta/d3d9.dll")
|
||||
libSiliconPatchCorrectSize := utils.CompareFileWithBundledResource(libSiliconPatchDllPath, "winerosetta/libSiliconPatch.dll")
|
||||
rosettaX87CorrectSize := utils.CompareFileWithBundledResource(rosettaX87ExePath, "rosettax87/rosettax87")
|
||||
libRuntimeRosettaX87CorrectSize := utils.CompareFileWithBundledResource(libRuntimeRosettaX87Path, "rosettax87/libRuntimeRosettax87")
|
||||
|
||||
// Check if shadowLOD setting is applied (only if user has enabled it in graphics settings)
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
shadowLODRequiredAndApplied := true // Default to true if not required
|
||||
if prefs.SetShadowLOD0 {
|
||||
shadowLODRequiredAndApplied = patching.CheckShadowLODSetting()
|
||||
}
|
||||
|
||||
if utils.PathExists(winerosettaDllPath) && utils.PathExists(d3d9DllPath) && utils.PathExists(libSiliconPatchDllPath) &&
|
||||
utils.DirExists(rosettaX87DirPath) && utils.PathExists(rosettaX87ExePath) &&
|
||||
utils.PathExists(libRuntimeRosettaX87Path) && dllsFileValid &&
|
||||
winerosettaDllCorrectSize && d3d9DllCorrectSize && libSiliconPatchCorrectSize &&
|
||||
rosettaX87CorrectSize && libRuntimeRosettaX87CorrectSize && shadowLODRequiredAndApplied {
|
||||
paths.PatchesAppliedTurtleWoW = true
|
||||
winerosettaDllCorrectSize && d3d9DllCorrectSize &&
|
||||
rosettaX87CorrectSize && libRuntimeRosettaX87CorrectSize {
|
||||
paths.PatchesAppliedEpoch = true
|
||||
}
|
||||
}
|
||||
turtlewowPathLabel.Refresh()
|
||||
epochPathLabel.Refresh()
|
||||
|
||||
if paths.PatchesAppliedTurtleWoW {
|
||||
turtlewowStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
|
||||
if paths.PatchesAppliedEpoch {
|
||||
epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
|
||||
if patchTurtleWoWButton != nil {
|
||||
patchTurtleWoWButton.Disable()
|
||||
}
|
||||
@@ -144,9 +130,9 @@ func updateTurtleWoWStatus() {
|
||||
unpatchTurtleWoWButton.Enable()
|
||||
}
|
||||
} else {
|
||||
turtlewowStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
if patchTurtleWoWButton != nil {
|
||||
if paths.TurtlewowPath != "" {
|
||||
if paths.EpochPath != "" {
|
||||
patchTurtleWoWButton.Enable()
|
||||
} else {
|
||||
patchTurtleWoWButton.Disable()
|
||||
@@ -156,13 +142,13 @@ func updateTurtleWoWStatus() {
|
||||
unpatchTurtleWoWButton.Disable()
|
||||
}
|
||||
}
|
||||
turtlewowStatusLabel.Refresh()
|
||||
epochStatusLabel.Refresh()
|
||||
}
|
||||
|
||||
// updatePlayButtonState enables/disables play and launch buttons based on current state
|
||||
func updatePlayButtonState() {
|
||||
launchEnabled := paths.PatchesAppliedTurtleWoW && paths.PatchesAppliedCrossOver &&
|
||||
paths.TurtlewowPath != "" && paths.CrossoverPath != "" && service.IsServiceRunning()
|
||||
launchEnabled := paths.PatchesAppliedEpoch && paths.PatchesAppliedCrossOver &&
|
||||
paths.EpochPath != "" && paths.CrossoverPath != "" && service.IsServiceRunning()
|
||||
|
||||
if launchButton != nil {
|
||||
if launchEnabled {
|
||||
@@ -239,7 +225,7 @@ func updateServiceStatus() {
|
||||
serviceStatusLabel.Refresh()
|
||||
}
|
||||
if startServiceButton != nil {
|
||||
if paths.TurtlewowPath != "" && paths.PatchesAppliedTurtleWoW {
|
||||
if paths.EpochPath != "" && paths.PatchesAppliedEpoch {
|
||||
startServiceButton.Enable()
|
||||
} else {
|
||||
startServiceButton.Disable()
|
||||
|
22
pkg/ui/ui.go
22
pkg/ui/ui.go
@@ -1,8 +1,6 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"turtlesilicon/pkg/debug"
|
||||
"turtlesilicon/pkg/patching"
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/utils"
|
||||
|
||||
@@ -14,15 +12,15 @@ import (
|
||||
func CreateUI(myWindow fyne.Window) fyne.CanvasObject {
|
||||
// Initialize UI component variables
|
||||
crossoverPathLabel = widget.NewRichText()
|
||||
turtlewowPathLabel = widget.NewRichText()
|
||||
turtlewowStatusLabel = widget.NewRichText()
|
||||
epochPathLabel = widget.NewRichText()
|
||||
epochStatusLabel = widget.NewRichText()
|
||||
crossoverStatusLabel = widget.NewRichText()
|
||||
serviceStatusLabel = widget.NewRichText()
|
||||
|
||||
// Load saved paths from prefs
|
||||
prefs, _ := utils.LoadPrefs()
|
||||
if prefs.TurtleWoWPath != "" {
|
||||
paths.TurtlewowPath = prefs.TurtleWoWPath
|
||||
if prefs.EpochPath != "" {
|
||||
paths.EpochPath = prefs.EpochPath
|
||||
}
|
||||
if prefs.CrossOverPath != "" {
|
||||
paths.CrossoverPath = prefs.CrossOverPath
|
||||
@@ -37,18 +35,6 @@ func CreateUI(myWindow fyne.Window) fyne.CanvasObject {
|
||||
// Check default CrossOver path
|
||||
paths.CheckDefaultCrossOverPath()
|
||||
|
||||
// Check graphics settings presence and set default state
|
||||
patching.CheckGraphicsSettingsPresence()
|
||||
|
||||
// Load graphics settings from Config.wtf and update UI
|
||||
if err := patching.LoadGraphicsSettingsFromConfig(); err != nil {
|
||||
// Log error but continue - this is not critical for app startup
|
||||
debug.Printf("Warning: failed to load graphics settings from Config.wtf: %v", err)
|
||||
} else {
|
||||
// Refresh checkbox states to reflect loaded settings
|
||||
refreshGraphicsSettingsCheckboxes()
|
||||
}
|
||||
|
||||
// Create header, main content and bottom bar
|
||||
headerContent := createHeaderContainer()
|
||||
mainContent := createMainContent(myWindow)
|
||||
|
@@ -11,8 +11,8 @@ import (
|
||||
var (
|
||||
// Status labels
|
||||
crossoverPathLabel *widget.RichText
|
||||
turtlewowPathLabel *widget.RichText
|
||||
turtlewowStatusLabel *widget.RichText
|
||||
epochPathLabel *widget.RichText
|
||||
epochStatusLabel *widget.RichText
|
||||
crossoverStatusLabel *widget.RichText
|
||||
serviceStatusLabel *widget.RichText
|
||||
|
||||
|
Reference in New Issue
Block a user