Ejemplo n.º 1
0
void CUniKeyMenu::reload()
{
	if (m_pPref->m_vietGUI) {
#ifndef _UNICODE
		initMenu(m_hInst, m_hParentWnd, IDR_KEY_MENU, VnMenuText);
#else
		wchar_t * WVnMenuText[sizeof(VnMenuText)/sizeof(char *)];
		int items = sizeof(VnMenuText)/sizeof(char *);
		int i, maxOutLen, inLen;
		for (i=0; i<items; i++) {
			inLen = -1;
			WVnMenuText[i] = new wchar_t[40];
			maxOutLen = 80;
			VnConvert(CONV_CHARSET_TCVN3, CONV_CHARSET_UNICODE, 
					 (BYTE *)VnMenuText[i], (BYTE *)WVnMenuText[i],
					 inLen, maxOutLen);
		}
		initMenu(m_hInst, m_hParentWnd, IDR_KEY_MENU, WVnMenuText);
		for (i=0; i<items; i++)
			delete [] WVnMenuText[i];
#endif
		setFont(VIET_FONT_NAME, VIET_MENU_FONT_SIZE);
	}
	else {
		initMenu(m_hInst, m_hParentWnd, IDR_KEY_MENU); // Use menu text from the resource
		setFont(_T(""), 0); // use Windows standard font
	}
	SetMenuDefaultItem(m_hMenu, ID_KEY_PANEL, FALSE);
	setMenuItemText(CharsetTable[m_pPref->m_otherCharset].name, ID_KEY_OTHER, FALSE);
	m_charsetItemID = 0;
	selectCharsetMenu(m_pPref->m_codeTable);
	m_inputMethodItemID = inputMethodToCmd(m_pPref->m_inMethod);
	selectInputMethod(inputMethodToCmd(m_pPref->m_inMethod));
}
Ejemplo n.º 2
0
int GUI_HoF::gameOptionsTalkie(Button *caller) {
	updateMenuButton(caller);
	restorePage1(_vm->_screenBuffer);
	backUpPage1(_vm->_screenBuffer);
	bool textEnabled = _vm->textEnabled();
	int lang = _vm->_lang;

	setupOptionsButtons();
	initMenu(_gameOptions);
	_isOptionsMenu = true;

	while (_isOptionsMenu) {
		processHighlights(_gameOptions);
		getInput();
	}

	restorePage1(_vm->_screenBuffer);
	backUpPage1(_vm->_screenBuffer);

	if (textEnabled && !_vm->textEnabled() && !_vm->speechEnabled()) {
		_vm->_configVoice = 1;
		_vm->setVolume(KyraEngine_v1::kVolumeSpeech, 75);
		choiceDialog(0x1E, 0);
	}

	if (_vm->_lang != lang) {
		_reloadTemporarySave = true;

		Graphics::Surface thumb;
		createScreenThumbnail(thumb);
		_vm->saveGameStateIntern(999, "Autosave", &thumb);
		thumb.free();

		_vm->_lastAutosave = _vm->_system->getMillis();

		_vm->loadCCodeBuffer("C_CODE.XXX");
		if (_vm->_flags.isTalkie)
			_vm->loadOptionsBuffer("OPTIONS.XXX");
		else
			_vm->_optionsBuffer = _vm->_cCodeBuffer;
		_vm->loadChapterBuffer(_vm->_newChapterFile);
		_vm->loadNPCScript();
		_vm->setupLangButtonShapes();
	}

	_vm->writeSettings();

	initMenu(*_currentMenu);
	updateAllMenuButtons();
	return 0;
}
Ejemplo n.º 3
0
BtDisplaySettingsButton::BtDisplaySettingsButton(QWidget *parent)
        : QToolButton(parent) {
    initMenu();

    setIcon(util::getIcon(CResMgr::displaywindows::displaySettings::icon));
    setPopupMode(QToolButton::InstantPopup);
    setEnabled(false);

    initMenu();
    retranslateUi();

    connect(m_popup, SIGNAL(triggered(QAction*)),
            this, SLOT(slotOptionToggled(QAction*)));
}
Ejemplo n.º 4
0
int GUI_HoF::audioOptions(Button *caller) {
	updateMenuButton(caller);
	restorePage1(_vm->_screenBuffer);
	backUpPage1(_vm->_screenBuffer);
	initMenu(_audioOptions);
	const int menuX = _audioOptions.x;
	const int menuY = _audioOptions.y;
	const int maxButton = 3;	// 2 if voc is disabled

	for (int i = 0; i < maxButton; ++i) {
		int x = menuX + _sliderBarsPosition[i*2+0];
		int y = menuY + _sliderBarsPosition[i*2+1];
		_screen->drawShape(0, _vm->_buttonShapes[16], x, y, 0, 0);
		drawSliderBar(i, _vm->_buttonShapes[17]);
		_sliderButtons[0][i].buttonCallback = _sliderHandlerFunctor;
		_sliderButtons[0][i].x = x;
		_sliderButtons[0][i].y = y;
		_menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[0][i]);
		_sliderButtons[2][i].buttonCallback = _sliderHandlerFunctor;
		_sliderButtons[2][i].x = x + 10;
		_sliderButtons[2][i].y = y;
		_menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[2][i]);
		_sliderButtons[1][i].buttonCallback = _sliderHandlerFunctor;
		_sliderButtons[1][i].x = x + 120;
		_sliderButtons[1][i].y = y;
		_menuButtonList = addButtonToList(_menuButtonList, &_sliderButtons[1][i]);
	}

	_isOptionsMenu = true;
	updateAllMenuButtons();
	bool speechEnabled = _vm->speechEnabled();
	while (_isOptionsMenu) {
		processHighlights(_audioOptions);
		getInput();
	}

	restorePage1(_vm->_screenBuffer);
	backUpPage1(_vm->_screenBuffer);
	if (speechEnabled && !_vm->textEnabled() && (!_vm->speechEnabled() || _vm->getVolume(KyraEngine_v1::kVolumeSpeech) == 2)) {
		_vm->_configVoice = 0;
		choiceDialog(0x1D, 0);
	}

	_vm->writeSettings();

	initMenu(*_currentMenu);
	updateAllMenuButtons();
	return 0;
}
Ejemplo n.º 5
0
CRecDirChooser::CRecDirChooser(const neutrino_locale_t Name, const std::string & Icon, int * chosenNfsIndex, std::string * chosenLocalDir, const char * const /*selectedLocalDir*/, const int mwidth, const int mheight)
	: CMenuWidget(Name, Icon,mwidth,mheight), index(chosenNfsIndex), localDirString(chosenLocalDir)
