Skip to content

Commit 8c2c09e

Browse files
fix: fix bug
1 parent dae7d75 commit 8c2c09e

File tree

5 files changed

+65
-2
lines changed

5 files changed

+65
-2
lines changed

resources/dist.rc

844 Bytes
Binary file not shown.

src/celemod-ui/src/resources/RecommendModData.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,50 @@ export const _skinMods = () => [
285285
'https://celeste.weg.fan/api/v2/download/gamebanana-files/857866',
286286
},
287287
];
288+
289+
export const _mapMods = ()=>[
290+
{
291+
name: 'StrawberryJam Collab (草莓酱)',
292+
description: '全蔚蓝最大的地图集,涵盖多个难度,美术优秀,地图有趣,适合新手和老玩家',
293+
download_url:
294+
'https://celeste.weg.fan/api/v2/download/mods/StrawberryJam2021',
295+
},
296+
{
297+
name: 'Spring Collab (春游)',
298+
description: '另一个大型地图集,与草莓酱相比较简单',
299+
download_url:
300+
'https://celeste.weg.fan/api/v2/download/mods/SpringCollab2020',
301+
},
302+
{
303+
name: 'Gallery Collab(画游)',
304+
description: '中国玩家制作的地图集,地图较少,美术精美,适合新手和老玩家',
305+
download_url:
306+
'https://celeste.weg.fan/api/v2/download/mods/ChineseNewYear2024Collab',
307+
},
308+
{
309+
name: 'Winter Collab (冬游)',
310+
description: '另一个大型地图集,与草莓酱相比较简单',
311+
download_url:
312+
'https://celeste.weg.fan/api/v2/download/mods/WinterCollab2021',
313+
},
314+
{
315+
name: 'the road less travelled',
316+
description: '独立地图,酱一难度,比较宁静,官图A面过后可打',
317+
download_url:
318+
'https://celeste.weg.fan/api/v2/download/mods/the%20road%20less%20travelled',
319+
},
320+
{
321+
name: 'glyph',
322+
description: '独立地图,酱二红难度,老图,要求',
323+
download_url:
324+
'https://celeste.weg.fan/api/v2/download/mods/glyph',
325+
},
326+
]
327+
328+
329+
/*
330+
into the jungle 官
331+
gate to the stars
332+
far away
333+
glyph
334+
*/

src/celemod-ui/src/sciter-specific.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import * as env from '@env'
44
import * as storage from '@storage'
5+
import * as sys from '@sys'
56

67
window.env = env
78
window.storage = storage

src/celemod-ui/src/states.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,26 @@ declare global {
2828
var configStorage: any;
2929
var storage: any;
3030
var env: any;
31+
var sys: any;
3132
}
3233

3334
export const useStorage = () => {
3435
if (!window.configStorage) {
35-
window.configStorage = storage.open('./cele-mod.db');
36+
let path = './cele-mod.db';
37+
const exists = (path)=>{
38+
try {
39+
sys.fs.statSync(path);
40+
return true;
41+
} catch (e) {
42+
return false;
43+
}
44+
}
45+
if (exists('../../cele-mod.db')) {
46+
path = '../../cele-mod.db';
47+
}
48+
49+
console.log('useStorage', path)
50+
window.configStorage = storage.open(path);
3651

3752
window.addEventListener('beforeunload', () => {
3853
configStorage.close();

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ impl Handler {
384384
let task = &mut tasklist[i_task];
385385
task.status = DownloadStatus::Failed;
386386
task.data = e.to_string();
387-
fs::remove_file(&current_task.dest);
387+
let _ = fs::remove_file(&task.dest);
388388
post_callback(&tasklist, "failed");
389389
return;
390390
}

0 commit comments

Comments
 (0)