mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 21:45:33 +00:00
Merge pull request #98 from OpenMW/master while resolving conflicts
# Conflicts: # apps/openmw/CMakeLists.txt
This commit is contained in:
commit
ec211e58d0
4 changed files with 23 additions and 9 deletions
|
@ -10,7 +10,6 @@ mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
cmake \
|
cmake \
|
||||||
-D CMAKE_EXE_LINKER_FLAGS="-lz" \
|
|
||||||
-D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH" \
|
-D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH" \
|
||||||
-D CMAKE_OSX_DEPLOYMENT_TARGET="10.8" \
|
-D CMAKE_OSX_DEPLOYMENT_TARGET="10.8" \
|
||||||
-D CMAKE_OSX_SYSROOT="macosx10.11" \
|
-D CMAKE_OSX_SYSROOT="macosx10.11" \
|
||||||
|
|
|
@ -190,6 +190,7 @@ if(APPLE)
|
||||||
find_library(COREVIDEO_FRAMEWORK CoreVideo)
|
find_library(COREVIDEO_FRAMEWORK CoreVideo)
|
||||||
find_library(VDA_FRAMEWORK VideoDecodeAcceleration)
|
find_library(VDA_FRAMEWORK VideoDecodeAcceleration)
|
||||||
target_link_libraries(tes3mp ${COREVIDEO_FRAMEWORK} ${VDA_FRAMEWORK})
|
target_link_libraries(tes3mp ${COREVIDEO_FRAMEWORK} ${VDA_FRAMEWORK})
|
||||||
|
target_link_libraries(tes3mp z ${COREVIDEO_FRAMEWORK} ${VDA_FRAMEWORK})
|
||||||
endif()
|
endif()
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
|
|
|
@ -466,9 +466,6 @@ namespace MWGui
|
||||||
else
|
else
|
||||||
actions = MWBase::Environment::get().getInputManager()->getActionControllerSorting();
|
actions = MWBase::Environment::get().getInputManager()->getActionControllerSorting();
|
||||||
|
|
||||||
const int h = 18;
|
|
||||||
const int w = mControlsBox->getWidth() - 28;
|
|
||||||
int curH = 0;
|
|
||||||
for (std::vector<int>::const_iterator it = actions.begin(); it != actions.end(); ++it)
|
for (std::vector<int>::const_iterator it = actions.begin(); it != actions.end(); ++it)
|
||||||
{
|
{
|
||||||
std::string desc = MWBase::Environment::get().getInputManager()->getActionDescription (*it);
|
std::string desc = MWBase::Environment::get().getInputManager()->getActionDescription (*it);
|
||||||
|
@ -481,16 +478,15 @@ namespace MWGui
|
||||||
else
|
else
|
||||||
binding = MWBase::Environment::get().getInputManager()->getActionControllerBindingName(*it);
|
binding = MWBase::Environment::get().getInputManager()->getActionControllerBindingName(*it);
|
||||||
|
|
||||||
Gui::SharedStateButton* leftText = mControlsBox->createWidget<Gui::SharedStateButton>("SandTextButton", MyGUI::IntCoord(0,curH,w,h), MyGUI::Align::Default);
|
Gui::SharedStateButton* leftText = mControlsBox->createWidget<Gui::SharedStateButton>("SandTextButton", MyGUI::IntCoord(), MyGUI::Align::Default);
|
||||||
leftText->setCaptionWithReplacing(desc);
|
leftText->setCaptionWithReplacing(desc);
|
||||||
|
|
||||||
Gui::SharedStateButton* rightText = mControlsBox->createWidget<Gui::SharedStateButton>("SandTextButton", MyGUI::IntCoord(0,curH,w,h), MyGUI::Align::Default);
|
Gui::SharedStateButton* rightText = mControlsBox->createWidget<Gui::SharedStateButton>("SandTextButton", MyGUI::IntCoord(), MyGUI::Align::Default);
|
||||||
rightText->setCaptionWithReplacing(binding);
|
rightText->setCaptionWithReplacing(binding);
|
||||||
rightText->setTextAlign (MyGUI::Align::Right);
|
rightText->setTextAlign (MyGUI::Align::Right);
|
||||||
rightText->setUserData(*it); // save the action id for callbacks
|
rightText->setUserData(*it); // save the action id for callbacks
|
||||||
rightText->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onRebindAction);
|
rightText->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onRebindAction);
|
||||||
rightText->eventMouseWheel += MyGUI::newDelegate(this, &SettingsWindow::onInputTabMouseWheel);
|
rightText->eventMouseWheel += MyGUI::newDelegate(this, &SettingsWindow::onInputTabMouseWheel);
|
||||||
curH += h;
|
|
||||||
|
|
||||||
Gui::ButtonGroup group;
|
Gui::ButtonGroup group;
|
||||||
group.push_back(leftText);
|
group.push_back(leftText);
|
||||||
|
@ -498,9 +494,25 @@ namespace MWGui
|
||||||
Gui::SharedStateButton::createButtonGroup(group);
|
Gui::SharedStateButton::createButtonGroup(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
layoutControlsBox();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SettingsWindow::layoutControlsBox()
|
||||||
|
{
|
||||||
|
const int h = 18;
|
||||||
|
const int w = mControlsBox->getWidth() - 28;
|
||||||
|
const int noWidgetsInRow = 2;
|
||||||
|
const int totalH = mControlsBox->getChildCount() / noWidgetsInRow * h;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < mControlsBox->getChildCount(); i++)
|
||||||
|
{
|
||||||
|
MyGUI::Widget * widget = mControlsBox->getChildAt(i);
|
||||||
|
widget->setCoord(0, i / noWidgetsInRow * h, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
// Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the scrollbar is hidden
|
// Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the scrollbar is hidden
|
||||||
mControlsBox->setVisibleVScroll(false);
|
mControlsBox->setVisibleVScroll(false);
|
||||||
mControlsBox->setCanvasSize (mControlsBox->getWidth(), std::max(curH, mControlsBox->getHeight()));
|
mControlsBox->setCanvasSize (mControlsBox->getWidth(), std::max(totalH, mControlsBox->getHeight()));
|
||||||
mControlsBox->setVisibleVScroll(true);
|
mControlsBox->setVisibleVScroll(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,7 +568,7 @@ namespace MWGui
|
||||||
|
|
||||||
void SettingsWindow::onWindowResize(MyGUI::Window *_sender)
|
void SettingsWindow::onWindowResize(MyGUI::Window *_sender)
|
||||||
{
|
{
|
||||||
updateControlsBox();
|
layoutControlsBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWindow::resetScrollbars()
|
void SettingsWindow::resetScrollbars()
|
||||||
|
|
|
@ -67,6 +67,8 @@ namespace MWGui
|
||||||
void configureWidgets(MyGUI::Widget* widget);
|
void configureWidgets(MyGUI::Widget* widget);
|
||||||
void updateSliderLabel(MyGUI::ScrollBar* scroller, const std::string& value);
|
void updateSliderLabel(MyGUI::ScrollBar* scroller, const std::string& value);
|
||||||
|
|
||||||
|
void layoutControlsBox();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void resetScrollbars();
|
void resetScrollbars();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue