Rev 179 | Rev 189 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 179 | Rev 185 | ||
---|---|---|---|
Line 272... | Line 272... | ||
272 | spinner_spriteindex[array_index] = Render_LoadSprite (L"%s/data/sprites/spinner-%d.png", app_path, array_index * 30); // spinning wheel |
272 | spinner_spriteindex[array_index] = Render_LoadSprite (L"%s/data/sprites/spinner-%d.png", app_path, array_index * 30); // spinning wheel |
273 | 273 | ||
274 | // add our custom fonts to the list of available fonts for the duration of the process |
274 | // add our custom fonts to the list of available fonts for the duration of the process |
275 | swprintf_s (font_pathname, WCHAR_SIZEOF (font_pathname), L"%s/data/fonts/papyrus.ttf", app_path); |
275 | swprintf_s (font_pathname, WCHAR_SIZEOF (font_pathname), L"%s/data/fonts/papyrus.ttf", app_path); |
276 | AddFontResourceEx (font_pathname, FR_PRIVATE, 0); |
276 | AddFontResourceEx (font_pathname, FR_PRIVATE, 0); |
277 | // load rendered fonts |
- | |
278 | arrow_fontindex = Render_LoadFont (L"Papyrus", 24, false, false); |
- | |
279 | chat_fontindex = Render_LoadFont (L"Papyrus", 32, false, false); |
- | |
280 | players_fontindex = Render_LoadFont (L"Papyrus", 40, false, true); |
- | |
281 | centermsg_fontindex = Render_LoadFont (L"Papyrus", 54, false, true); |
- | |
282 | 277 | ||
283 | // load themes, initialize a new human vs. human game and setup the scene |
278 | // load themes, initialize a new human vs. human game and setup the scene |
284 | if (!Themes_Init ()) |
279 | if (!Themes_Init ()) |
285 | return (-1); // bomb out on error |
280 | return (-1); // bomb out on error |
286 | Board_Init (&the_board, PLAYER_HUMAN, PLAYER_HUMAN, L"standard", FENSTARTUP_STANDARDCHESS); |
281 | Board_Init (&the_board, PLAYER_HUMAN, PLAYER_HUMAN, L"standard", FENSTARTUP_STANDARDCHESS); |
Line 638... | Line 633... | ||
638 | GUIBUTTON_ENABLE (the_scene.gui.larrow); // enable "back" arrow if it isn't displayed yet |
633 | GUIBUTTON_ENABLE (the_scene.gui.larrow); // enable "back" arrow if it isn't displayed yet |
639 | GUIBUTTON_DISABLE (the_scene.gui.rarrow); // disable "forward" arrow if it's already displayed |
634 | GUIBUTTON_DISABLE (the_scene.gui.rarrow); // disable "forward" arrow if it's already displayed |
640 | GUIBUTTON_DISABLE (the_scene.gui.rrarrow); // disable "jump to end" arrow if it's already displayed |
635 | GUIBUTTON_DISABLE (the_scene.gui.rrarrow); // disable "jump to end" arrow if it's already displayed |
641 | 636 | ||
642 | if (the_board.game_state == STATE_PLAYING) |
637 | if (the_board.game_state == STATE_PLAYING) |
643 | Scene_UpdateText (&the_scene.gui.arrow_text, |
638 | Scene_UpdateText (&the_scene.gui.arrow_text, RGBA_TO_RGBACOLOR (255, 255, 255, 191), DURATION_INFINITE, false, LOCALIZE (is_paused ? L"Paused" : L"Current")); |
644 | else if ((the_board.game_state == STATE_BLACKWIN_CHECKMATE) || (the_board.game_state == STATE_WHITEWIN_CHECKMATE)) |
639 | else if ((the_board.game_state == STATE_BLACKWIN_CHECKMATE) || (the_board.game_state == STATE_WHITEWIN_CHECKMATE)) |
645 | Scene_UpdateText (&the_scene.gui.arrow_text, |
640 | Scene_UpdateText (&the_scene.gui.arrow_text, RGBA_TO_RGBACOLOR (255, 255, 255, 191), DURATION_INFINITE, false, L"%s\n%s", LOCALIZE (L"EndGame_CheckMate"), LOCALIZE (L"EndGame_Title")); |
646 | else if ((the_board.game_state == STATE_WHITEWIN_RESIGNORFORFEIT) || (the_board.game_state == STATE_BLACKWIN_RESIGNORFORFEIT)) |
641 | else if ((the_board.game_state == STATE_WHITEWIN_RESIGNORFORFEIT) || (the_board.game_state == STATE_BLACKWIN_RESIGNORFORFEIT)) |
647 | Scene_UpdateText (&the_scene.gui.arrow_text, |
642 | Scene_UpdateText (&the_scene.gui.arrow_text, RGBA_TO_RGBACOLOR (255, 255, 255, 191), DURATION_INFINITE, false, L"%s\n%s", LOCALIZE (L"EndGame_Resign"), LOCALIZE (L"EndGame_Title")); |
648 | else if (the_board.game_state == STATE_DRAW_STALEMATE) |
643 | else if (the_board.game_state == STATE_DRAW_STALEMATE) |
649 | Scene_UpdateText (&the_scene.gui.arrow_text, |
644 | Scene_UpdateText (&the_scene.gui.arrow_text, RGBA_TO_RGBACOLOR (255, 255, 255, 191), DURATION_INFINITE, false, L"%s\n%s", LOCALIZE (L"EndGame_StaleMate"), LOCALIZE (L"EndGame_Title")); |
650 | else if (the_board.game_state == STATE_DRAW_AGREEMENT) |
645 | else if (the_board.game_state == STATE_DRAW_AGREEMENT) |
651 | Scene_UpdateText (&the_scene.gui.arrow_text, |
646 | Scene_UpdateText (&the_scene.gui.arrow_text, RGBA_TO_RGBACOLOR (255, 255, 255, 191), DURATION_INFINITE, false, L"%s\n%s", LOCALIZE (L"EndGame_Agreement"), LOCALIZE (L"EndGame_Title")); |
652 | else if (the_board.game_state == STATE_DRAW_OTHER) |
647 | else if (the_board.game_state == STATE_DRAW_OTHER) |
653 | Scene_UpdateText (&the_scene.gui.arrow_text, |
648 | Scene_UpdateText (&the_scene.gui.arrow_text, RGBA_TO_RGBACOLOR (255, 255, 255, 191), DURATION_INFINITE, false, L"%s\n%s", LOCALIZE (L"EndGame_DrawOther"), LOCALIZE (L"EndGame_Title")); |
654 | 649 | ||
655 | // enable the "comment on this move" menu option |
650 | // enable the "comment on this move" menu option |
656 | EnableMenuItem (GetMenu (hMainWnd), MENUID_MOVE_COMMENTMOVE, MF_ENABLED); |
651 | EnableMenuItem (GetMenu (hMainWnd), MENUID_MOVE_COMMENTMOVE, MF_ENABLED); |
657 | } |
652 | } |
658 | 653 | ||
Line 661... | Line 656... | ||
661 | { |
656 | { |
662 | GUIBUTTON_ENABLE (the_scene.gui.llarrow); // enable "jump to beginning" arrow if it isn't displayed yet |
657 | GUIBUTTON_ENABLE (the_scene.gui.llarrow); // enable "jump to beginning" arrow if it isn't displayed yet |
663 | GUIBUTTON_ENABLE (the_scene.gui.larrow); // enable "back" arrow if it isn't displayed yet |
658 | GUIBUTTON_ENABLE (the_scene.gui.larrow); // enable "back" arrow if it isn't displayed yet |
664 | GUIBUTTON_ENABLE (the_scene.gui.rarrow); // enable "forward" arrow if it isn't displayed yet |
659 | GUIBUTTON_ENABLE (the_scene.gui.rarrow); // enable "forward" arrow if it isn't displayed yet |
665 | GUIBUTTON_ENABLE (the_scene.gui.rrarrow); // enable "jump to end" arrow if it isn't displayed yet |
660 | GUIBUTTON_ENABLE (the_scene.gui.rrarrow); // enable "jump to end" arrow if it isn't displayed yet |
666 | Scene_UpdateText (&the_scene.gui.arrow_text, |
661 | Scene_UpdateText (&the_scene.gui.arrow_text, RGBA_TO_RGBACOLOR (255, 255, 255, 191), DURATION_INFINITE, false, L"%s %d\n%s", LOCALIZE (L"Move"), (the_board.viewed_move + 1) / 2, (the_board.viewed_move % 2 ? LOCALIZE (L"Games_White"): LOCALIZE (L"Games_Black"))); |
667 | 662 | ||
668 | // hints are not usable when watching the game history |
663 | // hints are not usable when watching the game history |
669 | EnableMenuItem (GetMenu (hMainWnd), MENUID_MOVE_SUGGESTMOVE, MF_GRAYED); |
664 | EnableMenuItem (GetMenu (hMainWnd), MENUID_MOVE_SUGGESTMOVE, MF_GRAYED); |
670 | 665 | ||
671 | // enable the "save position as" and "comment on this move" menu options |
666 | // enable the "save position as" and "comment on this move" menu options |
Line 678... | Line 673... | ||
678 | { |
673 | { |
679 | GUIBUTTON_DISABLE (the_scene.gui.llarrow); // disable "jump to beginning" arrow if it's already displayed |
674 | GUIBUTTON_DISABLE (the_scene.gui.llarrow); // disable "jump to beginning" arrow if it's already displayed |
680 | GUIBUTTON_DISABLE (the_scene.gui.larrow); // disable "back" arrow if it's already displayed |
675 | GUIBUTTON_DISABLE (the_scene.gui.larrow); // disable "back" arrow if it's already displayed |
681 | GUIBUTTON_ENABLE (the_scene.gui.rarrow); // enable "forward" arrow if it isn't displayed yet |
676 | GUIBUTTON_ENABLE (the_scene.gui.rarrow); // enable "forward" arrow if it isn't displayed yet |
682 | GUIBUTTON_ENABLE (the_scene.gui.rrarrow); // enable "jump to end" arrow if it isn't displayed yet |
677 | GUIBUTTON_ENABLE (the_scene.gui.rrarrow); // enable "jump to end" arrow if it isn't displayed yet |
683 | Scene_UpdateText (&the_scene.gui.arrow_text, |
678 | Scene_UpdateText (&the_scene.gui.arrow_text, RGBA_TO_RGBACOLOR (255, 255, 255, 191), DURATION_INFINITE, false, LOCALIZE (L"Beginning")); |
684 | 679 | ||
685 | // hints are not usable when watching the game history |
680 | // hints are not usable when watching the game history |
686 | EnableMenuItem (GetMenu (hMainWnd), MENUID_MOVE_SUGGESTMOVE, MF_GRAYED); |
681 | EnableMenuItem (GetMenu (hMainWnd), MENUID_MOVE_SUGGESTMOVE, MF_GRAYED); |
687 | 682 | ||
688 | // disable the "save position as" and "comment on this move" menu options |
683 | // disable the "save position as" and "comment on this move" menu options |