示例#1
0
void OptionsGraphicsMenu::callbackActive(Widget &widget) {
	if (widget.getTag() == "BTN_ADVANCED") {
		adoptChanges();
		sub(*_advanced);
		return;
	}

	if (widget.getTag() == "BTN_RESOLUTION") {
		sub(*_resolution, kStartCodeNone, true, false);
		return;
	}

	if (widget.getTag() == "BTN_DEFAULT") {
		setDefault();
		displayConfig();
	}

	if (widget.getTag() == "BTN_BACK") {
		adoptChanges();
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "CB_SHADOWS") {
		_shadows = getCheckBoxState("CB_SHADOWS");
		return;
	}

	if (widget.getTag() == "CB_GRASS") {
		_grass = getCheckBoxState("CB_GRASS");
		return;
	}
}
示例#2
0
文件: options.cpp 项目: cc9cii/xoreos
void OptionsMenu::callbackActive(Widget &widget) {
	if (widget.getTag() == "BTN_GAMEPLAY") {
		sub(*_gameplay);
		return;
	}

	if (widget.getTag() == "BTN_FEEDBACK") {
		sub(*_feedback);
		return;
	}

	if (widget.getTag() == "BTN_AUTOPAUSE") {
		sub(*_autopause);
		return;
	}

	if (widget.getTag() == "BTN_GRAPHICS") {
		sub(*_graphics);
		return;
	}

	if (widget.getTag() == "BTN_SOUND") {
		sub(*_sound);
		return;
	}

	if (widget.getTag() == "BTN_BACK") {
		adoptChanges();
		_returnCode = 1;
		return;
	}
}
示例#3
0
void OptionsGameMenu::callbackActive(Widget &widget) {
	if ((widget.getTag() == "CancelButton") ||
	    (widget.getTag() == "XButton")) {

		revertChanges();
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "OkButton") {

		adoptChanges();
		_returnCode = 2;
		return;
	}

	if (widget.getTag() == "PasswordButton") {
		sub(*_gorepass);
		return;
	}

	if (widget.getTag() == "FeedbackButton") {
		sub(*_feedback);
		return;
	}

	if (widget.getTag() == "DiffSlider") {
		updateDifficulty(dynamic_cast<WidgetSlider &>(widget).getState());
		return;
	}
}
示例#4
0
void OptionsVideoAdvancedMenu::callbackActive(Widget &widget) {
	if ((widget.getTag() == "CancelButton") ||
	    (widget.getTag() == "XButton")) {

		revertChanges();
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "OkButton") {

		adoptChanges();
		_returnCode = 2;
		return;
	}

	if (widget.getTag() == "AntiAliasSlider") {
		_fsaa = dynamic_cast<WidgetSlider &>(widget).getState();

		updateFSAALabel(_fsaa);
		if (_fsaa > 0)
		_fsaa = 1 << _fsaa;

		return;
	}
}
示例#5
0
文件: video.cpp 项目: jjardon/eos
void OptionsVideoMenu::callbackActive(Widget &widget) {
	if ((widget.getTag() == "CancelButton") ||
	    (widget.getTag() == "XButton")) {

		revertChanges();
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "OkButton") {

		adoptChanges();
		_returnCode = 2;
		return;
	}

	if (widget.getTag() == "VideoModeButton") {
		sub(*_resolution);
		return;
	}

	if (widget.getTag() == "AdvVideoButton") {
		sub(*_advanced);
		return;
	}

	if (widget.getTag() == "GammaSlider") {
		float gamma = dynamic_cast<WidgetSlider &>(widget).getState() / 10.0;

		GfxMan.setGamma(gamma + 0.1);
		return;
	}

	if (widget.getTag() == "GammaResetButton") {
		GfxMan.setGamma(_gamma);

		int gammaValue = CLIP(_gamma - 0.1f, 0.0f, 1.9f) * 10;

		getSlider("GammaSlider", true)->setState(gammaValue);
		return;
	}

	if (widget.getTag() == "TextureSlider") {
		_textureLevel = dynamic_cast<WidgetSlider &>(widget).getState();

		updateTextureQualityLabel();
		return;
	}

	if (widget.getTag() == "ApplyButton") {
		ConfigMan.setInt("texturepack", _textureLevel);
		return;
	}

}
示例#6
0
void OptionsFeedbackMenu::callbackActive(Widget &widget) {
	if ((widget.getTag() == "CancelButton") ||
	    (widget.getTag() == "XButton")) {

		revertChanges();
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "OkButton") {

		adoptChanges();
		_returnCode = 2;
		return;
	}

	if (widget.getTag() == "TooltipSlider") {
		updateTooltipDelay(dynamic_cast<WidgetSlider &>(widget).getState());
		return;
	}
}
示例#7
0
文件: sound.cpp 项目: cc9cii/xoreos
void OptionsSoundMenu::callbackActive(Widget &widget) {
	if ((widget.getTag() == "CancelButton") ||
	    (widget.getTag() == "XButton")) {

		revertChanges();
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "OkButton") {

		adoptChanges();
		_returnCode = 2;
		return;
	}

	if (widget.getTag() == "AdvSoundBtn") {
		sub(*_advanced);
		return;
	}

	if (widget.getTag() == "MusicSlider") {
		_volMusic = dynamic_cast<WidgetSlider &>(widget).getState() / 20.0;
		updateVolume(_volMusic, Sound::kSoundTypeMusic, "MusicLabel");
		return;
	}

	if (widget.getTag() == "VoicesSlider") {
		_volVoice = dynamic_cast<WidgetSlider &>(widget).getState() / 20.0;
		updateVolume(_volVoice, Sound::kSoundTypeVoice, "VoicesLabel");
		return;
	}

	if (widget.getTag() == "SoundFXSlider") {
		_volSFX = _volVideo = dynamic_cast<WidgetSlider &>(widget).getState() / 20.0;
		updateVolume(_volSFX  , Sound::kSoundTypeSFX  , "SoundFXLabel");
		updateVolume(_volVideo, Sound::kSoundTypeVideo, "");
		return;
	}
}
示例#8
0
void OptionsGameplayMenu::callbackActive(Widget &widget) {

	if (widget.getTag() == "BTN_DIFFRIGHT") {
		_difficulty++;
		if (_difficulty > 2) {
			_difficulty = 2;
		}
		updateDifficulty(_difficulty);
		return;
	}

	if (widget.getTag() == "BTN_DIFFLEFT") {
		_difficulty--;
		if (_difficulty < 0) {
			_difficulty = 0;
		}
		updateDifficulty(_difficulty);
		return;
	}

	if (widget.getTag() == "BTN_MOUSE") {
		adoptChanges();
		sub(*_mousesettings);
		return;
	}

	if (widget.getTag() == "BTN_KEYMAP") {
		adoptChanges();
		sub(*_keyboardconfiguration);
		return;
	}

	if (widget.getTag() == "BTN_DEFAULT") {
		_difficulty = 1;
		updateDifficulty(_difficulty);

		_autoLevelUp = false;
		setCheckBoxState("CB_LEVELUP", _autoLevelUp);

		_mouseMove = false;
		setCheckBoxState("CB_INVERTCAM", _mouseMove);

		_autoSave = true;
		setCheckBoxState("CB_AUTOSAVE", _autoSave);

		_reverseMinigameY = false;
		setCheckBoxState("CB_REVERSE", _reverseMinigameY);

		_combatMovement = true;
		setCheckBoxState("CB_DISABLEMOVE", _combatMovement);
	}

	if (widget.getTag() == "BTN_BACK") {
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "CB_LEVELUP") {
		_autoLevelUp = getCheckBoxState("CB_LEVELUP");
		return;
	}

	if (widget.getTag() == "CB_INVERTCAM") {
		_mouseMove = getCheckBoxState("CB_INVERTCAM");
		return;
	}

	if (widget.getTag() == "CB_AUTOSAVE") {
		_autoSave = getCheckBoxState("CB_AUTOSAVE");
		return;
	}

	if (widget.getTag() == "CB_REVERSE") {
		_reverseMinigameY = getCheckBoxState("CB_REVERSE");
		return;
	}

	if (widget.getTag() == "CB_DISABLEMOVE") {
		_combatMovement = getCheckBoxState("CB_DISABLEMOVE");
		return;
	}
}
示例#9
0
void OptionsGraphicsAdvancedMenu::callbackActive(Widget &widget) {

	if (widget.getTag() == "BTN_TEXQUALRIGHT") {
		_textureQuality++;
		if (_textureQuality > 2) {
			_textureQuality = 2;
		}
		updateTextureQuality(_textureQuality);
		return;
	}

	if (widget.getTag() == "BTN_TEXQUALLEFT") {
		_textureQuality--;
		if (_textureQuality < 0) {
			_textureQuality = 0;
		}
		updateTextureQuality(_textureQuality);
		return;
	}

	if (widget.getTag() == "BTN_ANTIALIASRIGHT") {
		_antiAliasing++;
		if (_antiAliasing > 3) {
			_antiAliasing = 3;
		}
		updateAntiAliasing(_antiAliasing);
		return;
	}

	if (widget.getTag() == "BTN_ANTIALIASLEFT") {
		_antiAliasing--;
		if (_antiAliasing < 0) {
			_antiAliasing = 0;
		}
		updateAntiAliasing(_antiAliasing);
		return;
	}

	if (widget.getTag() == "BTN_ANISOTROPYRIGHT") {
		_anisotropy++;
		if (_anisotropy > 4) {
			_anisotropy = 4;
		}
		updateAnisotropy(_anisotropy);
		return;
	}

	if (widget.getTag() == "BTN_ANISOTROPYLEFT") {
		_anisotropy--;
		if (_anisotropy < 0) {
			_anisotropy = 0;
		}
		updateAnisotropy(_anisotropy);
		return;
	}

	if (widget.getTag() == "BTN_DEFAULT") {
		_textureQuality = 0;
		updateTextureQuality(_textureQuality);

		_antiAliasing = 0;
		updateAntiAliasing(_antiAliasing);

		_anisotropy = 0;
		updateAnisotropy(_anisotropy);

		_frameBufferEffects = true;
		setCheckBoxState("CB_FRAMEBUFF", _frameBufferEffects);

		_softShadows = true;
		setCheckBoxState("CB_SOFTSHADOWS", _softShadows);

		_vsync = false;
		setCheckBoxState("CB_VSYNC", _vsync);
	}

	if (widget.getTag() == "BTN_CANCEL") {
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "BTN_BACK") {
		adoptChanges();
		_returnCode = 1;
		return;
	}

	if (widget.getTag() == "CB_FRAMEBUFF") {
		_frameBufferEffects = getCheckBoxState("CB_FRAMEBUFF");
		return;
	}

	if (widget.getTag() == "CB_SOFTSHADOWS") {
		_softShadows = getCheckBoxState("CB_SOFTSHADOWS");
		return;
	}

	if (widget.getTag() == "CB_VSYNC") {
		_vsync = getCheckBoxState("CB_VSYNC");
		return;
	}
}