/**********************************************************************/
{
	localDir = NULL;
	initMenu();
}
Ejemplo n.º 6
0
void Clock::init()
{
    setWindowIcon(QIcon(":/images/colors.png"));

    readSettings();
    m_backBrush.setStyle(Qt::SolidPattern);
    m_foreBrush.setStyle(Qt::SolidPattern);
    for (int i = 0; i < 10; ++i)
    {
        binaryNumbers[i] = intToBin(i);
    }
    setDateTimeSections(m_dateSections, m_timeSections);

    timer.setInterval(m_updateInterval);
    timerEvent();
    timer.start();
    connect(&timer, SIGNAL(timeout()), this, SLOT(timerEvent()));

    setMouseTracking(true);

    initMenu();
    settingsDlg = 0;

    alwaysOnTopAct->setChecked(m_isAlwaysOnTop);
    setAlwaysOnTop();
}
Ejemplo n.º 7
0
void initMainMenu(Menu *main_menu) {
  initMenu(main_menu, 4);
  setMenuStr(main_menu, MM_THROWDICE, "Throw dice");
  setMenuStr(main_menu, MM_ITEM, "Item");
  setMenuStr(main_menu, MM_SAVE, "Save");
  setMenuStr(main_menu, MM_QUIT, "Quit game");
}
Ejemplo n.º 8
0
MainWindow::MainWindow() {
	//init ui
	setupUi(this);
	menuPlugins->menuAction()->setVisible(false);
	showMaximized();
	
	//create manager
	createManager();

	//initialize menu
	initMenu();

	//create status bar
	createStatusBar();
	//create tool bar
	createToolBar();
	//create docks
	createDocks();
	//create action
	createActions();

	//read Settings
	readSettings();
	
	//plugins
	//@todo disable plugin for now as it s not ready yet ... to be continued
	//loadPlugins();
}
Ejemplo n.º 9
0
// -----------------------------------------------------------------
// Name : Init
// -----------------------------------------------------------------
void InterfaceManager::init()
{
    _tex->loadTexture("gui/interface", true/*composed*/);
    initMenu();
    _input->addCursoredEventListener(this);
    _input->pushUncursoredEventListener(this);
}
Ejemplo n.º 10
0
// entry point of the program
int main( int arc, char* argv[] )
{	
	// First we need to create our Game Framework
	Initialise(SCREEN_X, SCREEN_Y, false,"Shoot em up" );

	initGame();
	initMenu();
	initBoss();
	initGameOver();
	gameProcess = &menuState;	
	do {
		frameCounter++;

		if(frameCounter > 5000)
			frameCounter = 0;
		
		gameProcess();	// function pointer to run game
		
	} while ( FrameworkUpdate() == false );
	// clean up memory
	destroyGame();
	destroyMenu();
	destroyBoss();
	destroyGameOver();
	
	Shutdown();

	return 0;
}
Ejemplo n.º 11
0
void ZLApplicationWindow::init() {
	myApplication->myViewWidget = createViewWidget();

	initToolbar(WINDOW_TOOLBAR);
	initToolbar(FULLSCREEN_TOOLBAR);
	initMenu();
}
Ejemplo n.º 12
0
void disHighscore()
{
    FILE *p;
    int scr;
    char str[6];
    p= fopen("score.dat", "r");
    initMenu();
    settextstyle(3, HORIZ_DIR, 4);
    outtextxy(getmaxx()/2-80, top+5, "HIGHSCORE");
    settextstyle(DEFAULT_FONT, HORIZ_DIR, 1.75);

    fscanf(p, "%d ", &scr);
    sprintf(str, "%d", scr);
    outtextxy(getmaxx()/2-75, top+60, "1. BEGINNER    :");
    outtextxy(getmaxx()/2+60, top+60, str);
    fscanf(p, "%d ", &scr);
    sprintf(str, "%d", scr);
    outtextxy(getmaxx()/2-75, top+75, "2. PROFESSIONAL:");
    outtextxy(getmaxx()/2+60, top+75, str);
    fscanf(p, "%d ", &scr);
    sprintf(str, "%d", scr);
    outtextxy(getmaxx()/2-75, top+90, "3. EXPERT      :");
    outtextxy(getmaxx()/2+60, top+90, str);
    outtextxy(getmaxx()/2-100, top+240, "PRESS ANY KEY TO CONTINUE..");
    fclose(p);
    getch();
}
Ejemplo n.º 13
0
void menu()
{
    char choice;
    begin:
    initMenu();
    settextstyle(GOTHIC_FONT, HORIZ_DIR, 4);
    outtextxy(getmaxx()/2-45, top+5, "MENU");
    settextstyle(DEFAULT_FONT, HORIZ_DIR, 1.75);
    outtextxy(getmaxx()/2-75, top+60, "1. START");
    outtextxy(getmaxx()/2-75, top+75, "2. HIGH SCORE");
    outtextxy(getmaxx()/2-75, top+90, "3. CONTROLS");
    outtextxy(getmaxx()/2-75, top+105, "4. EXIT");
    error1:
    choice=getch();
    switch(choice)
    {
	case '1' : level();
		   return;
	case '2' : disHighscore();
		   goto begin;
    case '3' : controls();
	       goto begin;
	case '4' : closegraph();
		   exit(0);
	default  : goto error1;
    }
}
Ejemplo n.º 14
0
void QWSMainWindow::init()
{
	initMenu();
	initToolbar();
	initStatusbar();
	createWidget();
}
Ejemplo n.º 15
0
//Main
int main(int argc, char** argv)
{
	glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
    glutInitWindowSize(600,600);
    glutInitWindowPosition(0, 0);
    glutCreateWindow("Game of Life");

    glutCallBacks();
    initMenu();

    glViewport( 0,0, 600, 600 );
	glMatrixMode( GL_PROJECTION );
	glLoadIdentity();
	glOrtho( 0.0, 600.0, 0.0, 600.0, 1.0, -1.0 );

	glClear(GL_COLOR_BUFFER_BIT);  

	buildMap();

	timerRedisplay(0);
    glutMainLoop();

	return(0);
}
Ejemplo n.º 16
0
bool DialogLayer::init()
{
    bool bRet = false;
    
    do {

		CC_BREAK_IF(!CCLayerColor::initWithColor(ccc4(0, 0, 0, 125)));
		
		auto director = Director::getInstance();
		auto size = director->getWinSize();
		CCSprite * bg = CCSprite::create("MsgBox/message_box.png");
		bg->setPosition(size.width / 2, size.height / 2);
        this->addChild(bg);

        onInitDialog();
        initMenu();
		



		//onInitDialog();
		//initMenu();

        bRet = true;
    } while (0);
    
    return bRet;
}
Ejemplo n.º 17
0
bool BoxCar::run()
{
  while (state_ != Quit) {
    switch (state_)
    {
    case Menu:
      Logger::getInstance().log(INFO_LOG_NAME, "Switching to menu");
      initMenu();
      mainLoop();
      finishMenu();
      break;
    case Game:
      Logger::getInstance().log(INFO_LOG_NAME, "Switching to game");
      initGame();
      mainLoop();
      finishGame();
      break;
    case ShowCredits:
      Logger::getInstance().log(INFO_LOG_NAME, "Switching to credits");
      initCredits();
      mainLoop();
      finishCredits();
      break;
    default:
      Logger::getInstance().log(ERROR_LOG_NAME, "Encountered unknown state. Terminating.");
      state_ = Quit;
      break;
    }
  }
  close();
  return true;
}
Ejemplo n.º 18
0
void executeMenu(ALLEGRO_DISPLAY* _display)
{
    display = _display;
    initMenu();
    menuLoop(display);
    shutdownMenu();
}
Ejemplo n.º 19
0
QQuestionsTableWidget::QQuestionsTableWidget(QWidget *parent,unsigned int rating, unsigned int choice_count) :
    QTableWidget(parent),
    RATING(rating),
    CHOICE_COUNT(choice_count),
    shortcut_new(QKeySequence(Qt::CTRL + Qt::Key_N),this)
{
    table_width = -1;
    QStringList sl;
    sl << tr("Вопрос");
    for (unsigned int i = 0; i < CHOICE_COUNT; i++)
        sl << tr("Ответ №%1").arg(QString::number(i + 1));
    sl << tr("Правильный ответ");
    if (RATING)
        sl << tr("Сложность");
    setColumnCount(sl.count());
    setHorizontalHeaderLabels(sl);
    initMenu();
    setSelectionBehavior(SelectRows);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    connect(this,SIGNAL(itemChanged(QTableWidgetItem*)),this,SIGNAL(signalNeedSave()));
    connect(&shortcut_new,SIGNAL(activated()),this,SLOT(addQuestionRow()));

}
Ejemplo n.º 20
0
// on "init" you need to initialize your instance
bool OptionScene::init()
{
    //////////////////////////////
    // 1. super init first
    if ( !Layer::init() )
    {
        return false;
    }
    
	// 화면 사이즈
	SizeW = Director::getInstance()->getWinSize().width;
	SizeH = Director::getInstance()->getWinSize().height;

	iMusic = SimpleAudioEngine::getInstance()->isBackgroundMusicPlaying();

	// 메뉴 배경화면 초기화
	initBackGround();

	// 메뉴 초기화
	initMenu();

	// 라벨 초기화
	initLabel();


	menuView();

    return true;
}
Ejemplo n.º 21
0
int main(int argc, char **argv)
{
	initScreen();       //初始化屏幕
	initColor();        //初始化颜色
	bkgd(COLOR_PAIR(1));//给背景设定颜色
	box(stdscr, 0, 0);  //画边框
	editWin = newwin(LINES-4, COLS-4, 3, 2);
	wbkgd(editWin, COLOR_PAIR(2));
	wattron(editWin, COLOR_PAIR(3));    //当前使用该色彩
	box(editWin, 0, 0);
	wattroff(editWin, COLOR_PAIR(3));   //不使用该色彩了
    wattron(editWin,COLOR_PAIR(7));
	initMenu(); //初始化菜单
	draw_main_menu(stdscr); //画菜单
	initList(); //初始化链表
	while(isOn){
		wnoutrefresh(stdscr);
		wnoutrefresh(editWin);
		doupdate();
		drawMenuList(0, 0);
		touchwin(editWin);
		wrefresh(editWin);
	}
	exitScreen();   //退出函数
	return 0;
}
ScriptWindow::ScriptWindow(ScriptingEnv *env, ApplicationWindow *app)
: QMainWindow(),
d_app(app)
{
	initMenu();

	fileName = QString::null;

	te = new ScriptEdit(env, this, name());
	te->setContext(this);
	te->setDirPath(d_app->scriptsDirPath);
	connect(te, SIGNAL(dirPathChanged(const QString& )), d_app, SLOT(scriptsDirPathChanged(const QString&)));

	d_line_number = new LineNumberDisplay(te, this);
	d_frame = new QWidget(this);

	QHBoxLayout *hbox = new QHBoxLayout(d_frame);
	hbox->setMargin(0);
	hbox->setSpacing(0);
	hbox->addWidget(d_line_number);
	hbox->addWidget(te);

	setCentralWidget(d_frame);

	initActions();
	setIcon(QPixmap(logo_xpm));
	setWindowTitle(tr("QtiPlot - Script Window"));
	setFocusProxy(te);
	setFocusPolicy(Qt::StrongFocus);
	resize(QSize(500, 300));
}
Ejemplo n.º 23
0
MainWindow::MainWindow(FilesList *filesList)
{
    this->filesList = filesList;

    player = new Player(this);
    filesListWidget = new FilesListWidget(this->filesList, this);
    filesCountLabel = new QLabel(FILES_COUNT_TEXT.arg(0), this);

    QSplitter *splitter = new QSplitter(Qt::Vertical, this);
    //splitter->setStyleSheet("QSplitter::handle {background-color: black;}");

    splitter->addWidget(initVideoFrame());
    splitter->addWidget(initControlFrame());
    splitter->setChildrenCollapsible(false);
    //splitter->setCursor(Qt::SizeVerCursor);
    splitter->setHandleWidth(10);

    initMenu();
    setCentralWidget(splitter);
    setWindowTitle("Visual Renamer");
    setWindowIcon(QIcon(":/resources/logo_small.png"));
    resize(850, 650);

    connect(filesListWidget, SIGNAL(fileSelected(int)), SLOT(fileSelected(int)));
    connect(this->filesList, SIGNAL(renamed(int,int)), SLOT(filesRenamed(int,int)));
    connect(this->filesList, &FilesList::reseted, this, [=](){fileSelected(-1); filesCountLabel->setText(FILES_COUNT_TEXT.arg(this->filesList->getSize()));});
    connect(this->filesList, &FilesList::filesAdded, this, [=](){filesCountLabel->setText(FILES_COUNT_TEXT.arg(this->filesList->getSize()));});
    connect(this->filesList, &FilesList::removed, this, [=](){fileSelected(-1); filesCountLabel->setText(FILES_COUNT_TEXT.arg(this->filesList->getSize()));});

    this->setFocus();
}
void MainMenu::setup() {
	// add all the buttons for the different Reactickles
	
	initMenu();

	logo.setup(ofVec2f(), IMAGE_ROOT + "logo.png");
	logo.x = WIDTH/2 - logo.width/2;
	logo.y = 35;
	
	int PADDING = 10*WIDTH_SCALE;
	
	settingsButton.setup("settings", ofVec2f(), IMAGE_ROOT + "settingsButton.png", IMAGE_ROOT + "settingsButtonDown.png");
	aboutButton.setup("about", ofVec2f(), IMAGE_ROOT + "aboutButton.png", IMAGE_ROOT + "aboutButtonDown.png");
	settingsButton.x = 10 + WIDTH/2 - settingsButton.width;
	aboutButton.x = WIDTH/2 + 10;
	settingsButton.y = aboutButton.y = HEIGHT - settingsButton.height - 10;
	
	
	aboutButton.setListener(this);
	settingsButton.setListener(this);
	
	// setup scrolling stuff
	scrollRect.x = 0;
	scrollRect.width = WIDTH;
	scrollRect.y = 150;
	scrollRect.height = 2*reactickleButtons[0]->height+PADDING;
	scrollOffset = 0;
	deltaX = 0;
	touchX = 0;
	touching = false;
	
	
	if(IPAD) {
		bgImage.setup(ofVec2f(), "img/bg.png");
	} else if(HI_RES) {
		bgImage.setup(ofVec2f(), "img/bgIPhone4.png");
	} else {
		bgImage.setup(ofVec2f(), "img/bgIPhone.png");
	}
	
	
	add(&bgImage);
	add(&aboutButton);
	add(&settingsButton);
	add(&logo);
	
	// copy the reactickle list to the items list - the items list
	// is the one used to propagating events.
	for(int i = 0; i < reactickleButtons.size(); i++) {
		
		// add a button listener
		reactickleButtons[i]->setListener(this);
		
		// add it to the display/interaction hierarchy
		add(reactickleButtons[i]);
	}
	totalWidth = ((reactickleButtons.size()+1)/2)*(reactickleButtons[0]->width+PADDING);
	 
}
Ejemplo n.º 25
0
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, m_defaultMasterDelay(5)
, m_defaultLoginDelay(15)
, m_defaultLength(8)
, m_removeText(tr("&Remove URL && User"))
, m_saveText(tr("&Save URL && User"))
, m_saveToolTip(tr("Save current URL & User. Passwords are not saved."))
, m_removeToolTip(tr("Don't remember current URL & User anymore."))
, m_masterPasswordText(tr("<b>Master password:</b>"))
, m_masterDelay(m_defaultMasterDelay)
, m_loginDelay(m_defaultLoginDelay)
, m_autoCopy(false)
, m_autoClear(false)
, m_alwaysOnTop(true)
, m_masterEdit(new QLineEdit(this))
, m_masterLabel(new QLabel(this))
, m_userEdit(new QLineEdit(this))
, m_passwdEdit(new QLineEdit(this))
, m_urlCombo(new QComboBox(this))
, m_genButton(new QPushButton(tr("&Show password!"), this))
, m_saveButton(new QPushButton(m_saveText, this))
, m_lengthSpinBox(new QSpinBox(this))
, m_masterTimer(new QTimer)
, m_timeLine(new QTimeLine)
, m_settingsDlg(new SettingsDlg(this))
{
    setWindowTitle("Fleeting Password Manager");
    setWindowIcon(QIcon(":/fleetingpm.png"));

    initWidgets();
    initMenu();
    initBackground();
    loadSettings();

    // Apply window flags
    if (m_alwaysOnTop)
    {
        setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
    }

    // Initialize the timer used when fading out the login details.
    m_timeLine->setDuration(m_loginDelay * 1000);
    connect(m_timeLine, SIGNAL(frameChanged(int)), this, SLOT(decreasePasswordAlpha(int)));
    connect(m_timeLine, SIGNAL(finished()), this, SLOT(invalidateAll()));
    m_timeLine->setFrameRange(0, 255);

    // Initialize the timer used when showing the
    // master password.
    m_masterTimer->setInterval(m_masterDelay * 60 * 1000);
    m_masterTimer->setSingleShot(true);
    connect(m_masterTimer, SIGNAL(timeout()),
        m_masterEdit, SLOT(clear()));
    connect(m_masterEdit, SIGNAL(textChanged(QString)),
        m_masterTimer, SLOT(start()));

    // Load previous location or center the window.
    centerOrRestoreLocation();
}
Ejemplo n.º 26
0
int GUI_HoF::loadMenu(Button *caller) {
	updateSaveFileList(_vm->_targetName);

	if (!_vm->_menuDirectlyToLoad) {
		updateMenuButton(caller);
		restorePage1(_vm->_screenBuffer);
		backUpPage1(_vm->_screenBuffer);
	}

	_savegameOffset = 0;
	setupSavegameNames(_loadMenu, 5);
	initMenu(_loadMenu);
	_isLoadMenu = true;
	_noLoadProcess = false;
	_vm->_gameToLoad = -1;
	updateAllMenuButtons();

	_screen->updateScreen();
	while (_isLoadMenu) {
		processHighlights(_loadMenu);
		getInput();
	}

	if (_noLoadProcess) {
		if (!_vm->_menuDirectlyToLoad) {
			restorePage1(_vm->_screenBuffer);
			backUpPage1(_vm->_screenBuffer);
			initMenu(*_currentMenu);
			updateAllMenuButtons();
		}
	} else if (_vm->_gameToLoad >= 0) {
		restorePage1(_vm->_screenBuffer);
		restorePalette();
		_vm->loadGameStateCheck(_vm->_gameToLoad);
		if (_vm->_gameToLoad == 0) {
			_restartGame = true;
			for (int i = 0; i < 23; ++i)
				_vm->resetCauldronStateTable(i);
			_vm->runStartScript(1, 1);
		}
		_displayMenu = false;
		_loadedSave = true;
	}

	return 0;
}
Ejemplo n.º 27
0
void Menu()
{
	int done = 0;
	int ctrl = 0;

	// Set video mode based on aspect ratio
	if(CONF_GetAspectRatio() == CONF_ASPECT_16_9) isWide = 1;
	setVideoMode();
	drawLogo();

	dListTotal = findPaks();
	dListCurrentPosition = 0;
	if(dListTotal != 1)
	{
		sortList();
		getAllLogs();
		initMenu(1);
		drawMenu();
		pControl = ControlMenu;

		while(!done)
		{
			ctrl = Control();
			switch(ctrl)
			{
				case 1:
				case 2:
					done = 1;
					break;

				case 3:
					drawLogs();
					break;

				case -1:
					drawMenu();
					break;

				case -2:
					// BGM player isn't supported
					break;
			}
		}
		freeAllLogs();
		termMenu();
		if(ctrl == 2)
		{
			if (filelist)
			{
				free(filelist);
				filelist = NULL;
			}
			borExit(0);
		}
	}
	getBasePath(packfile, filelist[dListCurrentPosition+dListScrollPosition].filename, 1);
	free(filelist);
}
Ejemplo n.º 28
0
bool BalloonRankDialog::init()
{
	bool bRet = false;
	do
	{
		CC_BREAK_IF(!DialogLayer::init());
		CCNodeLoaderLibrary* pLoaderLib = CCNodeLoaderLibrary::newDefaultCCNodeLoaderLibrary();

		CCBReader* pCCBReader = new CCBReader(pLoaderLib);

		std::string strCCBFileName = "BalloonRankDialog.ccbi";

		const std::vector<std::string> vSearchOrder = CCFileUtils::sharedFileUtils()->getSearchResolutionsOrder();

		std::string strCCBRootPath = vSearchOrder[0];

		pCCBReader->setCCBRootPath(strCCBRootPath.c_str());

		CCNode* pNode = pCCBReader->readNodeGraphFromFile(strCCBFileName.c_str(), this);

		if (pNode != NULL)
		{
			this->addChild(pNode);
		}

		pCCBReader->release();
		
		setKeypadEnabled(true);

		initLabelTTF();
        
        initTableView();
        
        initMenu();
        
        // start fire
        CCArray* pArrayFire = CCArray::createWithCapacity(6);
        for (int idx = 1; idx <= 6; ++idx)
        {
            pArrayFire->addObject(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(CCString::createWithFormat("energy_fire%d.png", idx)->getCString()));
        }
        CCAnimation* pAnimation = CCAnimation::createWithSpriteFrames(pArrayFire, 0.1f);
        CCAnimate* pAnimateFire = CCAnimate::create(pAnimation);
        m_pSpriteScoreFire->runAction(CCRepeatForever::create(pAnimateFire));
        
        // set animation onEnter and onExit
        m_pMainBoard = m_pSpriteBoard;
        m_pSpriteBoard->setScale(0.01f);
        setOnEnterAction(CCEaseBounceOut::create(CCScaleTo::create(0.5f, 1.0f)));
        setOnExitAction(CCEaseExponentialIn::create(CCScaleTo::create(0.5f, 0.01f)));
		
		bRet = true;
		
	} while(0);
	
	return bRet;
}
Ejemplo n.º 29
0
FmDriverView::FmDriverView() : FmViewBase( EDriverView )
{
    FM_LOG( "FmDriverView::FmDriverView" );
    initMenu(); 
    initToolBar();
    initDiskListWidget();

    QMetaObject::connectSlotsByName( this );
}
Ejemplo n.º 30
0
/* constructor */
BTGame::BTGame()
{
	initBaseFunctions();
	initLogWindow();
	initSideBar();
	initCentralWindow();
	initMenu();
	readSettings();
}