create-pixi-vn 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template-react-vite-muijoy/.vscode/launch.json +9 -2
- package/template-react-vite-muijoy/.vscode/tasks.json +20 -4
- package/template-react-vite-muijoy/package-lock.json +100 -81
- package/template-react-vite-muijoy/package.json +3 -2
- package/template-react-vite-muijoy/src/components/loading.tsx +5 -44
- package/template-react-vite-muijoy/src/components/menus/settings/about.tsx +1 -1
- package/template-react-vite-muijoy/src/components/quick-tools.tsx +1 -1
- package/template-react-vite-muijoy/src/components/screens/narration/narration-cards.tsx +2 -3
- package/template-react-vite-muijoy/src/lib/query/narration-query.ts +5 -1
- package/template-react-vite-muijoy/src/lib/utils/assets-utility.ts +1 -1
- package/template-react-vite-muijoy-ink/.vscode/extensions.json +1 -2
- package/template-react-vite-muijoy-ink/.vscode/launch.json +9 -2
- package/template-react-vite-muijoy-ink/.vscode/settings.json +1 -6
- package/template-react-vite-muijoy-ink/.vscode/tasks.json +20 -4
- package/template-react-vite-muijoy-ink/_gitignore +0 -1
- package/template-react-vite-muijoy-ink/package-lock.json +104 -311
- package/template-react-vite-muijoy-ink/package.json +4 -5
- package/template-react-vite-muijoy-ink/src/App.tsx +25 -25
- package/template-react-vite-muijoy-ink/src/assets/index.ts +4 -2
- package/template-react-vite-muijoy-ink/src/assets/ink-manifest.gen.json +1 -4
- package/template-react-vite-muijoy-ink/src/components/loading.tsx +5 -44
- package/template-react-vite-muijoy-ink/src/components/menus/settings/about.tsx +1 -1
- package/template-react-vite-muijoy-ink/src/components/quick-tools.tsx +1 -1
- package/template-react-vite-muijoy-ink/src/components/screens/narration/narration-cards.tsx +2 -3
- package/template-react-vite-muijoy-ink/src/content/labels/second.label.ts +1207 -0
- package/template-react-vite-muijoy-ink/src/content/labels/start.label.ts +566 -0
- package/template-react-vite-muijoy-ink/src/lib/i18n.ts +1 -22
- package/template-react-vite-muijoy-ink/src/lib/query/narration-query.ts +5 -1
- package/template-react-vite-muijoy-ink/src/lib/utils/assets-utility.ts +1 -1
- package/template-react-vite-muijoy-ink/src/pixi-vn-keys.gen.d.ts +0 -2
- package/template-react-vite-muijoy-ink/src/routes/__root.tsx +0 -4
- package/template-react-vite-muijoy-ink/vite.config.ts +0 -6
- package/template-react-vite-muijoy-ink-tauri/.assetpack.ts +0 -9
- package/template-react-vite-muijoy-ink-tauri/.vscode/extensions.json +1 -5
- package/template-react-vite-muijoy-ink-tauri/.vscode/launch.json +6 -10
- package/template-react-vite-muijoy-ink-tauri/.vscode/settings.json +1 -6
- package/template-react-vite-muijoy-ink-tauri/.vscode/tasks.json +17 -48
- package/template-react-vite-muijoy-ink-tauri/README.md +3 -3
- package/template-react-vite-muijoy-ink-tauri/_gitignore +0 -11
- package/template-react-vite-muijoy-ink-tauri/package-lock.json +100 -557
- package/template-react-vite-muijoy-ink-tauri/package.json +5 -15
- package/template-react-vite-muijoy-ink-tauri/src/App.tsx +25 -25
- package/template-react-vite-muijoy-ink-tauri/src/assets/index.ts +4 -2
- package/template-react-vite-muijoy-ink-tauri/src/assets/ink-manifest.gen.json +1 -4
- package/template-react-vite-muijoy-ink-tauri/src/components/loading.tsx +5 -44
- package/template-react-vite-muijoy-ink-tauri/src/components/menus/main-menu.tsx +1 -16
- package/template-react-vite-muijoy-ink-tauri/src/components/menus/settings/about.tsx +1 -1
- package/template-react-vite-muijoy-ink-tauri/src/components/menus/settings/quick-menus.tsx +1 -17
- package/template-react-vite-muijoy-ink-tauri/src/components/menus/settings/system-controls.tsx +1 -11
- package/template-react-vite-muijoy-ink-tauri/src/components/quick-tools.tsx +1 -1
- package/template-react-vite-muijoy-ink-tauri/src/components/screens/narration/narration-cards.tsx +2 -3
- package/template-react-vite-muijoy-ink-tauri/src/content/labels/second.label.ts +1207 -0
- package/template-react-vite-muijoy-ink-tauri/src/content/labels/start.label.ts +566 -0
- package/template-react-vite-muijoy-ink-tauri/src/lib/i18n.ts +1 -22
- package/template-react-vite-muijoy-ink-tauri/src/lib/query/narration-query.ts +5 -1
- package/template-react-vite-muijoy-ink-tauri/src/lib/query/settings-query.ts +1 -7
- package/template-react-vite-muijoy-ink-tauri/src/lib/utils/assets-utility.ts +1 -1
- package/template-react-vite-muijoy-ink-tauri/src/pixi-vn-keys.gen.d.ts +0 -2
- package/template-react-vite-muijoy-ink-tauri/src/routes/__root.tsx +0 -4
- package/template-react-vite-muijoy-ink-tauri/vite.config.ts +0 -30
- package/template-react-vite-muijoy-tauri/.assetpack.ts +0 -9
- package/template-react-vite-muijoy-tauri/.vscode/extensions.json +1 -4
- package/template-react-vite-muijoy-tauri/.vscode/launch.json +6 -10
- package/template-react-vite-muijoy-tauri/.vscode/tasks.json +17 -48
- package/template-react-vite-muijoy-tauri/README.md +3 -3
- package/template-react-vite-muijoy-tauri/_gitignore +0 -10
- package/template-react-vite-muijoy-tauri/package-lock.json +100 -331
- package/template-react-vite-muijoy-tauri/package.json +4 -12
- package/template-react-vite-muijoy-tauri/src/components/loading.tsx +5 -44
- package/template-react-vite-muijoy-tauri/src/components/menus/main-menu.tsx +1 -16
- package/template-react-vite-muijoy-tauri/src/components/menus/settings/about.tsx +1 -1
- package/template-react-vite-muijoy-tauri/src/components/menus/settings/quick-menus.tsx +1 -17
- package/template-react-vite-muijoy-tauri/src/components/menus/settings/system-controls.tsx +1 -11
- package/template-react-vite-muijoy-tauri/src/components/quick-tools.tsx +1 -1
- package/template-react-vite-muijoy-tauri/src/components/screens/narration/narration-cards.tsx +2 -3
- package/template-react-vite-muijoy-tauri/src/lib/query/narration-query.ts +5 -1
- package/template-react-vite-muijoy-tauri/src/lib/query/settings-query.ts +1 -7
- package/template-react-vite-muijoy-tauri/src/lib/utils/assets-utility.ts +1 -1
- package/template-react-vite-muijoy-tauri/vite.config.ts +0 -24
- package/template-react-vite-muijoy-ink/ink/second_part.ink +0 -571
- package/template-react-vite-muijoy-ink/ink/start.ink +0 -214
- package/template-react-vite-muijoy-ink/src/content/ink/hashtag-commands.ts +0 -38
- package/template-react-vite-muijoy-ink/src/content/ink/text-replaces.ts +0 -19
- package/template-react-vite-muijoy-ink/src/lib/hooks/ink-hooks.tsx +0 -12
- package/template-react-vite-muijoy-ink-tauri/_github/workflows/desktop.yml +0 -188
- package/template-react-vite-muijoy-ink-tauri/_github/workflows/mobile.yml +0 -270
- package/template-react-vite-muijoy-ink-tauri/ink/second_part.ink +0 -571
- package/template-react-vite-muijoy-ink-tauri/ink/start.ink +0 -214
- package/template-react-vite-muijoy-ink-tauri/src/content/ink/hashtag-commands.ts +0 -55
- package/template-react-vite-muijoy-ink-tauri/src/content/ink/text-replaces.ts +0 -19
- package/template-react-vite-muijoy-ink-tauri/src/lib/hooks/ink-hooks.tsx +0 -12
- package/template-react-vite-muijoy-ink-tauri/src/lib/hooks/quit-hooks.ts +0 -24
- package/template-react-vite-muijoy-ink-tauri/src/lib/steam.ts +0 -143
- package/template-react-vite-muijoy-ink-tauri/src-tauri/Cargo.toml +0 -50
- package/template-react-vite-muijoy-ink-tauri/src-tauri/build.rs +0 -46
- package/template-react-vite-muijoy-ink-tauri/src-tauri/capabilities/default.json +0 -21
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/128x128.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/128x128@2x.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/32x32.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square107x107Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square142x142Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square150x150Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square284x284Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square30x30Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square310x310Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square44x44Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square71x71Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/Square89x89Logo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/StoreLogo.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/icon.icns +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/icon.ico +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/icons/icon.png +0 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/src/lib.rs +0 -64
- package/template-react-vite-muijoy-ink-tauri/src-tauri/src/main.rs +0 -6
- package/template-react-vite-muijoy-ink-tauri/src-tauri/src/steam.rs +0 -238
- package/template-react-vite-muijoy-ink-tauri/src-tauri/tauri.conf.json +0 -50
- package/template-react-vite-muijoy-tauri/_github/workflows/desktop.yml +0 -188
- package/template-react-vite-muijoy-tauri/_github/workflows/mobile.yml +0 -270
- package/template-react-vite-muijoy-tauri/src/lib/hooks/quit-hooks.ts +0 -24
- package/template-react-vite-muijoy-tauri/src/lib/steam.ts +0 -143
- package/template-react-vite-muijoy-tauri/src-tauri/Cargo.toml +0 -50
- package/template-react-vite-muijoy-tauri/src-tauri/build.rs +0 -46
- package/template-react-vite-muijoy-tauri/src-tauri/capabilities/default.json +0 -21
- package/template-react-vite-muijoy-tauri/src-tauri/icons/128x128.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/128x128@2x.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/32x32.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square107x107Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square142x142Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square150x150Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square284x284Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square30x30Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square310x310Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square44x44Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square71x71Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/Square89x89Logo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/StoreLogo.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/icon.icns +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/icon.ico +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/icons/icon.png +0 -0
- package/template-react-vite-muijoy-tauri/src-tauri/src/lib.rs +0 -64
- package/template-react-vite-muijoy-tauri/src-tauri/src/main.rs +0 -6
- package/template-react-vite-muijoy-tauri/src-tauri/src/steam.rs +0 -238
- package/template-react-vite-muijoy-tauri/src-tauri/tauri.conf.json +0 -50
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
name: 'Build Mobile App (Debug)'
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*'
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
# ── Create the release exactly once before the builds start ──────────────────
|
|
11
|
-
create-release:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
permissions:
|
|
14
|
-
contents: write
|
|
15
|
-
outputs:
|
|
16
|
-
release_tag: ${{ github.ref_name }}
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
|
|
20
|
-
- name: create release
|
|
21
|
-
run: |
|
|
22
|
-
gh release view "${{ github.ref_name }}" 2>/dev/null || \
|
|
23
|
-
gh release create "${{ github.ref_name }}" \
|
|
24
|
-
--title "App v$(jq -r '.version' src-tauri/tauri.conf.json)" \
|
|
25
|
-
--notes "See the assets to download this version and install." \
|
|
26
|
-
2>/dev/null || \
|
|
27
|
-
gh release view "${{ github.ref_name }}" > /dev/null
|
|
28
|
-
env:
|
|
29
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
30
|
-
|
|
31
|
-
# ---------------------------------------------------------------------------
|
|
32
|
-
# Android debug — unsigned APK uploaded to the release
|
|
33
|
-
# ---------------------------------------------------------------------------
|
|
34
|
-
build-android:
|
|
35
|
-
needs: create-release
|
|
36
|
-
runs-on: ubuntu-22.04
|
|
37
|
-
permissions:
|
|
38
|
-
contents: write
|
|
39
|
-
steps:
|
|
40
|
-
- uses: actions/checkout@v4
|
|
41
|
-
|
|
42
|
-
- name: setup node
|
|
43
|
-
uses: actions/setup-node@v4
|
|
44
|
-
with:
|
|
45
|
-
node-version: lts/*
|
|
46
|
-
|
|
47
|
-
- name: setup Java 17
|
|
48
|
-
uses: actions/setup-java@v4
|
|
49
|
-
with:
|
|
50
|
-
distribution: 'zulu'
|
|
51
|
-
java-version: '17'
|
|
52
|
-
|
|
53
|
-
- name: setup Android SDK
|
|
54
|
-
uses: android-actions/setup-android@v3
|
|
55
|
-
|
|
56
|
-
- name: install Android NDK r27
|
|
57
|
-
run: sdkmanager "ndk;27.0.12077973"
|
|
58
|
-
|
|
59
|
-
- name: install Rust stable + Android targets
|
|
60
|
-
uses: dtolnay/rust-toolchain@stable
|
|
61
|
-
with:
|
|
62
|
-
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
|
|
63
|
-
|
|
64
|
-
- name: install Linux dependencies
|
|
65
|
-
run: |
|
|
66
|
-
sudo apt-get update
|
|
67
|
-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
68
|
-
|
|
69
|
-
- name: install frontend dependencies
|
|
70
|
-
run: npm i
|
|
71
|
-
|
|
72
|
-
- name: init Tauri Android project
|
|
73
|
-
run: npx tauri android init
|
|
74
|
-
env:
|
|
75
|
-
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.12077973
|
|
76
|
-
|
|
77
|
-
- name: patch Android manifest (landscape + fullscreen)
|
|
78
|
-
run: |
|
|
79
|
-
python3 << 'PYEOF'
|
|
80
|
-
import glob, re
|
|
81
|
-
|
|
82
|
-
manifest = glob.glob('src-tauri/gen/android/app/src/main/AndroidManifest.xml')[0]
|
|
83
|
-
with open(manifest) as f:
|
|
84
|
-
content = f.read()
|
|
85
|
-
# Remove any pre-existing screenOrientation to avoid duplicates
|
|
86
|
-
content = re.sub(r'\s+android:screenOrientation="[^"]*"', '', content)
|
|
87
|
-
# Insert screenOrientation directly on the first <activity tag (robust, independent
|
|
88
|
-
# of which other attributes Tauri generates)
|
|
89
|
-
patched, n = re.subn(
|
|
90
|
-
r'(<activity\b)',
|
|
91
|
-
r'\1\n android:screenOrientation="sensorLandscape"',
|
|
92
|
-
content,
|
|
93
|
-
count=1
|
|
94
|
-
)
|
|
95
|
-
if n == 0:
|
|
96
|
-
print('WARNING: <activity> tag not found in manifest — orientation NOT patched')
|
|
97
|
-
else:
|
|
98
|
-
content = patched
|
|
99
|
-
print(f'Patched {manifest} (screenOrientation=sensorLandscape)')
|
|
100
|
-
with open(manifest, 'w') as f:
|
|
101
|
-
f.write(content)
|
|
102
|
-
|
|
103
|
-
# Tauri may generate styles.xml or themes.xml depending on the version
|
|
104
|
-
styles_candidates = (
|
|
105
|
-
glob.glob('src-tauri/gen/android/app/src/main/res/values/styles.xml') +
|
|
106
|
-
glob.glob('src-tauri/gen/android/app/src/main/res/values/themes.xml')
|
|
107
|
-
)
|
|
108
|
-
if not styles_candidates:
|
|
109
|
-
print('Warning: no styles.xml/themes.xml found, skipping fullscreen patch')
|
|
110
|
-
else:
|
|
111
|
-
styles = styles_candidates[0]
|
|
112
|
-
with open(styles) as f:
|
|
113
|
-
content = f.read()
|
|
114
|
-
# Hide status bar (fullscreen)
|
|
115
|
-
content = content.replace(
|
|
116
|
-
'</style>',
|
|
117
|
-
' <item name="android:windowFullscreen">true</item>\n </style>',
|
|
118
|
-
1
|
|
119
|
-
)
|
|
120
|
-
with open(styles, 'w') as f:
|
|
121
|
-
f.write(content)
|
|
122
|
-
print(f'Patched {styles}')
|
|
123
|
-
PYEOF
|
|
124
|
-
|
|
125
|
-
- name: build Android app
|
|
126
|
-
run: npx tauri android build --debug
|
|
127
|
-
env:
|
|
128
|
-
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.12077973
|
|
129
|
-
|
|
130
|
-
- name: upload APK to release
|
|
131
|
-
env:
|
|
132
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
133
|
-
TAG: ${{ needs.create-release.outputs.release_tag }}
|
|
134
|
-
run: |
|
|
135
|
-
find src-tauri/gen/android -name "*.apk" | while IFS= read -r f; do
|
|
136
|
-
gh release upload "$TAG" "$f" --clobber
|
|
137
|
-
done
|
|
138
|
-
|
|
139
|
-
# ---------------------------------------------------------------------------
|
|
140
|
-
# iOS debug — unsigned build uploaded to the release (best-effort)
|
|
141
|
-
# ---------------------------------------------------------------------------
|
|
142
|
-
build-ios:
|
|
143
|
-
needs: create-release
|
|
144
|
-
runs-on: macos-latest
|
|
145
|
-
permissions:
|
|
146
|
-
contents: write
|
|
147
|
-
steps:
|
|
148
|
-
- uses: actions/checkout@v4
|
|
149
|
-
|
|
150
|
-
- name: setup node
|
|
151
|
-
uses: actions/setup-node@v4
|
|
152
|
-
with:
|
|
153
|
-
node-version: lts/*
|
|
154
|
-
|
|
155
|
-
- name: install Rust stable + iOS targets
|
|
156
|
-
uses: dtolnay/rust-toolchain@stable
|
|
157
|
-
with:
|
|
158
|
-
targets: aarch64-apple-ios,aarch64-apple-ios-sim,x86_64-apple-ios
|
|
159
|
-
|
|
160
|
-
- name: install frontend dependencies
|
|
161
|
-
run: npm i
|
|
162
|
-
|
|
163
|
-
- name: init Tauri iOS project
|
|
164
|
-
run: npx tauri ios init
|
|
165
|
-
|
|
166
|
-
- name: disable code signing in Xcode project
|
|
167
|
-
run: |
|
|
168
|
-
python3 << 'PYEOF'
|
|
169
|
-
import glob, re
|
|
170
|
-
pbxproj = glob.glob('src-tauri/gen/apple/*.xcodeproj/project.pbxproj')[0]
|
|
171
|
-
with open(pbxproj) as f:
|
|
172
|
-
content = f.read()
|
|
173
|
-
sign_off = (
|
|
174
|
-
'\n\t\t\t\tCODE_SIGN_IDENTITY = "";'
|
|
175
|
-
'\n\t\t\t\tCODE_SIGNING_REQUIRED = NO;'
|
|
176
|
-
'\n\t\t\t\tCODE_SIGNING_ALLOWED = NO;'
|
|
177
|
-
'\n\t\t\t\tDEVELOPMENT_TEAM = "";'
|
|
178
|
-
)
|
|
179
|
-
content = re.sub(r'(buildSettings = \{)', r'\1' + sign_off, content)
|
|
180
|
-
with open(pbxproj, 'w') as f:
|
|
181
|
-
f.write(content)
|
|
182
|
-
print(f'Patched {pbxproj}')
|
|
183
|
-
PYEOF
|
|
184
|
-
|
|
185
|
-
- name: patch iOS Info.plist (landscape + hide status bar)
|
|
186
|
-
run: |
|
|
187
|
-
python3 << 'PYEOF'
|
|
188
|
-
import glob, re
|
|
189
|
-
|
|
190
|
-
plists = glob.glob('src-tauri/gen/apple/*/Info.plist')
|
|
191
|
-
if not plists:
|
|
192
|
-
plists = glob.glob('src-tauri/gen/apple/*/*/Info.plist')
|
|
193
|
-
for plist in plists:
|
|
194
|
-
with open(plist) as f:
|
|
195
|
-
content = f.read()
|
|
196
|
-
|
|
197
|
-
# Remove any existing orientation / status bar keys so we can replace them
|
|
198
|
-
for key in [
|
|
199
|
-
'UISupportedInterfaceOrientations',
|
|
200
|
-
'UISupportedInterfaceOrientations~ipad',
|
|
201
|
-
'UIStatusBarHidden',
|
|
202
|
-
'UIViewControllerBasedStatusBarAppearance',
|
|
203
|
-
]:
|
|
204
|
-
content = re.sub(
|
|
205
|
-
rf'\s*<key>{re.escape(key)}</key>\s*(<(true|false)/>|<array>.*?</array>)',
|
|
206
|
-
'', content, flags=re.DOTALL
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
-
additions = (
|
|
210
|
-
'\t<key>UIStatusBarHidden</key>\n'
|
|
211
|
-
'\t<true/>\n'
|
|
212
|
-
'\t<key>UIViewControllerBasedStatusBarAppearance</key>\n'
|
|
213
|
-
'\t<false/>\n'
|
|
214
|
-
'\t<key>UISupportedInterfaceOrientations</key>\n'
|
|
215
|
-
'\t<array>\n'
|
|
216
|
-
'\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n'
|
|
217
|
-
'\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n'
|
|
218
|
-
'\t</array>\n'
|
|
219
|
-
'\t<key>UISupportedInterfaceOrientations~ipad</key>\n'
|
|
220
|
-
'\t<array>\n'
|
|
221
|
-
'\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n'
|
|
222
|
-
'\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n'
|
|
223
|
-
'\t</array>\n'
|
|
224
|
-
)
|
|
225
|
-
new_content, n = re.subn(
|
|
226
|
-
r'</dict>\s*</plist>\s*$',
|
|
227
|
-
additions + '</dict>\n</plist>\n',
|
|
228
|
-
content.rstrip(),
|
|
229
|
-
flags=re.DOTALL
|
|
230
|
-
)
|
|
231
|
-
if n == 0:
|
|
232
|
-
print(f'WARNING: </dict></plist> not found in {plist} — orientation NOT patched')
|
|
233
|
-
else:
|
|
234
|
-
content = new_content
|
|
235
|
-
print(f'Patched {plist}')
|
|
236
|
-
with open(plist, 'w') as f:
|
|
237
|
-
f.write(content)
|
|
238
|
-
PYEOF
|
|
239
|
-
|
|
240
|
-
- name: build iOS app
|
|
241
|
-
run: npx tauri ios build --debug
|
|
242
|
-
# Export step fails without a signing team; archive still succeeds.
|
|
243
|
-
# We extract the .app from the .xcarchive below instead.
|
|
244
|
-
continue-on-error: true
|
|
245
|
-
|
|
246
|
-
- name: package and upload iOS app from archive
|
|
247
|
-
env:
|
|
248
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
249
|
-
TAG: ${{ needs.create-release.outputs.release_tag }}
|
|
250
|
-
run: |
|
|
251
|
-
BIN_NAME=$(grep '^name = ' src-tauri/Cargo.toml | head -1 | cut -d'"' -f2)
|
|
252
|
-
VERSION=$(jq -r '.version' src-tauri/tauri.conf.json)
|
|
253
|
-
|
|
254
|
-
ARCHIVE=$(find src-tauri/gen/apple/build -name "*.xcarchive" 2>/dev/null | head -1)
|
|
255
|
-
if [ -z "$ARCHIVE" ]; then
|
|
256
|
-
echo "No .xcarchive found — build may have failed before archiving"
|
|
257
|
-
exit 1
|
|
258
|
-
fi
|
|
259
|
-
|
|
260
|
-
APP=$(find "$ARCHIVE/Products/Applications" -name "*.app" | head -1)
|
|
261
|
-
if [ -z "$APP" ]; then
|
|
262
|
-
echo "No .app found inside archive $ARCHIVE"
|
|
263
|
-
exit 1
|
|
264
|
-
fi
|
|
265
|
-
|
|
266
|
-
mkdir Payload
|
|
267
|
-
cp -r "$APP" Payload/
|
|
268
|
-
IPA="${BIN_NAME}_${VERSION}_ios-debug.ipa"
|
|
269
|
-
zip -r "$IPA" Payload/
|
|
270
|
-
gh release upload "$TAG" "$IPA" --clobber
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useAlertDialog } from "@/components/providers/alert-dialog-provider";
|
|
2
|
-
import { exit } from "@tauri-apps/plugin-process";
|
|
3
|
-
import { useCallback } from "react";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
|
|
6
|
-
export function useQuit() {
|
|
7
|
-
const { openAlertDialog } = useAlertDialog();
|
|
8
|
-
const { t } = useTranslation(["ui"]);
|
|
9
|
-
|
|
10
|
-
const canQuit = typeof window !== "undefined" && !!window.__TAURI__;
|
|
11
|
-
|
|
12
|
-
const quit = useCallback(() => {
|
|
13
|
-
openAlertDialog({
|
|
14
|
-
head: t("quit"),
|
|
15
|
-
content: t("quit_confirm"),
|
|
16
|
-
onConfirm: async () => {
|
|
17
|
-
await exit();
|
|
18
|
-
return true;
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
}, [openAlertDialog, t]);
|
|
22
|
-
|
|
23
|
-
return { quit, canQuit };
|
|
24
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Steam utility — thin wrappers around Tauri commands exposed by the
|
|
3
|
-
* `steam` Cargo feature. All functions are safe to call even when:
|
|
4
|
-
* - the app is running outside Tauri (web mode)
|
|
5
|
-
* - Steam is not running
|
|
6
|
-
* - the `steam` feature was not compiled in
|
|
7
|
-
* In all those cases the functions return sensible defaults (null / false / 0)
|
|
8
|
-
* without throwing.
|
|
9
|
-
*
|
|
10
|
-
* Enable Steam in Rust:
|
|
11
|
-
* src-tauri/Cargo.toml → default = ["steam"] (or pass --features steam)
|
|
12
|
-
*
|
|
13
|
-
* Typical usage:
|
|
14
|
-
* import { steam } from "@/lib/steam";
|
|
15
|
-
*
|
|
16
|
-
* const name = await steam.getPlayerName(); // "Alice" | null
|
|
17
|
-
* await steam.unlockAchievement("ACH_COMPLETE_CH1"); // fire & forget
|
|
18
|
-
* await steam.openOverlay("achievements");
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
import { invoke } from "@tauri-apps/api/core";
|
|
22
|
-
|
|
23
|
-
const isTauri = typeof window !== "undefined" && "__TAURI__" in window;
|
|
24
|
-
|
|
25
|
-
/** Dialogs supported by the Steam overlay. */
|
|
26
|
-
export type SteamOverlayDialog =
|
|
27
|
-
| "achievements"
|
|
28
|
-
| "community"
|
|
29
|
-
| "friends"
|
|
30
|
-
| "players"
|
|
31
|
-
| "settings"
|
|
32
|
-
| "officialgamegroup"
|
|
33
|
-
| "stats";
|
|
34
|
-
|
|
35
|
-
async function call<T>(cmd: string, args?: Record<string, unknown>): Promise<T | null> {
|
|
36
|
-
if (!isTauri) return null;
|
|
37
|
-
try {
|
|
38
|
-
return await invoke<T>(cmd, args);
|
|
39
|
-
} catch {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// ── API ───────────────────────────────────────────────────────────────────────
|
|
45
|
-
|
|
46
|
-
export namespace steam {
|
|
47
|
-
/** `true` when Steam was initialised successfully (Steam client running). */
|
|
48
|
-
export async function isAvailable(): Promise<boolean> {
|
|
49
|
-
return (await call<boolean>("steam_is_available")) ?? false;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** Steam display name of the logged-in user. */
|
|
53
|
-
export async function getPlayerName(): Promise<string | null> {
|
|
54
|
-
return call<string>("steam_get_player_name");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Numeric App ID of the running application. */
|
|
58
|
-
export async function getAppId(): Promise<number | null> {
|
|
59
|
-
return call<number>("steam_get_app_id");
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ── Achievements ──────────────────────────────────────────────────────────
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Unlock an achievement and immediately persist it.
|
|
66
|
-
* `id` must match the API Name in Steamworks Partner.
|
|
67
|
-
*/
|
|
68
|
-
export async function unlockAchievement(id: string): Promise<void> {
|
|
69
|
-
await call("steam_unlock_achievement", { achievementId: id });
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Returns `true` if the user has already unlocked the achievement.
|
|
74
|
-
* Reliable only after the first few seconds of launch (stats are fetched
|
|
75
|
-
* automatically at startup).
|
|
76
|
-
*/
|
|
77
|
-
export async function isAchievementUnlocked(id: string): Promise<boolean> {
|
|
78
|
-
return (await call<boolean>("steam_is_achievement_unlocked", { achievementId: id })) ?? false;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** Reset an achievement — intended for development / testing only. */
|
|
82
|
-
export async function clearAchievement(id: string): Promise<void> {
|
|
83
|
-
await call("steam_clear_achievement", { achievementId: id });
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ── Stats ─────────────────────────────────────────────────────────────────
|
|
87
|
-
|
|
88
|
-
/** Set an integer stat. Remember to call `storeStats()` afterwards. */
|
|
89
|
-
export async function setStatInt(name: string, value: number): Promise<void> {
|
|
90
|
-
await call("steam_set_stat_int", { name, value: Math.trunc(value) });
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** Read an integer stat (returns `0` on error). */
|
|
94
|
-
export async function getStatInt(name: string): Promise<number> {
|
|
95
|
-
return (await call<number>("steam_get_stat_int", { name })) ?? 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/** Set a float stat. Remember to call `storeStats()` afterwards. */
|
|
99
|
-
export async function setStatFloat(name: string, value: number): Promise<void> {
|
|
100
|
-
await call("steam_set_stat_float", { name, value });
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/** Read a float stat (returns `0` on error). */
|
|
104
|
-
export async function getStatFloat(name: string): Promise<number> {
|
|
105
|
-
return (await call<number>("steam_get_stat_float", { name })) ?? 0;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Commit pending stat changes to Steam servers.
|
|
110
|
-
* `unlockAchievement` / `clearAchievement` already call this automatically;
|
|
111
|
-
* you only need this when using `setStatInt` / `setStatFloat` directly.
|
|
112
|
-
*/
|
|
113
|
-
export async function storeStats(): Promise<void> {
|
|
114
|
-
await call("steam_store_stats");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// ── DLC ───────────────────────────────────────────────────────────────────
|
|
118
|
-
|
|
119
|
-
/** `true` if the user owns and has installed the DLC with the given App ID. */
|
|
120
|
-
export async function isDlcInstalled(appId: number): Promise<boolean> {
|
|
121
|
-
return (await call<boolean>("steam_is_dlc_installed", { appId })) ?? false;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// ── Overlay ───────────────────────────────────────────────────────────────
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Open the Steam overlay to a specific dialog.
|
|
128
|
-
*
|
|
129
|
-
* Common values: "achievements", "friends", "community", "stats",
|
|
130
|
-
* "settings", "officialgamegroup", "players"
|
|
131
|
-
*/
|
|
132
|
-
export async function openOverlay(dialog: SteamOverlayDialog): Promise<void> {
|
|
133
|
-
await call("steam_open_overlay", { dialog });
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Open the Steam store page for this game.
|
|
138
|
-
* Pass a different `appId` to open another game's page.
|
|
139
|
-
*/
|
|
140
|
-
export async function openStore(appId?: number): Promise<void> {
|
|
141
|
-
await call("steam_open_store", { appId: appId ?? null });
|
|
142
|
-
}
|
|
143
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
[package]
|
|
2
|
-
name = "my-app-package-name"
|
|
3
|
-
version = "0.1.0"
|
|
4
|
-
description = "my-app-description"
|
|
5
|
-
authors = ["you"]
|
|
6
|
-
edition = "2021"
|
|
7
|
-
|
|
8
|
-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
9
|
-
|
|
10
|
-
# ── Steam (optional) ─────────────────────────────────────────────────────────
|
|
11
|
-
# To enable Steam support:
|
|
12
|
-
# 1. Set your App ID in steam_appid.txt (root of the repo, use 480 for testing)
|
|
13
|
-
# 2. Change `default = []` to `default = ["steam"]` below, or pass
|
|
14
|
-
# `--features steam` to cargo / tauri build.
|
|
15
|
-
# 3. On Windows, ship steam_api64.dll next to the executable.
|
|
16
|
-
# 4. On Linux, ship libsteam_api.so next to the executable.
|
|
17
|
-
# 5. On macOS, ship libsteam_api.dylib next to the executable.
|
|
18
|
-
# (The steamworks-sys crate copies the library to the build output
|
|
19
|
-
# automatically; you only need to include it in the Tauri bundle.)
|
|
20
|
-
# ─────────────────────────────────────────────────────────────────────────────
|
|
21
|
-
[features]
|
|
22
|
-
default = []
|
|
23
|
-
steam = ["dep:steamworks"]
|
|
24
|
-
|
|
25
|
-
[lib]
|
|
26
|
-
# The `_lib` suffix may seem redundant but it is necessary
|
|
27
|
-
# to make the lib name unique and wouldn't conflict with the bin name.
|
|
28
|
-
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
|
29
|
-
name = "my_app_lib"
|
|
30
|
-
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
31
|
-
|
|
32
|
-
[build-dependencies]
|
|
33
|
-
tauri-build = { version = "2", features = [] }
|
|
34
|
-
|
|
35
|
-
[dependencies]
|
|
36
|
-
tauri = { version = "2", features = [] }
|
|
37
|
-
tauri-plugin-opener = "2"
|
|
38
|
-
tauri-plugin-process = "2"
|
|
39
|
-
tauri-plugin-window-state = "2"
|
|
40
|
-
serde = { version = "1", features = ["derive"] }
|
|
41
|
-
serde_json = "1"
|
|
42
|
-
steamworks = { version = "0.13", optional = true }
|
|
43
|
-
|
|
44
|
-
[profile.release]
|
|
45
|
-
opt-level = "z" # max runtime performance
|
|
46
|
-
lto = true # link-time optimization — removes dead code across crates
|
|
47
|
-
codegen-units = 1 # slower compile, smaller output
|
|
48
|
-
panic = "abort" # no stack unwinding machinery
|
|
49
|
-
strip = true # strip symbols from the binary
|
|
50
|
-
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
use std::{env, fs, path::PathBuf};
|
|
2
|
-
|
|
3
|
-
fn main() {
|
|
4
|
-
if env::var("CARGO_FEATURE_STEAM").is_ok() {
|
|
5
|
-
copy_steam_lib();
|
|
6
|
-
}
|
|
7
|
-
tauri_build::build()
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// Copies the Steamworks redistributable library from steamworks-sys's OUT_DIR
|
|
11
|
-
// into src-tauri/ so that Tauri's bundler can pick it up as a resource.
|
|
12
|
-
fn copy_steam_lib() {
|
|
13
|
-
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
|
14
|
-
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
|
|
15
|
-
|
|
16
|
-
let lib_name = match env::var("CARGO_CFG_TARGET_OS").as_deref() {
|
|
17
|
-
Ok("windows") => "steam_api64.dll",
|
|
18
|
-
Ok("macos") => "libsteam_api.dylib",
|
|
19
|
-
_ => "libsteam_api.so",
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// OUT_DIR layout: .../target/[profile]/build/[pkg-hash]/out
|
|
23
|
-
// nth(2) walks up to .../target/[profile]/build/
|
|
24
|
-
let build_dir = out_dir
|
|
25
|
-
.ancestors()
|
|
26
|
-
.nth(2)
|
|
27
|
-
.expect("unexpected OUT_DIR layout");
|
|
28
|
-
|
|
29
|
-
if let Ok(entries) = fs::read_dir(build_dir) {
|
|
30
|
-
for entry in entries.flatten() {
|
|
31
|
-
let candidate = entry.path().join("out").join(lib_name);
|
|
32
|
-
if candidate.exists() {
|
|
33
|
-
let dest = manifest_dir.join(lib_name);
|
|
34
|
-
fs::copy(&candidate, &dest)
|
|
35
|
-
.unwrap_or_else(|e| panic!("failed to copy {lib_name}: {e}"));
|
|
36
|
-
println!("cargo:warning=Steam: copied {lib_name} → src-tauri/");
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
panic!(
|
|
43
|
-
"Steam: could not find `{lib_name}` in build artifacts. \
|
|
44
|
-
Ensure `--features steam` is active and the crate compiled successfully."
|
|
45
|
-
);
|
|
46
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../gen/schemas/desktop-schema.json",
|
|
3
|
-
"identifier": "default",
|
|
4
|
-
"description": "Capability for the main window",
|
|
5
|
-
"windows": ["main"],
|
|
6
|
-
"permissions": [
|
|
7
|
-
"core:default",
|
|
8
|
-
"core:window:allow-close",
|
|
9
|
-
"core:window:allow-is-fullscreen",
|
|
10
|
-
"core:window:allow-set-fullscreen",
|
|
11
|
-
"core:window:allow-minimize",
|
|
12
|
-
"core:window:allow-maximize",
|
|
13
|
-
"core:window:allow-unminimize",
|
|
14
|
-
"core:window:allow-set-title",
|
|
15
|
-
"opener:default",
|
|
16
|
-
"process:default",
|
|
17
|
-
"window-state:allow-filename",
|
|
18
|
-
"window-state:allow-restore-state",
|
|
19
|
-
"window-state:allow-save-window-state"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
use tauri::Manager;
|
|
2
|
-
#[cfg(not(mobile))]
|
|
3
|
-
use tauri_plugin_window_state::{AppHandleExt, StateFlags};
|
|
4
|
-
|
|
5
|
-
// Steam is only compiled on desktop targets when the "steam" feature is on.
|
|
6
|
-
#[cfg(all(feature = "steam", not(target_os = "ios"), not(target_os = "android")))]
|
|
7
|
-
mod steam;
|
|
8
|
-
|
|
9
|
-
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
10
|
-
pub fn run() {
|
|
11
|
-
#[allow(unused_mut)]
|
|
12
|
-
let mut builder = tauri::Builder::default()
|
|
13
|
-
.plugin(tauri_plugin_process::init())
|
|
14
|
-
.plugin(tauri_plugin_opener::init())
|
|
15
|
-
.on_page_load(on_page_load);
|
|
16
|
-
|
|
17
|
-
#[cfg(not(mobile))]
|
|
18
|
-
let mut builder = builder
|
|
19
|
-
.plugin(tauri_plugin_window_state::Builder::new().build())
|
|
20
|
-
.on_window_event(on_window_event);
|
|
21
|
-
|
|
22
|
-
// ── Steam ─────────────────────────────────────────────────────────────────
|
|
23
|
-
// Enabled only when `--features steam` is passed (or `default = ["steam"]`
|
|
24
|
-
// is set in Cargo.toml). Steam is not supported on iOS / Android.
|
|
25
|
-
#[cfg(all(feature = "steam", not(target_os = "ios"), not(target_os = "android")))]
|
|
26
|
-
{
|
|
27
|
-
builder = builder
|
|
28
|
-
.manage(steam::SteamClient {
|
|
29
|
-
client: std::sync::Mutex::new(steam::try_init()),
|
|
30
|
-
})
|
|
31
|
-
.invoke_handler(tauri::generate_handler![
|
|
32
|
-
steam::steam_is_available,
|
|
33
|
-
steam::steam_get_player_name,
|
|
34
|
-
steam::steam_get_app_id,
|
|
35
|
-
steam::steam_unlock_achievement,
|
|
36
|
-
steam::steam_is_achievement_unlocked,
|
|
37
|
-
steam::steam_clear_achievement,
|
|
38
|
-
steam::steam_set_stat_int,
|
|
39
|
-
steam::steam_get_stat_int,
|
|
40
|
-
steam::steam_set_stat_float,
|
|
41
|
-
steam::steam_get_stat_float,
|
|
42
|
-
steam::steam_store_stats,
|
|
43
|
-
steam::steam_is_dlc_installed,
|
|
44
|
-
steam::steam_open_overlay,
|
|
45
|
-
steam::steam_open_store,
|
|
46
|
-
]);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
builder
|
|
50
|
-
.run(tauri::generate_context!())
|
|
51
|
-
.expect("error while running tauri application");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
fn on_page_load(window: &tauri::Webview, _: &tauri::webview::PageLoadPayload<'_>) {
|
|
55
|
-
#[cfg(not(debug_assertions))]
|
|
56
|
-
let _ = window.eval("document.addEventListener('contextmenu', e => e.preventDefault())");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
#[cfg(not(mobile))]
|
|
60
|
-
fn on_window_event(window: &tauri::Window, event: &tauri::WindowEvent) {
|
|
61
|
-
if let tauri::WindowEvent::CloseRequested { .. } = event {
|
|
62
|
-
let _ = window.app_handle().save_window_state(StateFlags::all());
|
|
63
|
-
}
|
|
64
|
-
}
|