Exemplo n.º 1
0
Settings::Settings(QMap<QString, QVariant> language, QMap<QString, QString> settings, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Settings)
{
    ui->setupUi(this);

    setLanguageChoice(language);

    setLanguage(settings);
    setNewData(settings);
    setLoadData(settings);
    setSaveAsData(settings);
    setSaveData(settings);
    setQuit(settings);
    setUsers(settings);
    setSearch(settings);
    setSeeCategory(settings);
    setAddCategory(settings);
    setRemoveCategory(settings);
    setSeeMedia(settings);
    setAddMedia(settings);
    setRemoveMedia(settings);
    setSettings(settings);
}
Exemplo n.º 2
0
// 初期化処理
bool AdventureScene::init(SceneManager* smgr) {
	if (m_continue) { setLoadData(); } // 中段セーブデータの読み込み

    // データベースの生成
	mp_rcdata = new Database();
	mp_rcdata->createTable("img", "data/res/adventure/img.csv");
	mp_rcdata->createTable("snd", "data/res/adventure/snd.csv");

	mp_rsc = &smgr->getResources();
    // リソースファイルのロード
	ImageResourceManager& ircmgr = smgr->getResources().images();
	ircmgr.loadFromCSV(IMGLIST);
	SoundResourceManager& srcmgr = smgr->getResources().sounds();
	srcmgr.loadFromCSV(SNDLIST);
	BlendResourceManager& brcmgr = smgr->getResources().blends();
	brcmgr.loadFromCSV(BIMGLIST);
	//brcmgr.set("slidemask", "data/res/adventure/blend/slidemask.png");
	//フォントハンドルの生成
	FontResourceManager& frcmgr = smgr->getResources().fonts();
	if (!frcmgr.hasKey("adventure_message_font")) {
		AddFontResourceEx(FONTPATH.c_str(), FR_PRIVATE, NULL);
		frcmgr.set("adventure_message_font", "しねきゃぷしょん", 24, 9, DX_FONTTYPE_ANTIALIASING_EDGE);
	}
	int fontHandle = frcmgr.get("adventure_message_font");

	//シナリオリストの生成
	Record rec;
	Table* scriptTable = new Table("data/res/adventure/scriptList.csv");
	scriptTable->find([=](const Record& r) {
		return r.getStr("key") == m_scriptId;
	}).getRecord(rec);
	std::string path = rec.getStr("filename");
    // シナリオデータの読み込み
	ScenarioScript script; //ローカル変数に変更
	script.init(path);

    // タスクの登録処理
	std::vector<std::string>::iterator it;
	InstructionExpression iExp;
	std::string line;
	while ((line = script.getLine()) != "") {
		Context context(line);
		bool result = iExp.interpret(context, smgr, this);
		assert("スクリプトの解釈に失敗しました." && result);
	}
    // 画面レイアウトの構築
    // メッセージウィンドウの登録
	DrawableRegister reg(this, mp_rsc);
	reg.addImage(REGISTER);

	//シナリオとキャラ名を表示するための初期設定
	mp_animationTextBox = new DrawableAnimationTextBox();
	mp_animationText = new DrawableAnimationText();

	mp_animationText->setTextColor(255, 255, 255);
	mp_animationText->setUseAnimation(false);

	mp_animationTextBox->setSize(30, 3);
	mp_animationTextBox->setLineSpace(20);
	mp_animationTextBox->setTextColor(255, 255, 255);
	mp_animationTextBox->setPosition(20,420);

	mp_animationText->setFontHandle(fontHandle);
	mp_animationTextBox->setFontHandle(fontHandle);

	addDrawable("t", mp_animationText, 13);
	addDrawable("b", mp_animationTextBox, 13);

	mp_animationText->setIsVisible(true);
	mp_animationTextBox->setIsVisible(true);

    if (m_continue) { // 状態の復元
		if (!m_BGKey.empty()) { // 背景の復元
			Drawable* bg = getDrawable(m_BGKey);
			bg->setAlpha(kdna::MAX_ALPHA);
			bg->setIsVisible(true);
		}
		if (!m_leftCharKey.empty()) {
			Drawable* left = getDrawable(m_leftCharKey);
			left->setAlpha(kdna::MAX_ALPHA);
			left->setPosition(85, 100); // todo: 定数を使用するように変更
			left->setIsVisible(true);
		}
		if (!m_rightCharKey.empty()) {
			Drawable* right = getDrawable(m_rightCharKey);
			right->setAlpha(kdna::MAX_ALPHA);
			right->setPosition(405, 100); // todo: 定数を使用するように変更
			right->setIsVisible(true);
		}
		if (!m_BGMKey.empty()) { // BGMの再生
			Sound* bgm = getSound(m_BGMKey);
			bgm->setVolume(100);
			bgm->play();
		}
	}

	return true;
}