示例#1
0
文件: lbt.cpp 项目: ppdg123/LBtool
void kCallBack(char ch)
{
	switch(ch)
	{
		case ' ':
			saveDataFile(file_set[cur_file_ptr]);
			loadNext();
			break;
		case '\n':
			saveDataFile(file_set[cur_file_ptr]);
			loadPrevious();
			break;
		case 'p':
			loadPrevious();
			break;
		case 'q':
			exitLBT();
			break;
		case 'n':
			loadNext();
			break;
		case '=':
			nextPoint();
			showImage();
			break;
		case '-':
			previousPoint();
			showImage();
			break;
		case '[':
			previousAttrVal();
			showImage();
			break;
		case ']':
			nextAttrVal();
			showImage();
			break;
		case 'c':
			if(lb_type==TYPE_SQR)
			{
		        	saveSQR();
			}
	}
	if(ch>='0'&&ch<='9'&&lb_type==TYPE_DEG)
	{
		degree = ch-'0';
		printf("%c\n",ch);
		showImage();
	}
}
示例#2
0
void MainLoop::playGameChoice() {
  while (1) {
    auto choice = view->chooseGameType();
    PModel model;
    switch (choice) {
      case View::KEEPER_CHOICE:
        options->setDefaultString(OptionId::KEEPER_NAME, NameGenerator::get(NameGeneratorId::FIRST)->getNext());
        if (options->handleOrExit(view, OptionSet::KEEPER, -1)) {
          model = keeperGame();
        }
        break;
      case View::ADVENTURER_CHOICE:
        options->setDefaultString(OptionId::ADVENTURER_NAME,
            NameGenerator::get(NameGeneratorId::FIRST)->getNext());
        if (options->handleOrExit(view, OptionSet::ADVENTURER, -1)) {
          model = adventurerGame();
        }
        break;
      case View::LOAD_CHOICE:
        model = loadPrevious(eraseSave(options));
        break;
      case View::BACK_CHOICE:
        return;
    }
    if (model) {
      model->setOptions(options);
      model->setHighscores(highscores);
      jukebox->setType(MusicType::PEACEFUL, true);
      playModel(std::move(model));
    }
    view->reset();
  }
}
示例#3
0
void toNewConnection::previousCellChanged(const QModelIndex & current)
{
    loadPrevious(current);
}