Replace Entry by TextEdit for string settings to workaround the limit of 255 characters
This commit is contained in:
@ -4,6 +4,7 @@ namespace ManiaControl\Configurator;
|
||||
|
||||
use FML\Components\CheckBox;
|
||||
use FML\Controls\Entry;
|
||||
use FML\Controls\TextEdit;
|
||||
use FML\Controls\Frame;
|
||||
use FML\Controls\Label;
|
||||
use FML\Controls\Labels\Label_Text;
|
||||
@ -439,7 +440,7 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
||||
$quad->setX(0.27 * $width);
|
||||
$checkBox = new CheckBox(self::ACTION_PREFIX_SETTING . $settingName, $settingValue, $quad);
|
||||
$settingFrame->addChild($checkBox);
|
||||
} else {
|
||||
} else if (is_numeric($settingValue)) {
|
||||
// Value entry
|
||||
$entry = new Entry();
|
||||
$settingFrame->addChild($entry);
|
||||
@ -449,6 +450,19 @@ class GameModeSettings implements ConfiguratorMenu, CallbackListener, Communicat
|
||||
$entry->setStyle(Label_Text::STYLE_TextValueSmall);
|
||||
$entry->setTextSize(1);
|
||||
$entry->setX(0.275 * $width);
|
||||
} else {
|
||||
// Standard entry
|
||||
$textedit = new TextEdit();
|
||||
$settingFrame->addChild($textedit);
|
||||
$textedit->setX(0.275 * $width);
|
||||
$textedit->setSize(0.3 * $width, 0.9 * $settingHeight);
|
||||
$textedit->setStyle(Label_Text::STYLE_TextValueSmall);
|
||||
$textedit->setTextSize(1);
|
||||
$textedit->setName(self::ACTION_PREFIX_SETTING . $settingName);
|
||||
$textedit->setDefault($settingValue);
|
||||
$textedit->setHorizontalAlign(TextEdit::CENTER);
|
||||
$textedit->setVerticalAlign(TextEdit::CENTER);
|
||||
$textedit->setMaxLines(1);
|
||||
}
|
||||
|
||||
if ($isScriptMode) {
|
||||
|
Reference in New Issue
Block a user