void MoneyCounter::filter_keypoints_5b(){ Area a; a.add(9,5,15,21); a.add(7,100,20,30); a.add(240,107,16,22); filter(a); }
void MoneyCounter::filter_keypoints_20f(){ Area a; a.add(5, 3, 24, 25); a.add(7,110,29,25); a.add(159, 5, 63,52); filter(a); }
void MoneyCounter::filter_keypoints_10f(){ Area a; a.add(4,4,27,24); a.add(5,102,33,31); a.add(168,6,60,52); filter(a); }
void MoneyCounter::filter_keypoints_5f(){ Area a; a.add(6, 6, 20, 24); a.add(8, 92, 23, 28); a.add(128, 4, 104, 104); filter(a); }
void MoneyCounter::filter_keypoints_50b(){ Area a; a.add(7, 5, 7 + 160, 5 + 57); a.add(8, 114, 8 + 36, 114 + 29); a.add(237, 4, 237 + 24, 4 + 24); a.add(220, 111, 220 + 36, 111 + 28); filter(a); }
void MoneyCounter::filter_keypoints_50f(){ Area a; a.add(3, 5, 3 + 24, 5 + 23); a.add(3, 114, 3 + 32, 114 + 26); a.add(166, 4, 166 + 64, 4 + 52); a.add(142, 26, 142 + 80, 26 + 105); filter(a); }
void MoneyCounter::filter_keypoints_20b(){ Area a; a.add(6, 3, 6 + 150, 3 + 61); a.add(7, 111, 7 + 32, 111 + 29); a.add(236, 3, 236 + 24, 3 + 26); a.add(232, 114, 232 + 28, 114 + 25); filter(a); }
void MoneyCounter::filter_keypoints_10b(){ Area a; a.add(10,6,20,20); a.add(9, 10, 30, 27); a.add(233, 111, 23, 23); a.add(233, 4, 23, 23); filter(a); }
void Description::run() { area.add(new Window(100, 50, WIDTH, HEIGHT, L"blue.bmp")); area.add(new Label(titleFont, 250, 60, 300, 40, Label::ALIGN_CENTER, Label::ALIGN_MIDDLE, 255, 255, 0, msg(L"rules"))); area.add(new Button(110, 515, 80, 25, buttonFont, 255, 255, 0, L"blue.bmp", msg(L"prev"), prevCmd)); area.add(new Button(200, 515, 80, 25, buttonFont, 255, 255, 0, L"blue.bmp", msg(L"next"), nextCmd)); ExitCommand exitCmd(area); area.add(new Button(610, 515, 80, 25, buttonFont, 255, 255, 0, L"blue.bmp", msg(L"close"), &exitCmd)); area.add(new KeyAccel(SDLK_ESCAPE, &exitCmd)); printPage(); area.run(); }
virtual void doAction() { watch->stop(); Area area; area.add(background, false); Font font(L"laudcn2.ttf", 16); area.add(new Window(280, 275, 240, 50, L"greenpattern.bmp", 6)); area.add(new Label(&font, 280, 275, 240, 50, Label::ALIGN_CENTER, Label::ALIGN_MIDDLE, 255,255,0, msg(L"paused"))); area.add(new AnyKeyAccel()); area.run(); sound->play(L"click.wav"); gameArea->updateMouse(); gameArea->draw(); watch->start(); };
virtual void doAction() { watch->stop(); Area area; area.add(background, false); area.draw(); showDescription(&area); gameArea->updateMouse(); gameArea->draw(); watch->start(); };
virtual void doAction() { watch->stop(); Area area; area.add(background, false); saveGame(&area, game); gameArea->updateMouse(); gameArea->draw(); watch->start(); };
virtual void doAction() { sound->play(L"glasbk2.wav"); bool restart = false; bool newGame = false; Font font(L"laudcn2.ttf", 24); Font btnFont(L"laudcn2.ttf", 14); Area area; area.add(gameArea); area.add(new Window(220, 240, 360, 140, L"redpattern.bmp", 6)); area.add(new Label(&font, 250, 230, 300, 100, Label::ALIGN_CENTER, Label::ALIGN_MIDDLE, 255,255,0, msg(L"loose"))); OkDlgCommand newGameCmd(&area, newGame); area.add(new Button(250, 340, 90, 25, &btnFont, 255,255,0, L"redpattern.bmp", msg(L"startNew"), &newGameCmd)); OkDlgCommand restartCmd(&area, restart); area.add(new Button(350, 340, 90, 25, &btnFont, 255,255,0, L"redpattern.bmp", msg(L"tryAgain"), &restartCmd)); ExitCommand exitCmd(area); area.add(new Button(450, 340, 90, 25, &btnFont, 255,255,0, L"redpattern.bmp", msg(L"exit"), &exitCmd)); area.run(); if (restart || newGame) { if (newGame) game->newGame(); else game->restart(); gameArea->draw(); gameArea->updateMouse(); } else gameArea->finishEventLoop(); };
void Description::printPage() { TextPage *page = text->getPage(currentPage); if (! page) return; int len = page->getWidgetsCount(); for (int i = 0; i < len; i++) { Widget *w = page->getWidget(i); if (w) { widgets.push_back(w); area.add(w); } } }
void showOptionsWindow(Area *parentArea) { Font titleFont(L"nova.ttf", 26); Font font(L"laudcn2.ttf", 14); bool fullscreen = (getStorage()->get(L"fullscreen", 1) != 0); bool niceCursor = (getStorage()->get(L"niceCursor", 1) != 0); bool hideCursor = (getStorage()->get(L"hideCursor", 0) != 0); bool invertShoulder = (getStorage()->get(L"invertShoulder", 0) != 0); float volume = ((float)getStorage()->get(L"volume", 20)) / 100.0f; Area area; area.add(parentArea); area.add(new Window(250, 170, 300, 260, L"blue.bmp")); area.add(new Label(&titleFont, 250, 175, 300, 40, Label::ALIGN_CENTER, Label::ALIGN_MIDDLE, 255,255,0, msg(L"options"))); OPTION(240, L"fullscreen", fullscreen); #ifndef __APPLE__ OPTION(260, L"niceCursor", niceCursor); OPTION(280, L"hideCursor", hideCursor); #endif OPTION(300, L"invertShoulder", invertShoulder); area.add(new Label(&font, 265, 330, 300, 20, Label::ALIGN_LEFT, Label::ALIGN_MIDDLE, 255,255,255, msg(L"volume"))); area.add(new Slider(360, 332, 160, 16, volume)); ExitCommand exitCmd(area); OptionsChangedCommand okCmd(&area, fullscreen, niceCursor,hideCursor,invertShoulder, volume); area.add(new Button(315, 390, 85, 25, &font, 255,255,0, L"blue.bmp", msg(L"ok"), &okCmd)); area.add(new Button(405, 390, 85, 25, &font, 255,255,0, L"blue.bmp", msg(L"cancel"), &exitCmd)); area.add(new KeyAccel(SDLK_ESCAPE, &exitCmd)); area.add(new KeyAccel(SDLK_RETURN, &okCmd)); area.run(); }
void Game::run() { Area area; Font btnFont(L"laudcn2.ttf", 14); area.setTimer(300, watch); GameBackground *background = new GameBackground(); area.add(background); CheatCommand cheatCmd(&area); area.add(new CheatAccel(L"iddqd", &cheatCmd)); WinCommand winCmd(&area, watch, this); FailCommand failCmd(&area, this); puzzle->setCommands(&winCmd, &failCmd); area.add(puzzle, false); area.add(verHints, false); area.add(horHints, false); PauseGameCommand pauseGameCmd(&area, watch, background); BUTTON(12, 400, L"pause", &pauseGameCmd) ToggleHintCommand toggleHintsCmd(verHints, horHints); BUTTON(119, 400, L"switch", &toggleHintsCmd) SaveGameCommand saveCmd(&area, watch, background, this); BUTTON(12, 440, L"save", &saveCmd) GameOptionsCommand optionsCmd(&area); BUTTON(119, 440, L"options", &optionsCmd) ExitCommand exitGameCmd(area); BUTTON(226, 400, L"exit", &exitGameCmd) area.add(new KeyAccel(SDLK_ESCAPE, &exitGameCmd)); HelpCommand helpCmd(&area, watch, background); BUTTON(226, 440, L"help", &helpCmd) area.add(watch, false); watch->start(); area.run(); }