로그인 상태 유지와 다마고치 수정 화면 정리
This commit is contained in:
1 parent
80d332a79c
commit
40615838ac
33 files changed
+248
-73
No files matched your search
@@ -33,6 +33,10 @@ fs.writeFileSync(root+'/src/menu-auto-data.js','// Menu translations and Galmuri
|
||||
const token=k=>'"\\037\\'+(33+Math.floor(keys.indexOf(k)/94)).toString(8).padStart(3,'0')+'\\'+(33+keys.indexOf(k)%94).toString(8).padStart(3,'0')+'"';
|
||||
let s=fs.readFileSync(dir+'/main-en.c','utf8');
|
||||
const from=s.indexOf('static int ko_pair'),to=s.indexOf('static void text(int',from);s=s.slice(0,from)+'#include "auto-text.h"\n'+s.slice(to);
|
||||
s=s.replace('static void ko_detail(const char *s){',`static void ko_detail(const char *s){
|
||||
char expanded[192];AlText it={s,0,0};int code,nbytes=0;
|
||||
while((code=al_next(&it,999))>=0 && nbytes<188){if(code<128)expanded[nbytes++]=(char)code;else{u32 glyph=(u32)code-128;expanded[nbytes++]=(char)(128+(glyph>>7));expanded[nbytes++]=(char)(128+(glyph&127));}}
|
||||
expanded[nbytes]=0;s=expanded;`);
|
||||
const split=s.indexOf('/* ---------------------------------------------------------------- Display */');s=s.slice(0,split)+s.slice(split).replace(/"((?:[^"\\]|\\.)*)"/g,(m,k)=>keys.includes(k)?token(k):m);
|
||||
s=s.replace('if(k>=0){ u32 o=g_cfg.cat_off+8u+28u*(u32)k;', 'if(k>=0)return al_string((u32)k,1);\n if(k>=0){ u32 o=g_cfg.cat_off+8u+28u*(u32)k;');
|
||||
s=s.replace("s[5]=(char)('0'+code/10); s[6]=(char)('0'+code%10);", "s[3]=(char)('0'+code/10); s[4]=(char)('0'+code%10); s[5]=0;");
|
||||
|
||||
@@ -8,6 +8,7 @@ cp source/account.html source/account.js site/
|
||||
cp source/share.js site/
|
||||
cp source/member-nav.js site/
|
||||
cp source/feld/src/feld/qa/menu-main.png site/menu-main.png
|
||||
cp source/feld/src/feld/qa/menu-tama-edit.png site/menu-tama-edit.png
|
||||
cp source/feld/src/feld/qa/menu-character-list.png site/menu-character-list.png
|
||||
cp source/feld/src/feld/qa/menu-character.png site/menu-character.png
|
||||
cp source/feld/src/feld/qa/menu-item-list.png site/menu-item-list.png
|
||||
|
||||
@@ -60,6 +60,29 @@ static void ko_row(int y,int selected){rect(5,y+2,123,y+14,RGB(18,96,136));rect(
|
||||
s=s.replace('if(n>10u){ int h=100*10/(int)n; if(h<6) h=6; int y=12+(int)(100-h)*(int)top/(int)(n-10u);','if(n>6u){ int h=90*6/(int)n; if(h<6) h=6; int y=21+(int)(90-h)*(int)top/(int)(n-6u);');
|
||||
s=s.replace('ctext(118,foot,GREY,1);','ctext(117,foot,RGB(255,255,255),1);');
|
||||
s=s.replaceAll('if(sel>=top+10u) top=sel-9u;','if(sel>=top+6u) top=sel-5u;');
|
||||
// The character settings screen shares the regular list font and spacing.
|
||||
// Keep the selected row's value below the list, with two bounded text lines.
|
||||
const tama=s.indexOf('static void tama_menu(void){');
|
||||
s=s.slice(0,tama)+`static void ko_detail(const char *s){
|
||||
rect(5,77,123,111,BG);
|
||||
char line[128];int n=0,y=80;line[0]=0;
|
||||
while(*s){int z=ko_pair(s)?2:1;if(n+z>=124)break;for(int j=0;j<z;j++)line[n+j]=s[j];line[n+z]=0;
|
||||
if(text_w(line,1)>108){line[n]=0;text(10,y,line,GREY,1);if(y>=95)return;y=95;n=0;continue;}
|
||||
n+=z;s+=z;
|
||||
}
|
||||
text(10,y,line,GREY,1);
|
||||
}
|
||||
`+s.slice(tama);
|
||||
const ta=s.indexOf('static void tama_menu(void){'),tb=s.indexOf(' show(); wait_release();',ta);
|
||||
let screen=s.slice(ta,tb);
|
||||
const labels=[...screen.matchAll(/big_entry\(\d+,sel==\d,("(?:\\.|[^"\\])*"),/g)].map(m=>m[1]);
|
||||
if(labels.length!==3)throw Error('Character settings layout changed');
|
||||
screen=screen.replace(/rect\(0,0,128,128,BG\); ctext\(2,("(?:\\.|[^"\\])*"),WHITE,1\);/,'ko_surface(); ctext(4,$1,RGB(255,255,255),1);');
|
||||
screen=screen.replace(/utoa_\(lv_get\(\),st\); big_entry\(12,sel==0,.*?,st,GOLD,GREY\);/,`for(u32 i=0;i<3;i++){int y=25+(int)i*18;ko_row(y-2,i==sel);text(14,y,i==0?${labels[0]}:i==1?${labels[1]}:${labels[2]},WHITE,1);}\n utoa_(lv_get(),st);if(sel==0)ko_detail(st);`);
|
||||
screen=screen.replace(/big_entry\(41,sel==1,.*?,nm,PINK,GREY\);/,'if(sel==1)ko_detail(nm);');
|
||||
screen=screen.replace(/big_entry\(70,sel==2,.*?,st,ORANGE,GREY\);/,'if(sel==2)ko_detail(st);');
|
||||
screen=screen.replace(/ctext\(119,("(?:\\.|[^"\\])*"),GREY,1\);/,'ctext(115,$1,RGB(255,255,255),1);');
|
||||
s=s.slice(0,ta)+screen+s.slice(tb);
|
||||
// The full name and growth stage appear in the picture screen; keep list rows uncluttered.
|
||||
s=s.replace('q<3){ right[q]=fn[q];','q<0){ right[q]=fn[q];');
|
||||
s=s.replace('fn=fname(f-1u); *col=fcol(f-1u);','fn=fname(f-1u); *col=WHITE;');
|
||||
|
||||
Reference in new issue
Block a user