Skip to content

Commit

Permalink
feat: support 0x0ade mirror download
Browse files Browse the repository at this point in the history
  • Loading branch information
std-microblock committed Feb 15, 2024
1 parent 881e618 commit c2c20fb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
Binary file modified resources/dist.rc
Binary file not shown.
1 change: 1 addition & 0 deletions src/celemod-ui/src/context/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const createDownloadContext = () => {
else {
const gb_fileid = gb_fileid_or_url
if (downloadMirror === 'wegfan') url = `https://celeste.weg.fan/api/v2/download/gamebanana-files/${gb_fileid}`;
else if (downloadMirror === '0x0ade') url = `https://celestemodupdater.0x0a.de/banana-mirror/${gb_fileid}.zip`
else url = `https://gamebanana.com/dl/${gb_fileid}`
}

Expand Down
2 changes: 1 addition & 1 deletion src/celemod-ui/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const createI18NContext = () => {
}
else {
ctx.setLang('en-US')
setMirror('gamebanana')
setMirror('0x0ade')
}
}, [storage]);

Expand Down
9 changes: 4 additions & 5 deletions src/celemod-ui/src/routes/Home.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@use "../index.scss"as theme;

.home {
.languageSelect {
select {
style-set: custom-select-dropdown;
margin: 4px 0;
}
select {
style-set: custom-select-dropdown;
margin: 4px 0;
width: max-content;
}
.profiles {
// flow: horizontal-flow;
Expand Down
20 changes: 7 additions & 13 deletions src/celemod-ui/src/routes/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,12 @@ export const Home = () => {
</div>

<div className="config-block">
<input
type="checkbox"
checked={downloadMirror === 'wegfan'}
name="usecnmirror"
onChange={(e) => {
//@ts-ignore
const checked = e.target.checked;
setDownloadMirror(checked ? 'wegfan' : 'gamebanana')
}}
/>

<label for="usecnmirror">{_i18n.t('使用中国镜像 ( @WEGFan )')}</label>
<span>下载镜像</span>&nbsp;
<select value={downloadMirror} onChange={e=>setDownloadMirror(e.currentTarget.value)}>
<option value="0x0ade">0x0ade</option>
<option value="gamebanana">GameBanana</option>
<option value="wegfan">WEGFan</option>
</select>
</div>

<div className="config-block">
Expand Down Expand Up @@ -279,7 +273,7 @@ export const Home = () => {
<select
onChange={(e: any) => {
i18nCtx.setLang(e.target.value);
setDownloadMirror(e.target.value === 'zh-CN' ? 'wegfan' : 'gamebanana')
setDownloadMirror(e.target.value === 'zh-CN' ? 'wegfan' : '0x0ade')
}}
value={i18nCtx.currentLang}
>
Expand Down

0 comments on commit c2c20fb

Please sign in to comment.