void SVConditionParam::createCondition() { int nRow = numRows(); m_pLabel = new WText(m_szLabel, (WContainerWidget*)elementAt(nRow, 0)); elementAt(nRow, 0)->setContentAlignment(AlignTop | AlignLeft); elementAt(nRow, 0)->setStyleClass("cell_10"); string szValue (""); if(!m_szDefaultValue.empty()) szValue = chLeftBracket + m_szDefaultValue + chRightBracket; m_pConditionArea = new WTextArea(szValue, (WContainerWidget*)elementAt(nRow, 1)); if(m_pConditionArea) { //if(strcmp(m_szDefaultValue.substr(0, 1).c_str(), &chLeftBracket) == 0 ) // m_pConditionArea->setText(m_szDefaultValue); m_pConditionArea->setStyleClass(m_szStyle); } createShowButton(nRow); createHelp(nRow); m_pOperate = new WTable((WContainerWidget*)elementAt(nRow,1)); if(m_pOperate) { m_pOperate->setStyleClass("conditionset"); createHideButton(); createAddConidtion(); createButtonGroup(); m_pOperate->hide(); } }
PrefPlaylist::PrefPlaylist(QWidget * parent, Qt::WindowFlags f) : PrefWidget(parent, f ) { setupUi(this); createHelp(); }
///////////////////////////////////////////////////////////////////////////////////////////////////////////// // 创建条件 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// void SVConditionParam::createCondition() { int nRow = numRows(); m_pLabel = new WText(m_szLabel, elementAt(nRow, 0)); elementAt(nRow, 0)->setContentAlignment(AlignTop | AlignLeft); elementAt(nRow, 0)->setStyleClass("table_list_data_input_text"); GetRow(nRow)->setStyleClass("padding_top"); string szValue (""); if(!m_szDefaultValue.empty()) szValue = chLeftBracket + m_szDefaultValue + chRightBracket; m_pConditionArea = new WTextArea(szValue, elementAt(nRow, 1)); if(m_pConditionArea) m_pConditionArea->setStyleClass(m_szStyle); elementAt(nRow, 1)->setStyleClass("table_data_text"); createShowButton(nRow); createHelp(nRow); m_pOperate = new WTable(elementAt(nRow,1)); if(m_pOperate) { m_pOperate->setStyleClass("conditionset"); createHideButton(); createAddConidtion(); createButtonGroup(); m_pOperate->hide(); } }
MenuState::MenuState(xy::StateStack& stack, xy::State::Context ctx, SharedStateData& sharedData, LoadingScreen& ls) : xy::State(stack, ctx), m_scene (ctx.appInstance.getMessageBus()), m_helpScene (ctx.appInstance.getMessageBus()), m_resource (), m_menuBGRes (m_resource.load<sf::Texture>("assets/images/menu_background.png")), m_grassRes (m_resource.load<sf::Texture>("assets/images/grass.png")), m_flowerRes (m_resource.load<sf::Texture>("assets/images/flower.png")), m_helpSignRes (m_resource.load<sf::Texture>("assets/images/help_sign.png")), m_caveStoryRes (m_resource.load<sf::Font>("assets/fonts/Cave-Story.ttf")), m_helpRes (m_resource.load<sf::Texture>("assets/images/help.png")), m_keyBindsRes (m_resource.load<sf::Texture>("assets/images/keybinds.png")), m_buttonRes (m_resource.load<sf::Texture>("assets/images/button.png")), m_sharedStateData (sharedData), m_loadingScreen (ls), m_helpShown (false), m_blurEffect (nullptr) { launchLoadingScreen(); loadKeybinds(); createScene(); createMenu(); createHelp(); ctx.appInstance.setClearColour({ 1, 0, 10 }); xy::App::setMouseCursorVisible(true); quitLoadingScreen(); }
void PrefInterface::retranslateStrings() { int mainwindow_resize = mainwindow_resize_combo->currentIndex(); int timeslider_pos = timeslider_behaviour_combo->currentIndex(); retranslateUi(this); mainwindow_resize_combo->setCurrentIndex(mainwindow_resize); timeslider_behaviour_combo->setCurrentIndex(timeslider_pos); // Icons resize_window_icon->setPixmap( Images::icon("resize_window") ); /* volume_icon->setPixmap( Images::icon("speaker") ); */ #ifdef SINGLE_INSTANCE changeInstanceImages(); #endif // Seek widgets seek1->setLabel( tr("&Short jump") ); seek2->setLabel( tr("&Medium jump") ); seek3->setLabel( tr("&Long jump") ); seek4->setLabel( tr("Mouse &wheel jump") ); if (qApp->isLeftToRight()) { seek1->setIcon( Images::icon("forward10s") ); seek2->setIcon( Images::icon("forward1m") ); seek3->setIcon( Images::icon("forward10m") ); } else { seek1->setIcon( Images::flippedIcon("forward10s") ); seek2->setIcon( Images::flippedIcon("forward1m") ); seek3->setIcon( Images::flippedIcon("forward10m") ); } seek4->setIcon( Images::icon("mouse", seek1->icon()->width()) ); // Language combo int language_item = language_combo->currentIndex(); createLanguageCombo(); language_combo->setCurrentIndex( language_item ); // Iconset combo iconset_combo->setItemText( 0, tr("Default") ); #if STYLE_SWITCHING style_combo->setItemText( 0, tr("Default") ); #endif int gui_index = gui_combo->currentIndex(); gui_combo->clear(); gui_combo->addItem( tr("Default GUI"), "DefaultGUI"); gui_combo->addItem( tr("Mini GUI"), "MiniGUI"); gui_combo->addItem( tr("Mpc GUI"), "MpcGUI"); gui_combo->setCurrentIndex(gui_index); floating_width_label->setNum(floating_width_slider->value()); floating_margin_label->setNum(floating_margin_slider->value()); createHelp(); }
void PrefAdvanced::retranslateStrings() { retranslateUi(this); monitor_aspect_icon->setPixmap( Images::icon("monitor") ); monitoraspect_combo->setItemText(0, tr("Auto") ); createHelp(); }
void PrefDrives::retranslateStrings() { retranslateUi(this); cdrom_drive_icon->setPixmap( Images::icon("cdrom_drive") ); dvd_drive_icon->setPixmap( Images::icon("dvd_drive") ); #ifdef BLURAY_SUPPORT bluray_drive_icon->setPixmap( Images::icon("bluray_drive") ); #endif createHelp(); }
void PrefGeneral::retranslateStrings() { retranslateUi(this); initial_volume_label->setNum( initial_volume_slider->value() ); channels_combo->setItemText(0, tr("2 (Stereo)") ); channels_combo->setItemText(1, tr("4 (4.0 Surround)") ); channels_combo->setItemText(2, tr("6 (5.1 Surround)") ); int deinterlace_item = deinterlace_combo->currentIndex(); deinterlace_combo->clear(); deinterlace_combo->addItem( tr("None"), MediaSettings::NoDeinterlace ); deinterlace_combo->addItem( tr("Lowpass5"), MediaSettings::L5 ); deinterlace_combo->addItem( tr("Yadif (normal)"), MediaSettings::Yadif ); deinterlace_combo->addItem( tr("Yadif (double framerate)"), MediaSettings::Yadif_1 ); deinterlace_combo->addItem( tr("Linear Blend"), MediaSettings::LB ); deinterlace_combo->addItem( tr("Kerndeint"), MediaSettings::Kerndeint ); deinterlace_combo->setCurrentIndex(deinterlace_item); int filesettings_method_item = filesettings_method_combo->currentIndex(); filesettings_method_combo->clear(); filesettings_method_combo->addItem( tr("one ini file"), "normal"); filesettings_method_combo->addItem( tr("multiple ini files"), "hash"); filesettings_method_combo->setCurrentIndex(filesettings_method_item); updateDriverCombos(); // Icons /* resize_window_icon->setPixmap( Images::icon("resize_window") ); volume_icon->setPixmap( Images::icon("speaker") ); */ mplayerbin_edit->setCaption(tr("Select the mplayer executable")); #ifdef Q_OS_WIN mplayerbin_edit->setFilter(tr("Executables") +" (*.exe)"); #else mplayerbin_edit->setFilter(tr("All files") +" (*)"); #endif screenshot_edit->setCaption(tr("Select a directory")); preferred_desc->setText( tr("Here you can type your preferred language for the audio " "and subtitle streams. When a media with multiple audio or " "subtitle streams is found, SMPlayer will try to use your " "preferred language. This only will work with media that offer " "info about the language of audio and subtitle streams, like DVDs " "or mkv files.<br>These fields accept regular expressions. " "Example: <b>es|esp|spa</b> will select the track if it matches with " "<i>es</i>, <i>esp</i> or <i>spa</i>.")); createHelp(); }
void PrefPlaylist::retranslateStrings() { retranslateUi(this); int index = media_to_add_combo->currentIndex(); media_to_add_combo->clear(); media_to_add_combo->addItem(tr("None"), Preferences::NoFiles); media_to_add_combo->addItem(tr("Video files"), Preferences::VideoFiles); media_to_add_combo->addItem(tr("Audio files"), Preferences::AudioFiles); media_to_add_combo->addItem(tr("Video and audio files"), Preferences::MultimediaFiles); media_to_add_combo->addItem(tr("Consecutive files"), Preferences::ConsecutiveFiles); media_to_add_combo->setCurrentIndex(index); createHelp(); }
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); scene = new QGraphicsScene(0,0,500,500); ui->graphicsView->setScene( scene ); ui->graphicsView->setDragMode(QGraphicsView::RubberBandDrag); createHelp(); run = 0; this->createCards(); this->giveCards(); }
void PrefInput::retranslateStrings() { int wheel_function = wheel_function_combo->currentIndex(); retranslateUi(this); keyboard_icon->setPixmap( Images::icon("keyboard") ); mouse_icon->setPixmap( Images::icon("mouse") ); // Mouse function combos int mouse_left = left_click_combo->currentIndex(); int mouse_right = right_click_combo->currentIndex(); int mouse_double = double_click_combo->currentIndex(); int mouse_middle = middle_click_combo->currentIndex(); int mouse_xclick1 = xbutton1_click_combo->currentIndex(); int mouse_xclick2 = xbutton2_click_combo->currentIndex(); createMouseCombos(); left_click_combo->setCurrentIndex(mouse_left); right_click_combo->setCurrentIndex(mouse_right); double_click_combo->setCurrentIndex(mouse_double); middle_click_combo->setCurrentIndex(mouse_middle); xbutton1_click_combo->setCurrentIndex(mouse_xclick1); xbutton2_click_combo->setCurrentIndex(mouse_xclick2); wheel_function_combo->clear(); wheel_function_combo->addItem( tr("No function"), Preferences::DoNothing ); wheel_function_combo->addItem( tr("Media seeking"), Preferences::Seeking ); wheel_function_combo->addItem( tr("Volume control"), Preferences::Volume ); wheel_function_combo->addItem( tr("Zoom video"), Preferences::Zoom ); wheel_function_combo->addItem( tr("Change speed"), Preferences::ChangeSpeed ); wheel_function_combo->setCurrentIndex(wheel_function); wheel_function_seek->setText( tr("Media &seeking") ); wheel_function_zoom->setText( tr("&Zoom video") ); wheel_function_volume->setText( tr("&Volume control") ); wheel_function_speed->setText( tr("&Change speed") ); #if !USE_SHORTCUTGETTER actioneditor_desc->setText( tr("Here you can change any key shortcut. To do it double click or " "start typing over a shortcut cell. Optionally you can also save " "the list to share it with other people or load it in another " "computer.") ); #endif createHelp(); }
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); //menu QPushButton *quit = new QPushButton(tr("Quit")); quit->setFont(QFont("Times", 18, QFont::Bold)); connect(quit, SIGNAL(clicked()), qApp, SLOT(quit())); ui->menu->addWidget(quit, 0, 0); //scene tapis scene = new QGraphicsScene(0,0,700,450); connect(scene, SIGNAL(selectionChanged()), this, SLOT(selection())); ui->graphicsView->setScene( scene ); ui->graphicsView->setDragMode(QGraphicsView::RubberBandDrag); //menu jeu playgame QPushButton *Cancel = new QPushButton(tr("Cancel")); Cancel->setFont(QFont("Times", 18, QFont::Bold)); connect(Cancel, SIGNAL(clicked()), this, SLOT(recup_cards())); ui->playgame->addWidget(Cancel, 0, 0); LCDRange *mise = new LCDRange; ui->playgame->addWidget(mise, 0, 1); QPushButton *OK = new QPushButton(tr("OK")); OK->setFont(QFont("Times", 18, QFont::Bold)); connect(OK, SIGNAL(clicked()), this, SLOT(change_cards())); ui->playgame->addWidget(OK, 0, 2); // compte du joueur initJoueur(&joueur); //lancement createHelp(); initPaquet(&jeu); this->createCards(); creerJeu(&jeu); /* cree un jeu de 52 carte (complet) */ melangerPaquet(&jeu); restartGame(); }
void PrefInput::retranslateStrings() { int wheel_function = wheel_function_combo->currentIndex(); retranslateUi(this); wheel_function_combo->setCurrentIndex(wheel_function); keyboard_icon->setPixmap( Images::icon("keyboard") ); mouse_icon->setPixmap( Images::icon("mouse") ); // Mouse function combos left_click_combo->setItemText( 0, tr("None") ); double_click_combo->setItemText( 0, tr("None") ); #if !USE_SHORTCUTGETTER actioneditor_desc->setText( tr("Here you can change any key shortcut. To do it double click or " "start typing over a shortcut cell. Optionally you can also save " "the list to share it with other people or load it in another " "computer.") ); #endif createHelp(); }
void PrefPlaylist::retranslateStrings() { retranslateUi(this); createHelp(); }
void TAdvanced::retranslateStrings() { retranslateUi(this); icon_label->setPixmap(Images::icon("pref_advanced")); createHelp(); }
bool Game::update() { frect tempRec; char buffer[256]; if(curState != gplay) { if(curState != cselect) { menu.update(); menu.render(); tempInfo.type = screenSprite; tempInfo.asset = &backGround; D3DXMatrixIdentity(&tempInfo.matrix); if(curState != finish) { D3DXMatrixTranslation(&tempInfo.matrix,Engine::instance()->width()/2,Engine::instance()->height()/4,0); } else { D3DXMatrixTranslation(&tempInfo.matrix,Engine::instance()->width()/2,Engine::instance()->height()/2,0); } Engine::instance()->addRender(tempInfo); if(curState == finish) { tempInfo.type = text; tempRec.top = 0.1f; tempRec.bottom = 0.2f; tempRec.left = 0.0f; tempRec.right = 1.0f; if(p1Won) { sprintf(buffer,"%s WINS!",charList[p1Select].name.c_str()); p1Name.text = buffer; p1Name.rect = tempRec; tempInfo.asset = &p1Name; } else { sprintf(buffer,"%s WINS!",charList[p2Select].name.c_str()); p2Name.text = buffer; p2Name.rect = tempRec; tempInfo.asset = &p2Name; } Engine::instance()->addRender(tempInfo); } if(Engine::instance()->getMessage("CharSelect")) { menu.resetSelection(); p1Lock = false; p2Lock = false; p1Select = 0; p2Select = 0; startDelay = 3.0f; curState = cselect; } if(Engine::instance()->getMessage("MainMenu")) { menu.resetSelection(); createMenu(); } if(Engine::instance()->getMessage("Options")) { menu.resetSelection(); createOptions(); } if(Engine::instance()->getMessage("Help")) { menu.resetSelection(); createHelp(); } if(Engine::instance()->getMessage("Quit")) { play = false; } if(Engine::instance()->getMessage("ToggleRensa")) { _rensa = !_rensa; createOptions(); } if(Engine::instance()->getMessage("ToggleMagic")) { _magic = !_magic; createOptions(); } if(Engine::instance()->getMessage("replay")) { startTetris(); } //if (Engine::instance()->getMessage("BindControllers")) { // thought about it, and this is actually not necessary since it's only two controllers that are loaded kinda. fuckit man. fuckit. //} } else { //character select menu if(!p1Lock) { if (Engine::instance()->getFlags("SelectionUp")&buttonFlags::_repeat || Engine::instance()->getFlags("SelectionUpDpad")&buttonFlags::_repeat) { --p1Select; Engine::instance()->playSound(rollover, soundvec, soundvec); } else if (Engine::instance()->getFlags("SelectionDown")&buttonFlags::_repeat || Engine::instance()->getFlags("SelectionDownDpad")&buttonFlags::_repeat) { ++p1Select; Engine::instance()->playSound(rollover, soundvec, soundvec); } else if(Engine::instance()->getFlags("Accept")&buttonFlags::_pushed) { p1Lock = true; Engine::instance()->playSound(click, soundvec, soundvec); } if(p1Select < 0) { p1Select = charList.size()-1; } else if(p1Select >= charList.size()) { p1Select = 0; } } if(!p2Lock) { if (Engine::instance()->getFlags("SelectionUp2")&buttonFlags::_repeat || Engine::instance()->getFlags("SelectionUp2Dpad")&buttonFlags::_repeat) { --p2Select; Engine::instance()->playSound(rollover, soundvec, soundvec); } else if (Engine::instance()->getFlags("SelectionDown2")&buttonFlags::_repeat || Engine::instance()->getFlags("SelectionDown2Dpad")&buttonFlags::_repeat) { ++p2Select; Engine::instance()->playSound(rollover, soundvec, soundvec); } else if(Engine::instance()->getFlags("Accept2")&buttonFlags::_pushed) { p2Lock = true; Engine::instance()->playSound(click, soundvec, soundvec); } if(p2Select < 0) { p2Select = charList.size() - 1; } else if(p2Select >= charList.size()) { p2Select = 0; } } //draw character select tempInfo.type = text; if(p1Lock) { tempRec.top = 0.1f; tempRec.bottom = 0.2f; tempRec.left = 0.0f; tempRec.right = 0.5f; p1Name.text = charList[p1Select].name; } else { tempRec.top = (p1Select*(1.0f/charList.size())); tempRec.bottom = tempRec.top + 0.1; tempRec.left = 0.4f; tempRec.right = 0.6f; p1Name.text = "P1"; } p1Name.rect = tempRec; tempInfo.asset = &p1Name; Engine::instance()->addRender(tempInfo); //p1 magic tempRec.left = 0.0f; tempRec.right = 0.5f; for(int i = 0; i < 4; ++i) { tempRec.top = 0.6f+(i*0.1f); tempRec.bottom = 0.7f+(i*0.1f); p1Power[i].text = charList[p1Select].aName[i]; p1Power[i].rect = tempRec; tempInfo.asset = &p1Power[i]; Engine::instance()->addRender(tempInfo); } if(p2Lock) { tempRec.top = 0.1f; tempRec.bottom = 0.2f; tempRec.left = 0.5f; tempRec.right = 1.0f; p2Name.text = charList[p2Select].name; } else { tempRec.top = 0.2+(p2Select*(1.0f/charList.size())); tempRec.bottom = tempRec.top + 0.1; tempRec.left = 0.4f; tempRec.right = 0.6f; p2Name.text = "P2"; } p2Name.rect = tempRec; tempInfo.asset = &p2Name; Engine::instance()->addRender(tempInfo); //p2 magic tempRec.left = 0.5f; tempRec.right = 1.0f; for(int i = 0; i < 4; ++i) { tempRec.top = 0.6f+(i*0.1f); tempRec.bottom = 0.7f+(i*0.1f); p2Power[i].text = charList[p2Select].aName[i]; p2Power[i].rect = tempRec; tempInfo.asset = &p2Power[i]; Engine::instance()->addRender(tempInfo); } tempInfo.type = screenSprite; for(int i = 0; i < charList.size(); ++i) { tempInfo.asset = &charList[i].icon; D3DXMatrixIdentity(&tempInfo.matrix); D3DXMatrixIdentity(&charTrans); D3DXMatrixScaling(&tempInfo.matrix,((float)(Engine::instance()->height()/charList.size()))/charList[i].icon.image->texInfo.Width,((float)(Engine::instance()->height()/charList.size()))/charList[i].icon.image->texInfo.Height,0); D3DXMatrixTranslation(&charTrans,Engine::instance()->width()/2.0f,((Engine::instance()->height()/charList.size())/2.0f)+(i*(Engine::instance()->height()/charList.size())),0); D3DXMatrixMultiply(&tempInfo.matrix,&tempInfo.matrix,&charTrans); Engine::instance()->addRender(tempInfo); } if(p1Lock&&p2Lock) { startDelay -= Engine::instance()->dt(); if(startDelay <= 0) { //start game startTetris(); } } } } else { // GPLAY! tetris.Update(); //draw background tempInfo.type = screenSprite; tempInfo.asset = &charList[p2Select].selectBackground; D3DXMatrixIdentity(&tempInfo.matrix); D3DXMatrixIdentity(&charTrans); D3DXMatrixTranslation(&charTrans,Engine::instance()->width()/2.0f,Engine::instance()->height()/2.0f,0); D3DXMatrixScaling(&tempInfo.matrix,(Engine::instance()->width()*1.0f)/(charList[p2Select].selectBackground.rec.right*1.0f),(Engine::instance()->height()*1.0f)/(charList[p2Select].selectBackground.rec.bottom*1.0f),1.0f); D3DXMatrixMultiply(&tempInfo.matrix,&tempInfo.matrix,&charTrans); Engine::instance()->addRender(tempInfo); tetris.Draw(); // SAD AUST IT CRASHES BECAUSE OF THIS I'M GOING TO BED WTF IS WRONG AAAAAAAAAAAAHHHHHHHHHHHHHHHHHHH // CTRL+F FOR: dammitrender // to get to my other comments showing where things are. // never mind these comments if(Engine::instance()->getMessage("P1Wins")) { p1Won = true; createFinish(); backGround = charList[p1Select].victoryBackground; Engine::instance()->playSound(youwin, soundvec, soundvec); } else if(Engine::instance()->getMessage("P2Wins")) { p1Won = false; createFinish(); backGround = charList[p2Select].victoryBackground; Engine::instance()->playSound(youwin, soundvec, soundvec); } } if(showFPS) { fps = 1/Engine::instance()->dt(); sprintf(buffer,"%d",(int)fps); fpsText.text = buffer; tempInfo.type = text; tempInfo.asset = &fpsText; Engine::instance()->addRender(tempInfo); } Engine::instance()->render(); Engine::instance()->clearMessages(); return play; }
void PrefAssociations::retranslateStrings() { retranslateUi(this); createHelp(); }