Skip to content

Manic EMU is an all-in-one retro game emulator for iOS. It packs powerful features while keeping a clean, sleek UI and delivering buttery-smooth gameplay.

Swift

Adjusted the 3DS accelerometer; fixed the forced landscape error on iOS 26; fixed the issue where analog input was mistakenly treated as digital input; optimized iCloud sync logic.

Daiunof4f06bfa2aed
diff --git a/Cores/Citra.framework/Citra b/Cores/Citra.framework/Citra
index 544ad651..e408997f 100755
--- a/Cores/Citra.framework/Citra
+++ b/Cores/Citra.framework/Citra
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ca788a729c706155233678572d14b48b0e24462eddba4a1e054d5c4fc3cb47ed
-size 24326624
+oid sha256:84006b4bd0a579ae67ff29c6a2dd9f6c13f4e36dacfdf8bb0fb163996a4a826b
+size 24327248
diff --git a/Cores/Citra.framework/Headers/CitraCore.h b/Cores/Citra.framework/Headers/CitraCore.h
index eb5dffdd..b616d165 100644
--- a/Cores/Citra.framework/Headers/CitraCore.h
+++ b/Cores/Citra.framework/Headers/CitraCore.h
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:393601a6fa66153cbf9cca81132602f36c82f65632989e7d664430f1d660973d
-size 8006
+oid sha256:a8cfca8e15f2cd336c13d9e17c288cc93c3c982071d11485c3d9cacbaed2ba9a
+size 8771
diff --git a/Cores/Citra.framework/_CodeSignature/CodeResources b/Cores/Citra.framework/_CodeSignature/CodeResources
index 6f5c9af9..53e93693 100644
--- a/Cores/Citra.framework/_CodeSignature/CodeResources
+++ b/Cores/Citra.framework/_CodeSignature/CodeResources
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d7127ddbc1e90376d73ac61d3aa921c4e73c49d9d3a9191bad152bda379cfae9
+oid sha256:6f3361ecd7a36164a9264163c17d647387e3b00ebc76e3264a7cb878362272bc
size 2712
diff --git a/Cores/azahar.libretro.framework/azahar.libretro b/Cores/azahar.libretro.framework/azahar.libretro
index 11f09e8b..bf6c67ef 100755
--- a/Cores/azahar.libretro.framework/azahar.libretro
+++ b/Cores/azahar.libretro.framework/azahar.libretro
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a806f9199c85cacc2e996db1eeb12335347ed8b6218fda5cdf76df0cd0dab3a0
-size 27800000
+oid sha256:e0c4c480359a7bb3a8fff3a1417432da218c91be1af00319e16324530449d81e
+size 27800544
diff --git a/Dependencies/Libretro b/Dependencies/Libretro
index 9e88994b..6e01279f 160000
--- a/Dependencies/Libretro
+++ b/Dependencies/Libretro
@@ -1 +1 @@
-Subproject commit 9e88994b39f5f42f0ec4e7553c0dcc1985470fd8
+Subproject commit 6e01279fa2c3b5d4bc6611abc815ca39210db177
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/launch_bg.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/launch_bg.imageset/[email protected]
index 5801fa54..4e0da4da 100644
Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/launch_bg.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/launch_bg.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/launch_bg.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/launch_bg.imageset/[email protected]
index 53344025..9ec35b04 100644
Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/launch_bg.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/launch_bg.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Symbols/controller_icon.symbols.symbolset/controller_icon.symbols.svg b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Symbols/controller_icon.symbols.symbolset/controller_icon.symbols.svg
index 0c5e9554..7ffe2edf 100644
--- a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Symbols/controller_icon.symbols.symbolset/controller_icon.symbols.svg
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Symbols/controller_icon.symbols.symbolset/controller_icon.symbols.svg
@@ -1,58 +1,64 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg height="600" width="800" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <g id="Notes" font-family="'LucidaGrande', 'Lucida Grande', sans-serif" font-size="13">
- <rect fill="white" height="600.0" width="800.0" x="0.0" y="0.0" />
- <g font-size="13">
- <text x="18.0" y="176.0">Small</text>
- <text x="18.0" y="376.0">Medium</text>
- <text x="18.0" y="576.0">Large</text>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="800" height="600" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <g id="Notes" font-family="'LucidaGrande', 'Lucida Grande', sans-serif" font-weight="500" font-size="13px">
+ <rect x="0" y="0" width="800" height="600" fill="white"/>
+ <g font-weight="500" font-size="13px">
+ <text x="18px" y="176px">Small</text>
+ <text x="18px" y="376px">Medium</text>
+ <text x="18px" y="576px">Large</text>
</g>
- <g font-size="9">
- <text x="250.0" y="30.0">Ultralight</text>
- <text x="450.0" y="30.0">Regular</text>
- <text x="650.0" y="30.0">Black</text>
- <text id="template-version" fill="#505050" text-anchor="end" x="785.0" y="575.0">Template v.3.0</text>
- <a href="https://wangchujiang.com/#/app">
- <text fill="#505050" text-anchor="end" x="785.0" y="590.0">https://wangchujiang.com/#/app</text>
- </a>
+ <g font-weight="300" font-size="9px">
+ <text x="250px" y="30px">Ultralight</text>
+ <text x="450px" y="30px">Regular</text>
+ <text x="650px" y="30px">Black</text>
+ <text id="template-version" fill="#505050" x="785.0" y="575.0" text-anchor="end">Template v.3.0</text>
+ <a href="https://wangchujiang.com/#/app">
+ <text fill="#505050" x="785.0" y="590.0" text-anchor="end">https://wangchujiang.com/#/app</text>
+ </a>
</g>
</g>
- <g id="Guides" stroke="rgb(39, 170, 225)" stroke-width="0.5">
+
+ <g id="Guides" stroke="rgb(39,170,225)" stroke-width="0.5px">
<path id="Capline-S" d="M18,76 l800,0" />
- <path id="H-reference" d="M85,145.755 L87.685,145.755 L113.369,79.287 L114.052,79.287 L114.052,76 L112.148,76 L85,145.755 Z M95.693,121.536 L130.996,121.536 L130.263,119.313 L96.474,119.313 L95.693,121.536 Z M139.15,145.755 L141.787,145.755 L114.638,76 L113.466,76 L113.466,79.287 L139.15,145.755 Z" stroke="none" />
+ <path id="H-reference"
+ d="M85,145.755 L87.685,145.755 L113.369,79.287 L114.052002,79.287
+ L114.052002,76 L112.148,76 L85,145.755 Z
+ M95.693,121.536 L130.996,121.536 L130.263,119.313 L96.474,119.313 L95.693,121.536 Z
+ M139.14999,145.755 L141.787,145.755 L114.638,76 L113.466,76 L113.466,79.287 L139.14999,145.755 Z" stroke="none" />
<path id="Baseline-S" d="M18,146 l800,0" />
<path id="left-margin-Ultralight-S" d="M211,56 l0,110" />
- <path id="right-margin-Ultralight-S" d="M319,56 l0,110" />
- <path id="left-margin-Regular-S" d="M411,56 l0,110" />
- <path id="right-margin-Regular-S" d="M519,56 l0,110" />
- <path id="left-margin-Black-S" d="M611,56 l0,110" />
+ <path id="right-margin-Ultralight-S" d="M319,56 l0,110" /> <path id="left-margin-Regular-S" d="M411,56 l0,110" />
+ <path id="right-margin-Regular-S" d="M519,56 l0,110" /> <path id="left-margin-Black-S" d="M611,56 l0,110" />
<path id="right-margin-Black-S" d="M719,56 l0,110" />
<path id="Capline-M" d="M18,276 l800,0" />
<path id="Baseline-M" d="M18,346 l800,0" />
+
<path id="Capline-L" d="M18,476 l800,0" />
<path id="Baseline-L" d="M18,546 l800,0" />
+
</g>
+
<g id="Symbols">
<g id="Ultralight-S">
- <path d="M256.908,103.414 C258.863,103.414 260.448,104.999 260.448,106.954 C260.448,108.909 258.863,110.494 256.908,110.494 L240.724,110.494 C238.769,110.494 237.184,108.909 237.184,106.954 C237.184,104.999 238.769,103.414 240.724,103.414 L256.908,103.414 Z" />
- <path d="M245.276,115.046 L245.276,98.862 C245.276,96.907 246.861,95.322 248.816,95.322 C250.771,95.322 252.356,96.907 252.356,98.862 L252.356,115.046 C252.356,117.001 250.771,118.586 248.816,118.586 C246.861,118.586 245.276,117.001 245.276,115.046 Z" />
- <path d="M277.178,107.46 C279.133,107.46 280.718,109.045 280.718,111 C280.718,112.955 279.133,114.54 277.178,114.54 L277.138,114.54 C275.183,114.54 273.598,112.955 273.598,111 C273.598,109.045 275.183,107.46 277.138,107.46 L277.178,107.46 Z" />
- <path d="M289.316,99.368 C291.271,99.368 292.856,100.953 292.856,102.908 C292.856,104.863 291.271,106.448 289.316,106.448 L289.276,106.448 C287.321,106.448 285.736,104.863 285.736,102.908 C285.736,100.953 287.321,99.368 289.276,99.368 L289.316,99.368 Z" />
- <path d="M273.787,123.644 C276.871,123.644 279.829,124.87 282.01,127.05 L282.014,127.05 L287.735,132.771 C289.721,134.757 290.832,135.782 293.322,135.782 C295.602,135.782 297.79,134.877 299.403,133.265 C301.015,131.652 301.92,129.464 301.92,127.184 C301.92,121.252 299.555,101.419 299.181,98.309 C299.158,98.144 299.142,97.992 299.13,97.882 C299.117,97.756 299.111,97.694 299.102,97.621 L299.098,97.57 C298.779,94.458 297.315,91.575 294.993,89.478 C292.67,87.381 289.651,86.219 286.522,86.218 L243.478,86.218 L242.309,86.274 C239.604,86.525 237.039,87.64 235.007,89.474 C232.684,91.57 231.222,94.454 230.902,97.566 L230.898,97.61 C230.894,97.644 230.853,98.001 230.823,98.238 L230.827,98.242 C230.481,101.12 228.08,121.211 228.08,127.184 C228.08,129.464 228.985,131.652 230.597,133.265 C232.21,134.877 234.398,135.782 236.678,135.782 C239.168,135.782 240.279,134.757 242.265,132.771 L247.986,127.05 C250.167,124.868 253.128,123.644 256.213,123.644 L273.787,123.644 Z M309,127.184 C309,131.342 307.349,135.33 304.409,138.271 C301.468,141.211 297.48,142.862 293.322,142.862 C287.719,142.862 284.785,139.841 282.725,137.781 L277.004,132.06 C276.257,131.313 275.279,130.852 274.238,130.748 L273.787,130.724 L256.213,130.724 C255.006,130.725 253.85,131.206 252.996,132.06 L247.275,137.781 C245.215,139.841 242.281,142.862 236.678,142.862 C232.52,142.862 228.531,141.211 225.591,138.271 C222.651,135.33 221,131.342 221,127.184 C221,120.664 223.487,99.977 223.797,97.396 L223.805,97.337 C223.83,97.156 223.82,97.183 223.865,96.796 C224.374,91.958 226.654,87.479 230.265,84.219 C233.888,80.95 238.594,79.139 243.474,79.138 L286.526,79.138 L287.439,79.158 C291.991,79.37 296.342,81.153 299.738,84.219 C303.348,87.478 305.621,91.957 306.131,96.792 L306.135,96.792 L306.195,97.329 L306.203,97.396 C306.513,99.977 309,120.66 309,127.184 Z" />
+<path d="M256.878 103.553 C258.747 103.554 260.263 105.069 260.263 106.938 C260.263 108.807 258.747 110.322 256.878 110.323 L240.632 110.323 C238.762 110.323 237.247 108.807 237.247 106.938 C237.247 105.069 238.762 103.553 240.632 103.553 L256.878 103.553 Z" fill="currentColor"/>
+ <path d="M245.368 115.062 L245.368 98.815 C245.368 96.946 246.884 95.43 248.753 95.43 C250.622 95.43 252.138 96.946 252.138 98.815 L252.138 115.062 C252.137 116.931 250.622 118.447 248.753 118.447 C246.884 118.447 245.369 116.931 245.368 115.062 Z" fill="currentColor"/>
+ <path d="M277.222 107.131 C279.359 107.131 281.09 108.863 281.09 111 C281.09 113.136 279.359 114.868 277.222 114.868 L277.184 114.868 C275.048 114.868 273.316 113.136 273.316 111 C273.316 108.863 275.048 107.131 277.184 107.131 L277.222 107.131 Z" fill="currentColor"/>
+ <path d="M289.406 99.008 C291.543 99.008 293.274 100.74 293.274 102.877 C293.274 105.013 291.543 106.745 289.406 106.745 L289.368 106.745 C287.232 106.745 285.5 105.013 285.5 102.877 C285.5 100.74 287.232 99.008 289.368 99.008 L289.406 99.008 Z" fill="currentColor"/>
+ <path d="M273.824 123.86 C276.875 123.861 279.8 125.076 281.957 127.234 L287.702 132.976 C289.697 134.97 290.857 136.046 293.429 136.047 C295.763 136.047 298.004 135.117 299.655 133.466 C301.304 131.816 302.231 129.578 302.231 127.245 C302.23 121.275 299.854 101.348 299.481 98.238 L299.402 97.55 L299.398 97.501 C299.072 94.335 297.582 91.399 295.22 89.266 C293.153 87.401 290.545 86.266 287.793 86.01 L286.607 85.953 L243.393 85.953 C240.211 85.954 237.143 87.135 234.78 89.266 C232.418 91.398 230.929 94.332 230.602 97.497 L230.599 97.539 C230.594 97.583 230.553 97.932 230.523 98.166 L230.527 98.17 C230.181 101.048 227.769 121.235 227.769 127.245 C227.769 129.578 228.696 131.816 230.345 133.466 C231.996 135.117 234.237 136.047 236.571 136.047 C239.143 136.046 240.303 134.97 242.297 132.976 L248.043 127.234 C250.2 125.076 253.125 123.861 256.176 123.86 L273.824 123.86 Z M309 127.245 C309 131.374 307.36 135.337 304.441 138.256 C301.521 141.176 297.558 142.816 293.429 142.816 C287.88 142.815 284.979 139.828 282.913 137.762 L277.171 132.02 C276.283 131.131 275.077 130.63 273.821 130.63 L256.18 130.63 C254.923 130.63 253.717 131.131 252.829 132.02 L247.087 137.762 C245.021 139.828 242.119 142.815 236.571 142.816 C232.442 142.816 228.479 141.176 225.559 138.256 C222.64 135.337 221 131.374 221 127.245 C221 120.712 223.495 99.958 223.807 97.361 C223.809 97.344 223.812 97.326 223.814 97.309 C223.839 97.125 223.831 97.141 223.875 96.761 C224.381 91.946 226.649 87.487 230.243 84.242 C233.849 80.988 238.536 79.185 243.393 79.184 L286.607 79.184 C291.465 79.186 296.15 80.988 299.757 84.242 C303.362 87.497 305.636 91.974 306.133 96.806 L306.129 96.806 L306.186 97.297 L306.193 97.361 C306.505 99.958 309 120.708 309 127.245 Z" fill="currentColor"/>
</g>
<g id="Regular-S">
- <path d="M456.908,103.414 C458.863,103.414 460.448,104.999 460.448,106.954 C460.448,108.909 458.863,110.494 456.908,110.494 L440.724,110.494 C438.769,110.494 437.184,108.909 437.184,106.954 C437.184,104.999 438.769,103.414 440.724,103.414 L456.908,103.414 Z" />
- <path d="M445.276,115.046 L445.276,98.862 C445.276,96.907 446.861,95.322 448.816,95.322 C450.771,95.322 452.356,96.907 452.356,98.862 L452.356,115.046 C452.356,117.001 450.771,118.586 448.816,118.586 C446.861,118.586 445.276,117.001 445.276,115.046 Z" />
- <path d="M477.178,107.46 C479.133,107.46 480.718,109.045 480.718,111 C480.718,112.955 479.133,114.54 477.178,114.54 L477.138,114.54 C475.183,114.54 473.598,112.955 473.598,111 C473.598,109.045 475.183,107.46 477.138,107.46 L477.178,107.46 Z" />
- <path d="M489.316,99.368 C491.271,99.368 492.856,100.953 492.856,102.908 C492.856,104.863 491.271,106.448 489.316,106.448 L489.276,106.448 C487.321,106.448 485.736,104.863 485.736,102.908 C485.736,100.953 487.321,99.368 489.276,99.368 L489.316,99.368 Z" />
- <path d="M473.787,123.644 C476.871,123.644 479.829,124.87 482.01,127.05 L482.014,127.05 L487.735,132.771 C489.721,134.757 490.832,135.782 493.322,135.782 C495.602,135.782 497.79,134.877 499.403,133.265 C501.015,131.652 501.92,129.464 501.92,127.184 C501.92,121.252 499.555,101.419 499.181,98.309 C499.158,98.144 499.142,97.992 499.13,97.882 C499.117,97.756 499.111,97.694 499.102,97.621 L499.098,97.57 C498.779,94.458 497.315,91.575 494.993,89.478 C492.67,87.381 489.651,86.219 486.522,86.218 L443.478,86.218 L442.309,86.274 C439.604,86.525 437.039,87.64 435.007,89.474 C432.684,91.57 431.222,94.454 430.902,97.566 L430.898,97.61 C430.894,97.644 430.853,98.001 430.823,98.238 L430.827,98.242 C430.481,101.12 428.08,121.211 428.08,127.184 C428.08,129.464 428.985,131.652 430.597,133.265 C432.21,134.877 434.398,135.782 436.678,135.782 C439.168,135.782 440.279,134.757 442.265,132.771 L447.986,127.05 C450.167,124.868 453.128,123.644 456.213,123.644 L473.787,123.644 Z M509,127.184 C509,131.342 507.349,135.33 504.409,138.271 C501.468,141.211 497.48,142.862 493.322,142.862 C487.719,142.862 484.785,139.841 482.725,137.781 L477.004,132.06 C476.257,131.313 475.279,130.852 474.238,130.748 L473.787,130.724 L456.213,130.724 C455.006,130.725 453.85,131.206 452.996,132.06 L447.275,137.781 C445.215,139.841 442.281,142.862 436.678,142.862 C432.52,142.862 428.531,141.211 425.591,138.271 C422.651,135.33 421,131.342 421,127.184 C421,120.664 423.487,99.977 423.797,97.396 L423.805,97.337 C423.83,97.156 423.82,97.183 423.865,96.796 C424.374,91.958 426.654,87.479 430.265,84.219 C433.888,80.95 438.594,79.139 443.474,79.138 L486.526,79.138 L487.439,79.158 C491.991,79.37 496.342,81.153 499.738,84.219 C503.348,87.478 505.621,91.957 506.131,96.792 L506.135,96.792 L506.195,97.329 L506.203,97.396 C506.513,99.977 509,120.66 509,127.184 Z" />
+<path d="M456.878 103.553 C458.747 103.554 460.263 105.069 460.263 106.938 C460.263 108.807 458.747 110.322 456.878 110.323 L440.632 110.323 C438.762 110.323 437.247 108.807 437.247 106.938 C437.247 105.069 438.762 103.553 440.632 103.553 L456.878 103.553 Z" fill="currentColor"/>
+ <path d="M445.368 115.062 L445.368 98.815 C445.368 96.946 446.884 95.43 448.753 95.43 C450.622 95.43 452.138 96.946 452.138 98.815 L452.138 115.062 C452.137 116.931 450.622 118.447 448.753 118.447 C446.884 118.447 445.369 116.931 445.368 115.062 Z" fill="currentColor"/>
+ <path d="M477.222 107.131 C479.359 107.131 481.09 108.863 481.09 111 C481.09 113.136 479.359 114.868 477.222 114.868 L477.184 114.868 C475.048 114.868 473.316 113.136 473.316 111 C473.316 108.863 475.048 107.131 477.184 107.131 L477.222 107.131 Z" fill="currentColor"/>
+ <path d="M489.406 99.008 C491.543 99.008 493.274 100.74 493.274 102.877 C493.274 105.013 491.543 106.745 489.406 106.745 L489.368 106.745 C487.232 106.745 485.5 105.013 485.5 102.877 C485.5 100.74 487.232 99.008 489.368 99.008 L489.406 99.008 Z" fill="currentColor"/>
+ <path d="M473.824 123.86 C476.875 123.861 479.8 125.076 481.957 127.234 L487.702 132.976 C489.697 134.97 490.857 136.046 493.429 136.047 C495.763 136.047 498.004 135.117 499.655 133.466 C501.304 131.816 502.231 129.578 502.231 127.245 C502.23 121.275 499.854 101.348 499.481 98.238 L499.402 97.55 L499.398 97.501 C499.072 94.335 497.582 91.399 495.22 89.266 C493.153 87.401 490.545 86.266 487.793 86.01 L486.607 85.953 L443.393 85.953 C440.211 85.954 437.143 87.135 434.78 89.266 C432.418 91.398 430.929 94.332 430.602 97.497 L430.599 97.539 C430.594 97.583 430.553 97.932 430.523 98.166 L430.527 98.17 C430.181 101.048 427.769 121.235 427.769 127.245 C427.769 129.578 428.696 131.816 430.345 133.466 C431.996 135.117 434.237 136.047 436.571 136.047 C439.143 136.046 440.303 134.97 442.297 132.976 L448.043 127.234 C450.2 125.076 453.125 123.861 456.176 123.86 L473.824 123.86 Z M509 127.245 C509 131.374 507.36 135.337 504.441 138.256 C501.521 141.176 497.558 142.816 493.429 142.816 C487.88 142.815 484.979 139.828 482.913 137.762 L477.171 132.02 C476.283 131.131 475.077 130.63 473.821 130.63 L456.18 130.63 C454.923 130.63 453.717 131.131 452.829 132.02 L447.087 137.762 C445.021 139.828 442.119 142.815 436.571 142.816 C432.442 142.816 428.479 141.176 425.559 138.256 C422.64 135.337 421 131.374 421 127.245 C421 120.712 423.495 99.958 423.807 97.361 C423.809 97.344 423.812 97.326 423.814 97.309 C423.839 97.125 423.831 97.141 423.875 96.761 C424.381 91.946 426.649 87.487 430.243 84.242 C433.849 80.988 438.536 79.185 443.393 79.184 L486.607 79.184 C491.465 79.186 496.15 80.988 499.757 84.242 C503.362 87.497 505.636 91.974 506.133 96.806 L506.129 96.806 L506.186 97.297 L506.193 97.361 C506.505 99.958 509 120.708 509 127.245 Z" fill="currentColor"/>
</g>
<g id="Black-S">
- <path d="M656.908,103.414 C658.863,103.414 660.448,104.999 660.448,106.954 C660.448,108.909 658.863,110.494 656.908,110.494 L640.724,110.494 C638.769,110.494 637.184,108.909 637.184,106.954 C637.184,104.999 638.769,103.414 640.724,103.414 L656.908,103.414 Z" />
- <path d="M645.276,115.046 L645.276,98.862 C645.276,96.907 646.861,95.322 648.816,95.322 C650.771,95.322 652.356,96.907 652.356,98.862 L652.356,115.046 C652.356,117.001 650.771,118.586 648.816,118.586 C646.861,118.586 645.276,117.001 645.276,115.046 Z" />
- <path d="M677.178,107.46 C679.133,107.46 680.718,109.045 680.718,111 C680.718,112.955 679.133,114.54 677.178,114.54 L677.138,114.54 C675.183,114.54 673.598,112.955 673.598,111 C673.598,109.045 675.183,107.46 677.138,107.46 L677.178,107.46 Z" />
- <path d="M689.315,99.368 C691.271,99.368 692.856,100.953 692.856,102.908 C692.856,104.863 691.271,106.448 689.315,106.448 L689.276,106.448 C687.321,106.448 685.736,104.863 685.736,102.908 C685.736,100.953 687.321,99.368 689.276,99.368 L689.315,99.368 Z" />
- <path d="M673.787,123.644 C676.871,123.644 679.829,124.87 682.01,127.05 L682.014,127.05 L687.735,132.771 C689.72,134.757 690.832,135.782 693.322,135.782 C695.602,135.782 697.79,134.877 699.403,133.265 C701.015,131.652 701.919,129.464 701.919,127.184 C701.919,121.252 699.555,101.419 699.181,98.309 C699.158,98.144 699.142,97.992 699.13,97.882 C699.117,97.756 699.111,97.694 699.102,97.621 L699.098,97.57 C698.779,94.458 697.315,91.575 694.993,89.478 C692.67,87.381 689.651,86.219 686.522,86.218 L643.478,86.218 L642.309,86.274 C639.604,86.525 637.039,87.64 635.007,89.474 C632.684,91.57 631.222,94.454 630.902,97.566 L630.898,97.61 C630.894,97.644 630.853,98.001 630.823,98.238 L630.826,98.242 C630.481,101.12 628.08,121.211 628.08,127.184 C628.08,129.464 628.985,131.652 630.597,133.265 C632.21,134.877 634.398,135.782 636.678,135.782 C639.168,135.782 640.279,134.757 642.265,132.771 L647.986,127.05 C650.167,124.868 653.128,123.644 656.213,123.644 L673.787,123.644 Z M709,127.184 C709,131.342 707.349,135.33 704.409,138.271 C701.468,141.211 697.48,142.862 693.322,142.862 C687.719,142.862 684.785,139.841 682.725,137.781 L677.004,132.06 C676.257,131.313 675.279,130.852 674.238,130.748 L673.787,130.724 L656.213,130.724 C655.006,130.725 653.85,131.206 652.996,132.06 L647.275,137.781 C645.215,139.841 642.281,142.862 636.678,142.862 C632.52,142.862 628.531,141.211 625.591,138.271 C622.651,135.33 621,131.342 621,127.184 C621,120.664 623.487,99.977 623.797,97.396 L623.805,97.337 C623.83,97.156 623.82,97.183 623.865,96.796 C624.374,91.958 626.654,87.479 630.265,84.219 C633.888,80.95 638.594,79.139 643.474,79.138 L686.526,79.138 L687.439,79.158 C691.991,79.37 696.342,81.153 699.738,84.219 C703.348,87.478 705.621,91.957 706.131,96.792 L706.135,96.792 L706.194,97.329 L706.203,97.396 C706.513,99.977 709,120.66 709,127.184 Z" />
+<path d="M656.878 103.553 C658.747 103.554 660.263 105.069 660.263 106.938 C660.263 108.807 658.747 110.322 656.878 110.323 L640.632 110.323 C638.762 110.323 637.247 108.807 637.247 106.938 C637.247 105.069 638.762 103.553 640.632 103.553 L656.878 103.553 Z" fill="currentColor"/>
+ <path d="M645.368 115.062 L645.368 98.815 C645.368 96.946 646.884 95.43 648.753 95.43 C650.622 95.43 652.138 96.946 652.138 98.815 L652.138 115.062 C652.137 116.931 650.622 118.447 648.753 118.447 C646.884 118.447 645.369 116.931 645.368 115.062 Z" fill="currentColor"/>
+ <path d="M677.222 107.131 C679.359 107.131 681.09 108.863 681.09 111 C681.09 113.136 679.359 114.868 677.222 114.868 L677.184 114.868 C675.048 114.868 673.316 113.136 673.316 111 C673.316 108.863 675.048 107.131 677.184 107.131 L677.222 107.131 Z" fill="currentColor"/>
+ <path d="M689.406 99.008 C691.543 99.008 693.274 100.74 693.274 102.877 C693.274 105.013 691.543 106.745 689.406 106.745 L689.368 106.745 C687.232 106.745 685.5 105.013 685.5 102.877 C685.5 100.74 687.232 99.008 689.368 99.008 L689.406 99.008 Z" fill="currentColor"/>
+ <path d="M673.824 123.86 C676.875 123.861 679.8 125.076 681.957 127.234 L687.702 132.976 C689.697 134.97 690.857 136.046 693.429 136.047 C695.763 136.047 698.004 135.117 699.655 133.466 C701.304 131.816 702.231 129.578 702.231 127.245 C702.23 121.275 699.854 101.348 699.481 98.238 L699.402 97.55 L699.398 97.501 C699.072 94.335 697.582 91.399 695.22 89.266 C693.153 87.401 690.545 86.266 687.793 86.01 L686.607 85.953 L643.393 85.953 C640.211 85.954 637.143 87.135 634.78 89.266 C632.418 91.398 630.929 94.332 630.602 97.497 L630.599 97.539 C630.594 97.583 630.553 97.932 630.523 98.166 L630.527 98.17 C630.181 101.048 627.769 121.235 627.769 127.245 C627.769 129.578 628.696 131.816 630.345 133.466 C631.996 135.117 634.237 136.047 636.571 136.047 C639.143 136.046 640.303 134.97 642.297 132.976 L648.043 127.234 C650.2 125.076 653.125 123.861 656.176 123.86 L673.824 123.86 Z M709 127.245 C709 131.374 707.36 135.337 704.441 138.256 C701.521 141.176 697.558 142.816 693.429 142.816 C687.88 142.815 684.979 139.828 682.913 137.762 L677.171 132.02 C676.283 131.131 675.077 130.63 673.821 130.63 L656.18 130.63 C654.923 130.63 653.717 131.131 652.829 132.02 L647.087 137.762 C645.021 139.828 642.119 142.815 636.571 142.816 C632.442 142.816 628.479 141.176 625.559 138.256 C622.64 135.337 621 131.374 621 127.245 C621 120.712 623.495 99.958 623.807 97.361 C623.809 97.344 623.812 97.326 623.814 97.309 C623.839 97.125 623.831 97.141 623.875 96.761 C624.381 91.946 626.649 87.487 630.243 84.242 C633.849 80.988 638.536 79.185 643.393 79.184 L686.607 79.184 C691.465 79.186 696.15 80.988 699.757 84.242 C703.362 87.497 705.636 91.974 706.133 96.806 L706.129 96.806 L706.186 97.297 L706.193 97.361 C706.505 99.958 709 120.708 709 127.245 Z" fill="currentColor"/>
</g>
</g>
</svg>
\ No newline at end of file
diff --git a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
index db8a60a9..e80b9305 100644
--- a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
+++ b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
@@ -11,7 +11,7 @@
// https://help.apple.com/xcode/#/dev745c5c974
APP_BUNDLE_IDENTIFIER = com.aoshuang.manicemu
-APP_BUILD_VERSION = 15
+APP_BUILD_VERSION = 17
APP_VERSION = 2.0.0
// Prebuilt cores under ProjectManicEMU/Cores (Citra.framework, *.libretro.framework, …)
diff --git a/ManicEmu/ManicEmu/Sources/Base/Constants.swift b/ManicEmu/ManicEmu/Sources/Base/Constants.swift
index a5cec9f5..33cd1d31 100644
--- a/ManicEmu/ManicEmu/Sources/Base/Constants.swift
+++ b/ManicEmu/ManicEmu/Sources/Base/Constants.swift
@@ -556,6 +556,7 @@ extension _R {
static let HasShowFirstAnniversaryLetter = "HasShowFirstAnniversaryLetter"
static let FoolsDayTrickCount = "FoolsDayTrickCount"
static let HasShowDolphinCoreAlert = "HasShowDolphinCoreAlert"
+ static let HasPolishSkins = "HasPolishSkins"
}
struct _Font {
@@ -748,7 +749,7 @@ extension _R {
struct _URLs {
#if DEBUG
- static let ManicEMU = "http://10.10.10.2:4000/"
+ static let ManicEMU = "http://10.10.10.2:4321/"
#else
static let ManicEMU = "https://manicemu.site/"
#endif
@@ -758,26 +759,14 @@ extension _R {
static let TermsOfUse = URL(string: ManicEMU + "terms-of-use")!
static let PrivacyPolicy = URL(string: ManicEMU + "privacy-policy")!
static let PaymentTerms = URL(string: ManicEMU + "Payment-Terms")!
- static var FAQ: URL {
- Locale.prefersCN ? URL(string: ManicEMU + "FAQ-CN")! : URL(string: ManicEMU + "FAQ-EN")!
- }
- static var GameImportGuide: URL {
- Locale.prefersCN ? URL(string: ManicEMU + "Game-Import-Guide-CN")! : URL(string: ManicEMU + "Game-Import-Guide-EN")!
- }
- static var SkinUsageGuide: URL {
- Locale.prefersCN ? URL(string: ManicEMU + "Skin-Usage-Guide-CN")! : URL(string: ManicEMU + "Skin-Usage-Guide-EN")!
- }
- static var ControllerUsageGuide: URL {
- Locale.prefersCN ? URL(string: ManicEMU + "Controller-Usage-Guide-CN")! : URL(string: ManicEMU + "Controller-Usage-Guide-EN")!
- }
- static var CheatCodesGuide: URL {
- Locale.prefersCN ? URL(string: ManicEMU + "Cheat-Codes-Guide-CN")! : URL(string: ManicEMU + "Cheat-Codes-Guide-EN")!
- }
- static var AirPlayUsageGuide: URL {
- Locale.prefersCN ? URL(string: ManicEMU + "AirPlay-Usage-Guide-CN")! : URL(string: ManicEMU + "AirPlay-Usage-Guide-EN")!
- }
+ static let FAQ = URL(string: ManicEMU + "guides/faq")!
+ static let GameImportGuide = URL(string: ManicEMU + "guides/import")!
+ static let SkinUsageGuide = URL(string: ManicEMU + "guides/skins")!
+ static let ControllerUsageGuide = URL(string: ManicEMU + "guides/controllers")!
+ static let CheatCodesGuide = URL(string: ManicEMU + "guides/cheats")!
+ static let AirPlayUsageGuide = URL(string: ManicEMU + "guides/airplay")!
static func manufacturer(_ manufacturer: Manufacturer) -> URL {
- return URL(string: ManicEMU + "Manufacturer-" + manufacturer.title + "-EN")!
+ return URL(string: ManicEMU + "Manufacturer-" + manufacturer.title)!
}
static var JoinQQ: URL {
URL(string: "https://pd.qq.com/s/7i1g6jf5k")!
@@ -816,7 +805,7 @@ extension _R {
}
}
static func History(gameType: GameType) -> URL {
- return URL(string: ManicEMU + "History-" + (gameType == .gb ? GameType.gbc.localizedShortName : gameType.localizedShortName) + "-EN")!
+ return URL(string: ManicEMU + "History-" + (gameType == .gb ? GameType.gbc.localizedShortName : gameType.localizedShortName))!
}
static let WFC = URL(string: "https://cdn.altstore.io/file/deltaemulator/delta/wfc-servers.json")!
#if SIDE_LOAD
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToyScripts.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToyScripts.swift
index 55a761f9..af452f60 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToyScripts.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToyScripts.swift
@@ -427,49 +427,52 @@ extension ShaderToy {
A whirling blackhole.
Feel free to code golf!
-
+
FabriceNeyret2: -19
dean_the_coder: -12
iq: -4
+
+ Metal-safe rewrite of the golfed Image pass. The original left `w`
+ uninitialized, used log(0)/rcp(0) at the hole, and built a rotation
+ with mat2(cos(t+vec4(0,33,11,0))). iOS 26 Metal fast-math turns
+ those into NaN and the background goes black.
*/
void mainImage(out vec4 O, vec2 F)
{
- //Iterator and attenuation (distance-squared)
- float i = .2, a;
- //Resolution for scaling and centering
- vec2 r = iResolution.xy,
- //Centered ratio-corrected coordinates
- p = ( F+F - r ) / r.y / .7,
- //Diagonal vector for skewing
- d = vec2(-1,1),
- //Blackhole center
- b = p - i*d,
- //Rotate and apply perspective
- c = p * mat2(1, 1, d/(.1 + i/dot(b,b))),
- //Rotate into spiraling coordinates
- v = c * mat2(cos(.5*log(a=dot(c,c)) + iTime*i + vec4(0,33,11,0)))/i,
- //Waves cumulative total for coloring
- w;
-
- //Loop through waves
- for(; i++<6.; w += 1.+sin(v) )
- //Distort coordinates
- v += .7* sin(v.yx*i+iTime) / i + .5;
- //Acretion disk radius
- i = length( sin(v/.3)*.4 + c*(3.+d) );
- //Red/blue gradient
- O = 1. - exp( -exp( c.x * vec4(.6,-.4,-1,0) )
- //Wave coloring
- / w.xyyx
- //Acretion disk brightness
- / ( 2. + i*i/4. - i )
- //Center darkness
- / ( .5 + 1. / a )
- //Rim highlight
- / ( .03 + abs( length(p)-.7 ) )
- );
+ vec2 r = iResolution.xy;
+ vec2 p = (F + F - r) / r.y / 0.7;
+ vec2 d = vec2(-1.0, 1.0);
+
+ float i = 0.2;
+ vec2 b = p - i * d;
+ float b2 = max(dot(b, b), 1e-8);
+ vec2 skew = d / (0.1 + i / b2);
+ vec2 c = p * mat2(1.0, 1.0, skew.x, skew.y);
+
+ float a = max(dot(c, c), 1e-8);
+ float theta = 0.5 * log(a) + iTime * i;
+ float ct = cos(theta);
+ float st = sin(theta);
+ // Same as mat2(cos(theta + vec4(0,33,11,0))) — 33≈π/2, 11≈3π/2.
+ vec2 v = (c * mat2(ct, -st, st, ct)) / i;
+
+ vec2 w = vec2(0.0);
+ for (int n = 0; n < 6; n++) {
+ i += 1.0;
+ v += 0.7 * sin(v.yx * i + iTime) / i + 0.5;
+ w += 1.0 + sin(v);
}
+ i = length(sin(v / 0.3) * 0.4 + c * (3.0 + d));
+
+ vec4 inner = clamp(c.x * vec4(0.6, -0.4, -1.0, 0.0), -40.0, 40.0);
+ vec4 den = max(w.xyyx, vec4(1e-4));
+ den *= max(2.0 + i * i * 0.25 - i, 0.25);
+ den *= 0.5 + 1.0 / a;
+ den *= 0.03 + abs(length(p) - 0.7);
+ O = 1.0 - exp(-exp(inner) / den);
+ }
+
//Original [432]
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Protocols/ViewTransition.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Protocols/ViewTransition.swift
index 9e204951..7b129f40 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/Protocols/ViewTransition.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Protocols/ViewTransition.swift
@@ -7,7 +7,7 @@
//
///Get screen rotation events by receiving notifications through Base View.
-protocol ViewTransition where Self: UIView {
+protocol ViewTransition where Self: BaseView {
///About to start rotating.
///The device's orientation is correct, but the window size is still using old data.
///belove iOS 16 orientation is not correct too!!!
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift
index aea5b1df..21b1bc49 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift
@@ -142,10 +142,15 @@ class GameInfoView: BaseView {
addSubviews([gameCoverView, gameOptionView, navigationView, gameInfoDetailView])
updateViewsConstraints()
- gameUpdateToken = game.observe(keyPaths: [\Game.gameCover, \Game.icon, \Game.onlineCoverUrl], { [weak self] changes in
+ gameUpdateToken = game.observe(keyPaths: [\Game.gameCover, \Game.icon, \Game.onlineCoverUrl, \Game.isDeleted], { [weak self] changes in
guard let self else { return }
switch changes {
- case .change:
+ case .change(_, let properties):
+ if properties.contains(where: { $0.name == "isDeleted"} ) {
+ self.hide()
+ return
+ }
+
var image: UIImage? = nil
if R.Style.GameCoverForceSquare,
let imageData = self.game.icon?.storedData() {
@@ -169,6 +174,9 @@ class GameInfoView: BaseView {
self.gameCoverView.updateImage(placeHolder)
self.navigationView.gameCover.image = placeHolder.scaled(toSize: CGSize(R.Size.ItemHeightLarge - R.Size.ContentSpaceSmall*2))
}
+
+ case .deleted:
+ self.hide()
default:
break
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift
index 30506e8b..f350b229 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift
@@ -1328,7 +1328,6 @@ extension GameOption {
detail: detail,
options: options,
selectedIndex: selectedIndex,
- optionType: firstGame.gameType == .fds ? .chevron : .radio,
groupTogether: true,
completion: { index in
if let index {
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
index ac263d4b..a7a95e9c 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
@@ -274,6 +274,7 @@ class GamesViewController: BaseViewController {
} else {
if gamesListView?.superview != nil {
removeLandscapeListIfNeeded()
+ gamesListView?.collectionView.reloadData()
return
}
@@ -343,4 +344,9 @@ class GamesViewController: BaseViewController {
gameListLandscapeView.removeFromSuperview()
self.gameListLandscapeView = nil
}
+
+ func updateLandscapeBackgroundIfNeed() {
+ guard UIDevice.isLandscape else { return }
+ gameListLandscapeView?.updateFocusedGameInfo()
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift
index a664137c..f0b8f36c 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift
@@ -145,7 +145,11 @@ class GameListLandscapeView: BaseView {
insets: .init(inset: R.Size.ContentSpaceSmall)).enableGlass(true))
view.didTapButton = { [weak self] in
guard let self, let game = self.focusedGame else { return }
- GameOptionsView.show(scene: .common, games: [game])
+ GameOptionsView.show(scene: .common,
+ games: [game],
+ shouldHide: {
+ $0 == .genHomeMenu || $0 == .delete
+ })
}
return view
}()
@@ -321,6 +325,7 @@ class GameListLandscapeView: BaseView {
gamesUpdateToken = games.observe(keyPaths: [
\Game.gameCover,
\Game.icon,
+ \Game.banner,
\Game.aliasName,
\Game.onlineCoverUrl,
\Game.latestPlayDate,
@@ -632,7 +637,7 @@ class GameListLandscapeView: BaseView {
//MARK: - 聚焦信息与背景联动
- private func updateFocusedGameInfo() {
+ func updateFocusedGameInfo() {
guard let game = focusedGame else {
infoPanelView.isHidden = true
NotificationCenter.default.post(name: R.NotificationName.LandscapeBackgroundChange,
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameOptionsView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameOptionsView.swift
index 6fcf45b5..823feee1 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameOptionsView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameOptionsView.swift
@@ -191,6 +191,9 @@ class GameOptionsView: BaseView {
shortcuts = Prefference.defalut.getPrefference(kind: .gameShortcut,
storeKey: .game(gameId: game.id),
bestEfforts: true)?.gameShortcutValue ?? GameOption.defaultShortcutOptions(for: game)
+ let availableOptions = Set(GameOption.availableOptions(game: game, scene: .gaming))
+ shortcuts = shortcuts.filter({ availableOptions.contains($0) })
+
let tools = shortcuts.map({ $0.icon })
let navigation = ASListPage.Navigation.defaultNavigation(title: "MENU",
tools: tools)
diff --git a/ManicEmu/ManicEmu/Sources/Business/Home/ViewControllers/HomeViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Home/ViewControllers/HomeViewController.swift
index b8b9f7ba..012751c7 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Home/ViewControllers/HomeViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Home/ViewControllers/HomeViewController.swift
@@ -249,7 +249,7 @@ class HomeViewController: BaseViewController {
homeTabBar.snp.makeConstraints { make in
make.size.equalTo(R.Size.HomeTabBarSize)
make.centerX.equalTo(self.view)
- if UIDevice.isSmallScreenPhone {
+ if R.Size.SafeArea.top == 0 {
make.bottom.equalToSuperview().inset(R.Size.ContentInsetBottom)
} else {
make.bottom.equalTo(view.safeAreaLayoutGuide)
@@ -266,7 +266,9 @@ class HomeViewController: BaseViewController {
landscapeBackgroundView.isHidden = false
}
- if getSelection() != .games, !landscapeBackgroundView.isShaderMode {
+ if getSelection() == .games {
+ gamesViewController.updateLandscapeBackgroundIfNeed()
+ } else if !landscapeBackgroundView.isShaderMode {
landscapeBackgroundView.setBackground(LandscapeBackgroundView.Background.shader(reload: false), animated: false)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift
index e27519a2..7c235337 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift
@@ -287,7 +287,7 @@ class Game: Object, ObjectUpdatable {
}
}
}
- return URL(fileURLWithPath: R.Path.DOSBoxPure.appendingPathComponent("\(name).\(gameType.manicEmuCore?.gameSaveFileExtension ?? "")"))
+ return URL(fileURLWithPath: R.Path.DOSBoxPure.appendingPathComponent("\(EmulationCore.DOSBoxPure.name)/\(name).\(gameType.manicEmuCore?.gameSaveFileExtension ?? "")"))
}
let localUrl = URL(fileURLWithPath: R.Path.Data.appendingPathComponent("\(name).\(gameType.manicEmuCore?.gameSaveFileExtension ?? "")"))
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Skin.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Skin.swift
index baa793bb..5a312877 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Skin.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Skin.swift
@@ -10,7 +10,10 @@
import RealmSwift
import IceCream
-extension Skin: CKRecordConvertible & CKRecordRecoverable { }
+extension Skin: CKRecordConvertible & CKRecordRecoverable {
+ /// Bundled skins follow the app package. Only imported and buildIn skins sync to iCloud.
+ var isSyncable: Bool { skinType == .import || skinType == .buildIn }
+}
enum SkinType: Int, PersistableEnum {
// case `default`, manic, delta
@@ -97,4 +100,60 @@ class Skin: Object, ObjectUpdatable {
var isKeyboardSkin: Bool {
identifier.hasSuffix(".keyboard")
}
+
+ var supportShortcut: Bool {
+ skinType == .default || isKeyboardSkin || identifier == R.Strings.WiimoteSkinIdentifier
+ }
+
+ /// Drop stale `.buildIn` rows iCloud restored after a bundle skin file (hash PK) changed.
+ /// Default / PlayCase are local-only (`isSyncable`); imported skins are user data. Runs once per app version.
+ static func polishSkinsAfterRealmSync() {
+ guard let systemCoreVersion = UserDefaults.standard.string(forKey: R.DefaultKey.SystemCoreVersion) else { return }
+ let flagKey = R.DefaultKey.HasPolishSkins + systemCoreVersion
+ guard !UserDefaults.standard.bool(forKey: flagKey) else { return }
+
+ let realm = Database.realm
+ let skins = Array(realm.objects(Skin.self).where { !$0.isDeleted && $0.skinType == .buildIn })
+
+ func identityKey(_ identifier: String, _ gameType: GameType) -> String {
+ "\(identifier)\0\(gameType.rawValue)"
+ }
+ func matchesCurrentId(_ skinId: String, hash: String) -> Bool {
+ skinId == hash || skinId.hasPrefix(hash + ".")
+ }
+
+ var currentHashByIdentity = [String: String]()
+ for skin in skins {
+ let path = R.Path.Resource.appendingPathComponent(skin.fileName)
+ guard FileManager.default.fileExists(atPath: path),
+ let hash = FileHashUtil.truncatedHash(url: URL(fileURLWithPath: path)) else {
+ continue
+ }
+ currentHashByIdentity[identityKey(skin.identifier, skin.gameType)] = hash
+ }
+ // Resource files not ready yet; retry on a later sync instead of locking this version.
+ guard !currentHashByIdentity.isEmpty else { return }
+
+ let stale = skins.filter { skin in
+ guard let hash = currentHashByIdentity[identityKey(skin.identifier, skin.gameType)] else {
+ return false
+ }
+ return !matchesCurrentId(skin.id, hash: hash)
+ }
+ if !stale.isEmpty {
+ Log.debug("[Skin] polish: remove \(stale.count) stale buildIn skin(s)")
+ try? realm.write {
+ for skin in stale {
+ if Settings.defalut.iCloudSyncEnable {
+ skin.skinData?.deleteAndClean(realm: realm)
+ skin.isDeleted = true
+ } else {
+ realm.delete(skin)
+ }
+ }
+ }
+ }
+ // Preference remap already ran in Database.setup / addEmbedSkins on this launch.
+ UserDefaults.standard.set(object: true, forKey: flagKey)
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
index 0bc64009..cdbda3be 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
@@ -733,9 +733,7 @@ class PlayViewController: GameViewController {
manicGame.gameType == .gba {
make.top.equalTo(gameView.snp.bottom).offset(3)
} else if manicGame.gameType.usesDOSSkinLayout {
- if UIDevice.isPad {
- make.top.equalTo(gameView.snp.bottom).offset(UIDevice.isLandscape ? 30 : 40)
- } else if UIDevice.isSmallScreenPhone {
+ if UIDevice.isSmallScreenPhone {
make.top.equalTo(gameView.snp.bottom).offset(17)
} else if UIDevice.isProMaxPhone {
make.top.equalTo(gameView.snp.bottom).offset(22)
@@ -748,16 +746,12 @@ class PlayViewController: GameViewController {
make.top.equalTo(gameView.snp.bottom).offset(5)
} else if manicGame.gameType == .pce {
make.top.equalTo(gameView.snp.bottom).offset(R.Size.ContentSpaceMedium)
- } else if manicGame.gameType == .ds, UIDevice.isPad {
- make.top.equalTo(gameView.snp.bottom).offset(UIDevice.isLandscape ? 25 : 18)
} else {
make.top.equalTo(gameView.snp.bottom)
}
- if manicGame.gameType == .pm && !UIDevice.isLandscape {
- make.leading.trailing.equalTo(gameView).inset(50)
- } else {
- make.leading.trailing.equalTo(gameView)
- }
+
+ make.leading.trailing.equalTo(gameView)
+
if manicGame.gameType == .j2me ||
manicGame.gameType.usesDOSSkinLayout ||
(manicGame.gameType == .symbian && UIDevice.isPhone) ||
@@ -882,7 +876,14 @@ class PlayViewController: GameViewController {
LibretroNetplaySession.shared.clear()
}
- /// 进入默认显示的方向
+ override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
+ if #available(iOS 26.0, *) {
+ return AppDelegate.orientation
+ }
+ return super.supportedInterfaceOrientations
+ }
+
+ /// Default orientation when this screen is presented.
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
if manicGame.orientation == .landscape {
return .landscapeRight
@@ -892,6 +893,12 @@ class PlayViewController: GameViewController {
return super.preferredInterfaceOrientationForPresentation
}
+ /// iOS 26: keep the scene on the forced interface orientation even if the device is still held in portrait.
+ @available(iOS 26.0, *)
+ override var prefersInterfaceOrientationLocked: Bool {
+ manicGame.orientation != .auto
+ }
+
override func viewWillTransition(to size: CGSize, with coordinator: any UIViewControllerTransitionCoordinator) {
let fromSize = R.Size.WindowSize
let toSize = size
@@ -916,7 +923,7 @@ class PlayViewController: GameViewController {
self.view.setNeedsLayout()
}) { [weak self] _ in
guard let self = self else { return }
- self.updateAzaharMotionRotation()
+ self.update3DSMotionRotation()
self.updateSkin()
self.view.setNeedsLayout()
self.resumeEmulationAndHandleAudio()
@@ -2378,7 +2385,7 @@ extension PlayViewController {
}
}
- /// Android Surface.ROTATION_* value for Azahar `citra_motion_rotation`.
+ /// Azahar / Citra motion rotation: 0 portrait, 1 landscapeLeft, 2 upside down, 3 landscapeRight.
private static func citraMotionRotationValue(
for orientation: UIInterfaceOrientation = UIDevice.currentOrientation
) -> String {
@@ -2396,37 +2403,49 @@ extension PlayViewController {
}
}
- private func updateAzaharMotionRotation() {
- guard manicGame.isAzahar3DS else { return }
- LibretroCore.sharedInstance().updateRunningCoreConfigs(
- [SpecialCoreOption.citra_motion_rotation.rawValue: Self.citraMotionRotationValue()],
- flush: false
- )
+ private func update3DSMotionRotation() {
+ let value = Self.citraMotionRotationValue()
+ if manicGame.isAzahar3DS {
+ LibretroCore.sharedInstance().updateRunningCoreConfigs(
+ [SpecialCoreOption.citra_motion_rotation.rawValue: value],
+ flush: false
+ )
+ } else if manicGame.isCitra3DS {
+ citraCore?.applyCurrentMotionRotation()
+ }
}
/// Rotate to the orientation selected in game options.
private func startOrientation() {
- if #available(iOS 16.0, tvOS 16.0, *) {
- self.setNeedsUpdateOfSupportedInterfaceOrientations()
- if let scene = ApplicationSceneDelegate.applicationScene {
+ func requestForcedOrientation() {
+ if #available(iOS 16.0, tvOS 16.0, *) {
+ setNeedsUpdateOfSupportedInterfaceOrientations()
+ if let scene = ApplicationSceneDelegate.applicationScene {
+ if manicGame.orientation == .landscape {
+ scene.requestGeometryUpdate(UIWindowScene.GeometryPreferences.iOS.init(interfaceOrientations: .landscapeRight))
+ } else if manicGame.orientation == .portrait {
+ scene.requestGeometryUpdate(UIWindowScene.GeometryPreferences.iOS.init(interfaceOrientations: .portrait))
+ }
+ }
+ } else {
if manicGame.orientation == .landscape {
- scene.requestGeometryUpdate(UIWindowScene.GeometryPreferences.iOS.init(interfaceOrientations: .landscapeRight))
+ UIDevice.current.setValue(NSNumber(integerLiteral: UIInterfaceOrientation.landscapeRight.rawValue), forKey: "orientation")
} else if manicGame.orientation == .portrait {
- scene.requestGeometryUpdate(UIWindowScene.GeometryPreferences.iOS.init(interfaceOrientations: .portrait))
+ UIDevice.current.setValue(NSNumber(integerLiteral: UIInterfaceOrientation.portrait.rawValue), forKey: "orientation")
}
}
+ }
+ if #available(iOS 26.0, *) {
+ // iOS 26 requires the allowed mask to include the requested orientation first.
+ setOrientationConfig()
+ requestForcedOrientation()
} else {
- if manicGame.orientation == .landscape {
- UIDevice.current.setValue(NSNumber(integerLiteral: UIInterfaceOrientation.landscapeRight.rawValue), forKey: "orientation")
- } else if manicGame.orientation == .portrait {
- UIDevice.current.setValue(NSNumber(integerLiteral: UIInterfaceOrientation.portrait.rawValue), forKey: "orientation")
- }
+ requestForcedOrientation()
+ setOrientationConfig()
}
- setOrientationConfig()
}
-
- /// 设置游戏页面的旋转配置
+ /// Apply the in-game orientation lock to AppDelegate / iOS 26 scene lock.
private func setOrientationConfig() {
AppDelegate.orientation = {
if manicGame.orientation == .landscape {
@@ -2437,14 +2456,20 @@ extension PlayViewController {
return R.Config.DefaultOrientation
}
}()
+ if #available(iOS 26.0, *) {
+ setNeedsUpdateOfPrefersInterfaceOrientationLocked()
+ }
}
- /// 恢复默认旋转配置
+ /// Restore the app-wide default orientation mask.
private func resetOrientationConfig() {
AppDelegate.orientation = R.Config.DefaultOrientation
+ if #available(iOS 26.0, *) {
+ setNeedsUpdateOfPrefersInterfaceOrientationLocked()
+ }
}
- ///固定旋转配置
+ /// Pin the allowed mask to the current interface orientation (not the physical device).
private func fixedOrientationConfig() {
switch UIDevice.currentOrientation {
case .unknown: break
@@ -2524,7 +2549,7 @@ extension PlayViewController {
}
if let controllerSkin = controllerView.controllerSkin {
if let skin = Database.realm.objects(Skin.self).first(where: { $0.identifier == controllerSkin.identifier }) {
- if skin.skinType == .default || skin.isKeyboardSkin {
+ if skin.supportShortcut {
//当前使用的是默认皮肤 则添加功能按钮
var shortcuts = Prefference.defalut.getPrefference(kind: .gameShortcut,
storeKey: .game(gameId: manicGame.id),
@@ -2666,6 +2691,14 @@ extension PlayViewController {
shortcutsButtonContainer.snp.updateConstraints { make in
make.top.equalTo(gameView.snp.bottom).offset(UIDevice.isLandscape ? 30 : 40)
}
+ } else if manicGame.gameType == .ds, UIDevice.isPad {
+ shortcutsButtonContainer.snp.updateConstraints { make in
+ make.top.equalTo(gameView.snp.bottom).offset(UIDevice.isLandscape ? 25 : 40)
+ }
+ } else if manicGame.gameType == .pm && !UIDevice.isLandscape {
+ shortcutsButtonContainer.snp.updateConstraints { make in
+ make.leading.trailing.equalTo(gameView).inset(UIDevice.isLandscape ? 0 : 50)
+ }
}
}
@@ -2711,8 +2744,12 @@ extension PlayViewController {
self.updateFastforward(speed: self.manicGame.speed)
self.updateAirPlay()
}
- citraCore?.openKeyboardAction { hintText, keyboardType, maxTextSize in
- ThreeDSKeyboardView.showForCitra(hintText: hintText, keyboardType: keyboardType, maxTextSize: maxTextSize)
+ citraCore?.openKeyboardAction { [weak self] config in
+ guard let self else { return }
+ self.pauseEmulationIfNeed()
+ ThreeDSKeyboardView.showForCitra(config: config) { [weak self] _, _ in
+ self?.resumeEmulationAndHandleAudio()
+ }
}
}
}
@@ -2818,12 +2855,18 @@ extension PlayViewController {
if let corePath = self.manicGame.libretroCorePath {
var compltion: (([AnyHashable: Any]?)-> Void)? = nil
if manicGame.isAzahar3DS {
- //注册azahar的键盘
- compltion = { _ in
- LibretroCore.sharedInstance().registerAzaharKeyboard { config in
+ // Register Azahar SWKBD after the core is loaded.
+ compltion = { [weak self] _ in
+ guard let self else { return }
+ LibretroCore.sharedInstance().registerAzaharKeyboard { [weak self] config in
+ guard let self else { return }
+ self.pauseEmulationIfNeed()
ThreeDSKeyboardView.showForAzahar(config: config,
- tapAction: { buttonType, text in
+ tapAction: { [weak self] buttonType, text in
+ guard let self else { return }
+ // Finalize while paused so the next frame sees DataReady.
LibretroCore.sharedInstance().inputAzaharKeyboard(text, buttonType: buttonType)
+ self.resumeEmulationAndHandleAudio()
})
}
}
@@ -4381,4 +4424,17 @@ extension PlayViewController {
currentPlayViewController.updateSkin()
}
}
+
+ static func updateBackground() {
+ if let currentPlayViewController {
+ currentPlayViewController.updateBackground()
+ }
+ }
+
+ static var currentGame: Game? {
+ if let currentPlayViewController {
+ return currentPlayViewController.manicGame
+ }
+ return nil
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Views/ThreeDSKeyboardView.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Views/ThreeDSKeyboardView.swift
index 8362a7b1..07c02787 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Views/ThreeDSKeyboardView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Views/ThreeDSKeyboardView.swift
@@ -7,134 +7,56 @@
//
// SPDX-License-Identifier: AGPL-3.0-or-later
+import Citra
import ProHUD
struct ThreeDSKeyboardView {
- static func showForCitra(hintText: String?,
- keyboardType: ThreeDSKeyboardType,
- maxTextSize: UInt16) {
-
- Alert { alert in
- alert.config.cardCornerRadius = 0
- alert.contentMaskView.alpha = 0
- alert.config.backgroundViewMask { mask in
- mask.backgroundColor = .clear
- }
-
- let textfiledWidth = UIDevice.isPhone ? 300 : 380
+ static func showForCitra(config: CitraKeyboardConfig,
+ completion: ((_ buttonPressed: Int, _ text: String?) -> Void)? = nil) {
+ let mapped = AzaharKeyboardConfig()
+ mapped.buttonConfig = AzaharButtonConfig(rawValue: config.buttonConfig.rawValue) ?? .single
+ mapped.acceptedInput = AzaharAcceptedInput(rawValue: config.acceptedInput.rawValue) ?? .anything
+ mapped.multilineMode = config.multilineMode
+ mapped.maxTextLength = Int(config.maxTextSize)
+ mapped.maxDigits = Int(config.maxDigits)
+ mapped.hintText = config.hintText
+ mapped.buttonText = config.buttonText
+ mapped.preventDigit = config.preventDigit
+ mapped.preventAt = config.preventAt
+ mapped.preventPercent = config.preventPercent
+ mapped.preventBackslash = config.preventBackslash
+ mapped.preventProfanity = config.preventProfanity
+ mapped.enableCallback = config.enableCallback
- let containerView = RoundAndBorderView(roundCorner: .allCorners)
- containerView.backgroundColor = R.Color.BackgroundPrimary
- containerView.makeBlur()
- //标题
- let titleLabel = UILabel()
- titleLabel.textAlignment = .center
- let textTitle: String
- if let hintText, !hintText.isEmpty {
- textTitle = hintText
- } else {
- textTitle = R.string.localizable.game3DSInputTitle()
- }
- titleLabel.text = textTitle
- titleLabel.font = R.Font.Headline(emphasis: true)
- titleLabel.textColor = R.Color.LabelPrimary
- containerView.addSubview(titleLabel)
- titleLabel.snp.makeConstraints { make in
- make.centerX.equalToSuperview()
- make.top.equalToSuperview().offset(R.Size.ContentSpaceMedium)
- make.leading.trailing.greaterThanOrEqualToSuperview().inset(R.Size.ContentSpaceMedium)
- }
-
- //输入框
- let textFieldContainer = RoundAndBorderView(roundCorner: .allCorners, radius: R.Size.CornerRadiusMedium, borderColor: R.Color.Border, borderWidth: 1)
- textFieldContainer.backgroundColor = R.Color.InputBox
- containerView.addSubview(textFieldContainer)
- textFieldContainer.snp.makeConstraints { make in
- make.height.equalTo(R.Size.ItemHeightMedium)
- make.top.equalTo(titleLabel.snp.bottom).offset(R.Size.ContentSpaceMedium)
- make.leading.trailing.equalToSuperview().inset(R.Size.ContentSpaceMedium)
- make.width.equalTo(textfiledWidth)
- }
-
- let textField = UITextField()
- if maxTextSize > 0 {
- textField.placeholder = R.string.localizable.maxTextSizeAllowDesc("\(maxTextSize)")
- }
- textField.tintColor = R.Color.Main
- textField.textColor = R.Color.LabelPrimary
- textField.font = R.Font.Footnote()
- textField.clearButtonMode = .whileEditing
- textFieldContainer.addSubview(textField)
- textField.snp.makeConstraints { make in
- make.top.bottom.equalToSuperview()
- make.leading.trailing.equalToSuperview().inset(R.Size.ContentSpaceExtraSmall)
- }
- textField.becomeFirstResponder()
-
- let line = UIView()
- line.backgroundColor = R.Color.Border
- containerView.addSubview(line)
- line.snp.makeConstraints { make in
- make.height.equalTo(1)
- make.leading.trailing.equalToSuperview().inset(R.Size.ContentSpaceHuge)
- make.top.equalTo(textFieldContainer.snp.bottom).offset(R.Size.ContentSpaceMedium)
- }
-
- //按钮
- /**
- Single, /// Ok button
- Dual, /// Cancel | Ok buttons
- Triple, /// Cancel | I Forgot | Ok buttons
- None, /// No button (returned by swkbdInputText in special cases)
- */
- func closeKeyboard(text: String?, buttonPressed: Int = 0) {
- alert.pop()
- if let text {
- NotificationCenter.default.post(name: .init("closeKeyboard"), object: nil, userInfo: [
- "buttonPressed" : buttonPressed,
- "keyboardText" : text
- ])
- }
- }
-
- if keyboardType == .none {
- textField.onReturnKeyPress {
- closeKeyboard(text: nil)
- }
- }
-
- let okButton = UILabel()
- okButton.isUserInteractionEnabled = true
- okButton.enablePressEffect = true
- okButton.text = R.string.localizable.confirmTitle()
- okButton.textAlignment = .center
- okButton.font = R.Font.Headline()
- okButton.textColor = R.Color.LabelPrimary
- okButton.addTapGesture { gesture in
- if let text = textField.text, !text.isEmpty {
- if maxTextSize > 0, text.count > maxTextSize {
- textFieldContainer.shake()
- UIView.makeToast(message: R.string.localizable.maxTextSizeAllowDesc("\(maxTextSize)"))
- } else {
- closeKeyboard(text: textField.text, buttonPressed: keyboardType == .single ? 0 : (keyboardType == .dual ? 1 : 2))
- }
- } else {
- textFieldContainer.shake()
-
+ showForAzahar(config: mapped) { buttonType, text in
+ let buttonPressed: Int
+ switch buttonType {
+ case .ok:
+ switch config.buttonConfig {
+ case .dual:
+ buttonPressed = 1
+ case .triple:
+ buttonPressed = 2
+ case .single, .none:
+ buttonPressed = 0
+ @unknown default:
+ buttonPressed = 0
}
+ case .cancel:
+ buttonPressed = 0
+ case .forgot:
+ buttonPressed = 1
+ case .noButton:
+ buttonPressed = 0
+ @unknown default:
+ buttonPressed = 0
}
-
- containerView.addSubview(okButton)
- okButton.snp.makeConstraints { make in
- make.centerX.equalToSuperview()
- make.top.equalTo(line.snp.bottom).offset(R.Size.ContentSpaceLarge)
- make.leading.trailing.equalToSuperview().inset(R.Size.ContentSpaceMedium)
- make.bottom.equalToSuperview().inset(R.Size.ContentSpaceLarge)
- }
-
- alert.set(customView: containerView).snp.makeConstraints { make in
- make.edges.equalToSuperview()
- }
+ // Always notify the core so Execute() cannot stay blocked.
+ NotificationCenter.default.post(name: .init("closeKeyboard"), object: nil, userInfo: [
+ "buttonPressed": buttonPressed,
+ "keyboardText": text ?? ""
+ ])
+ completion?(buttonPressed, text)
}
}
@@ -186,11 +108,10 @@ struct ThreeDSKeyboardView {
make.width.equalTo(textfiledWidth)
}
- // 创建输入控件 - 根据多行模式使用不同控件
var inputText: () -> String? = { nil }
+ var bindReturnToSubmit: ((@escaping () -> Void) -> Void)?
if config.multilineMode {
- // 多行模式使用 UITextView
let textView = UITextView()
textView.backgroundColor = .clear
textView.tintColor = R.Color.Main
@@ -204,10 +125,8 @@ struct ThreeDSKeyboardView {
textView.becomeFirstResponder()
inputText = { textView.text }
} else {
- // 单行模式使用 UITextField
let textField = UITextField()
- // 设置placeholder - 显示最大长度限制或者固定长度要求
if config.acceptedInput == .fixedLength, config.maxTextLength > 0 {
textField.placeholder = R.string.localizable.exactlyTextSizeAllowDesc("\(config.maxTextLength)")
} else if config.maxTextLength > 0 {
@@ -219,9 +138,7 @@ struct ThreeDSKeyboardView {
textField.font = R.Font.Footnote()
textField.clearButtonMode = .whileEditing
- // 根据过滤器设置键盘类型
if config.preventDigit && config.maxDigits == 0 {
- // 如果完全禁止数字,可以考虑使用默认键盘
textField.keyboardType = .default
}
@@ -232,6 +149,11 @@ struct ThreeDSKeyboardView {
}
textField.becomeFirstResponder()
inputText = { textField.text }
+ bindReturnToSubmit = { submit in
+ textField.onReturnKeyPress {
+ submit()
+ }
+ }
}
let line = UIView()
@@ -243,57 +165,57 @@ struct ThreeDSKeyboardView {
make.top.equalTo(textFieldContainer.snp.bottom).offset(R.Size.ContentSpaceMedium)
}
- // 输入验证函数
+ // 3DS SWKBD measures length in UTF-16 code units.
+ func utf16Length(_ text: String) -> Int {
+ text.utf16.count
+ }
+
func validateInput(_ text: String?) -> String? {
guard let text = text else { return nil }
-
- // 检查是否为空
+ let length = utf16Length(text)
+ let isBlank = text.unicodeScalars.allSatisfy { CharacterSet.whitespacesAndNewlines.contains($0) }
+
if config.acceptedInput == .notEmpty || config.acceptedInput == .notEmptyAndNotBlank {
if text.isEmpty {
return R.string.localizable.emptyInputNotAllowed()
}
}
-
- // 检查是否为空白
+
if config.acceptedInput == .notBlank || config.acceptedInput == .notEmptyAndNotBlank {
- if text.trimmingCharacters(in: .whitespaces).isEmpty && !text.isEmpty {
+ if isBlank {
return R.string.localizable.blankInputNotAllowed()
}
}
-
- // 检查固定长度
+
if config.acceptedInput == .fixedLength {
- if text.count != config.maxTextLength {
+ if length != config.maxTextLength {
return R.string.localizable.exactlyTextSize("\(config.maxTextLength)")
}
}
-
- // 检查最大长度
- if config.maxTextLength > 0, text.count > config.maxTextLength {
+
+ if config.maxTextLength > 0, length > config.maxTextLength {
return R.string.localizable.maxTextSizeAllowDesc("\(config.maxTextLength)")
}
-
- // 检查过滤器
+
if config.preventAt, text.contains("@") {
return R.string.localizable.atSymbolNotAllowed()
}
-
+
if config.preventPercent, text.contains("%") {
return R.string.localizable.percentSymbolNotAllowed()
}
-
+
if config.preventBackslash, text.contains("\\") {
return R.string.localizable.backslashSymbolNotAllowed()
}
-
- // 检查数字限制
- if config.preventDigit, config.maxDigits > 0 {
+
+ if config.preventDigit {
let digitCount = text.filter { $0.isNumber }.count
if digitCount > config.maxDigits {
return R.string.localizable.digitsMaximumAllowed("\(config.maxDigits)")
}
}
-
+
return nil
}
@@ -311,32 +233,32 @@ struct ThreeDSKeyboardView {
return defaultText
}
- // 创建按钮
- // buttonText数组顺序: [0]=Cancel, [1]=Forgot, [2]=Ok
- let okButton = UILabel()
- okButton.isUserInteractionEnabled = true
- okButton.enablePressEffect = true
- okButton.text = getButtonText(at: 2, defaultText: R.string.localizable.confirmTitle())
- okButton.textAlignment = .center
- okButton.font = R.Font.Headline()
- okButton.textColor = R.Color.LabelPrimary
- okButton.addTapGesture { gesture in
+ // buttonText order: [0]=Cancel, [1]=Forgot, [2]=Ok
+ func submitOk() {
let text = inputText()
-
- // 验证输入
if let errorMessage = validateInput(text) {
textFieldContainer.shake()
UIView.makeToast(message: errorMessage)
return
}
-
- // 对于 Anything 模式允许空输入
- if config.acceptedInput == .anything || (text != nil && !text!.isEmpty) {
+ if config.acceptedInput == .anything || (text != nil && !(text?.isEmpty ?? true)) {
closeKeyboard(text: text, buttonType: .ok)
} else {
textFieldContainer.shake()
}
}
+ bindReturnToSubmit?(submitOk)
+
+ let okButton = UILabel()
+ okButton.isUserInteractionEnabled = true
+ okButton.enablePressEffect = true
+ okButton.text = getButtonText(at: 2, defaultText: R.string.localizable.confirmTitle())
+ okButton.textAlignment = .center
+ okButton.font = R.Font.Headline()
+ okButton.textColor = R.Color.LabelPrimary
+ okButton.addTapGesture { _ in
+ submitOk()
+ }
let cancelButton = UILabel()
cancelButton.isUserInteractionEnabled = true
@@ -360,9 +282,7 @@ struct ThreeDSKeyboardView {
closeKeyboard(text: nil, buttonType: .forgot)
}
- // 根据按钮配置布局
- if config.buttonConfig == .single {
- // 只有确定按钮
+ if config.buttonConfig == .single || config.buttonConfig == .none {
containerView.addSubview(okButton)
okButton.snp.makeConstraints { make in
make.centerX.equalToSuperview()
@@ -371,7 +291,6 @@ struct ThreeDSKeyboardView {
make.bottom.equalToSuperview().inset(R.Size.ContentSpaceLarge)
}
} else if config.buttonConfig == .dual {
- // 取消 | 确定
containerView.addSubview(cancelButton)
containerView.addSubview(okButton)
@@ -396,8 +315,7 @@ struct ThreeDSKeyboardView {
make.centerY.equalTo(cancelButton)
}
- } else if config.buttonConfig == .triple {
- // 取消 | 忘记了 | 确定
+ } else {
containerView.addSubview(cancelButton)
containerView.addSubview(forgetButton)
containerView.addSubview(okButton)
@@ -420,16 +338,6 @@ struct ThreeDSKeyboardView {
make.leading.equalTo(forgetButton.snp.trailing)
make.centerY.equalTo(forgetButton)
}
- } else {
- // None - 无按钮模式
- line.isHidden = true
- textFieldContainer.snp.remakeConstraints { make in
- make.height.equalTo(textFieldHeight)
- make.top.equalTo(titleLabel.snp.bottom).offset(R.Size.ContentSpaceMedium)
- make.leading.trailing.equalToSuperview().inset(R.Size.ContentSpaceMedium)
- make.width.equalTo(textfiledWidth)
- make.bottom.equalToSuperview().offset(-R.Size.ContentSpaceMedium)
- }
}
alert.set(customView: containerView).snp.makeConstraints { make in
diff --git a/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/FeaturesCell.swift b/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/FeaturesCell.swift
index 33d3fd93..ab7dea82 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/FeaturesCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/FeaturesCell.swift
@@ -10,6 +10,8 @@
import Device
class FeaturesCell: UICollectionViewCell {
+ private var viewAlongsideTransitionNotification: Any? = nil
+
private var titleLabel: UILabel = {
let view = UILabel()
view.font = R.Font.Headline(emphasis: true)
@@ -28,6 +30,8 @@ class FeaturesCell: UICollectionViewCell {
view.contentMode = .center
if Device.size().rawValue < Size.screen5_8Inch.rawValue {
view.transform = CGAffineTransform(scaleX: 0.6, y: 0.6)
+ } else if UIDevice.isPad, UIDevice.isLandscape {
+ view.transform = CGAffineTransform(scaleX: 0.65, y: 0.65)
}
return view
}()
@@ -74,6 +78,12 @@ class FeaturesCell: UICollectionViewCell {
}
}
+ deinit {
+ if let viewAlongsideTransitionNotification {
+ NotificationCenter.default.removeObserver(viewAlongsideTransitionNotification)
+ }
+ }
+
override init(frame: CGRect) {
super.init(frame: frame)
@@ -142,6 +152,26 @@ class FeaturesCell: UICollectionViewCell {
make.bottom.equalToSuperview().offset(-R.Size.ItemHeightMicro)
}
+ viewAlongsideTransitionNotification = NotificationCenter.default.addObserver(forName: R.NotificationName.ViewAlongsideTransition,
+ object: nil,
+ queue: .main,
+ using: { [weak self] _ in
+ guard let self else { return }
+ if Device.size().rawValue < Size.screen5_8Inch.rawValue {
+ if UIDevice.isLandscape {
+ self.iconImageView.transform = CGAffineTransform(scaleX: 1, y: 1)
+ } else {
+ self.iconImageView.transform = CGAffineTransform(scaleX: 0.6, y: 0.6)
+ }
+ } else if UIDevice.isPad {
+ if UIDevice.isLandscape {
+ self.iconImageView.transform = CGAffineTransform(scaleX: 0.65, y: 0.65)
+ } else {
+ self.iconImageView.transform = CGAffineTransform(scaleX: 1, y: 1)
+ }
+ }
+ })
+
}
required init?(coder: NSCoder) {
@@ -215,7 +245,11 @@ class FeaturesCell: UICollectionViewCell {
if UIDevice.isPad {
offset = (UIDevice.isLandscape ? R.Size.WindowHeight * 0.9 * 9 / 16 : R.Size.WindowWidth * 0.6) - iconImageView.width
} else {
- offset = R.Size.WindowWidth - iconImageView.width
+ if UIDevice.isLandscape {
+ offset = R.Size.WindowWidth/2 - iconImageView.width
+ } else {
+ offset = R.Size.WindowWidth - iconImageView.width
+ }
}
let defaultDistance = Device.size().rawValue < Size.screen5_8Inch.rawValue ? 80.0 : 50.0
diff --git a/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PriceItemCollectionCell.swift b/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PriceItemCollectionCell.swift
index c31f5a0e..01fa3104 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PriceItemCollectionCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PriceItemCollectionCell.swift
@@ -13,7 +13,7 @@ class PriceItemCollectionCell: UICollectionViewCell {
private var infoLabel: UILabel = {
let view = UILabel()
- view.numberOfLines = 0
+ view.numberOfLines = 2
return view
}()
@@ -48,6 +48,8 @@ class PriceItemCollectionCell: UICollectionViewCell {
}
roundAndBorderView.addSubview(infoLabel)
+ infoLabel.setContentHuggingPriority(.defaultLow, for: .horizontal)
+ infoLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
infoLabel.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(R.Size.ContentSpaceMedium)
make.centerY.equalToSuperview()
@@ -58,11 +60,12 @@ class PriceItemCollectionCell: UICollectionViewCell {
make.centerY.equalToSuperview()
make.trailing.equalToSuperview().offset(-R.Size.ContentSpaceMedium)
make.height.equalTo(R.Size.IconSizeMedium.height)
- make.width.greaterThanOrEqualTo(56)
- make.leading.greaterThanOrEqualTo(infoLabel.snp.trailing).offset(R.Size.ContentSpaceExtraSmall)
+ make.leading.equalTo(infoLabel.snp.trailing).offset(R.Size.ContentSpaceExtraSmall).priority(.high)
}
promptContainer.addSubview(promptLabel)
+ promptLabel.setContentHuggingPriority(.required, for: .horizontal)
+ promptLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
promptLabel.snp.makeConstraints { make in
make.leading.trailing.equalToSuperview().inset(R.Size.ContentSpaceExtraSmall)
make.top.bottom.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PurchaseView.swift b/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PurchaseView.swift
index 59233c37..791173ce 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PurchaseView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PurchaseView.swift
@@ -75,7 +75,7 @@ class PurchaseView: BaseView {
PurchaseManager.redeemOfferCode { [weak self] isCompleted, isMember in
guard let self else { return }
if isMember {
- self.needToClosePurchaseView?()
+ self.didTapClose?()
CheersView.makePurchaseCheers()
} else if isCompleted {
Log.debug("兑换优惠成功")
@@ -96,8 +96,6 @@ class PurchaseView: BaseView {
return view
}()
- var needToClosePurchaseView: (()->Void)? = nil
-
private var featureView = FeaturesView()
private lazy var priceView: PriceView = {
@@ -113,27 +111,16 @@ class PurchaseView: BaseView {
addSubview(backgroundGradientView)
addSubview(navigationView)
navigationView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.leading.trailing.equalTo(safeAreaLayoutGuide)
+ make.top.equalToSuperview()
make.height.equalTo(R.Size.ItemHeightMedium)
}
addSubview(featureView)
featureView.featuresType = featuresType
- featureView.snp.makeConstraints { make in
- make.leading.trailing.equalToSuperview()
- make.top.equalTo(navigationView.snp.bottom)
- }
- backgroundGradientView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
- make.bottom.equalTo(featureView.snp.bottom)
- }
-
addSubview(priceView)
- priceView.snp.makeConstraints { make in
- make.leading.bottom.trailing.equalToSuperview()
- make.top.equalTo(featureView.snp.bottom)
- make.height.equalTo(447)
- }
+
+ updateViewsConstraits()
}
override func layoutSubviews() {
@@ -145,4 +132,46 @@ class PurchaseView: BaseView {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
+
+ private func updateViewsConstraits() {
+ backgroundGradientView.snp.remakeConstraints { make in
+ if UIDevice.isPhone, UIDevice.isLandscape {
+ make.top.equalToSuperview()
+ make.leading.bottom.trailing.equalTo(featureView)
+ } else {
+ make.leading.top.trailing.equalToSuperview()
+ make.bottom.equalTo(featureView.snp.bottom)
+ }
+ }
+
+ featureView.snp.remakeConstraints { make in
+ if UIDevice.isPhone, UIDevice.isLandscape {
+ make.top.equalToSuperview().offset(R.Size.NavigationHeight)
+ make.leading.bottom.equalToSuperview()
+ make.width.equalToSuperview().dividedBy(2)
+ } else {
+ make.leading.trailing.equalToSuperview()
+ make.top.equalTo(navigationView.snp.bottom)
+ }
+ }
+
+ priceView.snp.remakeConstraints { make in
+ if UIDevice.isPhone, UIDevice.isLandscape {
+ make.top.equalToSuperview().offset(R.Size.NavigationHeight)
+ make.bottom.trailing.equalToSuperview()
+ make.leading.equalTo(featureView.snp.trailing)
+ } else {
+ make.leading.bottom.trailing.equalToSuperview()
+ make.top.equalTo(featureView.snp.bottom)
+ make.height.equalTo(447)
+ }
+ }
+ }
+}
+
+extension PurchaseView: ViewTransition {
+ func viewAlongsideTransition() {
+ guard UIDevice.isPhone else { return }
+ updateViewsConstraits()
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Skin/ViewControllers/FlexSkinSettingViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Skin/ViewControllers/FlexSkinSettingViewController.swift
index 748a6d26..f3edc06e 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Skin/ViewControllers/FlexSkinSettingViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Skin/ViewControllers/FlexSkinSettingViewController.swift
@@ -620,6 +620,12 @@ extension FlexSkinSettingViewController {
if indexPath.section == 0 {
//section 0 fetch images
var sources: [ImageFetcher.Source] = [.capture, .library, .file]
+
+ if let gameId = self.gameId,
+ let game = Database.realm.object(ofType: Game.self, forPrimaryKey: gameId) {
+ sources += [.libretro(game), .steamGridDB(game, preferredAssetType: .grids)]
+ }
+
if let image = background?.image {
sources += [.editImage(image)]
}
@@ -630,6 +636,7 @@ extension FlexSkinSettingViewController {
} else {
self.addBackground(image: image)
}
+ self.updateGamingBackgroundIfNeed()
})
} else if indexPath.section == 1 {
//section 1 setting background
@@ -642,9 +649,11 @@ extension FlexSkinSettingViewController {
} else if indexPath.row == 2 {
self.updateBackgroundStoreLevel(.game)
}
+ self.updateGamingBackgroundIfNeed()
} else if indexPath.section == 2 {
//section 2 delete
self.removeBackground()
+ self.updateGamingBackgroundIfNeed()
}
})
}
@@ -763,6 +772,14 @@ extension FlexSkinSettingViewController {
}
}
+ private func updateGamingBackgroundIfNeed() {
+ guard PlayViewController.isGaming else { return }
+ if let gameId, PlayViewController.currentGame?.id == gameId {
+ PlayViewController.updateBackground()
+ } else if self.gameType == PlayViewController.currentGameType {
+ PlayViewController.updateBackground()
+ }
+ }
}
///Screens
diff --git a/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinCollectionViewCell.swift b/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinCollectionViewCell.swift
index 3c441556..30b038d0 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinCollectionViewCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinCollectionViewCell.swift
@@ -38,11 +38,19 @@ class SkinCollectionViewCell: UICollectionViewCell {
}
}
+ var onPreview: (() -> Void)?
+ var onPlaycaseTap: (() -> Void)?
+
+ private var appliedSkinIdentifier: String?
+ private var appliedTraits: ControllerSkin.Traits?
+ private var appliedRenderGeneration: Int = -1
+
var controllerView: ControllerView = {
let view = ControllerView()
view.backgroundColor = .black
view.layerCornerRadius = R.Size.CornerRadiusMedium
view.isUserInteractionEnabled = false
+ view.overrideControllerSkinSize = .small
return view
}()
@@ -66,7 +74,7 @@ class SkinCollectionViewCell: UICollectionViewCell {
return view
}()
- var playcaseButton: UIImageView = {
+ private var playcaseButton: UIImageView = {
let view = UIImageView(image: R.image.playcase_footnote())
view.enablePressEffect = true
view.isFocusable = false
@@ -75,7 +83,7 @@ class SkinCollectionViewCell: UICollectionViewCell {
return view
}()
- var previewButton: SymbolButton = {
+ private var previewButton: SymbolButton = {
let view = SymbolButton(image: R.image.customArrowDownLeftAndArrowUpRight()?.applySymbolConfig(),
title: R.string.localizable.skinPreviewTitle(),
titleFont: R.Font.Footnote(),
@@ -135,6 +143,13 @@ class SkinCollectionViewCell: UICollectionViewCell {
playcaseButton.snp.makeConstraints { make in
make.leading.bottom.equalToSuperview()
}
+
+ previewButton.addTapGesture { [weak self] _ in
+ self?.onPreview?()
+ }
+ playcaseButton.addTapGesture { [weak self] _ in
+ self?.onPlaycaseTap?()
+ }
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
@@ -148,29 +163,47 @@ class SkinCollectionViewCell: UICollectionViewCell {
fatalError("init(coder:) has not been implemented")
}
+ override func prepareForReuse() {
+ super.prepareForReuse()
+ onPreview = nil
+ onPlaycaseTap = nil
+ onFocusConfirm = nil
+ }
+
func setData(controllerSkin: ControllerSkin?,
traits: ControllerSkin.Traits,
subscriptTitle: String? = nil,
isEditMode: Bool,
isUsing: Bool,
- isEditable: Bool) {
- let screenAspectRatio: CGFloat
- if traits.orientation == .portrait {
- screenAspectRatio = R.Size.WindowSize.aspectRatio
- } else {
- screenAspectRatio = R.Size.WindowSize.height/R.Size.WindowSize.width
- }
- if let aspectRatio = controllerSkin?.aspectRatio(for: traits), abs(aspectRatio.aspectRatio - screenAspectRatio) > 0.1 {
- controllerView.snp.updateConstraints { make in
- make.height.equalToSuperview().offset(-(height - (width/aspectRatio.aspectRatio)))
+ isEditable: Bool,
+ renderGeneration: Int = 0) {
+ let needsSkinUpdate = appliedSkinIdentifier != controllerSkin?.identifier
+ || appliedTraits != traits
+ || appliedRenderGeneration != renderGeneration
+
+ if needsSkinUpdate {
+ let screenAspectRatio: CGFloat
+ if traits.orientation == .portrait {
+ screenAspectRatio = R.Size.WindowSize.aspectRatio
+ } else {
+ screenAspectRatio = R.Size.WindowSize.height/R.Size.WindowSize.width
}
- } else {
- controllerView.snp.updateConstraints { make in
- make.height.equalToSuperview()
+ if let aspectRatio = controllerSkin?.aspectRatio(for: traits), abs(aspectRatio.aspectRatio - screenAspectRatio) > 0.1 {
+ controllerView.snp.updateConstraints { make in
+ make.height.equalToSuperview().offset(-(height - (width/aspectRatio.aspectRatio)))
+ }
+ } else {
+ controllerView.snp.updateConstraints { make in
+ make.height.equalToSuperview()
+ }
}
+ controllerView.overrideControllerSkinTraits = traits
+ controllerView.controllerSkin = controllerSkin
+ appliedSkinIdentifier = controllerSkin?.identifier
+ appliedTraits = traits
+ appliedRenderGeneration = renderGeneration
}
- controllerView.overrideControllerSkinTraits = traits
- controllerView.controllerSkin = controllerSkin
+
if let subscriptTitle {
subscriptView.isHidden = false
subscriptView.titleLabel.text = R.string.localizable.designedFor(subscriptTitle)
diff --git a/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinSettingsView.swift b/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinSettingsView.swift
index 06171489..0f7de304 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinSettingsView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinSettingsView.swift
@@ -103,6 +103,8 @@ class SkinSettingsView: BaseView {
}
private var isMoreGamesSetting = false
+ /// Bumped when a skin file is rewritten (flex edit) so cells rebuild the same identifier.
+ private var skinRenderGeneration = 0
private var collectionViewContentInsetBottom: CGFloat {
R.Size.ContentInsetBottom + ((UIDevice.isPad && !showClose) ? R.Size.HomeTabBarSize.height + R.Size.ContentSpaceMedium : 0)
@@ -370,6 +372,7 @@ class SkinSettingsView: BaseView {
vc.didCompletion = { [weak self] isModified in
if isModified {
flexSkin.controllerSkin = ControllerSkin(fileURL: flexSkin.fileURL)
+ self?.skinRenderGeneration += 1
self?.collectionView.reloadData()
}
}
@@ -764,15 +767,16 @@ extension SkinSettingsView: UICollectionViewDataSource {
subscriptTitle: skin.gameType == gameType ? nil : skin.gameType.localizedShortName,
isEditMode: isEditMode,
isUsing: isUsing,
- isEditable: skin.isEditable)
- cell.previewButton.addTapGesture { gesture in
+ isEditable: skin.isEditable,
+ renderGeneration: skinRenderGeneration)
+ cell.onPreview = {
if let controllerSkin = skin.controllerSkin {
topViewController()?.present(SkinPreviewViewController(skin: controllerSkin,
traits: traits),
animated: true)
}
}
- cell.playcaseButton.addTapGesture { _ in
+ cell.onPlaycaseTap = {
PlayCasePromoView.show(showDontShow: false)
}
cell.onFocusConfirm = { [weak self] in
@@ -938,6 +942,12 @@ extension SkinSettingsView: UICollectionViewDelegate {
Prefference.defalut.deletePrefference(kind: .skin,
level: .game,
extra: Prefference.StoreKey.orientationExtraKey(isLandScape: false))
+ Prefference.defalut.deletePrefference(kind: .skin,
+ level: .gameType,
+ extra: Prefference.StoreKey.orientationExtraKey(isLandScape: true))
+ Prefference.defalut.deletePrefference(kind: .skin,
+ level: .gameType,
+ extra: Prefference.StoreKey.orientationExtraKey(isLandScape: false))
}
landscapeUsingIndex = 0
diff --git a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerButtonStyleView.swift b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerButtonStyleView.swift
index 41bbe19f..dfe6946b 100644
--- a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerButtonStyleView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerButtonStyleView.swift
@@ -384,7 +384,7 @@ class AddTriggerButtonStyleView: BaseView {
self.item.buttonWidth = style.defaultSize.width
self.item.buttonHeight = style.defaultSize.height
self.item.buttonOpacity = 1
- self.item.buttonCornerRadiusRatio = style.defaultSize.height/2
+ self.item.buttonCornerRadiusRatio = 100
self.triggerButtonView.style = style
self.triggerButtonView.buttonSize = style.defaultSize
self.triggerButtonView.buttonOpacity = 1
diff --git a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerMappingListView.swift b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerMappingListView.swift
index eb58177b..299cdd93 100644
--- a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerMappingListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerMappingListView.swift
@@ -72,7 +72,7 @@ class AddTriggerMappingListView: BaseView {
make.center.equalToSuperview()
}
- gradientView.isHidden = triggerItem.mappings.count == 0
+ view.isHidden = triggerItem.mappings.count == 0
return view
}()
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/Amiga.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/Amiga.swift
index 364f82cb..e65268f6 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/Amiga.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/Amiga.swift
@@ -49,6 +49,15 @@ extension GameType {
return .game(.amiga)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a}
else if stringValue == "b" { self = .b}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/Arcade.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/Arcade.swift
index a4451c9d..60166444 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/Arcade.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/Arcade.swift
@@ -47,6 +47,15 @@ extension GameType {
return .game(.arcade)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a}
else if stringValue == "b" { self = .b}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/C64.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/C64.swift
index b1d0e29d..bfebe373 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/C64.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/C64.swift
@@ -49,6 +49,15 @@ extension GameType {
return .game(.c64)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a}
else if stringValue == "b" { self = .b}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/DC.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/DC.swift
index e9dab8f2..d0b20db8 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/DC.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/DC.swift
@@ -39,6 +39,14 @@ extension GameType
return .game(.dc)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a }
else if stringValue == "b" { self = .b }
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/DOS.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/DOS.swift
index 236ab4ab..3305489e 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/DOS.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/DOS.swift
@@ -50,6 +50,15 @@ extension GameType {
return .game(.dos)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a}
else if stringValue == "b" { self = .b}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/N64.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/N64.swift
index 52df7a15..8cf43f21 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/N64.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/N64.swift
@@ -46,6 +46,14 @@ extension GameType
return .game(.n64)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .analogStickUp, .analogStickDown, .analogStickLeft, .analogStickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a }
else if stringValue == "b" { self = .b }
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/NDS.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/NDS.swift
index 5af54688..7834aa70 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/NDS.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/NDS.swift
@@ -49,6 +49,15 @@ extension GameType
return .game(.ds)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
+ case .touchScreenX, .touchScreenY: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a }
else if stringValue == "b" { self = .b }
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/NGC.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/NGC.swift
index 262b98ed..95264af1 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/NGC.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/NGC.swift
@@ -47,6 +47,15 @@ extension GameType {
return .game(.ngc)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a}
else if stringValue == "b" { self = .b}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/PS1.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/PS1.swift
index a1bc0c2c..2271954b 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/PS1.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/PS1.swift
@@ -47,6 +47,15 @@ extension GameType
return .game(.ps1)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a }
else if stringValue == "b" { self = .b }
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/PSP.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/PSP.swift
index 76beb8e5..609a59a9 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/PSP.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/PSP.swift
@@ -40,6 +40,14 @@ extension GameType
return .game(.psp)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a }
else if stringValue == "b" { self = .b }
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
index cfd2264f..7c28a704 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
@@ -57,6 +57,8 @@ extension GameType
var isContinuous: Bool {
switch self
{
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
case .touchScreenX, .touchScreenY: return true
default: return false
}
@@ -221,13 +223,6 @@ struct ThreeDS: DeltaCoreProtocol {
}
}
-enum ThreeDSKeyboardType: UInt {
- case single
- case dual
- case triple
- case none
-}
-
class ThreeDSEmulatorBridge : EmulatorBridgeBase {
static let shared = ThreeDSEmulatorBridge()
@@ -250,6 +245,28 @@ class ThreeDSEmulatorBridge : EmulatorBridgeBase {
citraCore.setSimBlowing(start: start)
}
+ /// 0=portrait, 1=landscapeLeft, 2=upside down, 3=landscapeRight.
+ func setMotionRotation(_ rotation: Int) {
+ citraCore.setMotionRotation(rotation)
+ }
+
+ func applyCurrentMotionRotation(
+ _ orientation: UIInterfaceOrientation = UIDevice.currentOrientation
+ ) {
+ switch orientation {
+ case .portrait:
+ citraCore.setMotionRotation(0)
+ case .landscapeLeft:
+ citraCore.setMotionRotation(1)
+ case .portraitUpsideDown:
+ citraCore.setMotionRotation(2)
+ case .landscapeRight:
+ citraCore.setMotionRotation(3)
+ default:
+ citraCore.setMotionRotation(3)
+ }
+ }
+
func setFrameLimit(_ limit: UInt16) {
citraCore.setFrameLimit(limit)
}
@@ -270,8 +287,17 @@ class ThreeDSEmulatorBridge : EmulatorBridgeBase {
updateConfig(["ManicEMU.resolutionFactor": resolution.rawValue])
}
- func openKeyboardAction(_ action: ((_ hintText:String?, _ keyboardType: ThreeDSKeyboardType, _ maxTextSize: UInt16) -> Void)? = nil) {
- CitraCore.openKeyboardAction = { action?($0, ThreeDSKeyboardType(rawValue: $1.rawValue)!, $2) }
+ func openKeyboardAction(_ action: ((CitraKeyboardConfig) -> Void)? = nil) {
+ CitraCore.openKeyboardAction = { config in
+ guard let action else { return }
+ if Thread.isMainThread {
+ action(config)
+ } else {
+ DispatchQueue.main.async {
+ action(config)
+ }
+ }
+ }
}
func start(withGameURL gameURL: URL,
@@ -333,6 +359,7 @@ class ThreeDSEmulatorBridge : EmulatorBridgeBase {
self.metalView = metalView
let metalLayer = metalView.layer as! CAMetalLayer
citraCore.allocateMetalLayer(for: metalLayer, with: metalViewFrame.size, isSecondary: false)
+ applyCurrentMotionRotation()
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
Thread.setThreadPriority(1.0)
Thread.detachNewThread {
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/Wii.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/Wii.swift
index 7c249269..1b561fd6 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/Wii.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/Wii.swift
@@ -48,6 +48,15 @@ extension GameType {
return .game(.wii)
}
+ var isContinuous: Bool {
+ switch self
+ {
+ case .leftThumbstickUp, .leftThumbstickDown, .leftThumbstickLeft, .leftThumbstickRight: return true
+ case .rightThumbstickUp, .rightThumbstickDown, .rightThumbstickLeft, .rightThumbstickRight: return true
+ default: return false
+ }
+ }
+
init?(stringValue: String) {
if stringValue == "a" { self = .a}
else if stringValue == "b" { self = .b}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/StringExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/StringExtensions.swift
index 26757eee..1d7f84aa 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/StringExtensions.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/StringExtensions.swift
@@ -362,6 +362,11 @@ extension String {
}
return self
}
+
+ var parsedVersionNumber: UInt64 {
+ let digits = self.replacingOccurrences(ofPattern: "\\D", withTemplate: "")
+ return UInt64(digits) ?? 0
+ }
}
// Expand the character set used for recognizing emoji.
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/Database.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/Database.swift
index acadfa39..ea04da9e 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/Database.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/Database.swift
@@ -77,7 +77,7 @@ struct Database {
if let systemCoreVersion = UserDefaults.standard.string(forKey: R.DefaultKey.SystemCoreVersion) {
// Existing version record means this is an upgrade; run data migrations.
- let systemCoreVersionNumber = parseVersionNumber(systemCoreVersion)
+ let systemCoreVersionNumber = systemCoreVersion.parsedVersionNumber
if systemCoreVersionNumber < 141 {
//调整1.4.0的gameType问题
@@ -398,11 +398,6 @@ struct Database {
return try! Realm(configuration: memoryConfig)
}
- private static func parseVersionNumber(_ version: String) -> UInt64 {
- let digits = version.replacingOccurrences(ofPattern: "\\D", withTemplate: "")
- return UInt64(digits) ?? 0
- }
-
private static func removeRealmFiles(_ config: Realm.Configuration) {
guard let fileURL = config.fileURL else { return }
let folder = fileURL.deletingLastPathComponent()
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/SyncManager.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/SyncManager.swift
index fdc86e4d..26e4ad9b 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/SyncManager.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/SyncManager.swift
@@ -121,10 +121,10 @@ class SyncManager: NSObject {
SyncObject(realmConfiguration: configuration, type: Prefference.self)
])
realmSyncEngine?.setupCompletion = { error in
- //同步设定完成之后 尝试将本地所有数据推到云端
if let error = error {
Log.debug("[iCloud Sync]数据库同步初始化结束 error:\(error)")
} else {
+ Skin.polishSkinsAfterRealmSync()
Log.debug("[iCloud Sync]数据库同步初始化结束")
}
}
@@ -332,7 +332,6 @@ class SyncManager: NSObject {
static func download(to localFilePath: String, completion: ((Error?)->Void)? = nil) {
if SyncManager.shared.downloadingFiles.contains(localFilePath) {
- UIView.makeToast(message: R.string.localizable.filesDownloadErrorFileExist(localFilePath.deletingPathExtension.lastPathComponent))
return
}