fix #3923 && replace fonts size to font size (#3960)

* Replace fonts size into font size

* replace fonts size to font size

* Replace fonts size into font size

* #3923 && 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

View File

@ -55,7 +55,7 @@
<label proportion="1" I18N="In the ui settings" text="Font size" align="center"/> <label proportion="1" I18N="In the ui settings" text="Font size" align="center"/>
<spacer width="2%" height="20"/> <spacer width="2%" height="20"/>
<div layout="horizontal-row" proportion="5" height="100%"> <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>
</div> </div>

View File

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

View File

@ -405,16 +405,16 @@ void FontWithFace::setDPI()
irr_driver->getActualScreenSize().Width) / 720.0f; irr_driver->getActualScreenSize().Width) / 720.0f;
int factorTwo = getScalingFactorTwo(); 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); m_face_dpi = int(factorTwo * getScalingFactorOne() * scale);
#ifndef SERVER_ONLY #ifndef SERVER_ONLY
if (!disableTextShaping()) if (!disableTextShaping())

View File

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

View File

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

View File

@ -132,6 +132,26 @@ void OptionsScreenUI::loadedFromFile()
minimap_options->m_properties[GUIEngine::PROP_MIN_VALUE] = "1"; minimap_options->m_properties[GUIEngine::PROP_MIN_VALUE] = "1";
} }
minimap_options->m_properties[GUIEngine::PROP_MAX_VALUE] = "2"; 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 } // loadedFromFile
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -166,8 +186,8 @@ void OptionsScreenUI::init()
GUIEngine::SpinnerWidget* font_size = getWidget<GUIEngine::SpinnerWidget>("font_size"); GUIEngine::SpinnerWidget* font_size = getWidget<GUIEngine::SpinnerWidget>("font_size");
assert( font_size != NULL ); assert( font_size != NULL );
font_size->setValue((int)roundf(UserConfigParams::m_fonts_size)); font_size->setValue((int)roundf(UserConfigParams::m_font_size));
m_prev_font_size = UserConfigParams::m_fonts_size; m_prev_font_size = UserConfigParams::m_font_size;
font_size->setActive(!in_game); font_size->setActive(!in_game);
// ---- video modes // ---- 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"); GUIEngine::SpinnerWidget* font_size = getWidget<GUIEngine::SpinnerWidget>("font_size");
assert( font_size != NULL ); assert( font_size != NULL );
UserConfigParams::m_fonts_size = font_size->getValue(); UserConfigParams::m_font_size = font_size->getValue();
} }
else if (name == "split_screen_horizontally") else if (name == "split_screen_horizontally")
{ {
@ -282,7 +302,7 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
void OptionsScreenUI::tearDown() void OptionsScreenUI::tearDown()
{ {
if (m_prev_font_size != UserConfigParams::m_fonts_size) if (m_prev_font_size != UserConfigParams::m_font_size)
{ {
irr_driver->sameRestart(); irr_driver->sameRestart();
} }