comparison scn2k/scn2k_text.cc @ 65:4416cfac86ae

Convert EUC-JP files to UTF8
author Thibaut Girka <thib@sitedethib.com>
date Fri, 26 Nov 2010 10:53:15 +0100
parents 36d92d21300f
children d112357a0ec1
comparison
equal deleted inserted replaced
64:045ca45f9610 65:4416cfac86ae
1 /* 1 /*
2 TODO: 2 TODO:
3 日付のラベルが画面切り替え時に欠けるのを修正 3 ヤ脂√帥罨篆罩
4 画像効果 : 人間の入れ換わりなど 4 糸号 : 篋咲ャ
5 kcursor の操作を WidText クラスに任せる 5 kcursor 篏 WidText 鴻篁祉
6 WidText クラスには新たに以下の操作を加える 6 WidText 鴻違篁ヤ篏
7 ・ウェイト終了後、クリアなしに新たなテキストを追加、新たにstart-waitする 7 祉сゃ腟篋緇≪違鴻菴遵違start-wait
8 ・文字の描画 (Start) と Wait(カーソル表示待ち)の分離。 8 紙絖 (Start) Wait(若純茵腓阪)≪
9 Start すると文字を描画開始する。クリックで全描画。 9 Start 絖脂紮у祉
10 Flush するとバッファ内の文字をすべて描画する 10 Flush ≦絖鴻祉
11 Wait すると全描画後、クリックされるまでカーソルを表示するまで待つ 11 Wait 糸障с若純茵腓冴障у
12 Text 側の状態としては Wait のみを持つ (PREPAREに戻るのを待つ) 12 Text 眼倶 Wait 帥 (PREPARE祉緇)
13 ただし、Skip の権利はどっちがもつ?(現状は?) 13 Skip 罔c<わ鐚憟吟鐚鐚
14 14
15 GrpObj: NextObj と GrpObj を分離。CreateObj は現状通り、Visible=1 時に行う。 15 GrpObj: NextObj GrpObj ≪CreateObj 憟狗Visible=1 茵
16 それぞれ num=0 (screen) の枝leaf として実装。delete時は親のdeleteのみを 16 num=0 (screen) leaf 絎茖delete荀delete帥
17 行い、子はGrpObjの実体だけを削除する 17 茵絖GrpObj絎篏ゃ
18 Visible 後のhide は実際に hide とする 18 Visible 緇hide 絎 hide
19 ExecReservedCmd() はなくせるはず。Delete() もなくなる。 19 ExecReservedCmd() Delete()
20 カノギ:ReBlit() がうまくいかないせいで名前ウィンドウが消えた時の背景がなくなる 20 鐚ReBlit() 障уc潟羔
21 21
22 くら:回想表示 22 鐚活;腓
23 SEL画像効果 23 SEL糸号
24 DONE: 24 DONE:
25 ともよのテキストウィンドウ実装、ボタン実装 25 鴻c潟絎茖帥喝茖
26 shake の画像効果 26 shake 糸号
27 オブジェクト内のテキスト色の実装 27 吾с鴻蚊絎茖
28 画像効果の改善 28 糸号劫
29 */ 29 */
30 30
31 /* 31 /*
32 * Copyright (c) 2004-2006 Kazunori "jagarl" Ueno 32 * Copyright (c) 2004-2006 Kazunori "jagarl" Ueno
33 * All rights reserved. 33 * All rights reserved.
228 t->status = Status(WAIT_SELECT_VALUE + sel); 228 t->status = Status(WAIT_SELECT_VALUE + sel);
229 } 229 }
230 230
231 void Text::SetSkipMode(SkipMode _mode) { 231 void Text::SetSkipMode(SkipMode _mode) {
232 if ( (skip_mode & SKIP_IN_MENU) && (_mode & SKIP_IN_MENU) == 0) { 232 if ( (skip_mode & SKIP_IN_MENU) && (_mode & SKIP_IN_MENU) == 0) {
233 if (status_mask & BACKLOG_WAIT_MASK) { // backlog mode から復帰 233 if (status_mask & BACKLOG_WAIT_MASK) { // backlog mode 緇絽
234 status_mask = Status(status_mask & (~(BACKLOG_MASK|BACKLOG_MASK_FWD|BACKLOG_MASK_KOE|BACKLOG_WAIT_MASK))); 234 status_mask = Status(status_mask & (~(BACKLOG_MASK|BACKLOG_MASK_FWD|BACKLOG_MASK_KOE|BACKLOG_WAIT_MASK)));
235 text->wid->Clear(); 235 text->wid->Clear();
236 if (status == WAIT_TEXT && text != NULL) { 236 if (status == WAIT_TEXT && text != NULL) {
237 text->StartText(text_stream); 237 text->StartText(text_stream);
238 text->ShowFace(backlog_item.face.c_str()); 238 text->ShowFace(backlog_item.face.c_str());
276 char buf[1024]; 276 char buf[1024];
277 sprintf(buf, "#NAME.%c", i+'A'); 277 sprintf(buf, "#NAME.%c", i+'A');
278 const char* s = config->GetParaStr(buf); 278 const char* s = config->GetParaStr(buf);
279 if (s != NULL) replace_name[i] = s; 279 if (s != NULL) replace_name[i] = s;
280 } 280 }
281 // replace_name2 : 初期設定 281 // replace_name2 : 荐絎
282 // 渚、秋生、渚 (CLANNAD) 282 // 羝腱羝 (CLANNAD)
283 char name_nagisa[3] = {'\x8f', '\x8d', '\0'}; 283 char name_nagisa[3] = {'\x8f', '\x8d', '\0'};
284 char name_akio[5] = {'\x8f', '\x48', '\x90', '\xb6', '\0'}; 284 char name_akio[5] = {'\x8f', '\x48', '\x90', '\xb6', '\0'};
285 replace_name2[0] = name_nagisa; 285 replace_name2[0] = name_nagisa;
286 replace_name2[1] = name_akio; 286 replace_name2[1] = name_akio;
287 replace_name2[2] = name_nagisa; 287 replace_name2[2] = name_nagisa;
288 text = NULL; 288 text = NULL;
289 /* テキスト速度の設定 */ 289 /* 鴻綺荐絎 */
290 int speed, mod, wait, auto_mod; 290 int speed, mod, wait, auto_mod;
291 config->GetParam("#INIT_MESSAGE_SPEED", 1, &speed); 291 config->GetParam("#INIT_MESSAGE_SPEED", 1, &speed);
292 config->GetParam("#INIT_MESSAGE_SPEED_MOD", 1, &mod); 292 config->GetParam("#INIT_MESSAGE_SPEED_MOD", 1, &mod);
293 config->GetParam("#MESSAGE_KEY_WAIT_USE", 1, &auto_mod); 293 config->GetParam("#MESSAGE_KEY_WAIT_USE", 1, &auto_mod);
294 config->GetParam("#MESSAGE_KEY_WAIT_TIME", 1, &wait); 294 config->GetParam("#MESSAGE_KEY_WAIT_TIME", 1, &wait);
362 buflen += snprintf(buf+buflen, 1000-buflen, ",%c", 'A'+face_num); 362 buflen += snprintf(buf+buflen, 1000-buflen, ",%c", 'A'+face_num);
363 else 363 else
364 buflen += snprintf(buf+buflen, 1000-buflen, ",\"%s\"", it->face.c_str()); 364 buflen += snprintf(buf+buflen, 1000-buflen, ",\"%s\"", it->face.c_str());
365 } 365 }
366 buf[buflen++] = '\0'; 366 buf[buflen++] = '\0';
367 if (buflen >= 1000) { // 万が一、バックログ1アイテムの大きさが 1000byte を越えるとき 367 if (buflen >= 1000) { // 筝筝逸≪ゃ紊с 1000byte 莇
368 fprintf(stderr,"Fatal : Cannot save backlog crrectly; Please send bug report to the author.\n"); 368 fprintf(stderr,"Fatal : Cannot save backlog crrectly; Please send bug report to the author.\n");
369 } else str += buf; 369 } else str += buf;
370 } 370 }
371 str += "\n"; 371 str += "\n";
372 } while(it != backlog.end()); 372 } while(it != backlog.end());
482 new_backlog.push_back(item); 482 new_backlog.push_back(item);
483 } 483 }
484 } 484 }
485 } while (*strend != 0); 485 } while (*strend != 0);
486 } 486 }
487 if (new_backlog.empty() && (!backlog.empty())) { // empty なら save_selectcount まで backlog を巻き戻す 487 if (new_backlog.empty() && (!backlog.empty())) { // empty save_selectcount 障 backlog 綏祉祉
488 vector<BacklogItem>::iterator it = backlog.end(); 488 vector<BacklogItem>::iterator it = backlog.end();
489 do { 489 do {
490 it--; 490 it--;
491 if (it->scn == BacklogItem::SaveSelect && it->pos == save_selectcount) { 491 if (it->scn == BacklogItem::SaveSelect && it->pos == save_selectcount) {
492 // Save 位置を見つけたらそれ以降を erase 492 // Save 篏臀荀ゃ篁ラ erase
493 backlog.erase(it, backlog.end()); 493 backlog.erase(it, backlog.end());
494 break; 494 break;
495 } 495 }
496 } while(it != backlog.begin()); 496 } while(it != backlog.begin());
497 --save_selectcount; 497 --save_selectcount;
518 if (kcursor) { 518 if (kcursor) {
519 int kx, ky, d; 519 int kx, ky, d;
520 char key[1024]; 520 char key[1024];
521 sprintf(key, "#WINDOW.%03d.KEYCUR_MOD", text_window_number); 521 sprintf(key, "#WINDOW.%03d.KEYCUR_MOD", text_window_number);
522 config->GetParam(key, 3, &d, &kx, &ky); 522 config->GetParam(key, 3, &d, &kx, &ky);
523 // 正しくない気がする 523 // 罩c羂
524 kx += text->wid->Pic()->PosX(); 524 kx += text->wid->Pic()->PosX();
525 ky += text->wid->Pic()->PosY(); 525 ky += text->wid->Pic()->PosY();
526 // 微妙に下にする 526 // 緇絋筝
527 ky += 8; 527 ky += 8;
528 kcursor->Pic()->Move(kx, ky); 528 kcursor->Pic()->Move(kx, ky);
529 } 529 }
530 } 530 }
531 531
533 show(); 533 show();
534 text->wid->deactivate(); 534 text->wid->deactivate();
535 status_mask = Status(status_mask | BACKLOG_WAIT_MASK); 535 status_mask = Status(status_mask | BACKLOG_WAIT_MASK);
536 drawn_backlog_item = item; 536 drawn_backlog_item = item;
537 if (item.text.container.empty()) { 537 if (item.text.container.empty()) {
538 // cmd から text 内容を再構成 538 // cmd text 絎鴻罕
539 TextStream saved_text = text_stream; 539 TextStream saved_text = text_stream;
540 text_stream.Clear(); 540 text_stream.Clear();
541 AddText(cmd.Str(cmd.args[0])); 541 AddText(cmd.Str(cmd.args[0]));
542 item.text = text_stream; 542 item.text = text_stream;
543 text_stream = saved_text; 543 text_stream = saved_text;
580 if (cmd.cmd3 == 1) config->GetParam(key, 1, &sel_type); 580 if (cmd.cmd3 == 1) config->GetParam(key, 1, &sel_type);
581 else if (cmd.cmd3 == 3) sel_type = 0; 581 else if (cmd.cmd3 == 3) sel_type = 0;
582 582
583 int sel_size = cmd.args.size() / 2; 583 int sel_size = cmd.args.size() / 2;
584 int i; 584 int i;
585 // cur_backlog_item に次にbacklogに入るべき内容を作成 585 // cur_backlog_item 罨<backlogャ鴻絎鴻篏
586 // CreateSelect() 後、SAVEPOINT なので現在のbacklogの内容(前のメッセージ)が 586 // CreateSelect() 緇SAVEPOINT х憜backlog絎(<祉若)
587 // backlog に代入される。その後、backlog_item に cur_backlog_item の内容がセットされる(Wait()内) 587 // backlog 篁eャ緇backlog_item cur_backlog_item 絎鴻祉(Wait())
588 char backlog_sel_text[11] = {0x81,0x69,0x91,0x49,0x91,0xf0,0x8e,0x88,0x81,0x6a,0x00}; 588 char backlog_sel_text[11] = {0x81,0x69,0x91,0x49,0x91,0xf0,0x8e,0x88,0x81,0x6a,0x00};
589 cur_backlog_item.Clear(); 589 cur_backlog_item.Clear();
590 cur_backlog_item.AddTextPos(cmd); 590 cur_backlog_item.AddTextPos(cmd);
591 cur_backlog_item.text.Add(backlog_sel_text); 591 cur_backlog_item.text.Add(backlog_sel_text);
592 cur_backlog_item.text.AddReturn(); 592 cur_backlog_item.text.AddReturn();
596 cur_backlog_item.text.Add(cmd.Str(cmd.args[i*2])); 596 cur_backlog_item.text.Add(cmd.Str(cmd.args[i*2]));
597 cur_backlog_item.text.AddReturn(); 597 cur_backlog_item.text.AddReturn();
598 } 598 }
599 sel_backlog_pos.push_back(cur_backlog_item.text.container.size()); 599 sel_backlog_pos.push_back(cur_backlog_item.text.container.size());
600 600
601 if (sel_type == 0) { // Princess Bride: 選択ウィンドウを別表示 601 if (sel_type == 0) { // Princess Bride: 御c潟ヨ;腓
602 External_select: 602 External_select:
603 CreateSelBG(); 603 CreateSelBG();
604 hide(); // なので、テキストウィンドウは消去 604 hide(); // с鴻c潟羔サ
605 int baseposx, baseposy, repposx, repposy, centerx, centery; 605 int baseposx, baseposy, repposx, repposy, centerx, centery;
606 int mojisize, col1, col2; 606 int mojisize, col1, col2;
607 config->GetParam("#SELBTN.000.CENTERING", 2, &centerx, &centery); 607 config->GetParam("#SELBTN.000.CENTERING", 2, &centerx, &centery);
608 config->GetParam("#SELBTN.000.BASEPOS", 2, &baseposx, &baseposy); 608 config->GetParam("#SELBTN.000.BASEPOS", 2, &baseposx, &baseposy);
609 config->GetParam("#SELBTN.000.REPPOS", 2, &repposx, &repposy); 609 config->GetParam("#SELBTN.000.REPPOS", 2, &repposx, &repposy);
610 config->GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize); 610 config->GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize);
611 config->GetParam("#SELBTN.000.MOJIDEFAULTCOL", 1, &col1); 611 config->GetParam("#SELBTN.000.MOJIDEFAULTCOL", 1, &col1);
612 config->GetParam("#SELBTN.000.MOJISELECTCOL", 1, &col2); 612 config->GetParam("#SELBTN.000.MOJISELECTCOL", 1, &col2);
613 if (col1 == col2) col2 = 1; // CLANNAD でとりあえず。 613 if (col1 == col2) col2 = 1; // CLANNAD с
614 int r, g, b; 614 int r, g, b;
615 sprintf(key, "#COLOR_TABLE.%03d", col1); 615 sprintf(key, "#COLOR_TABLE.%03d", col1);
616 config->GetParam(key, 3, &r, &g, &b); 616 config->GetParam(key, 3, &r, &g, &b);
617 Color fore(r,g,b); 617 Color fore(r,g,b);
618 sprintf(key, "#COLOR_TABLE.%03d", col2); 618 sprintf(key, "#COLOR_TABLE.%03d", col2);
619 config->GetParam(key, 3, &r, &g, &b); 619 config->GetParam(key, 3, &r, &g, &b);
620 Color seled(r,g,b); 620 Color seled(r,g,b);
621 621
622 /* ウィジット作成 */ 622 /* c吾篏 */
623 /* ウィンドウ背景の大きさを求める */ 623 /* c潟紊с羆 */
624 if (baseposx == 0 && sel_bg_rect.width() != 0) 624 if (baseposx == 0 && sel_bg_rect.width() != 0)
625 baseposx = (parent.Width()-sel_bg_rect.width()) / 2; // ボタン位置をセンタリング 625 baseposx = (parent.Width()-sel_bg_rect.width()) / 2; // 帥割臀祉潟帥潟
626 if (centerx) 626 if (centerx)
627 baseposx = (parent.Width()-sel_bg_rect.width()-sel_size*repposx) / 2; 627 baseposx = (parent.Width()-sel_bg_rect.width()-sel_size*repposx) / 2;
628 if (centery) 628 if (centery)
629 baseposy = (parent.Height()-sel_bg_rect.height()-sel_size*repposy) / 2; 629 baseposy = (parent.Height()-sel_bg_rect.height()-sel_size*repposy) / 2;
630 630
631 sel_widget = parent.create_node( Rect(0, 0, parent.Width(), parent.Height()),0); 631 sel_widget = parent.create_node( Rect(0, 0, parent.Width(), parent.Height()),0);
632 632
633 for (i=0; i<sel_size; i++) { 633 for (i=0; i<sel_size; i++) {
634 PicBase* p; 634 PicBase* p;
635 // 背景作成 635 // 篏
636 if (sel_bg2) { 636 if (sel_bg2) {
637 p = sel_widget->create_node(Rect(baseposx, baseposy, baseposx+sel_bg_rect.width(), baseposy+sel_bg_rect.height()),0); 637 p = sel_widget->create_node(Rect(baseposx, baseposy, baseposx+sel_bg_rect.width(), baseposy+sel_bg_rect.height()),0);
638 p->SetSurface(sel_bg2, 0, 0); 638 p->SetSurface(sel_bg2, 0, 0);
639 } 639 }
640 if (sel_bg1) { 640 if (sel_bg1) {
641 p = sel_widget->create_node(Rect(baseposx, baseposy, baseposx+sel_bg_rect.width(), baseposy+sel_bg_rect.height()),0); 641 p = sel_widget->create_node(Rect(baseposx, baseposy, baseposx+sel_bg_rect.width(), baseposy+sel_bg_rect.height()),0);
642 p->SetSurface(sel_bg1, 0, 0); 642 p->SetSurface(sel_bg1, 0, 0);
643 } 643 }
644 /* ボタン作成 */ 644 /* 帥割 */
645 const char* str = cmd.Str(cmd.args[i*2]); 645 const char* str = cmd.Str(cmd.args[i*2]);
646 int value = cmd.args[i*2+1].value; 646 int value = cmd.args[i*2+1].value;
647 while(selects.size() <= value) selects.push_back(0); // vector の大きさを広げる 647 while(selects.size() <= value) selects.push_back(0); // vector 紊с綺
648 648
649 kconv( (const unsigned char*)str, (unsigned char*)key); 649 kconv( (const unsigned char*)str, (unsigned char*)key);
650 selects[value] = new WidTextButton(event, sel_widget, key, mojisize, WidTextButton::CENTER, 650 selects[value] = new WidTextButton(event, sel_widget, key, mojisize, WidTextButton::CENTER,
651 Rect(baseposx, baseposy, baseposx+sel_bg_rect.width(), baseposy+sel_bg_rect.height()), 1, fore, seled, Color(0,0,0,0)); 651 Rect(baseposx, baseposy, baseposx+sel_bg_rect.width(), baseposy+sel_bg_rect.height()), 1, fore, seled, Color(0,0,0,0));
652 selects[value]->press_func = &PressFuncButton; 652 selects[value]->press_func = &PressFuncButton;
655 baseposx += repposx; 655 baseposx += repposx;
656 baseposy += repposy; 656 baseposy += repposy;
657 } 657 }
658 sel_widget->show_all(); 658 sel_widget->show_all();
659 status = WAIT_SELECT_OUTBOX; 659 status = WAIT_SELECT_OUTBOX;
660 } else { // CLANNAD: テキストウィンドウ内に選択肢表示 660 } else { // CLANNAD: 鴻c潟御∵;腓
661 int mojisize; 661 int mojisize;
662 config->GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize); 662 config->GetParam("#SELBTN.000.MOJISIZE", 1, &mojisize);
663 Color fore(0xff,0xff,0xff); 663 Color fore(0xff,0xff,0xff);
664 Color seled(0xff,0xff,0xff); 664 Color seled(0xff,0xff,0xff);
665 665
666 show(); 666 show();
667 if (text == NULL) goto External_select; // テキスト・ウィンドウを表示できなければ外部選択肢にする 667 if (text == NULL) goto External_select; // 鴻祉c潟茵腓冴с医御≪
668 text->wid->Clear(); 668 text->wid->Clear();
669 if (kcursor) kcursor->hide(); 669 if (kcursor) kcursor->hide();
670 /* ウィジット作成 : テキスト表示範囲と同じ*/ 670 /* c吾篏 : 鴻茵腓榊蚊*/
671 int posx = text->wid->pictext->PosX(); 671 int posx = text->wid->pictext->PosX();
672 int posy = text->wid->pictext->PosY(); 672 int posy = text->wid->pictext->PosY();
673 int sel_w = text->wid->pictext->Width(); 673 int sel_w = text->wid->pictext->Width();
674 int sel_h = text->wid->pictext->Height(); 674 int sel_h = text->wid->pictext->Height();
675 sel_widget = text->wid->PicNode()->create_node(Rect(posx, posy, posx+sel_w, posy+sel_h), 0); 675 sel_widget = text->wid->PicNode()->create_node(Rect(posx, posy, posx+sel_w, posy+sel_h), 0);
676 676
677 int sel_y = 0; 677 int sel_y = 0;
678 for (i=0; i<sel_size; i++) { 678 for (i=0; i<sel_size; i++) {
679 /* ボタン作成 */ 679 /* 帥割 */
680 const char* str = cmd.Str(cmd.args[i*2]); 680 const char* str = cmd.Str(cmd.args[i*2]);
681 int value = cmd.args[i*2+1].value; 681 int value = cmd.args[i*2+1].value;
682 while(selects.size() <= value) selects.push_back(0); // vector の大きさを広げる 682 while(selects.size() <= value) selects.push_back(0); // vector 紊с綺
683 683
684 kconv( (const unsigned char*)str, (unsigned char*)key); 684 kconv( (const unsigned char*)str, (unsigned char*)key);
685 selects[value] = new WidTextButton(event, sel_widget, key, mojisize, WidTextButton::Attribute(WidTextButton::REVERSE | WidTextButton::NOPADDING), 685 selects[value] = new WidTextButton(event, sel_widget, key, mojisize, WidTextButton::Attribute(WidTextButton::REVERSE | WidTextButton::NOPADDING),
686 Rect(0, sel_y, sel_w, sel_y), 1, fore, seled, Color(0,0,0,0)); 686 Rect(0, sel_y, sel_w, sel_y), 1, fore, seled, Color(0,0,0,0));
687 selects[value]->press_func = &PressFuncButton; 687 selects[value]->press_func = &PressFuncButton;
695 } 695 }
696 696
697 void Text::AddText(const char* str_o) { 697 void Text::AddText(const char* str_o) {
698 char str[10001]; 698 char str[10001];
699 if (text == NULL) return; 699 if (text == NULL) return;
700 /* まず、replace string を変換 */ 700 /* 障replace string 紊 */
701 int i; 701 int i;
702 int cnt = 0; 702 int cnt = 0;
703 /* * = 81 96 A-Z = 0x82 [0x60-0x79] */ 703 /* 鐚 = 81 96 A-Z = 0x82 [0x60-0x79] */
704 /* % = 81 93 A-Z = 0x82 [0x60-0x79] */ 704 /* 鐚 = 81 93 A-Z = 0x82 [0x60-0x79] */
705 for (i=0; cnt<10000 && str_o[i] != 0; i++) { 705 for (i=0; cnt<10000 && str_o[i] != 0; i++) {
706 if (str_o[i] < 0) { 706 if (str_o[i] < 0) {
707 if ( (unsigned char)str_o[i] == 0x81 && (unsigned char)str_o[i+1] == 0x96 && (unsigned char)str_o[i+2] == 0x82) { 707 if ( (unsigned char)str_o[i] == 0x81 && (unsigned char)str_o[i+1] == 0x96 && (unsigned char)str_o[i+2] == 0x82) {
708 int c = str_o[i+3]; 708 int c = str_o[i+3];
709 if (c >= 0x60 && c <= 0x79 && replace_name[c-0x60].length() != 0) { // 名前変換 709 if (c >= 0x60 && c <= 0x79 && replace_name[c-0x60].length() != 0) { // 紊
710 i += 3; 710 i += 3;
711 strcpy(str+cnt, replace_name[c-0x60].c_str()); 711 strcpy(str+cnt, replace_name[c-0x60].c_str());
712 cnt += replace_name[c-0x60].length(); 712 cnt += replace_name[c-0x60].length();
713 continue; 713 continue;
714 } 714 }
715 } else if ( (unsigned char)str_o[i] == 0x81 && (unsigned char)str_o[i+1] == 0x93 && (unsigned char)str_o[i+2] == 0x82) { 715 } else if ( (unsigned char)str_o[i] == 0x81 && (unsigned char)str_o[i+1] == 0x93 && (unsigned char)str_o[i+2] == 0x82) {
716 int c = str_o[i+3]; 716 int c = str_o[i+3];
717 if (c >= 0x60 && c <= 0x79 && replace_name2[c-0x60].length() != 0) { // 名前変換2 717 if (c >= 0x60 && c <= 0x79 && replace_name2[c-0x60].length() != 0) { // 紊鐚
718 i += 3; 718 i += 3;
719 strcpy(str+cnt, replace_name2[c-0x60].c_str()); 719 strcpy(str+cnt, replace_name2[c-0x60].c_str());
720 cnt += replace_name2[c-0x60].length(); 720 cnt += replace_name2[c-0x60].length();
721 continue; 721 continue;
722 } 722 }
730 char* str_top = str; 730 char* str_top = str;
731 731
732 for (char* s = str_top; *s != 0; s++) { 732 for (char* s = str_top; *s != 0; s++) {
733 // if (*(unsigned char*)s == 0xa1 && *(unsigned char*)(s+1) == 0xda) { /* euc */ 733 // if (*(unsigned char*)s == 0xa1 && *(unsigned char*)(s+1) == 0xda) { /* euc */
734 if (*(unsigned char*)s == 0x81 && *(unsigned char*)(s+1) == 0x79) { /* sjis */ 734 if (*(unsigned char*)s == 0x81 && *(unsigned char*)(s+1) == 0x79) { /* sjis */
735 // 名前 735 //
736 *s = 0; 736 *s = 0;
737 if (s != str_top) text_stream.Add(str_top); 737 if (s != str_top) text_stream.Add(str_top);
738 s += 2; 738 s += 2;
739 char* name_top = s; 739 char* name_top = s;
740 for (; *s != 0; s++) { 740 for (; *s != 0; s++) {
743 *s = 0; 743 *s = 0;
744 s += 2; 744 s += 2;
745 text_stream.AddName(name_top); 745 text_stream.AddName(name_top);
746 break; 746 break;
747 } 747 }
748 if (*s < 0 && s[1] != 0) s++; // 全角文字なら2字飛ばす 748 if (*s < 0 && s[1] != 0) s++; // 茹絖鐚絖蕋違
749 } 749 }
750 str_top = s; 750 str_top = s;
751 } 751 }
752 if (*s == 0x0a) { 752 if (*s == 0x0a) {
753 *s = 0; 753 *s = 0;
778 eprintf("text: %s\n",debug); 778 eprintf("text: %s\n",debug);
779 if (text_parsing) 779 if (text_parsing)
780 cmd.clear(); 780 cmd.clear();
781 else 781 else
782 cmd.cmd_type = CMD_SAVEPOINT; 782 cmd.cmd_type = CMD_SAVEPOINT;
783 text_parsing = true; /* テキスト待ち直後のテキスト位置=セーブ位置 */ 783 text_parsing = true; /* 鴻緇∞翫鴻篏臀鐚祉若篏臀 */
784 return; 784 return;
785 } 785 }
786 786
787 if (cmd.cmd_type != CMD_OTHER) return; 787 if (cmd.cmd_type != CMD_OTHER) return;
788 788
807 if (status_mask & (BACKLOG_MASK|BACKLOG_MASK_FWD) ) { 807 if (status_mask & (BACKLOG_MASK|BACKLOG_MASK_FWD) ) {
808 if (status_mask & BACKLOG_WAIT_MASK) ; 808 if (status_mask & BACKLOG_WAIT_MASK) ;
809 else { 809 else {
810 if ( (status == WAIT_TEXT && text != NULL) || status == WAIT_SELECT_INBOX || status == WAIT_SELECT_OUTBOX) { 810 if ( (status == WAIT_TEXT && text != NULL) || status == WAIT_SELECT_INBOX || status == WAIT_SELECT_OUTBOX) {
811 if(text && text->wid->status != WidText::PREPARE && text->wid->status != WidText::WAIT && text->wid->status != WidText::WAIT2) { 811 if(text && text->wid->status != WidText::PREPARE && text->wid->status != WidText::WAIT && text->wid->status != WidText::WAIT2) {
812 text->wid->Flush(); // 表示を最後の状態にする 812 text->wid->Flush(); // 茵腓冴緇倶
813 } 813 }
814 if (status == WAIT_TEXT && text != NULL && kcursor != NULL) kcursor->show(); 814 if (status == WAIT_TEXT && text != NULL && kcursor != NULL) kcursor->show();
815 } 815 }
816 } 816 }
817 if (status_mask & BACKLOG_MASK) { 817 if (status_mask & BACKLOG_MASK) {
847 status_mask = Status(status_mask & ~LOADMASK); 847 status_mask = Status(status_mask & ~LOADMASK);
848 return false; 848 return false;
849 } 849 }
850 if (status_mask & SKIPEND_MASK) { 850 if (status_mask & SKIPEND_MASK) {
851 if ( (skip_mode & SKIP_TEXT) && (skip_mode & SKIPEND_TEXT)) { 851 if ( (skip_mode & SKIP_TEXT) && (skip_mode & SKIPEND_TEXT)) {
852 if (skip_mode & SKIPEND_KEY) { // shift skip 中 852 if (skip_mode & SKIPEND_KEY) { // shift skip 筝
853 SkipMode new_mode = SkipMode(skip_mode & (~SKIPEND_TEXT)); 853 SkipMode new_mode = SkipMode(skip_mode & (~SKIPEND_TEXT));
854 if (new_mode & (SKIP_GRP_NOEFFEC || SKIP_GRP_NODRAW)) 854 if (new_mode & (SKIP_GRP_NOEFFEC || SKIP_GRP_NODRAW))
855 new_mode = SkipMode(new_mode & (~SKIP_GRP_FAST)); 855 new_mode = SkipMode(new_mode & (~SKIP_GRP_FAST));
856 cmd.SetSysvar(TYPE_SYS_SKIPMODE, new_mode); 856 cmd.SetSysvar(TYPE_SYS_SKIPMODE, new_mode);
857 } else { 857 } else {
870 return false; 870 return false;
871 } 871 }
872 if (event.presscount(MOUSE_RIGHT)) { 872 if (event.presscount(MOUSE_RIGHT)) {
873 if ( (status == WAIT_TEXT && text != NULL) || status == WAIT_SELECT_INBOX || status == WAIT_SELECT_OUTBOX) { 873 if ( (status == WAIT_TEXT && text != NULL) || status == WAIT_SELECT_INBOX || status == WAIT_SELECT_OUTBOX) {
874 if(text && text->wid->status != WidText::PREPARE && text->wid->status != WidText::WAIT && text->wid->status != WidText::WAIT2) { 874 if(text && text->wid->status != WidText::PREPARE && text->wid->status != WidText::WAIT && text->wid->status != WidText::WAIT2) {
875 text->wid->Flush(); // 表示を最後の状態にする 875 text->wid->Flush(); // 茵腓冴緇倶
876 } 876 }
877 cmd.cmd_type = CMD_MENUREQ; 877 cmd.cmd_type = CMD_MENUREQ;
878 if (!(status_mask & STATSAVE_MASK)) { 878 if (!(status_mask & STATSAVE_MASK)) {
879 status_saved = status; 879 status_saved = status;
880 status_mask = Status(status_mask | STATSAVE_MASK); 880 status_mask = Status(status_mask | STATSAVE_MASK);
885 } 885 }
886 } 886 }
887 if (event.presscount(MOUSE_UP)) { 887 if (event.presscount(MOUSE_UP)) {
888 if ( (status == WAIT_TEXT && text != NULL) || status == WAIT_SELECT_INBOX || status == WAIT_SELECT_OUTBOX) { 888 if ( (status == WAIT_TEXT && text != NULL) || status == WAIT_SELECT_INBOX || status == WAIT_SELECT_OUTBOX) {
889 if(text && text->wid->status != WidText::PREPARE && text->wid->status != WidText::WAIT && text->wid->status != WidText::WAIT2) { 889 if(text && text->wid->status != WidText::PREPARE && text->wid->status != WidText::WAIT && text->wid->status != WidText::WAIT2) {
890 text->wid->Flush(); // 表示を最後の状態にする 890 text->wid->Flush(); // 茵腓冴緇倶
891 } 891 }
892 cmd.cmd_type = CMD_BACKLOGREQ; 892 cmd.cmd_type = CMD_BACKLOGREQ;
893 if (!(status_mask & STATSAVE_MASK)) { 893 if (!(status_mask & STATSAVE_MASK)) {
894 status_saved = status; 894 status_saved = status;
895 status_mask = Status(status_mask | STATSAVE_MASK); 895 status_mask = Status(status_mask | STATSAVE_MASK);
899 } 899 }
900 if (status_mask & CLEARSCR_MASK) { 900 if (status_mask & CLEARSCR_MASK) {
901 if ( (status == WAIT_TEXT && text != NULL ) || status == WAIT_SELECT_INBOX || status == WAIT_SELECT_OUTBOX) { 901 if ( (status == WAIT_TEXT && text != NULL ) || status == WAIT_SELECT_INBOX || status == WAIT_SELECT_OUTBOX) {
902 if (skip_mode) skip_mode = SKIP_NO; 902 if (skip_mode) skip_mode = SKIP_NO;
903 if (text && text->wid->status != WidText::PREPARE && text->wid->status != WidText::WAIT && text->wid->status != WidText::WAIT2) { 903 if (text && text->wid->status != WidText::PREPARE && text->wid->status != WidText::WAIT && text->wid->status != WidText::WAIT2) {
904 text->wid->Flush(); // 表示を最後の状態にする 904 text->wid->Flush(); // 茵腓冴緇倶
905 return true; 905 return true;
906 } 906 }
907 status_mask = Status(status_mask & (~CLEARSCR_MASK) | CLEARSCR_WAIT_MASK); 907 status_mask = Status(status_mask & (~CLEARSCR_MASK) | CLEARSCR_WAIT_MASK);
908 if (text != NULL) text->hide(); 908 if (text != NULL) text->hide();
909 if (kcursor != NULL) kcursor->hide(); 909 if (kcursor != NULL) kcursor->hide();
964 cmd.SetSysvar(sel_val); 964 cmd.SetSysvar(sel_val);
965 selects.clear(); 965 selects.clear();
966 delete sel_widget; 966 delete sel_widget;
967 sel_widget = NULL; 967 sel_widget = NULL;
968 status = NORMAL; 968 status = NORMAL;
969 // CreateSelect() で作成された cur_backlog_item を backlog_item へ反映させる 969 // CreateSelect() т cur_backlog_item backlog_item 後
970 cur_backlog_item.text.InsertColor(sel_backlog_pos[sel_val], sel_backlog_pos[sel_val+1], 0xff, 0, 0); 970 cur_backlog_item.text.InsertColor(sel_backlog_pos[sel_val], sel_backlog_pos[sel_val+1], 0xff, 0, 0);
971 backlog_item = cur_backlog_item; 971 backlog_item = cur_backlog_item;
972 cur_backlog_item.Clear(); 972 cur_backlog_item.Clear();
973 } 973 }
974 return false; 974 return false;
1027 "EXBTN_000", 1027 "EXBTN_000",
1028 "EXBTN_001", 1028 "EXBTN_001",
1029 "EXBTN_002" 1029 "EXBTN_002"
1030 }; 1030 };
1031 1031
1032 static int btnpos[BTNCNT] = { // g00 ファイル内のボタン情報の位置 1032 static int btnpos[BTNCNT] = { // g00 <ゃ帥恰宴篏臀
1033 // 0, 1, 13, 12, 2, 3, 4, 5, 6, 7 // princess bride? 1033 // 0, 1, 13, 12, 2, 3, 4, 5, 6, 7 // princess bride?
1034 0, 1, 13, 14, 2, 3, 4, 5, 6, 7 // tomoyo after? 1034 0, 1, 13, 14, 2, 3, 4, 5, 6, 7 // tomoyo after?
1035 }; 1035 };
1036 1036
1037 static WidButton::PressFunc btnpress[BTNCNT] = { 1037 static WidButton::PressFunc btnpress[BTNCNT] = {
1086 1086
1087 void Text::SetCursor(int cursor_no) { 1087 void Text::SetCursor(int cursor_no) {
1088 char key[1024]; 1088 char key[1024];
1089 sprintf(key, "#CURSOR.%03d.NAME", cursor_no); 1089 sprintf(key, "#CURSOR.%03d.NAME", cursor_no);
1090 string path = config->GetParaStr(key); 1090 string path = config->GetParaStr(key);
1091 if (path.length() == 0) return; // 名前なし 1091 if (path.length() == 0) return; //
1092 path += ".pdt"; 1092 path += ".pdt";
1093 int w,h,cont,speed; 1093 int w,h,cont,speed;
1094 sprintf(key, "#CURSOR.%03d.SIZE", cursor_no); 1094 sprintf(key, "#CURSOR.%03d.SIZE", cursor_no);
1095 config->GetParam(key, 2, &w, &h); 1095 config->GetParam(key, 2, &w, &h);
1096 sprintf(key, "#CURSOR.%03d.CONT", cursor_no); 1096 sprintf(key, "#CURSOR.%03d.CONT", cursor_no);
1097 config->GetParam(key, 1, &cont); 1097 config->GetParam(key, 1, &cont);
1098 sprintf(key, "#CURSOR.%03d.SPEED", cursor_no); 1098 sprintf(key, "#CURSOR.%03d.SPEED", cursor_no);
1099 config->GetParam(key, 1, &speed); 1099 config->GetParam(key, 1, &speed);
1100 1100
1101 // speed で1周、cont 回変化 1101 // speed эcont 紊
1102 if (kcursor != NULL) delete kcursor; 1102 if (kcursor != NULL) delete kcursor;
1103 1103
1104 kcursor = new WidTimeCursor(event, speed/cont, &parent, path.c_str(), 0, 0, w, 0, cont, Rect(0,0,w,h)); 1104 kcursor = new WidTimeCursor(event, speed/cont, &parent, path.c_str(), 0, 0, w, 0, cont, Rect(0,0,w,h));
1105 int i; 1105 int i;
1106 for (i=0; i<32; i++) { 1106 for (i=0; i<32; i++) {
1256 1256
1257 void TextWindow::MakeWaku(PicContainer& pic, Event::Container& event, int waku_no, int window_no, bool* use_btn, void* callback) { 1257 void TextWindow::MakeWaku(PicContainer& pic, Event::Container& event, int waku_no, int window_no, bool* use_btn, void* callback) {
1258 AyuSysConfig *config = AyuSysConfig::GetInstance(); 1258 AyuSysConfig *config = AyuSysConfig::GetInstance();
1259 char key[1024]; 1259 char key[1024];
1260 std::string str; 1260 std::string str;
1261 /* 枠を作成 */ 1261 /* 篏 */
1262 sprintf(key, "#WAKU.%03d.000.NAME", waku_no); 1262 sprintf(key, "#WAKU.%03d.000.NAME", waku_no);
1263 const char* name = config->GetParaStr(key); 1263 const char* name = config->GetParaStr(key);
1264 if (name != NULL && name[0] == 0) name = NULL; 1264 if (name != NULL && name[0] == 0) name = NULL;
1265 sprintf(key, "#WAKU.%03d.000.BACK", waku_no); 1265 sprintf(key, "#WAKU.%03d.000.BACK", waku_no);
1266 const char* back = config->GetParaStr(key); 1266 const char* back = config->GetParaStr(key);
1269 const char* btn = config->GetParaStr(key); 1269 const char* btn = config->GetParaStr(key);
1270 if (btn != NULL && btn[0] == 0) btn = NULL; 1270 if (btn != NULL && btn[0] == 0) btn = NULL;
1271 1271
1272 if (name == NULL && back == NULL && btn == NULL) return; 1272 if (name == NULL && back == NULL && btn == NULL) return;
1273 1273
1274 /* まず、テキスト背景を設定 */ 1274 /* 障鴻荐絎 */
1275 if (back != NULL) { 1275 if (back != NULL) {
1276 str = back; str += ".g00"; 1276 str = back; str += ".g00";
1277 int rc, gc, bc, ac, flag; 1277 int rc, gc, bc, ac, flag;
1278 char key[1024]; 1278 char key[1024];
1279 sprintf(key, "#WINDOW.%03d.ATTR", window_no); 1279 sprintf(key, "#WINDOW.%03d.ATTR", window_no);
1283 Surface* back_s = pic.Root().NewSurface(str.c_str()); 1283 Surface* back_s = pic.Root().NewSurface(str.c_str());
1284 if (back_s != NULL) { 1284 if (back_s != NULL) {
1285 Rect rect(*back_s); 1285 Rect rect(*back_s);
1286 Surface* s = pic.Root().NewSurface(rect.width(), rect.height(), ALPHA_MASK); 1286 Surface* s = pic.Root().NewSurface(rect.width(), rect.height(), ALPHA_MASK);
1287 DSurfaceMove(back_s, rect, s, rect); 1287 DSurfaceMove(back_s, rect, s, rect);
1288 DSurfaceFillA(s, rect, rc, gc, bc, ac); // 透明度設定 1288 DSurfaceFillA(s, rect, rc, gc, bc, ac); // 綺荐絎
1289 pic.SetSurface(s, 0, 0); 1289 pic.SetSurface(s, 0, 0);
1290 pic.SetSurfaceFreeFlag(1); 1290 pic.SetSurfaceFreeFlag(1);
1291 if (flag == 0) wid->Pic()->SetSurfaceAttribute(PicBase::BLIT_MULTIPLY); 1291 if (flag == 0) wid->Pic()->SetSurfaceAttribute(PicBase::BLIT_MULTIPLY);
1292 pic.Root().DeleteSurface(back_s); 1292 pic.Root().DeleteSurface(back_s);
1293 } 1293 }
1294 } 1294 }
1295 /* その前に枠飾りを設定 */ 1295 /* 蕋障荐絎 */
1296 if (name != NULL) { 1296 if (name != NULL) {
1297 str = name; str += ".g00"; 1297 str = name; str += ".g00";
1298 Surface* s = pic.Root().NewSurface(str.c_str()); 1298 Surface* s = pic.Root().NewSurface(str.c_str());
1299 if (s) { 1299 if (s) {
1300 Rect rect(*s); 1300 Rect rect(*s);
1305 p->show(); 1305 p->show();
1306 } 1306 }
1307 } 1307 }
1308 if (btn == NULL) return; 1308 if (btn == NULL) return;
1309 if (use_btn == NULL) return; 1309 if (use_btn == NULL) return;
1310 // ボタンの作成 1310 // 帥潟篏
1311 // 使用するボタンについては、必要に応じて show() すること 1311 // 篏睡帥潟ゃ綽荀綽 show()
1312 1312
1313 /* ボタンの位置情報を求める */ 1313 /* 帥潟篏臀宴羆 */
1314 str = btn; str += ".g00"; 1314 str = btn; str += ".g00";
1315 ARCINFO* info = FileSearcher::GetInstance()->Find(FileSearcher::PDT, str.c_str(), "g00"); 1315 ARCINFO* info = FileSearcher::GetInstance()->Find(FileSearcher::PDT, str.c_str(), "g00");
1316 if (info == NULL) return; // cannot find file 1316 if (info == NULL) return; // cannot find file
1317 const char* data = info->Read(); 1317 const char* data = info->Read();
1318 /* g00 ファイルのヘッダ部分に位置情報は入っている */ 1318 /* g00 <ゃ篏臀宴ャc */
1319 /* 存在しなければボタン画像ではない */ 1319 /* 絖違帥括糸с */
1320 if (data == NULL || *data != 2) { 1320 if (data == NULL || *data != 2) {
1321 delete info; 1321 delete info;
1322 return; 1322 return;
1323 } 1323 }
1324 int index_count = read_little_endian_int(data+5); // 0x70 == 112 ( 8 個ずつグループなので、14個のボタン ) が標準 1324 int index_count = read_little_endian_int(data+5); // 0x70 == 112 ( 8 ゃ違若с14帥 ) 罔羣
1325 int i; 1325 int i;
1326 for (i=0; i<BTNCNT; i++) { 1326 for (i=0; i<BTNCNT; i++) {
1327 if (!use_btn[i]) continue; 1327 if (!use_btn[i]) continue;
1328 if (btnpos[i]*8 >= index_count) { 1328 if (btnpos[i]*8 >= index_count) {
1329 continue; // ボタンが存在しない 1329 continue; // 帥潟絖
1330 } 1330 }
1331 int x, y, w, h; 1331 int x, y, w, h;
1332 sprintf(key, "#WAKU.%03d.000.%s_BOX", waku_no, btnname[i]); 1332 sprintf(key, "#WAKU.%03d.000.%s_BOX", waku_no, btnname[i]);
1333 if (config->GetParam(key, 5, 0, &x, &y, &w, &h) == -1) continue; 1333 if (config->GetParam(key, 5, 0, &x, &y, &w, &h) == -1) continue;
1334 int sx, sy, sdx, sdy, cnt; 1334 int sx, sy, sdx, sdy, cnt;
1363 sprintf(key, "#WINDOW.%03d.MOJI_POS", win_no); if (config->GetParam(key, 4, &mposy, NULL, &mposx, NULL) == -1) return; 1363 sprintf(key, "#WINDOW.%03d.MOJI_POS", win_no); if (config->GetParam(key, 4, &mposy, NULL, &mposx, NULL) == -1) return;
1364 sprintf(key, "#WINDOW.%03d.MOJI_MIN", win_no); if (config->GetParam(key, 2, &minx, &miny) == -1) return; 1364 sprintf(key, "#WINDOW.%03d.MOJI_MIN", win_no); if (config->GetParam(key, 2, &minx, &miny) == -1) return;
1365 sprintf(key, "#WINDOW.%03d.WAKU_SETNO", win_no);if (config->GetParam(key, 1, &waku_no) == -1) return; 1365 sprintf(key, "#WINDOW.%03d.WAKU_SETNO", win_no);if (config->GetParam(key, 1, &waku_no) == -1) return;
1366 sprintf(key, "#WINDOW.%03d.LUBY_SIZE", win_no); if (config->GetParam(key, 1, &ruby) == -1) return; 1366 sprintf(key, "#WINDOW.%03d.LUBY_SIZE", win_no); if (config->GetParam(key, 1, &ruby) == -1) return;
1367 1367
1368 /* テキストウィジット:画面の右下一杯まで使用 */ 1368 /* 鴻c吾鐚脂≪劽筝障т戎 */
1369 /* posd == 2 なら画面下にひっつくように配置 */ 1369 /* posd == 2 脂≫蚊cゃ臀 */
1370 Rect r(0,0); 1370 Rect r(0,0);
1371 if (posd == 2) { 1371 if (posd == 2) {
1372 r = WakuSize(parent, waku_no); 1372 r = WakuSize(parent, waku_no);
1373 r = Rect(0, parent.Height()-r.height(), r.width(), parent.Height()); 1373 r = Rect(0, parent.Height()-r.height(), r.width(), parent.Height());
1374 posx = 0; 1374 posx = 0;
1375 posy = parent.Height()-r.height(); 1375 posy = parent.Height()-r.height();
1376 } else /* posd == 0 ? */ 1376 } else /* posd == 0 ? */
1377 r = Rect(posx, posy, parent.Width(), parent.Height()); 1377 r = Rect(posx, posy, parent.Width(), parent.Height());
1378 1378
1379 /* テキストウィンドウの作成 */ 1379 /* 鴻c潟篏 */
1380 int w = size*cntw; int h = (size+ruby+2)*cnth; 1380 int w = size*cntw; int h = (size+ruby+2)*cnth;
1381 wid = new WidText(event, &parent, r, Rect(mposx, mposy, mposx+w, mposy+h), size); 1381 wid = new WidText(event, &parent, r, Rect(mposx, mposy, mposx+w, mposy+h), size);
1382 wid->stream.kanji_type = TextStream::sjis; 1382 wid->stream.kanji_type = TextStream::sjis;
1383 /* 顔ウィンドウの作成 */ 1383 /* 蕁c潟篏 */
1384 for (i=0; i<8; i++) { 1384 for (i=0; i<8; i++) {
1385 int x,y; 1385 int x,y;
1386 sprintf(key, "#WINDOW.%03d.FACE.%03d", win_no, i); 1386 sprintf(key, "#WINDOW.%03d.FACE.%03d", win_no, i);
1387 if (config->GetParam(key, 2, &x, &y) == -1) continue; 1387 if (config->GetParam(key, 2, &x, &y) == -1) continue;
1388 /* 顔ウィンドウを作成する */ 1388 /* 蕁c潟篏 */
1389 if (x >= 0 && y >= 0) { 1389 if (x >= 0 && y >= 0) {
1390 face_pics[i] = wid->PicNode()->create_leaf(Rect(x,y), PicBase::FIT_SURFACE); 1390 face_pics[i] = wid->PicNode()->create_leaf(Rect(x,y), PicBase::FIT_SURFACE);
1391 } else { 1391 } else {
1392 face_pics[i] = parent.create_leaf(Rect(x+posx,y+posy), PicBase::FIT_SURFACE); 1392 face_pics[i] = parent.create_leaf(Rect(x+posx,y+posy), PicBase::FIT_SURFACE);
1393 } 1393 }
1394 face_pics[i]->show(); 1394 face_pics[i]->show();
1395 } 1395 }
1396 face = face_pics[0]; 1396 face = face_pics[0];
1397 // ボタンの設定 1397 // 帥潟荐絎
1398 for (i=0; i<BTNCNT; i++) { 1398 for (i=0; i<BTNCNT; i++) {
1399 int num; 1399 int num;
1400 sprintf(key, "#WINDOW.%03d.%s_USE", win_no, btnname[i]); 1400 sprintf(key, "#WINDOW.%03d.%s_USE", win_no, btnname[i]);
1401 config->GetParam(key, 1, &num); 1401 config->GetParam(key, 1, &num);
1402 use_btn[i] = (num==0) ? false : true; 1402 use_btn[i] = (num==0) ? false : true;
1418 int w = name_size*name_min; int h = name_size; 1418 int w = name_size*name_min; int h = name_size;
1419 int name_waku; 1419 int name_waku;
1420 sprintf(key, "#WINDOW.%03d.NAME_WAKU_SETNO", win_no); 1420 sprintf(key, "#WINDOW.%03d.NAME_WAKU_SETNO", win_no);
1421 if (config->GetParam(key, 1, &name_waku) != -1 && name_waku != -1) { 1421 if (config->GetParam(key, 1, &name_waku) != -1 && name_waku != -1) {
1422 Rect waku_r = WakuSize(parent, name_waku); 1422 Rect waku_r = WakuSize(parent, name_waku);
1423 waku_r.rmove(r.lx, r.ty); // テキストウィンドウ位置に動かす 1423 waku_r.rmove(r.lx, r.ty); // 鴻c潟篏臀
1424 waku_r.rmove(name_posx, name_posy-waku_r.height()); // NAME_POS へ位置補正 1424 waku_r.rmove(name_posx, name_posy-waku_r.height()); // NAME_POS 娯臀茖罩
1425 name_container = parent.create_node(waku_r, 0); 1425 name_container = parent.create_node(waku_r, 0);
1426 MakeWaku(*name_container, event, name_waku, win_no, 0, callback); 1426 MakeWaku(*name_container, event, name_waku, win_no, 0, callback);
1427 Rect name_r(0,0,w,h); 1427 Rect name_r(0,0,w,h);
1428 name_r.rmove(name_mposx, name_mposy); 1428 name_r.rmove(name_mposx, name_mposy);
1429 name = new WidLabel(name_container, name_r, true, 0, name_size); 1429 name = new WidLabel(name_container, name_r, true, 0, name_size);
1430 name->show(); 1430 name->show();
1431 } else { // 名前専用枠なし 1431 } else { // 絨
1432 Rect name_r(0, 0, w, h); 1432 Rect name_r(0, 0, w, h);
1433 name_r.rmove(r.lx, r.ty); 1433 name_r.rmove(r.lx, r.ty);
1434 name_r.rmove(name_posx, name_posy-name_size); 1434 name_r.rmove(name_posx, name_posy-name_size);
1435 name_container = parent.create_node(name_r, 0); 1435 name_container = parent.create_node(name_r, 0);
1436 name = new WidLabel(name_container, Rect(0, 0, w, h), true, 0, name_size); 1436 name = new WidLabel(name_container, Rect(0, 0, w, h), true, 0, name_size);