mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-19 12:15:31 +02:00
fix(ios): route native picker results
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>Pokemon Red</string>
|
<string>gen1recomp</string>
|
||||||
<key>CFBundleDocumentTypes</key>
|
<key>CFBundleDocumentTypes</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
@@ -49,10 +49,6 @@
|
|||||||
<false/>
|
<false/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
<string>Launch Screen</string>
|
<string>Launch Screen</string>
|
||||||
<key>UIRequiredDeviceCapabilities</key>
|
|
||||||
<array>
|
|
||||||
<string>opengles-2</string>
|
|
||||||
</array>
|
|
||||||
<key>UIStatusBarHidden</key>
|
<key>UIStatusBarHidden</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ TARGET="all"
|
|||||||
NOTARY_PROFILE="notary-profile"
|
NOTARY_PROFILE="notary-profile"
|
||||||
NOTARIZE=true
|
NOTARIZE=true
|
||||||
IOS_RELEASE=false
|
IOS_RELEASE=false
|
||||||
|
IOS_IPA=false
|
||||||
|
|
||||||
say() { printf '\033[1;32m==>\033[0m %s\n' "$*"; }
|
say() { printf '\033[1;32m==>\033[0m %s\n' "$*"; }
|
||||||
warn() { printf '\033[1;33mwarn:\033[0m %s\n' "$*" >&2; }
|
warn() { printf '\033[1;33mwarn:\033[0m %s\n' "$*" >&2; }
|
||||||
@@ -48,6 +49,7 @@ while [ $# -gt 0 ]; do
|
|||||||
--notary-profile) NOTARY_PROFILE="$2"; shift ;;
|
--notary-profile) NOTARY_PROFILE="$2"; shift ;;
|
||||||
--no-notarize) NOTARIZE=false ;;
|
--no-notarize) NOTARIZE=false ;;
|
||||||
--release) IOS_RELEASE=true ;;
|
--release) IOS_RELEASE=true ;;
|
||||||
|
--ipa) IOS_IPA=true ;;
|
||||||
*) fail "unknown argument: $1" ;;
|
*) fail "unknown argument: $1" ;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
@@ -298,6 +300,9 @@ build_android() {
|
|||||||
if [ "$VERSION_EXPLICIT" = true ]; then
|
if [ "$VERSION_EXPLICIT" = true ]; then
|
||||||
args+=(--version "$VERSION")
|
args+=(--version "$VERSION")
|
||||||
fi
|
fi
|
||||||
|
if [ "$IOS_IPA" = true ]; then
|
||||||
|
args+=(--ipa)
|
||||||
|
fi
|
||||||
"$ROOT/scripts/build_android.sh" ${args[@]+"${args[@]}"}
|
"$ROOT/scripts/build_android.sh" ${args[@]+"${args[@]}"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+32
-1
@@ -50,7 +50,7 @@ DISPLAY_NAME="gen1recomp"
|
|||||||
# capabilities like HealthKit are involved), so a per-team default
|
# capabilities like HealthKit are involved), so a per-team default
|
||||||
# lets anyone build without colliding with someone else's app
|
# lets anyone build without colliding with someone else's app
|
||||||
# 4. simulator: the project default (no App ID registration involved)
|
# 4. simulator: the project default (no App ID registration involved)
|
||||||
BUNDLE_ID="${GEN1_BUNDLE_ID:-}"
|
BUNDLE_ID="${GEN1_BUNDLE_ID:-com.theboisclub.gen1recomp}"
|
||||||
if [ -z "$BUNDLE_ID" ] && [ -f "$IOS_DIR/bundle_id.local" ]; then
|
if [ -z "$BUNDLE_ID" ] && [ -f "$IOS_DIR/bundle_id.local" ]; then
|
||||||
BUNDLE_ID="$(tr -d '[:space:]' < "$IOS_DIR/bundle_id.local")"
|
BUNDLE_ID="$(tr -d '[:space:]' < "$IOS_DIR/bundle_id.local")"
|
||||||
fi
|
fi
|
||||||
@@ -65,6 +65,7 @@ DEVICE=false
|
|||||||
RELEASE=false
|
RELEASE=false
|
||||||
PACKAGE_ONLY=false
|
PACKAGE_ONLY=false
|
||||||
INSTALL=false
|
INSTALL=false
|
||||||
|
CREATE_IPA=false
|
||||||
# Last resort for an incomplete source export, mirroring build_android.sh.
|
# Last resort for an incomplete source export, mirroring build_android.sh.
|
||||||
MANIFEST_BASE_URL="${MANIFEST_BASE_URL:-https://raw.githubusercontent.com/bryanthaboi/gen1recomp/main}"
|
MANIFEST_BASE_URL="${MANIFEST_BASE_URL:-https://raw.githubusercontent.com/bryanthaboi/gen1recomp/main}"
|
||||||
MANIFESTS=""
|
MANIFESTS=""
|
||||||
@@ -82,6 +83,7 @@ while [ $# -gt 0 ]; do
|
|||||||
--release) RELEASE=true ;;
|
--release) RELEASE=true ;;
|
||||||
--package-only) PACKAGE_ONLY=true ;;
|
--package-only) PACKAGE_ONLY=true ;;
|
||||||
--install) INSTALL=true ;;
|
--install) INSTALL=true ;;
|
||||||
|
--ipa) CREATE_IPA=true ;;
|
||||||
--version) VERSION="$2"; shift ;;
|
--version) VERSION="$2"; shift ;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
sed -n '2,24p' "$0"
|
sed -n '2,24p' "$0"
|
||||||
@@ -92,6 +94,10 @@ while [ $# -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if $CREATE_IPA; then
|
||||||
|
DEVICE=true
|
||||||
|
fi
|
||||||
|
|
||||||
VERSION_CODE=""
|
VERSION_CODE=""
|
||||||
if [ -n "$VERSION" ]; then
|
if [ -n "$VERSION" ]; then
|
||||||
if ! printf '%s' "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
if ! printf '%s' "$VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
||||||
@@ -232,6 +238,30 @@ apply_ios_branding() {
|
|||||||
cp "$OVERLAY_PLIST" "$dest"
|
cp "$OVERLAY_PLIST" "$dest"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply_ios_icon() {
|
||||||
|
local source="$ROOT/assets/logo/logo.png"
|
||||||
|
local target="$XCODE_DIR/Images.xcassets/iOS AppIcon.appiconset"
|
||||||
|
[ -f "$source" ] || fail "missing iOS icon source: $source"
|
||||||
|
[ -d "$target" ] || fail "missing iOS app icon set: $target"
|
||||||
|
local entry name size
|
||||||
|
while IFS=: read -r name size; do
|
||||||
|
sips -z "$size" "$size" "$source" --out "$target/$name" >/dev/null
|
||||||
|
done <<'EOF'
|
||||||
|
icon-1024pt@1x.png:1024
|
||||||
|
icon-29pt@1x.png:29
|
||||||
|
icon-29pt@2x.png:58
|
||||||
|
icon-29pt@3x.png:87
|
||||||
|
icon-40pt@1x.png:40
|
||||||
|
icon-40pt@2x.png:80
|
||||||
|
icon-40pt@3x.png:120
|
||||||
|
icon-60pt@2x.png:120
|
||||||
|
icon-60pt@3x.png:180
|
||||||
|
icon-76pt@1x.png:76
|
||||||
|
icon-76pt@2x.png:152
|
||||||
|
icon-83.5pt@2x.png:167
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
# --------------------------------------------------------------- game.love
|
# --------------------------------------------------------------- game.love
|
||||||
# Every version's import manifest has to ship or that game's ROM import fails in
|
# Every version's import manifest has to ship or that game's ROM import fails in
|
||||||
# the built app: decodeManifest (src/import/RomImporter.lua) errors outright when
|
# the built app: decodeManifest (src/import/RomImporter.lua) errors outright when
|
||||||
@@ -640,6 +670,7 @@ install_to_device() {
|
|||||||
|
|
||||||
# --------------------------------------------------------------- main
|
# --------------------------------------------------------------- main
|
||||||
apply_ios_branding
|
apply_ios_branding
|
||||||
|
apply_ios_icon
|
||||||
say "applying iOS native bridge patches (picker/Files support)"
|
say "applying iOS native bridge patches (picker/Files support)"
|
||||||
python3 "$IOS_DIR/patch_love_src.py" || fail "patch_love_src.py failed"
|
python3 "$IOS_DIR/patch_love_src.py" || fail "patch_love_src.py failed"
|
||||||
ensure_manifests
|
ensure_manifests
|
||||||
|
|||||||
@@ -818,7 +818,11 @@ local function resetPointerCursor(self)
|
|||||||
if not (love.mouse.isCursorSupported and love.mouse.isCursorSupported()) then
|
if not (love.mouse.isCursorSupported and love.mouse.isCursorSupported()) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.arrowCursor = self.arrowCursor or love.mouse.getSystemCursor("arrow")
|
if not self.arrowCursor then
|
||||||
|
local ok, cursor = pcall(love.mouse.getSystemCursor, "arrow")
|
||||||
|
if not ok then return end
|
||||||
|
self.arrowCursor = cursor
|
||||||
|
end
|
||||||
love.mouse.setCursor(self.arrowCursor)
|
love.mouse.setCursor(self.arrowCursor)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2512,8 +2516,11 @@ function RomImporter:draw()
|
|||||||
if self._hoverEnabled and not self._padCursorActive
|
if self._hoverEnabled and not self._padCursorActive
|
||||||
and love.mouse.isCursorSupported and love.mouse.isCursorSupported() then
|
and love.mouse.isCursorSupported and love.mouse.isCursorSupported() then
|
||||||
if self._anyHover then
|
if self._anyHover then
|
||||||
self.handCursor = self.handCursor or love.mouse.getSystemCursor("hand")
|
if not self.handCursor then
|
||||||
love.mouse.setCursor(self.handCursor)
|
local ok, cursor = pcall(love.mouse.getSystemCursor, "hand")
|
||||||
|
if ok then self.handCursor = cursor end
|
||||||
|
end
|
||||||
|
if self.handCursor then love.mouse.setCursor(self.handCursor) end
|
||||||
else
|
else
|
||||||
resetPointerCursor(self)
|
resetPointerCursor(self)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -36,4 +36,13 @@ ri:play("red")
|
|||||||
eq(booted, "red", "android play still boots")
|
eq(booted, "red", "android play still boots")
|
||||||
eq(currentCursor, "hand", "android play leaves the cursor alone")
|
eq(currentCursor, "hand", "android play leaves the cursor alone")
|
||||||
|
|
||||||
|
booted = nil
|
||||||
|
currentCursor = "hand"
|
||||||
|
ri.android = false
|
||||||
|
ri.arrowCursor = nil
|
||||||
|
love.mouse.getSystemCursor = function() error("CreateSystemCursor is not currently supported") end
|
||||||
|
ri:play("red")
|
||||||
|
eq(booted, "red", "unsupported system cursors still allow boot")
|
||||||
|
eq(currentCursor, "hand", "unsupported system cursors leave the existing cursor alone")
|
||||||
|
|
||||||
S.finish()
|
S.finish()
|
||||||
|
|||||||
Reference in New Issue
Block a user