Allow to draw steering wheel on the right side
This commit is contained in:
parent
2cda14686d
commit
9fc1acc4c0
@ -15,6 +15,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div width="75%" layout="horizontal-row" proportion="1">
|
||||
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Inverted buttons"/>
|
||||
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||
<spacer width="40" height="10" />
|
||||
<checkbox id="buttons_inverted"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div width="75%" layout="horizontal-row" proportion="1">
|
||||
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Buttons scale"/>
|
||||
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
|
||||
|
@ -414,6 +414,11 @@ namespace UserConfigParams
|
||||
&m_multitouch_group,
|
||||
"Steering mode: 0 = off, 1 = buttons"));
|
||||
|
||||
PARAM_PREFIX BoolUserConfigParam m_multitouch_inverted
|
||||
PARAM_DEFAULT( BoolUserConfigParam(false, "multitouch_inverted",
|
||||
&m_multitouch_group,
|
||||
"Draw steering wheel on right side.") );
|
||||
|
||||
PARAM_PREFIX IntUserConfigParam m_multitouch_accelerometer
|
||||
PARAM_DEFAULT( IntUserConfigParam(0, "multitouch_accelerometer",
|
||||
&m_multitouch_group,
|
||||
|
@ -90,6 +90,10 @@ GUIEngine::EventPropagation MultitouchSettingsDialog::processEvent(
|
||||
assert(buttons_en != NULL);
|
||||
UserConfigParams::m_multitouch_mode = buttons_en->getState() ? 1 : 0;
|
||||
|
||||
CheckBoxWidget* buttons_inv = getWidget<CheckBoxWidget>("buttons_inverted");
|
||||
assert(buttons_inv != NULL);
|
||||
UserConfigParams::m_multitouch_inverted = buttons_inv->getState();
|
||||
|
||||
SpinnerWidget* accelerometer = getWidget<SpinnerWidget>("accelerometer");
|
||||
assert(accelerometer != NULL);
|
||||
|
||||
@ -144,7 +148,11 @@ void MultitouchSettingsDialog::updateValues()
|
||||
|
||||
CheckBoxWidget* buttons_en = getWidget<CheckBoxWidget>("buttons_enabled");
|
||||
assert(buttons_en != NULL);
|
||||
buttons_en->setState(UserConfigParams::m_multitouch_mode!=0);
|
||||
buttons_en->setState(UserConfigParams::m_multitouch_mode != 0);
|
||||
|
||||
CheckBoxWidget* buttons_inv = getWidget<CheckBoxWidget>("buttons_inverted");
|
||||
assert(buttons_inv != NULL);
|
||||
buttons_inv->setState(UserConfigParams::m_multitouch_inverted);
|
||||
|
||||
SpinnerWidget* accelerometer = getWidget<SpinnerWidget>("accelerometer");
|
||||
assert(accelerometer != NULL);
|
||||
|
@ -104,34 +104,48 @@ void RaceGUIMultitouch::initMultitouchSteering()
|
||||
const float btn_size = 0.125f * h * scale;
|
||||
const float btn2_size = 0.35f * h * scale;
|
||||
const float margin = 0.075f * h * scale;
|
||||
const float top_margin = 0.3f * h;
|
||||
const float margin_top = 0.3f * h;
|
||||
const float col_size = (btn_size + margin);
|
||||
|
||||
const float small_ratio = 0.75f;
|
||||
const float btn_small_size = small_ratio * btn_size;
|
||||
const float margin_small = small_ratio * margin;
|
||||
const float col_small_size = small_ratio * col_size;
|
||||
|
||||
float first_column_x = w - 2 * col_size;
|
||||
float second_column_x = w - 1 * col_size;
|
||||
float steering_btn_x = 0.5f * margin;
|
||||
|
||||
if (UserConfigParams::m_multitouch_inverted)
|
||||
{
|
||||
first_column_x = margin + 1 * col_size;
|
||||
second_column_x = margin;
|
||||
steering_btn_x = w - btn2_size - 0.5f * margin;
|
||||
}
|
||||
|
||||
m_minimap_bottom = (unsigned int)(h - 2 * col_size);
|
||||
|
||||
m_device->addButton(BUTTON_STEERING,
|
||||
int(0.5f * margin), int(h - 0.5f * margin - btn2_size),
|
||||
int(btn2_size), int(btn2_size));
|
||||
int(steering_btn_x), int(h - 0.5f * margin - btn2_size),
|
||||
int(btn2_size), int(btn2_size));
|
||||
m_device->addButton(BUTTON_ESCAPE,
|
||||
int(top_margin), int(small_ratio * margin),
|
||||
int(small_ratio * btn_size), int(small_ratio * btn_size));
|
||||
int(margin_top), int(margin_small),
|
||||
int(btn_small_size), int(btn_small_size));
|
||||
m_device->addButton(BUTTON_RESCUE,
|
||||
int(top_margin + small_ratio * col_size),
|
||||
int(small_ratio * margin),
|
||||
int(small_ratio * btn_size), int(small_ratio * btn_size));
|
||||
int(margin_top + col_small_size), int(margin_small),
|
||||
int(btn_small_size), int(btn_small_size));
|
||||
m_device->addButton(BUTTON_NITRO,
|
||||
int(w - 1 * col_size), int(h - 2 * col_size),
|
||||
int(btn_size), int(btn_size));
|
||||
int(second_column_x), int(h - 2 * col_size),
|
||||
int(btn_size), int(btn_size));
|
||||
m_device->addButton(BUTTON_SKIDDING,
|
||||
int(w - 1 * col_size), int(h - 1 * col_size),
|
||||
int(btn_size), int(btn_size));
|
||||
int(second_column_x), int(h - 1 * col_size),
|
||||
int(btn_size), int(btn_size));
|
||||
m_device->addButton(BUTTON_FIRE,
|
||||
int(w - 2 * col_size), int(h - 2 * col_size),
|
||||
int(btn_size), int(btn_size));
|
||||
int(first_column_x), int(h - 2 * col_size),
|
||||
int(btn_size), int(btn_size));
|
||||
m_device->addButton(BUTTON_LOOK_BACKWARDS,
|
||||
int(w - 2 * col_size), int(h - 1 * col_size),
|
||||
int(btn_size), int(btn_size));
|
||||
int(first_column_x), int(h - 1 * col_size),
|
||||
int(btn_size), int(btn_size));
|
||||
|
||||
m_directionnal_wheel_tex = irr_driver->getTexture(FileManager::GUI,
|
||||
"android/directionnal_wheel.png");
|
||||
|
Loading…
Reference in New Issue
Block a user