Compare commits
107 Commits
fd18f10a9c
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12a9c101f2 | ||
|
|
ff6381575e | ||
|
|
acb4401e37 | ||
| 76d8c1744a | |||
|
|
b2bef77f09 | ||
| 4cbb0666cb | |||
| 83cb34001f | |||
| 1f09482950 | |||
| 1af4d225b5 | |||
| 7863c53280 | |||
|
|
35d888ec62 | ||
|
|
15e317b6fe | ||
| 07f11c7d22 | |||
|
|
7c28081b65 | ||
| d9a75a5e21 | |||
|
|
5da6636dd7 | ||
| b04e653350 | |||
|
|
8469610328 | ||
| 9703682b4a | |||
| e281fbafdb | |||
| be35430727 | |||
| 3667bfae52 | |||
| 8ec9119bc1 | |||
| 4924466a93 | |||
| e37e629630 | |||
| e1db654a48 | |||
| ee19aadac9 | |||
| 17b0d9f72e | |||
| 99a59b47c2 | |||
| 77f83b89f6 | |||
|
|
86d4095444 | ||
|
|
3fd22398d3 | ||
| fcb127ef05 | |||
|
|
4cbadb0f6f | ||
|
|
7ef5780e84 | ||
| 7d37c75d64 | |||
| 31f3df710a | |||
| 709a06ffe6 | |||
|
|
777ed46879 | ||
| 89dedb9870 | |||
| 57d8c1b330 | |||
| 4c1de974f0 | |||
| 452fe85d26 | |||
| 8de631afa2 | |||
|
|
242df40852 | ||
| 2c6a8ac7b0 | |||
| 95caed9b33 | |||
|
|
39d120b6b4 | ||
|
|
66772ad2b5 | ||
| cad13efe95 | |||
|
|
08044c7d46 | ||
|
|
bd2f536c5d | ||
| 738d0727ed | |||
| d10d83dd05 | |||
|
|
9fb92a3367 | ||
|
|
6ba0f1bdea | ||
| 6630747d65 | |||
| aaeaebdb03 | |||
|
|
9595f055dd | ||
|
|
2b224eeee7 | ||
| 875202ceb4 | |||
| 63c5871275 | |||
| 4da5f46fdd | |||
| 60e7e9e506 | |||
| a9624e532a | |||
| f5c621f808 | |||
|
|
8d07f92c26 | ||
|
|
9b44f03a0b | ||
| 32174bfb41 | |||
|
|
5c2951884e | ||
|
|
c0aced282b | ||
| 08baf8e1da | |||
|
|
9104c1148e | ||
|
|
764dfe0e07 | ||
| 2e120d9a77 | |||
| b9379f9d66 | |||
|
|
346ac15bcd | ||
|
|
5b00d477c3 | ||
| 527e04972e | |||
| 64abc18256 | |||
|
|
60d71bd20f | ||
|
|
3fcf6ad181 | ||
| b6f08243db | |||
| 8eb82dd204 | |||
|
|
ff5cba66de | ||
|
|
8b75f3d4a1 | ||
| f7539388f9 | |||
| bc478e4702 | |||
|
|
b3edcc46e6 | ||
|
|
be8256466d | ||
| f1e9961bdd | |||
| e75f77be7f | |||
| a5655abe76 | |||
|
|
5f71a5d9b8 | ||
|
|
9d195c7044 | ||
| 9c80432611 | |||
|
|
296120ef95 | ||
|
|
fb9b3f4ebe | ||
| 62e66751d8 | |||
|
|
1a8ff3cd8b | ||
| 8e2cfc67e3 | |||
| 58bb19b43f | |||
| 5fced26e78 | |||
| c47db7b2d4 | |||
| 932990a27a | |||
| 3379e26597 | |||
| 11ec9a09cb |
124
.gitea/workflows/pull-request-ci.yaml
Normal file
124
.gitea/workflows/pull-request-ci.yaml
Normal file
@@ -0,0 +1,124 @@
|
||||
name: CI
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Install go dependencies
|
||||
run: go mod tidy
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: latest
|
||||
|
||||
test:
|
||||
name: Test
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Get fyne command
|
||||
run: |
|
||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||
|
||||
- name: Get go dependencies
|
||||
run: |
|
||||
go mod tidy
|
||||
|
||||
- name: Test
|
||||
run: go test -race -v -shuffle=on ./...
|
||||
|
||||
build:
|
||||
name: Build
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Get fyne command
|
||||
run: |
|
||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||
|
||||
- name: Get go dependencies
|
||||
run: |
|
||||
go mod tidy
|
||||
|
||||
- name: Build for linux
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
GOOS: linux
|
||||
GOARCH: amd64
|
||||
EXE: ""
|
||||
CGO_ENABLED: 1
|
||||
CC: gcc
|
||||
|
||||
- name: Build for windows
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
GOOS: windows
|
||||
GOARCH: amd64
|
||||
EXE: ".exe"
|
||||
CGO_ENABLED: 1
|
||||
CC: x86_64-w64-mingw32-gcc
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
|
||||
path: bin/
|
||||
125
.gitea/workflows/push-ci.yaml
Normal file
125
.gitea/workflows/push-ci.yaml
Normal file
@@ -0,0 +1,125 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches: [master, develop]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Install go dependencies
|
||||
run: go mod tidy
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: latest
|
||||
|
||||
test:
|
||||
name: Test
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Get fyne command
|
||||
run: |
|
||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||
|
||||
- name: Get go dependencies
|
||||
run: |
|
||||
go mod tidy
|
||||
|
||||
- name: Test
|
||||
run: go test -race -v -shuffle=on ./...
|
||||
|
||||
build:
|
||||
name: Build
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Get fyne command
|
||||
run: |
|
||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||
|
||||
- name: Get go dependencies
|
||||
run: |
|
||||
go mod tidy
|
||||
|
||||
- name: Build for linux
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}
|
||||
ls bin
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
GOOS: linux
|
||||
GOARCH: amd64
|
||||
CGO_ENABLED: 1
|
||||
CC: gcc
|
||||
|
||||
- name: Build for windows
|
||||
run: |
|
||||
fyne build --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION}.${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
ls bin
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
GOOS: windows
|
||||
GOARCH: amd64
|
||||
CGO_ENABLED: 1
|
||||
CC: x86_64-w64-mingw32-gcc
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: swiped-mod-switcher-${{github.ref_name}}-${{github.run_number}}
|
||||
path: bin/
|
||||
122
.gitea/workflows/tag-release.yaml
Normal file
122
.gitea/workflows/tag-release.yaml
Normal file
@@ -0,0 +1,122 @@
|
||||
name: Release versioned tag
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Install go dependencies
|
||||
run: go mod tidy
|
||||
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: latest
|
||||
|
||||
test:
|
||||
name: Test
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Get fyne command
|
||||
run: |
|
||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||
|
||||
- name: Get go dependencies
|
||||
run: |
|
||||
go mod tidy
|
||||
|
||||
- name: Test
|
||||
run: go test -race -v -shuffle=on ./...
|
||||
|
||||
release:
|
||||
name: Build versioned release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
|
||||
- name: Setup OS dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev
|
||||
|
||||
- name: Install fyne command
|
||||
run: |
|
||||
go install fyne.io/fyne/v2/cmd/fyne@latest
|
||||
|
||||
- name: Install go dependencies
|
||||
run: go mod tidy
|
||||
|
||||
- name: Build for linux
|
||||
run: |
|
||||
fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
GOOS: linux
|
||||
GOARCH: amd64
|
||||
EXE: ""
|
||||
CGO_ENABLED: 1
|
||||
CC: gcc
|
||||
|
||||
- name: Build for windows
|
||||
run: |
|
||||
fyne build --release --os=${GOOS} --metadata BuildVersion=${VERSION} --metadata BuildNumber=${BUILD} -o bin/swiped-mod-switcher-${VERSION#v}.${BUILD}-${GOOS}-${GOARCH}.exe
|
||||
env:
|
||||
VERSION: ${{github.ref_name}}
|
||||
BUILD: ${{github.run_number}}
|
||||
GOOS: windows
|
||||
GOARCH: amd64
|
||||
EXE: ".exe"
|
||||
CGO_ENABLED: 1
|
||||
CC: x86_64-w64-mingw32-gcc
|
||||
|
||||
- name: Release binaries
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |-
|
||||
bin/**
|
||||
api_key: '${{secrets.RELEASE_TOKEN}}'
|
||||
4
FyneApp.toml
Normal file
4
FyneApp.toml
Normal file
@@ -0,0 +1,4 @@
|
||||
[Details]
|
||||
Icon = "icon.png"
|
||||
Name = "Swiped Mod Switcher"
|
||||
ID = "com.s1d3sw1ped.swipedmodswitcher"
|
||||
10
README.md
10
README.md
@@ -16,10 +16,10 @@ the switch is really just a symbolic link so it happens in milliseconds even on
|
||||
- because it switches your games mods folder it does work with existing mod managers mostly however they may get slow having to figure out what mods are installed already when they open or may even get borked if they keep an external journal of what is installed.
|
||||
|
||||
### Never Happening
|
||||
- deduplicating mods this will never be supported as this would be a drastic change from being a mod switcher to being a mod manager and that's a pile of crazy I don't want to touch.
|
||||
- deduplicating mods will never be supported that's a pile of crazy I don't want to touch.
|
||||
|
||||
## Installation
|
||||
1. Download the latest version from the [releases]("https://git.s1d3sw1ped.com/s1d3sw1ped/SwipedModSwitcher/releases") page.
|
||||
1. Download the latest version from the releases page. https://git.s1d3sw1ped.com/s1d3sw1ped/SwipedModSwitcher/releases
|
||||
2. Make a folder and place it in there.
|
||||
3. Make a second folder in that folder named profiles.
|
||||
4. Open Swiped Mod Switcher and select the second folder in the Mod Profiles Directory selection.
|
||||
@@ -27,3 +27,9 @@ the switch is really just a symbolic link so it happens in milliseconds even on
|
||||
6. Now if you already have some mods installed make a new folder in the Mod Profiles Directory name it whatever you would like to call the profile and then copy the current mods to that folder once done you can delete the games mod folder dont worry Swiped Mod Switcher will remake the folder itself when you select a profile.
|
||||
7. Click Reload Mod Profiles and it should display your profile then simply click it to switch to that profile.
|
||||
8. Play your game or create more profiles the choice at this point is yours.
|
||||
|
||||
## Disclaimer
|
||||
No testing goes into ensuring the linux builds actually work.
|
||||
|
||||
## Virus Warning
|
||||
There are alot of false positives with golang programs if you got a warning for this app it was 99% a false positive however if you believe that it may not be a false positive then either check with virustotal or delete it. there is basically nothing i can do to make your virus scanner not think its a virus and im not spending the years to call or email your virus scanner company to have them fix it. if it really bothers you then do that yourself.
|
||||
35
main.go
35
main.go
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime/debug"
|
||||
"s1d3sw1ped/swipedmodswitcher/admin"
|
||||
"slices"
|
||||
"strings"
|
||||
@@ -60,16 +61,42 @@ var cfg *Config
|
||||
|
||||
func main() {
|
||||
if !admin.Admin() {
|
||||
fmt.Println("not running as administrator relaunching")
|
||||
if err := admin.RunSelfElevated(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
os.Exit(0)
|
||||
return // just incase
|
||||
}
|
||||
|
||||
cfg = loadConfig()
|
||||
|
||||
ap := app.New()
|
||||
wp := ap.NewWindow("Swiped Mod Switcher")
|
||||
|
||||
commithash := func() string {
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
for _, setting := range info.Settings {
|
||||
if setting.Key == "vcs.revision" {
|
||||
return setting.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}()
|
||||
|
||||
buildversion := ap.Metadata().Custom["BuildVersion"]
|
||||
if buildversion == "" {
|
||||
buildversion = ""
|
||||
}
|
||||
|
||||
buildnumber := ap.Metadata().Custom["BuildNumber"]
|
||||
if buildnumber == "" {
|
||||
buildnumber = "commit " + commithash
|
||||
} else {
|
||||
buildnumber = "build " + buildnumber
|
||||
}
|
||||
|
||||
wp := ap.NewWindow(ap.Metadata().Name + " " + buildversion + " " + buildnumber)
|
||||
wp.Resize(fyne.NewSize(600, 1))
|
||||
wp.CenterOnScreen()
|
||||
|
||||
@@ -135,10 +162,14 @@ func fillGrid(grid *fyne.Container, parent fyne.Window) {
|
||||
grid.Hide()
|
||||
defer grid.Show()
|
||||
grid.RemoveAll()
|
||||
if admin.Admin() {
|
||||
for _, profile := range profiles {
|
||||
profilename := filepath.Base(profile)
|
||||
grid.Add(widget.NewButton(profilename, makeIFunc(profile, archive, parent)))
|
||||
}
|
||||
} else {
|
||||
grid.Add(widget.NewLabel("not running as administrator"))
|
||||
}
|
||||
}
|
||||
|
||||
func scanProfiles(profilesroot string) []string {
|
||||
@@ -180,6 +211,6 @@ func makeIFunc(profile, archive string, parent fyne.Window) func() {
|
||||
return
|
||||
}
|
||||
|
||||
dialog.NewInformation("Success", fmt.Sprintf("filinked files from %s to %s", filepath.Base(profile), archive), parent).Show()
|
||||
dialog.NewInformation("Success", fmt.Sprintf("linked files from %s to %s", filepath.Base(profile), archive), parent).Show()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user