void drawgamescreen_1p() { drawboard(1); refreshwin(0); if (game_paused) clearboard_paused(); else redrawboard(&player1, 19); drawpanel_1p(); print_top_scores(); print_tetr_stats(); refreshwin(WIN_PANEL); }
static void tetrom_colors_menu(int x, int y) { const char *menu[7] = {"I", "J", "L", "O", "S", "T", "Z"}; menuhandler handlers[7] = { op_tcolor, op_tcolor, op_tcolor, op_tcolor, op_tcolor_gt4, op_tcolor_gt4, op_tcolor_gt4 }; int i = 0; if (y+6 >= term_height) y -= 7; drawbox(x, y, 19, 6, (char *) 0); x++; y++; drawmenu(menu, 4, 0, x, y, handlers); drawmenu(menu+4, 3, -1, x+9, y, handlers+4); autorep_a_b_btns = 1; while (1) { setcurs(x, y+i%4); refreshwin(-1); switch (handle_menuitem_2cols(menu, 7, &i, 4, x, y+i%4, handlers, getkeypress_block(SINGLE_PL))) { case 0: case 2: autorep_a_b_btns = 0; if (i >= 4) x -= 9; clearbox(x-1, y-1, 19, 6); return; case 3: x += i>=4 ? 9 : -9; setcurs(x, y+i%4); printmenuitem(menu[i], 1); } } }
static int hiscore_entername_menu(char *name, const char **menu, int x, int y) { int pos = 0; int i = 0; int k; while (1) { drawmenu(menu, 2, i-2, x, y+2, NULL); textbox: setcurs(x, y); printtextbox(name, pos); movefwd(3); printsavebutton(!i && pos==7); if (!i) x += pos; setcurs(x, y+i); refreshwin(-1); autorep_a_b_btns = 1; k = getkeypress_block(SINGLE_PL) & 0xFF; autorep_a_b_btns = 0; if (k == ESC) return 0; if (!i) { x -= pos; switch (k) { case STARTBTN: return 1; case '\t': if (pos < 7) break; case MVDOWN: i = 2; continue; } pos = hiscore_editname(name, pos, k); goto textbox; } switch (k) { case STARTBTN: case A_BTN: if (i==2) return 2; case 'q': exit(0); case MVUP: i = i==2 ? 0 : 2; break; case '\t': i = i==2 ? 3 : 0; break; case MVDOWN: if (i < 3) i++; } if (!i && pos==7) { pos = 6; while (pos && name[pos-1]==' ') pos--; } } }
int dropdownlist(const char **items, int n, int i, int x, int y) { int w = getdropdownwidth(items, n); int j; while (is_outside_screen(0, y+n+1)) y--; setattr_standout(); drawbox(x, y, w+2, n+2, NULL); x++; y++; setcurs(x, y); for (j = 0; j < n; j++) { printdropdownitem(items[j], i==j, w); newln(x); } while (1) { setcurs(x-1, y+i); refreshwin(-1); switch (getkeypress_block(SINGLE_PL) & 0xFF) { case STARTBTN: case A_BTN: goto out; case 'q': exit(0); case MVUP: if (!i) continue; j = -1; break; case '\t': if (i == n-1) { j = -i; break; } case MVDOWN: if (i < n-1) { j = 1; break; } case MVRIGHT: continue; default: i = -1; goto out; } setcurs(x, y+i); printdropdownitem(items[i], 0, w); i += j; setcurs(x, y+i); printdropdownitem(items[i], 1, w); } out: clearbox(x-1, y-1, w+2, n+2); return i+1; }
void CWinMapEditor::warn_no_map() { CWinMsg* nw_msg; nw_msg = new CWinMsg; nw_msg->m_msg = msg[MY_MSG_SYS_NO_MAP].msg; nw_msg->setdefcpair(1, 0); nw_msg->startwin(true); delete(nw_msg); refreshwin(); drawwin(); }
bool CWinMapEditor::onkeypress_right() { chg_attr(m_cur.x - m_dpos.x, m_cur.y - m_dpos.y, WA_NORMAL); if (m_cur.x < m_dpos.x + COLS / 2 && m_cur.x < m_mapdata.width - 1){ m_cur.x++; // カーソル右 if (m_cur.x > m_dpos.x + COLS / 2 - 1) { m_dpos.x++; // 右スクロール refreshwin(); } } drawwin(); return true; // キーループ継続 }
bool CWinMapEditor::onkeypress_up() { chg_attr(m_cur.x - m_dpos.x, m_cur.y - m_dpos.y, WA_NORMAL); if (m_cur.y > 0){ m_cur.y--; // カーソル上げる if (m_cur.y < m_dpos.y) { m_dpos.y--; // 上スクロール refreshwin(); } } drawwin(); return true; // キーループ継続 }
bool CWinMapEditor::onkeypress_down() { chg_attr(m_cur.x - m_dpos.x, m_cur.y - m_dpos.y, WA_NORMAL); if (m_cur.y < m_dpos.y + LINES && m_cur.y < m_mapdata.height - 1){ m_cur.y++; // カーソル下げる if (m_cur.y > m_dpos.y + LINES - 1) { m_dpos.y++; // 下スクロール refreshwin(); } } drawwin(); return true; // キーループ継続 }
bool CWinMapEditor::onkeypress_left() { chg_attr(m_cur.x - m_dpos.x, m_cur.y - m_dpos.y, WA_NORMAL); if (m_cur.x > 0){ m_cur.x--; // カーソル左 if (m_cur.x < m_dpos.x) { m_dpos.x--; // 左スクロール refreshwin(); } } drawwin(); return true; // キーループ継続 }
void print_game_message(int pl, const char *str, int bold) { int x = board_x(pl, 4); int n = strlen(str); if (!(game->player[pl-1].rotationsys & ROT_LEFTHAND)) x--; while (n >= 6) { x--; n -= 2; } setwcurs(0, x, _HEIGHT_24L ? 7 : 3); setattr_normal(); if (bold) setcolorpair(MAGENTA_FG); printstr(str); refreshwin(0); }
int openmenu(const char **menu, int n, int i, int x, int y, menuhandler *handlers) { drawmenu(menu, n, i, x, y, handlers); while (1) { setcurs(x, y+i); refreshwin(-1); /* refresh active window */ switch (handle_menuitem(menu, n, &i, x, y+i, handlers, getkeypress_block(SINGLE_PL))) { case 0: return 0; case 2: return i+1; #if !NO_MENU case 3: return openmenu(menu, n, i, x, y, handlers); #endif } } }
static void print_tetr_stats() { const char letters[8] = "IJLOSTZ"; int sum = 0; int i; if (term_width < 45) return; setwcurs(WIN_TETROM_STATS, 1, 0); for (i = 0; i < 7; i++) { setblockcolor(tetrom_colors[i]); putch(block_chars[0]); putch(letters[i]); putch(block_chars[1]); setattr_normal(); printint(" %03d", tetr_stats[i]); newln(1); sum += tetr_stats[i]; } printstr(" -----"); newln(0); printint("Sum %04d", sum); refreshwin(WIN_TETROM_STATS); }
static void print_top_scores() { char s[8]; const struct hiscore *hs = hiscores; int pos = 0; int i = 1; if (term_width < 47 || !hs[0].score) return; setwcurs(WIN_TOP_SCORES, 0, 0); setcolorpair(MAGENTA_FG); printstr("Top Scores"); setattr_normal(); while (hs->score && i <= 5) { newln(0); if (!pos && player1.score > hs->score) { hiscoreline(); pos = 1; continue; } putch(i+'0'); putch('.'); if (hs->score < 1000000) putch(' '); sprintf(s, "%06ld", (long) hs->score); printstr(s); hs++; i++; } if (!pos) { newln(0); if (ishiscore()) hiscoreline(); else cleartoeol(); } refreshwin(WIN_TOP_SCORES); }
void inputsetup_menu(int pl, int x, int y) { const char *menu[11] = { " Up", "Dwn", "Lft", "Rgt", " A", " B", " Rotate ", " Rot cw ", NULL, "Harddrop", "Softdrop" }; char rot_acw[9] = " Rot acw"; int dev = 0; int i = 0; int xx, k; #ifdef JOYSTICK int devlist = num_joyst; if (devlist) { i = -1; setcurs(x, y); newln(x); y++; } #endif spellword(rot_acw+5); menu[8] = rot_acw; drawmenu(menu, 6, i, x, y, NULL); drawmenu(menu+6, 5, -1, x+12, y, NULL); #ifdef TWOPLAYER player_ = pl; #endif while (1) { #ifdef JOYSTICK if (devlist && i==-1) { if (!inp_devlist(&dev, x, y-1)) return; printmenuitem(menu[0], 1); i = 0; } #endif inp_printkeys(dev, x, y); xx = inp_setcurs(x, y, i); refreshwin(-1); k = setkeymapping(dev, inp_keypr(i)); #ifdef JOYSTICK if (devlist && (k==MVUP && !i || k=='\t' && i==10)) { printmenuitem(menu[i], 0); i = -1; continue; } #endif if (k==MVUP && !i) k = MVDOWN; else if (k==MVDOWN && i==10) { printmenuitem(menu[10], 0); inp_setcurs(x, y, i=0); printmenuitem(menu[0], 1); continue; } switch (handle_menuitem_2cols(menu, 11, &i, 6, xx, y+i%6, NULL, k)) { case 0: case 2: return; case 3: inp_setcurs(x, y, i); printmenuitem(menu[i], 1); } } }
void CWinMapEditor::keyloop() { timeout(-1); // キー入力で待つ CWinEditValue* nw_editvalue; CWinEditValue_Flg* nw_editvalue_flg; CWinEditValue_Tile* nw_editvalue_tile; CWinEditValue_Event* nw_editvalue_event; CWinEditValue_Pos* nw_editvalue_pos; CWinEditValue_Cmask* nw_editvalue_cmask; CWinSelect1Icon* nw_select1icon; CWinSelect1Item* nw_select1item; CWinMsg* nw_msg; CWinGetPath* nw_getpath; for( ; ; ) { int ch = wgetch(m_this); switch(ch) { case MYKEY_LEFT: if (!onkeypress_left()) return; break; case MYKEY_DOWN: if (!onkeypress_down()) return; break; case MYKEY_UP: if (!onkeypress_up()) return; break; case MYKEY_RIGHT: if (!onkeypress_right()) return; break; case 'a': // タイル追加 int tmp_copyid; if (m_data->get_flg(m_posdata[xyton(m_cur.x, m_cur.y)].flg) == true) tmp_copyid = m_posdata[xyton(m_cur.x, m_cur.y)].trueid; else tmp_copyid = m_posdata[xyton(m_cur.x, m_cur.y)].falseid; m_tiledata[m_tilenum] = m_tiledata[tmp_copyid]; m_tilenum++; // 追加完了メッセージ nw_msg = new CWinMsg; nw_msg->m_msg = msg[MY_MSG_SYS_ADD_TILE].msg; nw_msg->setdefcpair(1, 0); nw_msg->startwin(true); delete(nw_msg); refreshwin(); drawwin(); break; case 'b': // フラグビットエディタ int tmp_id, tmp_old_id, tmp_value, tmp_ret; tmp_id = 1; tmp_old_id = 1; for ( ; ; ) { nw_editvalue_flg = new CWinEditValue_Flg(m_data); tmp_value = m_data->get_flg(tmp_id); nw_editvalue_flg->push("ID", &tmp_id, TT_INT, 1); nw_editvalue_flg->push("Value ", &tmp_value, TT_INT, 1); nw_editvalue_flg->setsize(12, 5); tmp_ret = nw_editvalue_flg->startwin(true); delete(nw_editvalue_flg); if (tmp_id != tmp_old_id) { // IDが変更された if (tmp_id < 0) tmp_id = FLG_BITS * 32 - 1; if (tmp_id > FLG_BITS * 32 - 1) tmp_id = 0; tmp_old_id = tmp_id; continue; } // フラグ変更 m_data->set_flg(tmp_id, tmp_value); if (tmp_ret) break; } refreshwin(); drawwin(); break; case 'c': // コピー m_posbuf = m_posdata[xyton(m_cur.x, m_cur.y)]; break; case 'v': // ペースト m_posundobuf = m_posdata[xyton(m_cur.x, m_cur.y)]; if (m_posmsk.flg) m_posdata[xyton(m_cur.x, m_cur.y)].flg = m_posbuf.flg; if (m_posmsk.falseid) m_posdata[xyton(m_cur.x, m_cur.y)].falseid = m_posbuf.falseid; if (m_posmsk.trueid) m_posdata[xyton(m_cur.x, m_cur.y)].trueid = m_posbuf.trueid; if (m_posmsk.name) m_posdata[xyton(m_cur.x, m_cur.y)].name = m_posbuf.name; if (m_posmsk.enemy) m_posdata[xyton(m_cur.x, m_cur.y)].enemy = m_posbuf.enemy; if (m_posmsk.encount) m_posdata[xyton(m_cur.x, m_cur.y)].encount = m_posbuf.encount; refreshwin(); drawwin(); break; case 'u': // アンドゥ if (m_posmsk.flg) m_posdata[xyton(m_cur.x, m_cur.y)].flg = m_posundobuf.flg; if (m_posmsk.falseid) m_posdata[xyton(m_cur.x, m_cur.y)].falseid = m_posundobuf.falseid; if (m_posmsk.trueid) m_posdata[xyton(m_cur.x, m_cur.y)].trueid = m_posundobuf.trueid; if (m_posmsk.name) m_posdata[xyton(m_cur.x, m_cur.y)].name = m_posundobuf.name; if (m_posmsk.enemy) m_posdata[xyton(m_cur.x, m_cur.y)].enemy = m_posundobuf.enemy; if (m_posmsk.encount) m_posdata[xyton(m_cur.x, m_cur.y)].encount = m_posundobuf.encount; refreshwin(); drawwin(); break; case 'e': // イベントエディタ case 'f': // イベントエディタ if (m_mapdata.height > 0 && m_mapdata.width > 0) { // マップが存在した int tmp_id = 0; for ( ; ; ) { nw_editvalue_event = new CWinEditValue_Event; if (ch == 'e') { nw_editvalue_event->push("StopEvent:ID", &tmp_id, TT_INT, 1); nw_editvalue_event->push("StopEvent:FLG ", &m_sevent[tmp_id].flg, TT_INT, 1); nw_editvalue_event->push("StopEvent:FLG BIT ", &m_sevent[tmp_id].torf, TT_INT, 1); nw_editvalue_event->push("StopEvent:HEIGHT", &m_sevent[tmp_id].h, TT_INT, 1); nw_editvalue_event->push("StopEvent:EVENT NO", &m_sevent[tmp_id].event, TT_INT, 1); } else { nw_editvalue_event->push("PointEvent:ID ", &tmp_id, TT_INT, 1); nw_editvalue_event->push("PointEvent:FLG", &m_pevent[tmp_id].flg, TT_INT, 1); nw_editvalue_event->push("PointEvent:FLG BIT", &m_pevent[tmp_id].torf, TT_INT, 1); nw_editvalue_event->push("PointEvent:HEIGHT ", &m_pevent[tmp_id].h, TT_INT, 1); nw_editvalue_event->push("PointEvent:EVENT NO ",&m_pevent[tmp_id].event, TT_INT, 1); } int tmp_ret = nw_editvalue_event->startwin(true); delete(nw_editvalue_event); if (tmp_ret == 1) { // IDが変更された if (tmp_id < 0) tmp_id = MAX_MAPEVENT - 1; if (tmp_id > MAX_MAPEVENT - 1) tmp_id = 0; refreshwin(); drawwin(); } else { refreshwin(); drawwin(); break; } } } else { // マップが読み込まれていない警告 warn_no_map(); } break; case 'h': nw_msg = new CWinMsg; nw_msg->m_msg = "A:タイル追加nB:フラグビットエディタnC:コピーnV:ペーストnU:アンドゥnQ:コピーマスクエディタnE:イベントエディタnL:ロードnM:マップ情報エディタnN:地名エディタnP:パレット表示nT:タイルエディタnS:スペシャルポジションエディタnX:ポジションエディタnZ:セーブ終了"; nw_msg->setsize(20,16); nw_msg->startwin(true); delete(nw_msg); refreshwin(); drawwin(); break; case 'l': // マップ番号を入力する nw_getpath = new CWinGetPath; nw_getpath->settitle(std::string(msg[MY_MSG_SYS_INP_MAPNO].msg)); m_path = nw_getpath->startdialog(true); m_path = "data/qwert123/map/" + m_path; delete(nw_getpath); // マップサイズ、NextMapを取得 m_mapdata = m_file->get_map_size(m_path); if (m_mapdata.height > 0 && m_mapdata.width > 0) { // 以前のポジションテーブルがあれば、まず破棄する if (m_posdata != NULL) delete[] m_posdata; // ポジションテーブル再生成 m_posdata = new PosData[m_mapdata.height * m_mapdata.width]; // マップの中身を読み込み m_tilenum = m_file->read_map(m_path, &m_mapdata, m_posdata, m_spposdata, m_tiledata, m_pevent, m_sevent, m_fieldname); } m_cur.x = 1; m_cur.y = 1; refreshwin(); drawwin(); break; case 'm': // マップ情報エディタ nw_editvalue = new CWinEditValue; nw_editvalue->push("NEXTMAP 上", &m_mapdata.nextmap_u, TT_INT, 1); nw_editvalue->push("NEXTMAP 下", &m_mapdata.nextmap_d, TT_INT, 1); nw_editvalue->push("NEXTMAP 左", &m_mapdata.nextmap_l, TT_INT, 1); nw_editvalue->push("NEXTMAP 右", &m_mapdata.nextmap_r, TT_INT, 1); nw_editvalue->startwin(true); delete(nw_editvalue); refreshwin(); drawwin(); break; case 'n': // 地名エディタ nw_editvalue = new CWinEditValue; char tmp_str[4]; for (int i = 0; i < MAX_FNAME; i++) { sprintf(tmp_str, "%02d", i); nw_editvalue->push(std::string(tmp_str), &m_fieldname[i], TT_STR, 1); } nw_editvalue->startwin(true); delete(nw_editvalue); refreshwin(); drawwin(); break; case 'p': // パレット表示 if (m_mapdata.height > 0 && m_mapdata.width > 0) { // マップが存在した nw_select1icon = new CWinSelect1Icon; nw_select1icon->setsize(10, 10); for (int i = 0; i < COLOR_NUM * COLOR_NUM; i++) { nw_select1icon->m_cols = 8; nw_select1icon->push("● ", i, i); } nw_select1icon->startwin(true); delete(nw_select1icon); refreshwin(); drawwin(); } else { // マップが読み込まれていない警告 warn_no_map(); } break; case 'q': // コピーマスクエディタ for ( ; ; ) { nw_editvalue_cmask = new CWinEditValue_Cmask(); nw_editvalue_cmask->push("FLG ", &m_posmsk.flg, TT_INT, 1); nw_editvalue_cmask->push("FALSE ID", &m_posmsk.falseid, TT_INT, 1); nw_editvalue_cmask->push("TRUE ID", &m_posmsk.trueid, TT_INT, 1); nw_editvalue_cmask->push("NAME", &m_posmsk.name, TT_STR, 1); nw_editvalue_cmask->push("ENEMY ", &m_posmsk.enemy, TT_INT, 1); nw_editvalue_cmask->push("ENCOUNT ", &m_posmsk.encount, TT_INT, 1); nw_editvalue_cmask->setsize(20, 8); tmp_ret = nw_editvalue_cmask->startwin(true); delete(nw_editvalue_cmask); if (!tmp_ret) break; } refreshwin(); drawwin(); break; case 't': // タイルエディタ if (m_mapdata.height > 0 && m_mapdata.width > 0) { // マップが存在した int tmp_id = gettile(m_cur.x, m_cur.y); for ( ; ; ) { nw_editvalue_tile = new CWinEditValue_Tile; nw_editvalue_tile->push("FALSE ID", &tmp_id, TT_INT, 1); nw_editvalue_tile->push("FALSE CHAR", &m_tiledata[tmp_id].tile, TT_STR, 1, getcpair(m_tiledata[tmp_id].ch, m_tiledata[tmp_id].bg)); nw_editvalue_tile->push("FALSE CH", &m_tiledata[tmp_id].ch, TT_INT, 1, getcpair(m_tiledata[tmp_id].ch, 0)); nw_editvalue_tile->push("FALSE BG", &m_tiledata[tmp_id].bg, TT_INT, 1, getcpair(m_tiledata[tmp_id].bg, 0)); nw_editvalue_tile->push("FALSE ATTR", &m_tiledata[tmp_id].attr, TT_INT, 1); nw_editvalue_tile->push("FALSE HEIGHT", &m_tiledata[tmp_id].height, TT_INT, 1); nw_editvalue_tile->push("FALSE MOVE", &m_tiledata[tmp_id].move, TT_INT, 1); int tmp_ret_id = nw_editvalue_tile->startwin(true); delete(nw_editvalue_tile); if (tmp_ret_id == 1) { // タイルが変更された if (tmp_id < 0) tmp_id = m_tilenum - 1; if (tmp_id > m_tilenum - 1) tmp_id = 0; refreshpos(m_cur.x, m_cur.y); drawwin(); } else { refreshwin(); drawwin(); break; } } } else { // マップが読み込まれていない警告 warn_no_map(); } break; case 's': // スペシャルポジションデータエディタ case 'x': // ポジションデータエディタ if (m_mapdata.height > 0 && m_mapdata.width > 0) { // マップが存在した PosData* tmp_posdata; int posi = -1; for ( ; ; ) { if (ch == 'x') { posi = xyton(m_cur.x, m_cur.y); tmp_posdata = &m_posdata[posi]; } else { if (posi == -1) { nw_getpath = new CWinGetPath(); nw_getpath->settitle(std::string(msg[MY_MSG_SYS_INP_SPOS].msg)); std::string spos = nw_getpath->startdialog(true); delete(nw_getpath); posi = atoi(spos.c_str()); if (posi < 0 || posi >= MAX_SPPOS) { posi = -1; continue; } tmp_posdata = &m_spposdata[posi]; } } nw_editvalue_pos = new CWinEditValue_Pos; // 参照フラグ nw_editvalue_pos->push("FLAG", &tmp_posdata->flg, TT_INT, 1); nw_editvalue_pos->push("FALSE ID", &tmp_posdata->falseid, TT_INT, 1); nw_editvalue_pos->push("TRUE ID", &tmp_posdata->trueid, TT_INT, 1); nw_editvalue_pos->push("F NAME", &tmp_posdata->name, TT_INT, 1); nw_editvalue_pos->push("ENEMY ", &tmp_posdata->enemy, TT_INT, 1); nw_editvalue_pos->push("ENCOUNT ", &tmp_posdata->encount, TT_INT, 1); nw_editvalue_pos->push("--------------", NULL, TT_SPC, 1); if (tmp_posdata->falseid >= 100000) nw_editvalue_pos->push("FALSE CHAR", &tmp_posdata->falseid, TT_INT, 1); else nw_editvalue_pos->push("FALSE CHAR", &m_tiledata[tmp_posdata->falseid].tile, TT_STR, 1, getcpair(m_tiledata[tmp_posdata->falseid].ch, m_tiledata[tmp_posdata->falseid].bg)); if (tmp_posdata->trueid >= 100000) nw_editvalue_pos->push("TRUE CHAR", &tmp_posdata->trueid, TT_INT, 1); else nw_editvalue_pos->push("TRUE CHAR", &m_tiledata[tmp_posdata->trueid ].tile, TT_STR, 1, getcpair(m_tiledata[tmp_posdata->trueid ].ch, m_tiledata[tmp_posdata->trueid ].bg)); nw_editvalue_pos->push("F NAMESTR ", &m_fieldname[(int)tmp_posdata->name], TT_STR, 1); int tmp_ret = nw_editvalue_pos->startwin(true); delete(nw_editvalue_pos); if (tmp_ret == 1) { // Falseタイルが変更された if (tmp_posdata->falseid == 99999) tmp_posdata->falseid = 100000 + MAX_SPPOS - 1; else if (tmp_posdata->falseid > 100000 + MAX_SPPOS - 1) tmp_posdata->falseid = 100000; else if (tmp_posdata->falseid >= 100000) ; else if (tmp_posdata->falseid < 0) tmp_posdata->falseid = m_tilenum - 1; else if (tmp_posdata->falseid > m_tilenum - 1) tmp_posdata->falseid = 0; refreshpos(m_cur.x, m_cur.y); drawwin(); } else if (tmp_ret == 2) { // Trueタイルが変更された if (tmp_posdata->trueid == 99999) tmp_posdata->trueid = 100000 + MAX_SPPOS - 1; else if (tmp_posdata->trueid > 100000 + MAX_SPPOS - 1) tmp_posdata->trueid = 100000; else if (tmp_posdata->trueid >= 100000) ; else if (tmp_posdata->trueid < 0) tmp_posdata->trueid = m_tilenum - 1; else if (tmp_posdata->trueid > m_tilenum - 1) tmp_posdata->trueid = 0; refreshpos(m_cur.x, m_cur.y); drawwin(); } else { refreshwin(); drawwin(); break; } } } else { // マップが読み込まれていない警告 warn_no_map(); } break; case 'z': // マップの中身を書き出し if (m_mapdata.height > 0 && m_mapdata.width > 0) { nw_select1item = new CWinSelect1Item; nw_select1item->setsize(20, 5); nw_select1item->m_msg = msg[MY_MSG_SYS_SAVE_YN].msg; nw_select1item->m_split = 2; nw_select1item->m_wpos.y = 3; nw_select1item->push(msg[MY_MSG_SYS_YES].msg, 1); nw_select1item->push(msg[MY_MSG_SYS_NO].msg, 2); int tmp_ret = nw_select1item->startwin(true); delete(nw_select1item); if (tmp_ret == 1) { m_file->write_map( m_path, &m_mapdata, m_posdata, m_spposdata, m_tiledata, m_pevent, m_sevent, m_fieldname, m_tilenum ); return; } else if (tmp_ret == 2) { return; } } refreshwin(); drawwin(); break; default: continue; break; } } }