Commit 8b5c689a authored by fallenstardust's avatar fallenstardust

为wMainMenu添加设置功能按钮

parent dcf88f22
......@@ -226,36 +226,42 @@ bool Game::Initialize() {
wMainMenu = env->addWindow(rect<s32>(450 * xScale, 40 * yScale, 900 * xScale, 600 * yScale), false, strbuf);
wMainMenu->getCloseButton()->setVisible(false);
wMainMenu->setDrawBackground(false);
btnLanMode = env->addButton(rect<s32>(15 * xScale, 30 * yScale, 415 * xScale, 106 * yScale), wMainMenu, BUTTON_LAN_MODE, dataManager.GetSysString(1200));
btnLanMode->setUseAlphaChannel(true);
//btnLanMode->setDrawBorder(false);
btnLanMode = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(15 * xScale, 30 * yScale, 415 * xScale, 106 * yScale), wMainMenu, BUTTON_LAN_MODE);
btnLanMode->setImageSize(core::dimension2di(400 * yScale, 76 * yScale));
btnLanMode->setDrawBorder(false);
btnLanMode->setImage(imageManager.tTitleBar);
btnLanMode->setText(dataManager.GetSysString(1200));
btnLanMode->setOverrideFont(titleFont);
env->addStaticText(strbuf, rect<s32>(75 * xScale, 35 * yScale, 300 * xScale, 65 * yScale), false, false, wMainMenu);
btnSingleMode = env->addButton(rect<s32>(15 * xScale, 110 * yScale, 415 * xScale, 186 * yScale), wMainMenu, BUTTON_SINGLE_MODE, dataManager.GetSysString(1201));
btnSingleMode->setUseAlphaChannel(true);
btnSingleMode->setDrawBorder(false);
env->addStaticText(strbuf, rect<s32>(72 * xScale, 2 * yScale, 300 * xScale, 35 * yScale), false, false, btnLanMode);
btnSingleMode = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(15 * xScale, 110 * yScale, 415 * xScale, 186 * yScale), wMainMenu, BUTTON_SINGLE_MODE);
btnSingleMode->setImageSize(core::dimension2di(400 * yScale, 76 * yScale));
btnSingleMode->setDrawBorder(false);
btnSingleMode->setImage(imageManager.tTitleBar);
btnSingleMode->setText(dataManager.GetSysString(1201));
btnSingleMode->setOverrideFont(titleFont);
btnReplayMode = env->addButton(rect<s32>(15 * xScale, 190 * yScale, 415 * xScale, 266 * yScale), wMainMenu, BUTTON_REPLAY_MODE, dataManager.GetSysString(1202));
btnReplayMode->setUseAlphaChannel(true);
btnReplayMode = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(15 * xScale, 190 * yScale, 415 * xScale, 266 * yScale), wMainMenu, BUTTON_REPLAY_MODE);
btnReplayMode->setImageSize(core::dimension2di(400 * yScale, 76 * yScale));
btnReplayMode->setDrawBorder(false);
btnReplayMode->setImage(imageManager.tTitleBar);
btnReplayMode->setText(dataManager.GetSysString(1202));
btnReplayMode->setOverrideFont(titleFont);
btnDeckEdit = env->addButton(rect<s32>(15 * xScale, 270 * yScale, 415 * xScale, 346 * yScale), wMainMenu, BUTTON_DECK_EDIT, dataManager.GetSysString(1204));
btnDeckEdit->setUseAlphaChannel(true);
btnDeckEdit = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(15 * xScale, 270 * yScale, 415 * xScale, 346 * yScale), wMainMenu, BUTTON_DECK_EDIT);
btnDeckEdit->setImageSize(core::dimension2di(400 * yScale, 76 * yScale));
btnDeckEdit->setDrawBorder(false);
btnDeckEdit->setImage(imageManager.tTitleBar);
btnDeckEdit->setText(dataManager.GetSysString(1204));
btnDeckEdit->setOverrideFont(titleFont);
btnSettings = env->addButton(rect<s32>(15 * xScale, 350 * yScale, 415 * xScale, 426 * yScale), wMainMenu, BUTTON_SETTINGS, dataManager.GetSysString(1273));
btnSettings->setUseAlphaChannel(true);
btnSettings = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(15 * xScale, 350 * yScale, 415 * xScale, 426 * yScale), wMainMenu, BUTTON_SETTINGS);
btnSettings->setImageSize(core::dimension2di(400 * yScale, 76 * yScale));
btnSettings->setDrawBorder(false);
btnSettings->setImage(imageManager.tTitleBar);
btnSettings->setText(dataManager.GetSysString(1273));
btnSettings->setOverrideFont(titleFont);
btnModeExit = env->addButton(rect<s32>(15 * xScale, 430 * yScale, 415 * xScale, 506 * yScale), wMainMenu, BUTTON_MODE_EXIT, dataManager.GetSysString(1210));
btnModeExit->setUseAlphaChannel(true);
btnModeExit = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(15 * xScale, 430 * yScale, 415 * xScale, 506 * yScale), wMainMenu, BUTTON_MODE_EXIT);
btnModeExit->setImageSize(core::dimension2di(400 * yScale, 76 * yScale));
btnModeExit->setDrawBorder(false);
btnModeExit->setImage(imageManager.tTitleBar);
btnModeExit->setText(dataManager.GetSysString(1210));
btnModeExit->setOverrideFont(titleFont);
//lan mode
wLanWindow = env->addWindow(rect<s32>(200 * xScale, 80 * yScale, 820 * xScale, 590 * yScale), false, dataManager.GetSysString(1200));
......
......@@ -310,13 +310,13 @@ public:
irr::gui::IGUICheckBox* chkMusicMode;
//main menu
irr::gui::IGUIWindow* wMainMenu;
irr::gui::IGUIButton* btnLanMode;
irr::gui::IGUIButton* btnSingleMode;
irr::gui::IGUIButton* btnReplayMode;
irr::gui::CGUIImageButton* btnLanMode;
irr::gui::CGUIImageButton* btnSingleMode;
irr::gui::CGUIImageButton* btnReplayMode;
irr::gui::IGUIButton* btnTestMode;
irr::gui::IGUIButton* btnDeckEdit;
irr::gui::IGUIButton* btnSettings;
irr::gui::IGUIButton* btnModeExit;
irr::gui::CGUIImageButton* btnDeckEdit;
irr::gui::CGUIImageButton* btnSettings;
irr::gui::CGUIImageButton* btnModeExit;
//lan
irr::gui::IGUIWindow* wLanWindow;
irr::gui::IGUIEditBox* ebNickName;
......
......@@ -462,6 +462,16 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
prev_sel = -1;
break;
}
case BUTTON_SETTINGS: {
mainGame->HideElement(mainGame->wMainMenu);
mainGame->ShowElement(mainGame->wSettings);
break;
}
case BUTTON_CLOSE_SETTINGS: {
mainGame->HideElement(mainGame->wSettings);
mainGame->ShowElement(mainGame->wMainMenu);
break;
}
}
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment