first epoch pass
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (pull_request) Has been cancelled
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (pull_request) Has been cancelled
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"epochsilicon/pkg/debug"
|
||||
"git.burkey.co/eburk/epochcli/pkg/epoch"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"turtlesilicon/pkg/paths"
|
||||
"turtlesilicon/pkg/service"
|
||||
"turtlesilicon/pkg/utils"
|
||||
"epochsilicon/pkg/paths"
|
||||
"epochsilicon/pkg/service"
|
||||
"epochsilicon/pkg/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
@@ -75,7 +77,7 @@ func updateCrossoverStatus() {
|
||||
crossoverStatusLabel.Refresh()
|
||||
}
|
||||
|
||||
// updateEpochStatus updates TurtleWoW path and patch status
|
||||
// updateEpochStatus updates Epoch path and patch status
|
||||
func updateEpochStatus() {
|
||||
if paths.EpochPath == "" {
|
||||
epochPathLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not set", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
@@ -86,7 +88,6 @@ func updateEpochStatus() {
|
||||
// Check if all required files exist
|
||||
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")
|
||||
@@ -98,7 +99,7 @@ func updateEpochStatus() {
|
||||
contentStr := string(fileContent)
|
||||
winerosettaPresent := strings.Contains(contentStr, "winerosetta.dll")
|
||||
|
||||
// Validate dlls.txt: winerosetta must be present, libSiliconPatch based on setting
|
||||
// Validate dlls.txt: winerosetta must be present
|
||||
if winerosettaPresent {
|
||||
dllsFileValid = true
|
||||
}
|
||||
@@ -111,35 +112,46 @@ func updateEpochStatus() {
|
||||
rosettaX87CorrectSize := utils.CompareFileWithBundledResource(rosettaX87ExePath, "rosettax87/rosettax87")
|
||||
libRuntimeRosettaX87CorrectSize := utils.CompareFileWithBundledResource(libRuntimeRosettaX87Path, "rosettax87/libRuntimeRosettax87")
|
||||
|
||||
if utils.PathExists(winerosettaDllPath) && utils.PathExists(d3d9DllPath) && utils.PathExists(libSiliconPatchDllPath) &&
|
||||
if utils.PathExists(winerosettaDllPath) && utils.PathExists(d3d9DllPath) &&
|
||||
utils.DirExists(rosettaX87DirPath) && utils.PathExists(rosettaX87ExePath) &&
|
||||
utils.PathExists(libRuntimeRosettaX87Path) && dllsFileValid &&
|
||||
winerosettaDllCorrectSize && d3d9DllCorrectSize &&
|
||||
rosettaX87CorrectSize && libRuntimeRosettaX87CorrectSize {
|
||||
paths.PatchesAppliedEpoch = true
|
||||
}
|
||||
|
||||
// Check for Epoch-specific files, set PatchesAppliedEpoch to false if not updated
|
||||
stats, err := epoch.Update(paths.EpochPath, false, true, true)
|
||||
if err != nil {
|
||||
paths.PatchesAppliedEpoch = false
|
||||
debug.Printf("Failed to get download Epoch patches: %v", err)
|
||||
}
|
||||
if stats.Outdated > 0 {
|
||||
paths.PatchesAppliedEpoch = false
|
||||
}
|
||||
}
|
||||
|
||||
epochPathLabel.Refresh()
|
||||
|
||||
if paths.PatchesAppliedEpoch {
|
||||
epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameSuccess}}}
|
||||
if patchTurtleWoWButton != nil {
|
||||
patchTurtleWoWButton.Disable()
|
||||
if patchEpochButton != nil {
|
||||
patchEpochButton.Disable()
|
||||
}
|
||||
if unpatchTurtleWoWButton != nil {
|
||||
unpatchTurtleWoWButton.Enable()
|
||||
if unpatchEpochButton != nil {
|
||||
unpatchEpochButton.Enable()
|
||||
}
|
||||
} else {
|
||||
epochStatusLabel.Segments = []widget.RichTextSegment{&widget.TextSegment{Text: "Not patched", Style: widget.RichTextStyle{ColorName: theme.ColorNameError}}}
|
||||
if patchTurtleWoWButton != nil {
|
||||
if patchEpochButton != nil {
|
||||
if paths.EpochPath != "" {
|
||||
patchTurtleWoWButton.Enable()
|
||||
patchEpochButton.Enable()
|
||||
} else {
|
||||
patchTurtleWoWButton.Disable()
|
||||
patchEpochButton.Disable()
|
||||
}
|
||||
}
|
||||
if unpatchTurtleWoWButton != nil {
|
||||
unpatchTurtleWoWButton.Disable()
|
||||
if unpatchEpochButton != nil {
|
||||
unpatchEpochButton.Disable()
|
||||
}
|
||||
}
|
||||
epochStatusLabel.Refresh()
|
||||
|
Reference in New Issue
Block a user