fix && replace fonts size to font size ()

* Replace fonts size into font size

* replace fonts size to font size

* Replace fonts size into font size

*  && replace fonts size to font size

* delete min & max

* add font size spinner in loadedfromfile

* Delete wrap around

* Fix a bug

* Wider range in artist debug mode

* Better word
This commit is contained in:
dumaosen 2019-06-16 00:33:57 +08:00 committed by Benau
parent fb31ddc81f
commit 4f6e3793b8
6 changed files with 38 additions and 16 deletions

@ -55,7 +55,7 @@
<label proportion="1" I18N="In the ui settings" text="Font size" align="center"/>
<spacer width="2%" height="20"/>
<div layout="horizontal-row" proportion="5" height="100%">
<gauge id="font_size" min_value="1" max_value="5" width="60%"/>
<gauge id="font_size" width="60%"/>
</div>
</div>

@ -643,8 +643,8 @@ namespace UserConfigParams
PARAM_DEFAULT(BoolUserConfigParam(false, "hq_mipmap",
&m_video_group, "Generate mipmap for textures using "
"high quality method with SSE"));
PARAM_PREFIX FloatUserConfigParam m_fonts_size
PARAM_DEFAULT( FloatUserConfigParam(3, "fonts_size",
PARAM_PREFIX FloatUserConfigParam m_font_size
PARAM_DEFAULT( FloatUserConfigParam(3, "font_size",
&m_video_group,"The size of fonts. 0 is the smallest and 6 is the biggest") );
// ---- Recording

@ -405,16 +405,16 @@ void FontWithFace::setDPI()
irr_driver->getActualScreenSize().Width) / 720.0f;
int factorTwo = getScalingFactorTwo();
if (UserConfigParams::m_fonts_size < 0)
if (UserConfigParams::m_font_size < 0)
{
UserConfigParams::m_fonts_size = 0;
UserConfigParams::m_font_size = 0;
}
else if (UserConfigParams::m_fonts_size > 6)
else if (UserConfigParams::m_font_size > 6)
{
UserConfigParams::m_fonts_size = 6;
UserConfigParams::m_font_size = 6;
}
factorTwo += UserConfigParams::m_fonts_size * 5 - 10;
factorTwo += UserConfigParams::m_font_size * 5 - 10;
m_face_dpi = int(factorTwo * getScalingFactorOne() * scale);
#ifndef SERVER_ONLY
if (!disableTextShaping())

@ -1398,8 +1398,10 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget,
{
const int handle_size = (int)( widget->m_h*params->m_left_border
/(float)params->getImage()->getSize().Height );
const float value = (float)(w->getValue() - w->getMin())
float value = (float)(w->getValue() - w->getMin())
/ (w->getMax() - w->getMin());
if (value > 1.0f) value = 1.0f;
if (value > 0.0f)
{

@ -52,17 +52,17 @@ void override_default_params()
case ACONFIGURATION_SCREENSIZE_NORMAL:
UserConfigParams::m_multitouch_scale = 1.3f;
UserConfigParams::m_multitouch_sensitivity_x = 0.1f;
UserConfigParams::m_fonts_size = 5.0f;
UserConfigParams::m_font_size = 5.0f;
break;
case ACONFIGURATION_SCREENSIZE_LARGE:
UserConfigParams::m_multitouch_scale = 1.2f;
UserConfigParams::m_multitouch_sensitivity_x = 0.15f;
UserConfigParams::m_fonts_size = 5.0f;
UserConfigParams::m_font_size = 5.0f;
break;
case ACONFIGURATION_SCREENSIZE_XLARGE:
UserConfigParams::m_multitouch_scale = 1.1f;
UserConfigParams::m_multitouch_sensitivity_x = 0.2f;
UserConfigParams::m_fonts_size = 4.0f;
UserConfigParams::m_font_size = 4.0f;
break;
default:
break;

@ -132,6 +132,26 @@ void OptionsScreenUI::loadedFromFile()
minimap_options->m_properties[GUIEngine::PROP_MIN_VALUE] = "1";
}
minimap_options->m_properties[GUIEngine::PROP_MAX_VALUE] = "2";
GUIEngine::SpinnerWidget* font_size = getWidget<GUIEngine::SpinnerWidget>("font_size");
assert( font_size != NULL );
font_size->clearLabels();
font_size->addLabel( core::stringw("Extremely small"));
font_size->addLabel( core::stringw(_("Very small")));
font_size->addLabel( core::stringw(_("Small")));
font_size->addLabel( core::stringw(_("Medium")));
font_size->addLabel( core::stringw(_("Large")));
font_size->addLabel( core::stringw(_("Very large")));
font_size->addLabel( core::stringw("Extremely large"));
font_size->m_properties[GUIEngine::PROP_MIN_VALUE] = "1";
font_size->m_properties[GUIEngine::PROP_MAX_VALUE] = "5";
if(UserConfigParams::m_artist_debug_mode)
{
font_size->m_properties[GUIEngine::PROP_MIN_VALUE] = "0";
font_size->m_properties[GUIEngine::PROP_MAX_VALUE] = "6";
}
} // loadedFromFile
// -----------------------------------------------------------------------------
@ -166,8 +186,8 @@ void OptionsScreenUI::init()
GUIEngine::SpinnerWidget* font_size = getWidget<GUIEngine::SpinnerWidget>("font_size");
assert( font_size != NULL );
font_size->setValue((int)roundf(UserConfigParams::m_fonts_size));
m_prev_font_size = UserConfigParams::m_fonts_size;
font_size->setValue((int)roundf(UserConfigParams::m_font_size));
m_prev_font_size = UserConfigParams::m_font_size;
font_size->setActive(!in_game);
// ---- video modes
@ -260,7 +280,7 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
{
GUIEngine::SpinnerWidget* font_size = getWidget<GUIEngine::SpinnerWidget>("font_size");
assert( font_size != NULL );
UserConfigParams::m_fonts_size = font_size->getValue();
UserConfigParams::m_font_size = font_size->getValue();
}
else if (name == "split_screen_horizontally")
{
@ -282,7 +302,7 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
void OptionsScreenUI::tearDown()
{
if (m_prev_font_size != UserConfigParams::m_fonts_size)
if (m_prev_font_size != UserConfigParams::m_font_size)
{
irr_driver->sameRestart();
}