create-pixi-vn 2.1.4 → 2.1.6
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-lib/package.json +3 -0
- package/template-nqtr-react-vite-muijoy/package.json +2 -2
- package/template-nqtr-react-vite-muijoy/src/assets/index.ts +2 -11
- package/template-nqtr-react-vite-muijoy/src/assets/manifest.gen.json +2 -7
- package/template-nqtr-react-vite-muijoy/src/components/menus/settings/index.tsx +15 -6
- package/template-nqtr-react-vite-muijoy/src/components/menus/settings/menus/diagnostics.tsx +266 -0
- package/template-nqtr-react-vite-muijoy/src/components/menus/settings/quick-menus.tsx +25 -1
- package/template-nqtr-react-vite-muijoy/src/lib/hooks/device-diagnostics-hooks.ts +68 -0
- package/template-nqtr-react-vite-muijoy/src/lib/hooks/hotkeys-hooks.ts +16 -0
- package/template-nqtr-react-vite-muijoy/src/lib/utils/device-diagnostics-utility.ts +382 -0
- package/template-nqtr-react-vite-muijoy/src/locales/en.json +50 -0
- package/template-nqtr-react-vite-muijoy/src/pixi-vn.keys.gen.ts +4 -7
- package/template-nqtr-react-vite-muijoy-ink/package.json +3 -3
- package/template-nqtr-react-vite-muijoy-ink/src/assets/index.ts +2 -11
- package/template-nqtr-react-vite-muijoy-ink/src/assets/manifest.gen.json +2 -7
- package/template-nqtr-react-vite-muijoy-ink/src/components/menus/settings/index.tsx +15 -6
- package/template-nqtr-react-vite-muijoy-ink/src/components/menus/settings/menus/diagnostics.tsx +266 -0
- package/template-nqtr-react-vite-muijoy-ink/src/components/menus/settings/quick-menus.tsx +25 -1
- package/template-nqtr-react-vite-muijoy-ink/src/lib/hooks/device-diagnostics-hooks.ts +68 -0
- package/template-nqtr-react-vite-muijoy-ink/src/lib/hooks/hotkeys-hooks.ts +16 -0
- package/template-nqtr-react-vite-muijoy-ink/src/lib/utils/device-diagnostics-utility.ts +382 -0
- package/template-nqtr-react-vite-muijoy-ink/src/locales/en.json +50 -0
- package/template-nqtr-react-vite-muijoy-ink/src/pixi-vn.keys.gen.ts +4 -7
- package/template-nqtr-react-vite-muijoy-ink-tauri/.vscode/launch.json +1 -1
- package/template-nqtr-react-vite-muijoy-ink-tauri/.vscode/tasks.json +1 -35
- package/template-nqtr-react-vite-muijoy-ink-tauri/_github/workflows/mobile.yml +76 -13
- package/template-nqtr-react-vite-muijoy-ink-tauri/package.json +3 -3
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/assets/index.ts +2 -11
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/assets/manifest.gen.json +2 -7
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/components/menus/settings/index.tsx +15 -6
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/components/menus/settings/menus/diagnostics.tsx +332 -0
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/components/menus/settings/quick-menus.tsx +32 -1
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/content/ink/hashtag-commands.ts +17 -0
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/lib/hooks/device-diagnostics-hooks.ts +96 -0
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/lib/hooks/hotkeys-hooks.ts +16 -0
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/lib/system-info.ts +54 -0
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/lib/utils/device-diagnostics-utility.ts +511 -0
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/locales/en.json +66 -0
- package/template-nqtr-react-vite-muijoy-ink-tauri/src/pixi-vn.keys.gen.ts +4 -7
- package/template-nqtr-react-vite-muijoy-ink-tauri/src-tauri/Cargo.toml +1 -0
- package/template-nqtr-react-vite-muijoy-ink-tauri/src-tauri/src/lib.rs +34 -22
- package/template-nqtr-react-vite-muijoy-ink-tauri/src-tauri/src/system_info.rs +33 -0
- package/template-nqtr-react-vite-muijoy-tauri/.vscode/launch.json +1 -1
- package/template-nqtr-react-vite-muijoy-tauri/.vscode/tasks.json +1 -35
- package/template-nqtr-react-vite-muijoy-tauri/_github/workflows/mobile.yml +76 -13
- package/template-nqtr-react-vite-muijoy-tauri/package.json +2 -2
- package/template-nqtr-react-vite-muijoy-tauri/src/assets/index.ts +2 -11
- package/template-nqtr-react-vite-muijoy-tauri/src/assets/manifest.gen.json +2 -7
- package/template-nqtr-react-vite-muijoy-tauri/src/components/menus/settings/index.tsx +15 -6
- package/template-nqtr-react-vite-muijoy-tauri/src/components/menus/settings/menus/diagnostics.tsx +332 -0
- package/template-nqtr-react-vite-muijoy-tauri/src/components/menus/settings/quick-menus.tsx +32 -1
- package/template-nqtr-react-vite-muijoy-tauri/src/lib/hooks/device-diagnostics-hooks.ts +96 -0
- package/template-nqtr-react-vite-muijoy-tauri/src/lib/hooks/hotkeys-hooks.ts +16 -0
- package/template-nqtr-react-vite-muijoy-tauri/src/lib/system-info.ts +54 -0
- package/template-nqtr-react-vite-muijoy-tauri/src/lib/utils/device-diagnostics-utility.ts +511 -0
- package/template-nqtr-react-vite-muijoy-tauri/src/locales/en.json +66 -0
- package/template-nqtr-react-vite-muijoy-tauri/src/pixi-vn.keys.gen.ts +4 -7
- package/template-nqtr-react-vite-muijoy-tauri/src-tauri/Cargo.toml +1 -0
- package/template-nqtr-react-vite-muijoy-tauri/src-tauri/src/lib.rs +32 -20
- package/template-nqtr-react-vite-muijoy-tauri/src-tauri/src/system_info.rs +33 -0
- package/template-react-vite-muijoy/package.json +1 -1
- package/template-react-vite-muijoy/src/assets/index.ts +55 -55
- package/template-react-vite-muijoy/src/assets/manifest.gen.json +2 -7
- package/template-react-vite-muijoy/src/components/menus/settings/index.tsx +15 -6
- package/template-react-vite-muijoy/src/components/menus/settings/menus/diagnostics.tsx +266 -0
- package/template-react-vite-muijoy/src/components/menus/settings/quick-menus.tsx +25 -1
- package/template-react-vite-muijoy/src/lib/hooks/device-diagnostics-hooks.ts +68 -0
- package/template-react-vite-muijoy/src/lib/hooks/hotkeys-hooks.ts +16 -0
- package/template-react-vite-muijoy/src/lib/utils/device-diagnostics-utility.ts +382 -0
- package/template-react-vite-muijoy/src/locales/en.json +50 -0
- package/template-react-vite-muijoy/src/pixi-vn.keys.gen.ts +2 -3
- package/template-react-vite-muijoy-ink/ink/second_part.ink +0 -1
- package/template-react-vite-muijoy-ink/ink/start.ink +4 -6
- package/template-react-vite-muijoy-ink/package.json +2 -2
- package/template-react-vite-muijoy-ink/src/assets/index.ts +55 -55
- package/template-react-vite-muijoy-ink/src/assets/manifest.gen.json +2 -7
- package/template-react-vite-muijoy-ink/src/components/menus/settings/index.tsx +15 -6
- package/template-react-vite-muijoy-ink/src/components/menus/settings/menus/diagnostics.tsx +266 -0
- package/template-react-vite-muijoy-ink/src/components/menus/settings/quick-menus.tsx +25 -1
- package/template-react-vite-muijoy-ink/src/lib/hooks/device-diagnostics-hooks.ts +68 -0
- package/template-react-vite-muijoy-ink/src/lib/hooks/hotkeys-hooks.ts +16 -0
- package/template-react-vite-muijoy-ink/src/lib/utils/device-diagnostics-utility.ts +382 -0
- package/template-react-vite-muijoy-ink/src/locales/en.json +50 -0
- package/template-react-vite-muijoy-ink/src/pixi-vn.keys.gen.ts +2 -3
- package/template-react-vite-muijoy-ink-tauri/.vscode/launch.json +1 -1
- package/template-react-vite-muijoy-ink-tauri/.vscode/tasks.json +1 -35
- package/template-react-vite-muijoy-ink-tauri/_github/workflows/mobile.yml +76 -13
- package/template-react-vite-muijoy-ink-tauri/ink/second_part.ink +0 -1
- package/template-react-vite-muijoy-ink-tauri/ink/start.ink +4 -6
- package/template-react-vite-muijoy-ink-tauri/package-lock.json +12 -12
- package/template-react-vite-muijoy-ink-tauri/package.json +2 -2
- package/template-react-vite-muijoy-ink-tauri/src/assets/index.ts +55 -55
- package/template-react-vite-muijoy-ink-tauri/src/assets/manifest.gen.json +2 -7
- package/template-react-vite-muijoy-ink-tauri/src/components/menus/settings/index.tsx +15 -6
- package/template-react-vite-muijoy-ink-tauri/src/components/menus/settings/menus/diagnostics.tsx +332 -0
- package/template-react-vite-muijoy-ink-tauri/src/components/menus/settings/quick-menus.tsx +32 -1
- package/template-react-vite-muijoy-ink-tauri/src/lib/hooks/device-diagnostics-hooks.ts +96 -0
- package/template-react-vite-muijoy-ink-tauri/src/lib/hooks/hotkeys-hooks.ts +16 -0
- package/template-react-vite-muijoy-ink-tauri/src/lib/system-info.ts +54 -0
- package/template-react-vite-muijoy-ink-tauri/src/lib/utils/device-diagnostics-utility.ts +511 -0
- package/template-react-vite-muijoy-ink-tauri/src/locales/en.json +66 -0
- package/template-react-vite-muijoy-ink-tauri/src/pixi-vn.keys.gen.ts +2 -3
- package/template-react-vite-muijoy-ink-tauri/src-tauri/Cargo.toml +1 -0
- package/template-react-vite-muijoy-ink-tauri/src-tauri/src/lib.rs +32 -20
- package/template-react-vite-muijoy-ink-tauri/src-tauri/src/system_info.rs +33 -0
- package/template-react-vite-muijoy-tauri/.vscode/launch.json +1 -1
- package/template-react-vite-muijoy-tauri/.vscode/tasks.json +1 -35
- package/template-react-vite-muijoy-tauri/_github/workflows/mobile.yml +76 -13
- package/template-react-vite-muijoy-tauri/package.json +1 -1
- package/template-react-vite-muijoy-tauri/src/assets/index.ts +55 -55
- package/template-react-vite-muijoy-tauri/src/assets/manifest.gen.json +2 -7
- package/template-react-vite-muijoy-tauri/src/components/menus/settings/index.tsx +15 -6
- package/template-react-vite-muijoy-tauri/src/components/menus/settings/menus/diagnostics.tsx +332 -0
- package/template-react-vite-muijoy-tauri/src/components/menus/settings/quick-menus.tsx +32 -1
- package/template-react-vite-muijoy-tauri/src/lib/hooks/device-diagnostics-hooks.ts +96 -0
- package/template-react-vite-muijoy-tauri/src/lib/hooks/hotkeys-hooks.ts +16 -0
- package/template-react-vite-muijoy-tauri/src/lib/system-info.ts +54 -0
- package/template-react-vite-muijoy-tauri/src/lib/utils/device-diagnostics-utility.ts +511 -0
- package/template-react-vite-muijoy-tauri/src/locales/en.json +66 -0
- package/template-react-vite-muijoy-tauri/src/pixi-vn.keys.gen.ts +2 -3
- package/template-react-vite-muijoy-tauri/src-tauri/Cargo.toml +1 -0
- package/template-react-vite-muijoy-tauri/src-tauri/src/lib.rs +32 -20
- package/template-react-vite-muijoy-tauri/src-tauri/src/system_info.rs +33 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import packageJson from "@/../package.json";
|
|
2
|
+
import { canvas, PIXIVN_VERSION } from "@drincs/pixi-vn";
|
|
3
|
+
import motionPackageJson from "motion/package.json";
|
|
4
|
+
import { VERSION as PIXIJS_VERSION } from "pixi.js";
|
|
5
|
+
import tonePackageJson from "tone/package.json";
|
|
6
|
+
|
|
7
|
+
export interface WebglExtensionCheck {
|
|
8
|
+
name: string;
|
|
9
|
+
supported: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface WebglDiagnostics {
|
|
13
|
+
webgl1Supported: boolean;
|
|
14
|
+
webgl2Supported: boolean;
|
|
15
|
+
vendor: string | null;
|
|
16
|
+
renderer: string | null;
|
|
17
|
+
unmaskedVendor: string | null;
|
|
18
|
+
unmaskedRenderer: string | null;
|
|
19
|
+
/** null when it cannot be determined (e.g. WEBGL_debug_renderer_info is blocked). */
|
|
20
|
+
hardwareAccelerated: boolean | null;
|
|
21
|
+
maxTextureSize: number | null;
|
|
22
|
+
floatTexturesSupported: boolean;
|
|
23
|
+
msaaSupported: boolean;
|
|
24
|
+
shadersCompile: boolean;
|
|
25
|
+
keyExtensions: WebglExtensionCheck[];
|
|
26
|
+
allExtensions: string[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface BrowserCapabilities {
|
|
30
|
+
audio: boolean;
|
|
31
|
+
gamepad: boolean;
|
|
32
|
+
clipboard: boolean;
|
|
33
|
+
fullscreen: boolean;
|
|
34
|
+
localStorage: boolean;
|
|
35
|
+
indexedDb: boolean;
|
|
36
|
+
/** Best-effort heuristic only: Steam's overlay is compositor-level and generally invisible to page JS. */
|
|
37
|
+
steamOverlayDetected: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ResolutionInfo {
|
|
41
|
+
innerWidth: number;
|
|
42
|
+
innerHeight: number;
|
|
43
|
+
screenWidth: number;
|
|
44
|
+
screenHeight: number;
|
|
45
|
+
devicePixelRatio: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface JsMemoryInfo {
|
|
49
|
+
usedJSHeapSize: number;
|
|
50
|
+
totalJSHeapSize: number;
|
|
51
|
+
jsHeapSizeLimit: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const KEY_WEBGL_EXTENSIONS = [
|
|
55
|
+
"WEBGL_debug_renderer_info",
|
|
56
|
+
"WEBGL_lose_context",
|
|
57
|
+
"WEBGL_compressed_texture_s3tc",
|
|
58
|
+
"WEBGL_compressed_texture_astc",
|
|
59
|
+
"WEBGL_compressed_texture_etc",
|
|
60
|
+
"OES_texture_float",
|
|
61
|
+
"OES_texture_float_linear",
|
|
62
|
+
"OES_texture_half_float",
|
|
63
|
+
"OES_element_index_uint",
|
|
64
|
+
"OES_standard_derivatives",
|
|
65
|
+
"ANGLE_instanced_arrays",
|
|
66
|
+
"EXT_texture_filter_anisotropic",
|
|
67
|
+
"EXT_color_buffer_float",
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const SOFTWARE_RENDERER_PATTERN =
|
|
71
|
+
/swiftshader|llvmpipe|software|microsoft basic render|d3d11 warp|apple software renderer/i;
|
|
72
|
+
|
|
73
|
+
function testShaderCompilation(gl: WebGLRenderingContext | WebGL2RenderingContext): boolean {
|
|
74
|
+
try {
|
|
75
|
+
const vertexShader = gl.createShader(gl.VERTEX_SHADER);
|
|
76
|
+
const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
|
|
77
|
+
if (!vertexShader || !fragmentShader) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
gl.shaderSource(
|
|
82
|
+
vertexShader,
|
|
83
|
+
"attribute vec2 p; void main() { gl_Position = vec4(p, 0.0, 1.0); }",
|
|
84
|
+
);
|
|
85
|
+
gl.compileShader(vertexShader);
|
|
86
|
+
gl.shaderSource(
|
|
87
|
+
fragmentShader,
|
|
88
|
+
"precision mediump float; void main() { gl_FragColor = vec4(1.0); }",
|
|
89
|
+
);
|
|
90
|
+
gl.compileShader(fragmentShader);
|
|
91
|
+
if (
|
|
92
|
+
!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS) ||
|
|
93
|
+
!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)
|
|
94
|
+
) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const program = gl.createProgram();
|
|
99
|
+
if (!program) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
gl.attachShader(program, vertexShader);
|
|
103
|
+
gl.attachShader(program, fragmentShader);
|
|
104
|
+
gl.linkProgram(program);
|
|
105
|
+
return !!gl.getProgramParameter(program, gl.LINK_STATUS);
|
|
106
|
+
} catch {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Probes a throwaway canvas instead of the live Pixi-VN canvas so this works
|
|
113
|
+
* regardless of which renderer Pixi actually picked (or before Pixi has initialized).
|
|
114
|
+
*/
|
|
115
|
+
export function getWebglDiagnostics(): WebglDiagnostics {
|
|
116
|
+
const probeCanvas = document.createElement("canvas");
|
|
117
|
+
const gl2 = probeCanvas.getContext("webgl2") as WebGL2RenderingContext | null;
|
|
118
|
+
const gl1 = (probeCanvas.getContext("webgl") ??
|
|
119
|
+
probeCanvas.getContext("experimental-webgl")) as WebGLRenderingContext | null;
|
|
120
|
+
const gl = gl2 ?? gl1;
|
|
121
|
+
|
|
122
|
+
if (!gl) {
|
|
123
|
+
return {
|
|
124
|
+
webgl1Supported: false,
|
|
125
|
+
webgl2Supported: false,
|
|
126
|
+
vendor: null,
|
|
127
|
+
renderer: null,
|
|
128
|
+
unmaskedVendor: null,
|
|
129
|
+
unmaskedRenderer: null,
|
|
130
|
+
hardwareAccelerated: null,
|
|
131
|
+
maxTextureSize: null,
|
|
132
|
+
floatTexturesSupported: false,
|
|
133
|
+
msaaSupported: false,
|
|
134
|
+
shadersCompile: false,
|
|
135
|
+
keyExtensions: KEY_WEBGL_EXTENSIONS.map((name) => ({ name, supported: false })),
|
|
136
|
+
allExtensions: [],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
|
|
141
|
+
const vendor = (gl.getParameter(gl.VENDOR) as string) ?? null;
|
|
142
|
+
const renderer = (gl.getParameter(gl.RENDERER) as string) ?? null;
|
|
143
|
+
const unmaskedVendor = debugInfo
|
|
144
|
+
? ((gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL) as string) ?? null)
|
|
145
|
+
: null;
|
|
146
|
+
const unmaskedRenderer = debugInfo
|
|
147
|
+
? ((gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) as string) ?? null)
|
|
148
|
+
: null;
|
|
149
|
+
const rendererForHeuristic = unmaskedRenderer ?? renderer;
|
|
150
|
+
const hardwareAccelerated = rendererForHeuristic
|
|
151
|
+
? !SOFTWARE_RENDERER_PATTERN.test(rendererForHeuristic)
|
|
152
|
+
: null;
|
|
153
|
+
|
|
154
|
+
const allExtensions = gl.getSupportedExtensions() ?? [];
|
|
155
|
+
const keyExtensions = KEY_WEBGL_EXTENSIONS.map((name) => ({
|
|
156
|
+
name,
|
|
157
|
+
supported: allExtensions.includes(name),
|
|
158
|
+
}));
|
|
159
|
+
|
|
160
|
+
const maxTextureSize = (gl.getParameter(gl.MAX_TEXTURE_SIZE) as number) ?? null;
|
|
161
|
+
const floatTexturesSupported = gl2 ? true : allExtensions.includes("OES_texture_float");
|
|
162
|
+
const msaaSupported = gl2
|
|
163
|
+
? ((gl2.getParameter(gl2.MAX_SAMPLES) as number) ?? 0) > 1
|
|
164
|
+
: (gl.getContextAttributes()?.antialias ?? false);
|
|
165
|
+
const shadersCompile = testShaderCompilation(gl);
|
|
166
|
+
|
|
167
|
+
// This is a throwaway probe context; release it instead of leaving it around.
|
|
168
|
+
gl.getExtension("WEBGL_lose_context")?.loseContext();
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
webgl1Supported: !!gl1 || !!gl2,
|
|
172
|
+
webgl2Supported: !!gl2,
|
|
173
|
+
vendor,
|
|
174
|
+
renderer,
|
|
175
|
+
unmaskedVendor,
|
|
176
|
+
unmaskedRenderer,
|
|
177
|
+
hardwareAccelerated,
|
|
178
|
+
maxTextureSize,
|
|
179
|
+
floatTexturesSupported,
|
|
180
|
+
msaaSupported,
|
|
181
|
+
shadersCompile,
|
|
182
|
+
keyExtensions,
|
|
183
|
+
allExtensions,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function detectPlatform(): string {
|
|
188
|
+
const ua = navigator.userAgent;
|
|
189
|
+
const uaData = (navigator as Navigator & { userAgentData?: { platform?: string } })
|
|
190
|
+
.userAgentData;
|
|
191
|
+
const platformHint = uaData?.platform ?? navigator.platform ?? "";
|
|
192
|
+
|
|
193
|
+
if (/android/i.test(ua)) return "Android";
|
|
194
|
+
if (/iphone|ipod/i.test(ua)) return "iOS";
|
|
195
|
+
// iPadOS reports as "MacIntel" but exposes multi-touch, unlike a real Mac.
|
|
196
|
+
if (/ipad/i.test(ua) || (/mac/i.test(platformHint) && navigator.maxTouchPoints > 1))
|
|
197
|
+
return "iOS";
|
|
198
|
+
if (/mac/i.test(platformHint)) return "macOS";
|
|
199
|
+
if (/win/i.test(platformHint)) return "Windows";
|
|
200
|
+
if (/linux/i.test(platformHint)) return "Linux";
|
|
201
|
+
return "Unknown";
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function detectBrowserEngine(): string {
|
|
205
|
+
const ua = navigator.userAgent;
|
|
206
|
+
if (/edg\//i.test(ua)) return "Chromium (Edge)";
|
|
207
|
+
if (/firefox|fxios/i.test(ua)) return "Gecko (Firefox)";
|
|
208
|
+
if (/crios/i.test(ua)) return "Chromium (Chrome iOS)";
|
|
209
|
+
if (/chrome|chromium/i.test(ua)) return "Chromium";
|
|
210
|
+
if (/safari/i.test(ua)) return "WebKit (Safari)";
|
|
211
|
+
return "Unknown";
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function getBrowserCapabilities(): BrowserCapabilities {
|
|
215
|
+
const win = window as Window & {
|
|
216
|
+
webkitAudioContext?: typeof AudioContext;
|
|
217
|
+
cefQuery?: unknown;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
let localStorageAvailable = false;
|
|
221
|
+
try {
|
|
222
|
+
const testKey = "__diagnostics_test__";
|
|
223
|
+
window.localStorage.setItem(testKey, "1");
|
|
224
|
+
window.localStorage.removeItem(testKey);
|
|
225
|
+
localStorageAvailable = true;
|
|
226
|
+
} catch {
|
|
227
|
+
localStorageAvailable = false;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return {
|
|
231
|
+
audio: typeof AudioContext !== "undefined" || typeof win.webkitAudioContext !== "undefined",
|
|
232
|
+
gamepad: typeof navigator.getGamepads === "function",
|
|
233
|
+
clipboard: typeof navigator.clipboard?.writeText === "function",
|
|
234
|
+
fullscreen: document.fullscreenEnabled === true,
|
|
235
|
+
localStorage: localStorageAvailable,
|
|
236
|
+
indexedDb: typeof window.indexedDB !== "undefined",
|
|
237
|
+
steamOverlayDetected:
|
|
238
|
+
typeof win.cefQuery === "function" ||
|
|
239
|
+
/Valve Steam|SteamOverlay/i.test(navigator.userAgent),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export function getResolutionInfo(): ResolutionInfo {
|
|
244
|
+
return {
|
|
245
|
+
innerWidth: window.innerWidth,
|
|
246
|
+
innerHeight: window.innerHeight,
|
|
247
|
+
screenWidth: window.screen?.width ?? 0,
|
|
248
|
+
screenHeight: window.screen?.height ?? 0,
|
|
249
|
+
devicePixelRatio: window.devicePixelRatio || 1,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export function getJsMemoryInfo(): JsMemoryInfo | null {
|
|
254
|
+
const memory = (performance as Performance & { memory?: JsMemoryInfo }).memory;
|
|
255
|
+
if (!memory) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
usedJSHeapSize: memory.usedJSHeapSize,
|
|
260
|
+
totalJSHeapSize: memory.totalJSHeapSize,
|
|
261
|
+
jsHeapSizeLimit: memory.jsHeapSizeLimit,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function getCurrentFps(): number | null {
|
|
266
|
+
try {
|
|
267
|
+
return Math.round(canvas.app.ticker.FPS);
|
|
268
|
+
} catch {
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export function getGameVersion(): string {
|
|
274
|
+
return packageJson.version;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export function getPixiJsVersion(): string {
|
|
278
|
+
return PIXIJS_VERSION;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export function getPixiVnVersion(): string {
|
|
282
|
+
return PIXIVN_VERSION;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export function getToneJsVersion(): string {
|
|
286
|
+
return tonePackageJson.version;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export function getMotionVersion(): string {
|
|
290
|
+
return motionPackageJson.version;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function formatBytes(bytes: number): string {
|
|
294
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export interface DeviceDiagnosticsSnapshot {
|
|
298
|
+
webgl: WebglDiagnostics;
|
|
299
|
+
capabilities: BrowserCapabilities;
|
|
300
|
+
resolution: ResolutionInfo;
|
|
301
|
+
memory: JsMemoryInfo | null;
|
|
302
|
+
fps: number | null;
|
|
303
|
+
userAgent: string;
|
|
304
|
+
platform: string;
|
|
305
|
+
browserEngine: string;
|
|
306
|
+
gameVersion: string;
|
|
307
|
+
pixiJsVersion: string;
|
|
308
|
+
pixiVnVersion: string;
|
|
309
|
+
toneJsVersion: string;
|
|
310
|
+
motionVersion: string;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export function buildDiagnosticsReportText(snapshot: DeviceDiagnosticsSnapshot): string {
|
|
314
|
+
const { webgl, capabilities, resolution, memory, fps } = snapshot;
|
|
315
|
+
const yn = (value: boolean | null) => (value === null ? "Unknown" : value ? "Yes" : "No");
|
|
316
|
+
|
|
317
|
+
const lines = [
|
|
318
|
+
"=== Device Diagnostics Report ===",
|
|
319
|
+
`Game version: ${snapshot.gameVersion}`,
|
|
320
|
+
`PixiJS version: ${snapshot.pixiJsVersion}`,
|
|
321
|
+
`Pixi'VN version: ${snapshot.pixiVnVersion}`,
|
|
322
|
+
`Tone.js version: ${snapshot.toneJsVersion}`,
|
|
323
|
+
`Motion version: ${snapshot.motionVersion}`,
|
|
324
|
+
`User Agent: ${snapshot.userAgent}`,
|
|
325
|
+
`Platform: ${snapshot.platform}`,
|
|
326
|
+
`Browser/WebView: ${snapshot.browserEngine}`,
|
|
327
|
+
"",
|
|
328
|
+
"-- Graphics --",
|
|
329
|
+
`WebGL1 available: ${yn(webgl.webgl1Supported)}`,
|
|
330
|
+
`WebGL2 available: ${yn(webgl.webgl2Supported)}`,
|
|
331
|
+
`Hardware acceleration: ${yn(webgl.hardwareAccelerated)}`,
|
|
332
|
+
`GPU vendor: ${webgl.unmaskedVendor ?? webgl.vendor ?? "Unknown"}`,
|
|
333
|
+
`GPU renderer: ${webgl.unmaskedRenderer ?? webgl.renderer ?? "Unknown"}`,
|
|
334
|
+
`Max texture size: ${webgl.maxTextureSize ?? "Unknown"}`,
|
|
335
|
+
`Float textures: ${yn(webgl.floatTexturesSupported)}`,
|
|
336
|
+
`MSAA: ${yn(webgl.msaaSupported)}`,
|
|
337
|
+
`Shaders compile: ${yn(webgl.shadersCompile)}`,
|
|
338
|
+
`WebGL extensions: ${webgl.keyExtensions
|
|
339
|
+
.filter((extension) => extension.supported)
|
|
340
|
+
.map((extension) => extension.name)
|
|
341
|
+
.join(", ")}`,
|
|
342
|
+
"",
|
|
343
|
+
"-- Display --",
|
|
344
|
+
`Resolution: ${resolution.innerWidth}x${resolution.innerHeight} (screen ${resolution.screenWidth}x${resolution.screenHeight})`,
|
|
345
|
+
`Device pixel ratio: ${resolution.devicePixelRatio}`,
|
|
346
|
+
`FPS: ${fps ?? "Unknown"}`,
|
|
347
|
+
"",
|
|
348
|
+
"-- Memory --",
|
|
349
|
+
memory
|
|
350
|
+
? `JS heap: ${formatBytes(memory.usedJSHeapSize)} / ${formatBytes(memory.totalJSHeapSize)} (limit ${formatBytes(memory.jsHeapSizeLimit)})`
|
|
351
|
+
: "JS heap: Not available in this browser",
|
|
352
|
+
"",
|
|
353
|
+
"-- Browser capabilities --",
|
|
354
|
+
`Audio (Web Audio API): ${yn(capabilities.audio)}`,
|
|
355
|
+
`Gamepad API: ${yn(capabilities.gamepad)}`,
|
|
356
|
+
`Clipboard API: ${yn(capabilities.clipboard)}`,
|
|
357
|
+
`Fullscreen API: ${yn(capabilities.fullscreen)}`,
|
|
358
|
+
`LocalStorage: ${yn(capabilities.localStorage)}`,
|
|
359
|
+
`IndexedDB: ${yn(capabilities.indexedDb)}`,
|
|
360
|
+
`Steam Overlay detected (best-effort): ${yn(capabilities.steamOverlayDetected)}`,
|
|
361
|
+
];
|
|
362
|
+
|
|
363
|
+
return lines.join("\n");
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export function buildDiagnosticsReportJson(snapshot: DeviceDiagnosticsSnapshot): object {
|
|
367
|
+
return {
|
|
368
|
+
generatedAt: new Date().toISOString(),
|
|
369
|
+
...snapshot,
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export function downloadDiagnosticsReportJson(snapshot: DeviceDiagnosticsSnapshot) {
|
|
374
|
+
const jsonString = JSON.stringify(buildDiagnosticsReportJson(snapshot), null, 2);
|
|
375
|
+
const blob = new Blob([jsonString], { type: "application/json" });
|
|
376
|
+
const url = URL.createObjectURL(blob);
|
|
377
|
+
const a = document.createElement("a");
|
|
378
|
+
a.href = url;
|
|
379
|
+
a.download = `${__APP_NAME__}-${__APP_VERSION__}-diagnostics-${Date.now()}.json`;
|
|
380
|
+
a.click();
|
|
381
|
+
URL.revokeObjectURL(url);
|
|
382
|
+
}
|
|
@@ -63,6 +63,56 @@
|
|
|
63
63
|
"name": "Name",
|
|
64
64
|
"version": "Version",
|
|
65
65
|
"engine": "Engine",
|
|
66
|
+
"diagnostics": "Diagnostics",
|
|
67
|
+
"diagnostics_yes": "Yes",
|
|
68
|
+
"diagnostics_no": "No",
|
|
69
|
+
"diagnostics_unknown": "Unknown",
|
|
70
|
+
"diagnostics_webgl2_missing_message": "This game requires WebGL2. Please update your browser, operating system, or GPU drivers.",
|
|
71
|
+
"diagnostics_section_engine": "Engine",
|
|
72
|
+
"diagnostics_section_device": "Device",
|
|
73
|
+
"diagnostics_section_graphics": "Graphics",
|
|
74
|
+
"diagnostics_section_display": "Display",
|
|
75
|
+
"diagnostics_section_memory": "Memory",
|
|
76
|
+
"diagnostics_section_capabilities": "Browser Capabilities",
|
|
77
|
+
"diagnostics_section_extensions": "WebGL Extensions",
|
|
78
|
+
"diagnostics_game_version": "Game version",
|
|
79
|
+
"diagnostics_pixijs_version": "PixiJS version",
|
|
80
|
+
"diagnostics_pixivn_version": "Pixi'VN version",
|
|
81
|
+
"diagnostics_tonejs_version": "Tone.js version",
|
|
82
|
+
"diagnostics_motion_version": "Motion version",
|
|
83
|
+
"diagnostics_platform": "Platform",
|
|
84
|
+
"diagnostics_browser_engine": "Browser/WebView",
|
|
85
|
+
"diagnostics_user_agent": "User Agent",
|
|
86
|
+
"diagnostics_webgl1": "WebGL1 available",
|
|
87
|
+
"diagnostics_webgl2": "WebGL2 available",
|
|
88
|
+
"diagnostics_hardware_acceleration": "Hardware acceleration",
|
|
89
|
+
"diagnostics_gpu_vendor": "GPU vendor",
|
|
90
|
+
"diagnostics_gpu_renderer": "GPU renderer",
|
|
91
|
+
"diagnostics_max_texture_size": "Max texture size",
|
|
92
|
+
"diagnostics_max_texture_size_check": "Max texture size >= 8192",
|
|
93
|
+
"diagnostics_gpu_supported": "GPU supported",
|
|
94
|
+
"diagnostics_float_textures": "Float textures",
|
|
95
|
+
"diagnostics_msaa": "MSAA",
|
|
96
|
+
"diagnostics_shaders_compile": "Shaders compile",
|
|
97
|
+
"diagnostics_resolution": "Resolution",
|
|
98
|
+
"diagnostics_device_pixel_ratio": "Device pixel ratio",
|
|
99
|
+
"diagnostics_fps": "FPS",
|
|
100
|
+
"diagnostics_js_heap": "JS heap used / total",
|
|
101
|
+
"diagnostics_js_heap_unavailable": "Not available in this browser.",
|
|
102
|
+
"diagnostics_audio": "Audio (Web Audio API)",
|
|
103
|
+
"diagnostics_gamepad": "Gamepad API",
|
|
104
|
+
"diagnostics_clipboard": "Clipboard API",
|
|
105
|
+
"diagnostics_fullscreen": "Fullscreen API",
|
|
106
|
+
"diagnostics_local_storage": "LocalStorage",
|
|
107
|
+
"diagnostics_indexed_db": "IndexedDB",
|
|
108
|
+
"diagnostics_steam_overlay": "Steam Overlay",
|
|
109
|
+
"diagnostics_steam_overlay_hint": "Best-effort detection only; not reliable in a standard browser.",
|
|
110
|
+
"diagnostics_copy_report": "Copy report",
|
|
111
|
+
"diagnostics_report_copied": "Report copied to clipboard",
|
|
112
|
+
"diagnostics_report_copy_failed": "Could not copy the report",
|
|
113
|
+
"diagnostics_download_report": "Download JSON",
|
|
114
|
+
"diagnostics_report_downloaded": "Report downloaded",
|
|
115
|
+
"diagnostics_hotkey_description": "Open settings directly on the diagnostics page.",
|
|
66
116
|
"quick_actions": "Quick Actions",
|
|
67
117
|
"quick_actions_open_description": "Press Tab to open or close the quick actions wheel.",
|
|
68
118
|
"quick_actions_click_hint": "Click an action to execute",
|
|
@@ -31,7 +31,6 @@ declare module "@drincs/pixi-vn/narration" {
|
|
|
31
31
|
}
|
|
32
32
|
declare module "@drincs/pixi-vn/canvas" {
|
|
33
33
|
interface PixivnBundleIds {
|
|
34
|
-
"default": never;
|
|
35
34
|
"audio": never;
|
|
36
35
|
"/": never;
|
|
37
36
|
"main_map": never;
|
|
@@ -46,8 +45,6 @@ declare module "@drincs/pixi-vn/canvas" {
|
|
|
46
45
|
"alice": never;
|
|
47
46
|
}
|
|
48
47
|
interface PixivnAssetAliasIds {
|
|
49
|
-
"bgm_cheerful": never;
|
|
50
|
-
"sfx_whoosh": never;
|
|
51
48
|
"background_main_menu": never;
|
|
52
49
|
"map-0": never;
|
|
53
50
|
"map-1": never;
|
|
@@ -87,7 +84,7 @@ export const characterIds = ["mc","alice"] as const;
|
|
|
87
84
|
export const characterIdsEnum = {"mc":"mc","alice":"alice"} as const;
|
|
88
85
|
export const labelIds = ["sleep_1_hour","nap_1_hour","sleep","nap","alice_talk_menu","alice_talk_menu_|_c-0","alice_talk_menu_|_c-1","order_product","start","take_product","talk_alice","talk_alice_|_talk_alice0","talk_alice_|_talk_alice1","talk_alice_|_talk_alice2","talk_alice_|_talk_alice3","talk_alice_sleep","talk_alice_sleep_|_c-0","talk_alice_sleep_|_c-1"] as const;
|
|
89
86
|
export const labelIdsEnum = {"sleep_1_hour":"sleep_1_hour","nap_1_hour":"nap_1_hour","sleep":"sleep","nap":"nap","alice_talk_menu":"alice_talk_menu","alice_talk_menu_|_c-0":"alice_talk_menu_|_c-0","alice_talk_menu_|_c-1":"alice_talk_menu_|_c-1","order_product":"order_product","start":"start","take_product":"take_product","talk_alice":"talk_alice","talk_alice_|_talk_alice0":"talk_alice_|_talk_alice0","talk_alice_|_talk_alice1":"talk_alice_|_talk_alice1","talk_alice_|_talk_alice2":"talk_alice_|_talk_alice2","talk_alice_|_talk_alice3":"talk_alice_|_talk_alice3","talk_alice_sleep":"talk_alice_sleep","talk_alice_sleep_|_c-0":"talk_alice_sleep_|_c-0","talk_alice_sleep_|_c-1":"talk_alice_sleep_|_c-1"} as const;
|
|
90
|
-
export const bundleIds = ["
|
|
91
|
-
export const bundleIdsEnum = {"
|
|
92
|
-
export const assetAliasIds = ["
|
|
93
|
-
export const assetAliasIdsEnum = {"
|
|
87
|
+
export const bundleIds = ["audio","/","main_map","nightcity_map","mc_room","alice_room","ann_room","bathroom","lounge","terrace","gym_room","alice"] as const;
|
|
88
|
+
export const bundleIdsEnum = {"audio":"audio","/":"/","main_map":"main_map","nightcity_map":"nightcity_map","mc_room":"mc_room","alice_room":"alice_room","ann_room":"ann_room","bathroom":"bathroom","lounge":"lounge","terrace":"terrace","gym_room":"gym_room","alice":"alice"} as const;
|
|
89
|
+
export const assetAliasIds = ["background_main_menu","map-0","map-1","map-2","map-3","icon_location_home","icon_location_gym","map-nightcity","location_myroom-0","location_myroom-1","location_myroom-2","location_myroom-3","location_aliceroom-0","location_aliceroom-1","location_aliceroom-2","location_aliceroom-3","location_annroom-0","location_annroom-1","location_annroom-2","location_annroom-3","location_bathroom","location_lounge-0","location_lounge-1","location_lounge-2","location_lounge-3","location_terrace-0","location_terrace-1","location_terrace-2","location_terrace-3","location_gym","alice_terrace0A","alice_terrace0At","alice_roomsleep0A"] as const;
|
|
90
|
+
export const assetAliasIdsEnum = {"background_main_menu":"background_main_menu","map-0":"map-0","map-1":"map-1","map-2":"map-2","map-3":"map-3","icon_location_home":"icon_location_home","icon_location_gym":"icon_location_gym","map-nightcity":"map-nightcity","location_myroom-0":"location_myroom-0","location_myroom-1":"location_myroom-1","location_myroom-2":"location_myroom-2","location_myroom-3":"location_myroom-3","location_aliceroom-0":"location_aliceroom-0","location_aliceroom-1":"location_aliceroom-1","location_aliceroom-2":"location_aliceroom-2","location_aliceroom-3":"location_aliceroom-3","location_annroom-0":"location_annroom-0","location_annroom-1":"location_annroom-1","location_annroom-2":"location_annroom-2","location_annroom-3":"location_annroom-3","location_bathroom":"location_bathroom","location_lounge-0":"location_lounge-0","location_lounge-1":"location_lounge-1","location_lounge-2":"location_lounge-2","location_lounge-3":"location_lounge-3","location_terrace-0":"location_terrace-0","location_terrace-1":"location_terrace-1","location_terrace-2":"location_terrace-2","location_terrace-3":"location_terrace-3","location_gym":"location_gym","alice_terrace0A":"alice_terrace0A","alice_terrace0At":"alice_terrace0At","alice_roomsleep0A":"alice_roomsleep0A"} as const;
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"label": "Cargo Build (Desktop Dev)",
|
|
107
107
|
"type": "shell",
|
|
108
108
|
"command": "cargo build --manifest-path=./src-tauri/Cargo.toml --no-default-features",
|
|
109
|
-
"dependsOn": ["
|
|
109
|
+
"dependsOn": ["Restart Vite Dev Server"],
|
|
110
110
|
"presentation": {
|
|
111
111
|
"reveal": "always",
|
|
112
112
|
"panel": "dedicated",
|
|
@@ -114,40 +114,6 @@
|
|
|
114
114
|
"close": true
|
|
115
115
|
},
|
|
116
116
|
"problemMatcher": ["$rustc"]
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"label": "Start Vite Desktop Server",
|
|
120
|
-
"type": "shell",
|
|
121
|
-
"command": "npm run dev",
|
|
122
|
-
"isBackground": true,
|
|
123
|
-
"dependsOn": ["Install Dependencies"],
|
|
124
|
-
"problemMatcher": {
|
|
125
|
-
"owner": "vite",
|
|
126
|
-
"pattern": {
|
|
127
|
-
"regexp": "^(?!x)x"
|
|
128
|
-
},
|
|
129
|
-
"background": {
|
|
130
|
-
"activeOnStart": true,
|
|
131
|
-
"beginsPattern": ".",
|
|
132
|
-
"endsPattern": "localhost:5173"
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
"presentation": {
|
|
136
|
-
"reveal": "always",
|
|
137
|
-
"panel": "dedicated",
|
|
138
|
-
"clear": false,
|
|
139
|
-
"close": true
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"label": "Stop Vite Desktop Server",
|
|
144
|
-
"type": "shell",
|
|
145
|
-
"command": "pkill -f 'vite' 2>/dev/null; pkill -f 'npm run dev' 2>/dev/null; exit 0",
|
|
146
|
-
"presentation": {
|
|
147
|
-
"reveal": "never",
|
|
148
|
-
"panel": "dedicated",
|
|
149
|
-
"close": true
|
|
150
|
-
}
|
|
151
117
|
}
|
|
152
118
|
]
|
|
153
119
|
}
|
|
@@ -100,26 +100,89 @@ jobs:
|
|
|
100
100
|
with open(manifest, 'w') as f:
|
|
101
101
|
f.write(content)
|
|
102
102
|
|
|
103
|
-
# Tauri may generate styles.xml or themes.xml
|
|
103
|
+
# Tauri may generate styles.xml or themes.xml, and both a light (values/)
|
|
104
|
+
# and dark (values-night/) variant — patch every variant we find so the
|
|
105
|
+
# fullscreen flag doesn't silently no-op when the device is in dark mode.
|
|
104
106
|
styles_candidates = (
|
|
105
|
-
glob.glob('src-tauri/gen/android/app/src/main/res/values
|
|
106
|
-
glob.glob('src-tauri/gen/android/app/src/main/res/values
|
|
107
|
+
glob.glob('src-tauri/gen/android/app/src/main/res/values*/styles.xml') +
|
|
108
|
+
glob.glob('src-tauri/gen/android/app/src/main/res/values*/themes.xml')
|
|
107
109
|
)
|
|
108
110
|
if not styles_candidates:
|
|
109
111
|
print('Warning: no styles.xml/themes.xml found, skipping fullscreen patch')
|
|
110
112
|
else:
|
|
111
|
-
styles
|
|
112
|
-
|
|
113
|
+
for styles in styles_candidates:
|
|
114
|
+
with open(styles) as f:
|
|
115
|
+
content = f.read()
|
|
116
|
+
# Hide status bar (fullscreen) — kept as a best-effort theme hint,
|
|
117
|
+
# but on targetSdk 35+ (edge-to-edge is enforced by the OS) this
|
|
118
|
+
# alone has no effect; the real fix is the MainActivity.kt patch below.
|
|
119
|
+
content = content.replace(
|
|
120
|
+
'</style>',
|
|
121
|
+
' <item name="android:windowFullscreen">true</item>\n </style>',
|
|
122
|
+
1
|
|
123
|
+
)
|
|
124
|
+
with open(styles, 'w') as f:
|
|
125
|
+
f.write(content)
|
|
126
|
+
print(f'Patched {styles}')
|
|
127
|
+
|
|
128
|
+
# Since this project's Android template targets SDK 35+, edge-to-edge display
|
|
129
|
+
# is enforced by the OS and the theme-based windowFullscreen flag above no
|
|
130
|
+
# longer hides the status bar (it's always drawn, transparent, over the
|
|
131
|
+
# content). The only reliable way to hide it is to hide the system bars at
|
|
132
|
+
# runtime via WindowInsetsControllerCompat in MainActivity.kt.
|
|
133
|
+
activity_candidates = glob.glob(
|
|
134
|
+
'src-tauri/gen/android/app/src/main/**/MainActivity.kt', recursive=True
|
|
135
|
+
)
|
|
136
|
+
if not activity_candidates:
|
|
137
|
+
print('WARNING: MainActivity.kt not found — status bar hiding NOT patched')
|
|
138
|
+
else:
|
|
139
|
+
activity = activity_candidates[0]
|
|
140
|
+
with open(activity) as f:
|
|
113
141
|
content = f.read()
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
'
|
|
117
|
-
'
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
|
|
143
|
+
new_imports = [
|
|
144
|
+
'androidx.core.view.WindowCompat',
|
|
145
|
+
'androidx.core.view.WindowInsetsCompat',
|
|
146
|
+
'androidx.core.view.WindowInsetsControllerCompat',
|
|
147
|
+
]
|
|
148
|
+
import_lines = list(re.finditer(r'^import .+$', content, re.MULTILINE))
|
|
149
|
+
if import_lines:
|
|
150
|
+
insert_at = import_lines[-1].end()
|
|
151
|
+
addition = ''.join(
|
|
152
|
+
f'\nimport {imp}' for imp in new_imports if imp not in content
|
|
153
|
+
)
|
|
154
|
+
content = content[:insert_at] + addition + content[insert_at:]
|
|
155
|
+
|
|
156
|
+
if 'hideSystemBars' not in content:
|
|
157
|
+
content = content.replace(
|
|
158
|
+
'super.onCreate(savedInstanceState)',
|
|
159
|
+
'super.onCreate(savedInstanceState)\n hideSystemBars()',
|
|
160
|
+
1
|
|
161
|
+
)
|
|
162
|
+
content = re.sub(
|
|
163
|
+
r'\n}\s*$',
|
|
164
|
+
'\n\n'
|
|
165
|
+
' override fun onWindowFocusChanged(hasFocus: Boolean) {\n'
|
|
166
|
+
' super.onWindowFocusChanged(hasFocus)\n'
|
|
167
|
+
' if (hasFocus) {\n'
|
|
168
|
+
' hideSystemBars()\n'
|
|
169
|
+
' }\n'
|
|
170
|
+
' }\n'
|
|
171
|
+
'\n'
|
|
172
|
+
' private fun hideSystemBars() {\n'
|
|
173
|
+
' WindowCompat.setDecorFitsSystemWindows(window, false)\n'
|
|
174
|
+
' val controller = WindowInsetsControllerCompat(window, window.decorView)\n'
|
|
175
|
+
' controller.hide(WindowInsetsCompat.Type.systemBars())\n'
|
|
176
|
+
' controller.systemBarsBehavior =\n'
|
|
177
|
+
' WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE\n'
|
|
178
|
+
' }\n'
|
|
179
|
+
'}\n',
|
|
180
|
+
content,
|
|
181
|
+
count=1
|
|
182
|
+
)
|
|
183
|
+
with open(activity, 'w') as f:
|
|
121
184
|
f.write(content)
|
|
122
|
-
print(f'Patched {
|
|
185
|
+
print(f'Patched {activity} (hide system bars at runtime)')
|
|
123
186
|
PYEOF
|
|
124
187
|
|
|
125
188
|
- name: build Android app
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@base-ui/react": "^1.6.0",
|
|
27
|
-
"@drincs/nqtr": "^1.0.
|
|
28
|
-
"@drincs/pixi-vn": "^1.8.
|
|
29
|
-
"@drincs/pixi-vn-ink": "^1.1.
|
|
27
|
+
"@drincs/nqtr": "^1.0.3",
|
|
28
|
+
"@drincs/pixi-vn": "^1.8.25",
|
|
29
|
+
"@drincs/pixi-vn-ink": "^1.1.9",
|
|
30
30
|
"@tailwindcss/vite": "^4.3.0",
|
|
31
31
|
"@tanstack/hotkeys": "^0.8.0",
|
|
32
32
|
"@tanstack/react-hotkeys": "^0.10.0",
|