From 77978c7178023db33820240f1522c6353e69bf4b Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Sun, 19 Apr 2026 01:03:49 +0200 Subject: [PATCH 1/5] stop prepending the adventure side (#6819) the adventure side of adventure cards used to be the first entry in mtgjson, at some point this changed to the second entry, better reflecting its secondary nature, however cockatrice has hardcoded the treatment of the card to assume the second part was the "main" part, when implementing the treatment of prepare layout cards (#6792) I copied the behavior over which was then already incorrect, this pr removes the special treatment of this card layout bringing the result back in line with expectation: the main part of the card provides the main type used in cockatrice for sorting and behavior --- oracle/src/oracleimporter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/oracle/src/oracleimporter.cpp b/oracle/src/oracleimporter.cpp index b5d7b9856..578afd98d 100644 --- a/oracle/src/oracleimporter.cpp +++ b/oracle/src/oracleimporter.cpp @@ -366,8 +366,6 @@ int OracleImporter::importCardsFromSet(const CardSetPtr ¤tSet, const QList auto found_iter = splitCards.find(name + numProperty); if (found_iter == splitCards.end()) { splitCards.insert(name + numProperty, {{split}, name}); - } else if (layout == "adventure" || layout == "prepare") { - found_iter->first.insert(0, split); } else { found_iter->first.append(split); } From 682ac4ed0cf8ccf7ab6c124417fbde181c52a543 Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Sun, 19 Apr 2026 01:07:38 +0200 Subject: [PATCH 2/5] Add -R option in Windows NSIS script for silent upgrade (#6818) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add -R option in Windows NSIS script Took 23 minutes * Small fix. Took 3 minutes --------- Co-authored-by: Lukas BrĂ¼bach --- cmake/NSIS.template.in | 103 +++++++++++++++++- .../interface/widgets/dialogs/dlg_update.cpp | 4 +- 2 files changed, 102 insertions(+), 5 deletions(-) diff --git a/cmake/NSIS.template.in b/cmake/NSIS.template.in index 2fdc61fb9..7b52b7bcc 100644 --- a/cmake/NSIS.template.in +++ b/cmake/NSIS.template.in @@ -11,6 +11,7 @@ SetCompressor LZMA Var NormalDestDir Var PortableDestDir Var PortableMode +Var ReinstallMode !include LogicLib.nsh !include FileFunc.nsh @@ -28,13 +29,23 @@ Var PortableMode !define MUI_FINISHPAGE_RUN_TEXT "Run 'Cockatrice' now" !define MUI_ICON "${NSIS_SOURCE_PATH}\cockatrice\resources\appicon.ico" +!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfReinstall !insertmacro MUI_PAGE_WELCOME + +!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfReinstall !insertmacro MUI_PAGE_LICENSE "${NSIS_SOURCE_PATH}\LICENSE" + Page Custom PortableModePageCreate PortableModePageLeave !define MUI_PAGE_CUSTOMFUNCTION_PRE componentsPagePre !insertmacro MUI_PAGE_COMPONENTS + +!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfReinstall !insertmacro MUI_PAGE_DIRECTORY + +!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfReinstall !insertmacro MUI_PAGE_INSTFILES + +!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfReinstall !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM @@ -73,6 +84,7 @@ ${IfNot} ${Errors} MessageBox MB_ICONINFORMATION|MB_SETFOREGROUND "\ /PORTABLE : Install in portable mode$\n\ /S : Silent install$\n\ + /R : Silent upgrade$\n\ /D=%directory% : Specify destination directory$\n" Quit ${EndIf} @@ -90,6 +102,16 @@ ${Else} ${EndIf} ${EndIf} +ClearErrors +${GetOptions} $9 "/R" $8 +${IfNot} ${Errors} + StrCpy $ReinstallMode 1 + SetSilent silent + SetAutoClose true +${Else} + StrCpy $ReinstallMode 0 +${EndIf} + ${If} $InstDir == "" ; User did not use /D to specify a directory, ; we need to set a default based on the install mode @@ -97,6 +119,22 @@ ${If} $InstDir == "" ${EndIf} Call SetModeDestinationFromInstdir +; --- Detect portable install when using /R --- +${If} $ReinstallMode = 1 + IfFileExists "$InstDir\portable.dat" 0 not_portable + StrCpy $PortableMode 1 + Goto portable_done + + not_portable: + StrCpy $PortableMode 0 + + portable_done: +${EndIf} + +${If} $ReinstallMode = 1 + Call AutoUninstallIfNeeded +${EndIf} + FunctionEnd Function un.onInit @@ -126,8 +164,46 @@ ${Else} ${EndIf} FunctionEnd +Function SkipIfReinstall +${If} $ReinstallMode = 1 + Abort +${EndIf} +FunctionEnd + +Function AutoUninstallIfNeeded + +SetShellVarContext all + +; --- 32-bit uninstall --- +SetRegView 32 +ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString" + +StrCmp $R0 "" done32 +DetailPrint "Removing previous version (32-bit)..." +ExecWait '$R0' + +done32: + +; --- 64-bit uninstall --- +${If} ${RunningX64} + SetRegView 64 + ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString" + + StrCmp $R0 "" done64 + DetailPrint "Removing previous version (64-bit)..." + ExecWait '$R0' + + done64: +${EndIf} + +FunctionEnd Function PortableModePageCreate + +${If} $ReinstallMode = 1 + Abort +${EndIf} + Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory !insertmacro MUI_HEADER_TEXT "Install Mode" "Choose how you want to install Cockatrice." nsDialogs::Create 1018 @@ -159,6 +235,11 @@ ${EndIf} FunctionEnd Function componentsPagePre + +${If} $ReinstallMode = 1 + Return +${EndIf} + ${If} $PortableMode = 0 SetShellVarContext all @@ -168,8 +249,12 @@ ${If} $PortableMode = 0 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString" StrCmp $R0 "" done32 - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst32 - Abort + ${If} $ReinstallMode = 0 + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst32 + Abort + ${Else} + Goto uninst32 + ${EndIf} uninst32: ClearErrors @@ -184,8 +269,12 @@ ${If} $PortableMode = 0 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString" StrCmp $R0 "" done64 - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst64 - Abort + ${If} $ReinstallMode = 0 + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst64 + Abort + ${Else} + Goto uninst64 + ${EndIf} uninst64: ClearErrors @@ -277,6 +366,12 @@ ${Else} FileWrite $0 "PORTABLE" FileClose $0 ${EndIf} + +${If} $ReinstallMode = 1 + IfFileExists "$INSTDIR\cockatrice.exe" 0 +2 + Exec '"$INSTDIR\cockatrice.exe"' +${EndIf} + SectionEnd Section "Start menu item" SecStartMenu diff --git a/cockatrice/src/interface/widgets/dialogs/dlg_update.cpp b/cockatrice/src/interface/widgets/dialogs/dlg_update.cpp index 0a9244dec..c9adeb270 100644 --- a/cockatrice/src/interface/widgets/dialogs/dlg_update.cpp +++ b/cockatrice/src/interface/widgets/dialogs/dlg_update.cpp @@ -219,7 +219,9 @@ void DlgUpdate::downloadSuccessful(const QUrl &filepath) { setLabel(tr("Installing...")); // Try to open the installer. If it opens, quit Cockatrice - if (QDesktopServices::openUrl(filepath)) { + if (QProcess::startDetached(filepath.toLocalFile(), + QStringList() + << "/R" << QString("/D=%1").arg(QCoreApplication::applicationDirPath()))) { QMetaObject::invokeMethod(static_cast(parent()), "close", Qt::QueuedConnection); qCInfo(DlgUpdateLog) << "Opened downloaded update file successfully - closing Cockatrice"; close(); From db235ecae80a0a6dbf0cfb7289d63bd9602a5352 Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Sun, 19 Apr 2026 01:11:00 +0200 Subject: [PATCH 3/5] update version number to 3.0.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe808a652..e4d6ee11e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ endif() # A project name is needed for CPack # Version can be overriden by git tags, see cmake/getversion.cmake -project("Cockatrice" VERSION 2.11.0) +project("Cockatrice" VERSION 3.0.0) # Set release name if not provided via env/cmake var if(NOT DEFINED GIT_TAG_RELEASENAME) From 655a8e52a156da9115a34b5584cf9ce011580d00 Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Sun, 19 Apr 2026 01:15:58 +0200 Subject: [PATCH 4/5] update release name --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4d6ee11e..4a5e944c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ project("Cockatrice" VERSION 3.0.0) # Set release name if not provided via env/cmake var if(NOT DEFINED GIT_TAG_RELEASENAME) - set(GIT_TAG_RELEASENAME "Omenpath") + set(GIT_TAG_RELEASENAME "Graduation Day") endif() # Use c++20 for all targets From 58a8c7d3df6902f0b32d403bddb9a9adabf2237a Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 19 Apr 2026 02:47:14 +0200 Subject: [PATCH 5/5] CI: Use `ubuntu-slim` for simple jobs (#6798) --- .github/workflows/desktop-build.yml | 2 +- .github/workflows/desktop-lint.yml | 4 ++-- .github/workflows/translations-pull.yml | 2 +- .github/workflows/translations-push.yml | 4 ++-- .github/workflows/web-lint.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index aeed5da81..3c8e915a8 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -46,7 +46,7 @@ concurrency: jobs: configure: name: Configure - runs-on: ubuntu-latest + runs-on: ubuntu-slim outputs: tag: ${{steps.configure.outputs.tag}} sha: ${{steps.configure.outputs.sha}} diff --git a/.github/workflows/desktop-lint.yml b/.github/workflows/desktop-lint.yml index 433f302a5..fe7be0287 100644 --- a/.github/workflows/desktop-lint.yml +++ b/.github/workflows/desktop-lint.yml @@ -20,13 +20,13 @@ on: jobs: format: - runs-on: ubuntu-22.04 + runs-on: ubuntu-slim steps: - name: Checkout uses: actions/checkout@v6 with: - fetch-depth: 20 # should be enough to find merge base + fetch-depth: 20 # should be enough to find merge base - name: Install dependencies shell: bash diff --git a/.github/workflows/translations-pull.yml b/.github/workflows/translations-pull.yml index ed61e3b19..ca9069192 100644 --- a/.github/workflows/translations-pull.yml +++ b/.github/workflows/translations-pull.yml @@ -16,7 +16,7 @@ jobs: if: github.event_name != 'schedule' || github.repository_owner == 'Cockatrice' name: Pull languages - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - name: Checkout repo diff --git a/.github/workflows/translations-push.yml b/.github/workflows/translations-push.yml index 777e9e6ac..e926a58ed 100644 --- a/.github/workflows/translations-push.yml +++ b/.github/workflows/translations-push.yml @@ -16,7 +16,7 @@ jobs: if: github.event_name != 'schedule' || github.repository_owner == 'Cockatrice' name: Push strings - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - name: Checkout repo @@ -46,7 +46,7 @@ jobs: - name: Render template id: template - uses: chuhlomin/render-template@v1 + uses: chuhlomin/render-template/binary@v1 with: template: .ci/update_translation_source_strings_template.md vars: | diff --git a/.github/workflows/web-lint.yml b/.github/workflows/web-lint.yml index 8a90325e7..ecc6d14d1 100644 --- a/.github/workflows/web-lint.yml +++ b/.github/workflows/web-lint.yml @@ -10,7 +10,7 @@ on: jobs: ESLint: - runs-on: ubuntu-latest + runs-on: ubuntu-slim defaults: run: