mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
check enableUiEnhancements flag
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
#include "../render/Colors.h"
|
#include "../render/Colors.h"
|
||||||
#include "../render/IRenderHandler.h"
|
#include "../render/IRenderHandler.h"
|
||||||
|
|
||||||
|
#include "../../lib/CConfigHandler.h"
|
||||||
|
|
||||||
void CSlider::mouseDragged(const Point & cursorPosition, const Point & lastUpdateDistance)
|
void CSlider::mouseDragged(const Point & cursorPosition, const Point & lastUpdateDistance)
|
||||||
{
|
{
|
||||||
bool onControl = pos.isInside(cursorPosition) && !left->pos.isInside(cursorPosition) && !right->pos.isInside(cursorPosition);
|
bool onControl = pos.isInside(cursorPosition) && !left->pos.isInside(cursorPosition) && !right->pos.isInside(cursorPosition);
|
||||||
@@ -293,13 +295,18 @@ void CSlider::setAmount( int to )
|
|||||||
positions = to - capacity;
|
positions = to - capacity;
|
||||||
vstd::amax(positions, 0);
|
vstd::amax(positions, 0);
|
||||||
|
|
||||||
int track = length - 32;
|
if(settings["general"]["enableUiEnhancements"].Bool())
|
||||||
if(to > 0)
|
{
|
||||||
barLength = (track * capacity) / to;
|
int track = length - 32;
|
||||||
|
if(to > 0)
|
||||||
|
barLength = (track * capacity) / to;
|
||||||
|
else
|
||||||
|
barLength = track;
|
||||||
|
vstd::amax(barLength, 16);
|
||||||
|
vstd::amin(barLength, track);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
barLength = track;
|
barLength = 16;
|
||||||
vstd::amax(barLength, 16);
|
|
||||||
vstd::amin(barLength, track);
|
|
||||||
|
|
||||||
updateSlider();
|
updateSlider();
|
||||||
updateSliderPos();
|
updateSliderPos();
|
||||||
|
|||||||
Reference in New Issue
Block a user