// --------------------------------------------------------------------- string smopen() { string c=cmd.getid(); string p=cmd.getparms(); if (c=="edit") term->vieweditor(); if (c=="edit2") { if (note==0) return smerror("no edit window open"); note->on_winotherAct_triggered(); } if (c=="edit" || c=="edit2") return ""; if (c!="tab") { return smerror("unrecognized sm command: open " + c); } term->vieweditor(); if (p.empty()) note->newtemp(); else { QString f=s2q(smgetscript(p)); if (!cfexist(f)) return smerror("file not found: " + q2s(f)); note->fileopen(f); } rc=-1; return i2s(note->editIndex()); }
void gamefont_loadfont(int gf,int fi){ if (cfexist(font_conf[gf].font[fi].f.name)){ gamefont_unloadfont(gf); Gamefonts[gf]=gr_init_font(font_conf[gf].font[fi].f.name); }else { if (Gamefonts[gf]==NULL){ Gamefonts[gf]=gr_init_font(Gamefont_filenames_l[gf]); font_conf[gf].cur=-1; } return; } font_conf[gf].cur=fi; }
void gamefont_loadfont(int gf,int fi){ if (cfexist(font_conf[gf].font[fi].f.name)){ gamefont_unloadfont(gf); Gamefonts[gf]=gr_init_font(font_conf[gf].font[fi].f.name); }else { hud_message(MSGC_GAME_FEEDBACK,"Couldn't find font file %s!",font_conf[gf].font[fi].f.name); if (Gamefonts[gf]==NULL){ Gamefonts[gf]=gr_init_font(Gamefont_filenames_l[gf]); font_conf[gf].cur=-1; } return; } font_conf[gf].cur=fi; }
// --------------------------------------------------------------------- string smreplace() { string c=cmd.getid(); string p=cmd.getparms(); if (note==0 || note->editIndex()<0) return smerror ("No active edit window"); if (c!="edit") return smerror("unrecognized sm command: replace " + c); if (p.empty()) return smerror("replace needs 2 parameters: edit filename"); QString f=s2q(smgetscript(p)); if (!cfexist(f)) return smerror("file not found: " + q2s(f)); note->filereplace(f); return""; }
void addfontconf(int gf, int x, int y, char * fn){ int i; if (!cfexist(fn)) return; for (i=0;i<font_conf[gf].num;i++){ if (font_conf[gf].font[i].x==x && font_conf[gf].font[i].y==y){ if (i==font_conf[gf].cur) gamefont_unloadfont(gf); strcpy(font_conf[gf].font[i].f.name,fn); if (i==font_conf[gf].cur) gamefont_loadfont(gf,i); return; } } font_conf[gf].font[font_conf[gf].num].x=x; font_conf[gf].font[font_conf[gf].num].y=y; strcpy(font_conf[gf].font[font_conf[gf].num].f.name,fn); font_conf[gf].num++; }