Add settings for touchscreen controls.
This commit is contained in:
@@ -1184,6 +1184,10 @@ STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :Select on which
|
||||
STR_CONFIG_SETTING_SIGNALSIDE_LEFT :On the left
|
||||
STR_CONFIG_SETTING_SIGNALSIDE_DRIVING_SIDE :On the driving side
|
||||
STR_CONFIG_SETTING_SIGNALSIDE_RIGHT :On the right
|
||||
STR_CONFIG_SETTING_TOUCHSCREEN_MODE :Control mode for touchscreen devices: {STRING2}
|
||||
STR_CONFIG_SETTING_TOUCHSCREEN_MODE_HELPTEXT :If playing with a mouse, choose no adaptation. Other modes are for touchscreen devices. Associated hotkey: N
|
||||
STR_CONFIG_SETTING_TOUCHSCREEN_NONE :no adaptation
|
||||
STR_CONFIG_SETTING_TOUCHSCREEN_SIMPLE :simple
|
||||
STR_CONFIG_SETTING_SHOWFINANCES :Show finances window at the end of the year: {STRING2}
|
||||
STR_CONFIG_SETTING_SHOWFINANCES_HELPTEXT :If enabled, the finances window pops up at the end of each year to allow easy inspection of the financial status of the company
|
||||
STR_CONFIG_SETTING_NONSTOP_BY_DEFAULT :New orders are 'non-stop' by default: {STRING2}
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "roadveh.h"
|
||||
#include "fios.h"
|
||||
#include "strings_func.h"
|
||||
#include "toolbar_gui.h"
|
||||
|
||||
#include "void_map.h"
|
||||
#include "station_base.h"
|
||||
@@ -1069,6 +1070,12 @@ static bool ZoomMinMaxChanged(int32 p1)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool TouchscreenModeChanged(int32 p1)
|
||||
{
|
||||
//ResetTabletWindow();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update any possible saveload window and delete any newgrf dialogue as
|
||||
* its widget parts might change. Reinit all windows as it allows access to the
|
||||
|
||||
@@ -1487,6 +1487,7 @@ static SettingEntry _settings_ui[] = {
|
||||
SettingEntry(&_settings_ui_interaction_page, STR_CONFIG_SETTING_INTERACTION),
|
||||
SettingEntry(&_settings_ui_sound_page, STR_CONFIG_SETTING_SOUND),
|
||||
SettingEntry(&_settings_ui_news_page, STR_CONFIG_SETTING_NEWS),
|
||||
SettingEntry("gui.touchscreen_mode"),
|
||||
SettingEntry("gui.show_finances"),
|
||||
SettingEntry("gui.errmsg_duration"),
|
||||
SettingEntry("gui.hover_delay"),
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "linkgraph/linkgraph_type.h"
|
||||
#include "zoom_type.h"
|
||||
#include "openttd.h"
|
||||
#include "toolbar_type.h"
|
||||
|
||||
|
||||
/** Settings profiles and highscore tables. */
|
||||
@@ -77,6 +78,7 @@ struct GUISettings {
|
||||
bool lost_vehicle_warn; ///< if a vehicle can't find its destination, show a warning
|
||||
uint8 order_review_system; ///< perform order reviews on vehicles
|
||||
bool vehicle_income_warn; ///< if a vehicle isn't generating income, show a warning
|
||||
TouchscreenModeByte touchscreen_mode; ///< touchscreen mode for toolbars
|
||||
uint min_button; ///< min size of most button widgets
|
||||
uint min_step; ///< min size of scrollbar/dropdown elements
|
||||
bool manage_min_sizing; ///< automatically set min_button and min_step
|
||||
|
||||
@@ -40,6 +40,7 @@ static bool RedrawTownAuthority(int32 p1);
|
||||
static bool InvalidateCompanyInfrastructureWindow(int32 p1);
|
||||
static bool InvalidateCompanyWindow(int32 p1);
|
||||
static bool ZoomMinMaxChanged(int32 p1);
|
||||
static bool TouchscreenModeChanged(int32 p1);
|
||||
|
||||
#ifdef ENABLE_NETWORK
|
||||
static bool UpdateClientName(int32 p1);
|
||||
@@ -2496,6 +2497,21 @@ str = STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES
|
||||
strhelp = STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_HELPTEXT
|
||||
strval = STR_CONFIG_SETTING_DATE_FORMAT_IN_SAVE_NAMES_LONG
|
||||
|
||||
[SDTC_VAR]
|
||||
var = gui.touchscreen_mode
|
||||
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
||||
type = SLE_UINT8
|
||||
guiflags = SGF_MULTISTRING
|
||||
def = 0
|
||||
min = 0
|
||||
max = 1
|
||||
interval = 1
|
||||
str = STR_CONFIG_SETTING_TOUCHSCREEN_MODE
|
||||
strval = STR_CONFIG_SETTING_TOUCHSCREEN_NONE
|
||||
strhelp = STR_CONFIG_SETTING_TOUCHSCREEN_MODE_HELPTEXT
|
||||
proc = TouchscreenModeChanged
|
||||
cat = SC_BASIC
|
||||
|
||||
[SDTC_BOOL]
|
||||
var = gui.show_finances
|
||||
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
||||
|
||||
Reference in New Issue
Block a user