Merge branch 'tracerestrict-sx' into jgrpp
Conflicts: src/lang/english.txt src/settings_gui.cpp src/settings_type.h src/table/settings.ini
This commit is contained in:
@@ -48,6 +48,7 @@ static const SpriteID * const _landscape_spriteindexes[] = {
|
|||||||
|
|
||||||
/** file index of first user-added GRF file */
|
/** file index of first user-added GRF file */
|
||||||
int _first_user_grf_file_index;
|
int _first_user_grf_file_index;
|
||||||
|
int _opengfx_grf_file_index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load an old fashioned GRF file.
|
* Load an old fashioned GRF file.
|
||||||
@@ -185,6 +186,11 @@ static void LoadSpriteTables()
|
|||||||
/* Tracerestrict sprites. */
|
/* Tracerestrict sprites. */
|
||||||
LoadGrfFile("tracerestrict.grf", SPR_TRACERESTRICT_BASE, i++);
|
LoadGrfFile("tracerestrict.grf", SPR_TRACERESTRICT_BASE, i++);
|
||||||
|
|
||||||
|
/* Fill duplicate original signal graphics sprite block */
|
||||||
|
for (uint i = 0; i < DUP_ORIGINAL_SIGNALS_SPRITE_COUNT; i++) {
|
||||||
|
DupSprite(SPR_ORIGINAL_SIGNALS_BASE + i, SPR_DUP_ORIGINAL_SIGNALS_BASE + i);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The second basic file always starts at the given location and does
|
* The second basic file always starts at the given location and does
|
||||||
* contain a different amount of sprites depending on the "type"; DOS
|
* contain a different amount of sprites depending on the "type"; DOS
|
||||||
@@ -242,6 +248,16 @@ static void LoadSpriteTables()
|
|||||||
LoadNewGRF(SPR_NEWGRFS_BASE, i);
|
LoadNewGRF(SPR_NEWGRFS_BASE, i);
|
||||||
|
|
||||||
_first_user_grf_file_index = i + 1;
|
_first_user_grf_file_index = i + 1;
|
||||||
|
_opengfx_grf_file_index = -1;
|
||||||
|
uint index = i;
|
||||||
|
for (GRFConfig *c = master; c != NULL; c = c->next, index++) {
|
||||||
|
if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND || HasBit(c->flags, GCF_INIT_ONLY)) continue;
|
||||||
|
if (c->ident.grfid == BSWAP32(0xFF4F4701)) {
|
||||||
|
/* Detect OpenGFX GRF ID */
|
||||||
|
_opengfx_grf_file_index = index;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Free and remove the top element. */
|
/* Free and remove the top element. */
|
||||||
delete master;
|
delete master;
|
||||||
|
@@ -1298,6 +1298,8 @@ STR_CONFIG_SETTING_SHOW_TRAIN_LENGTH_IN_DETAILS :Show train leng
|
|||||||
STR_CONFIG_SETTING_SHOW_TRAIN_LENGTH_IN_DETAILS_HELPTEXT :Show train length in the vehicle details window
|
STR_CONFIG_SETTING_SHOW_TRAIN_LENGTH_IN_DETAILS_HELPTEXT :Show train length in the vehicle details window
|
||||||
STR_CONFIG_SETTING_SHOW_VEHICLE_GROUP_IN_DETAILS :Show vehicle group in details: {STRING2}
|
STR_CONFIG_SETTING_SHOW_VEHICLE_GROUP_IN_DETAILS :Show vehicle group in details: {STRING2}
|
||||||
STR_CONFIG_SETTING_SHOW_VEHICLE_GROUP_IN_DETAILS_HELPTEXT :Show vehicle group name in the vehicle details window
|
STR_CONFIG_SETTING_SHOW_VEHICLE_GROUP_IN_DETAILS_HELPTEXT :Show vehicle group name in the vehicle details window
|
||||||
|
STR_CONFIG_SETTING_SHOW_RESTRICTED_SIG_DEF :Show restricted electric signals using default graphics: {STRING2}
|
||||||
|
STR_CONFIG_SETTING_SHOW_RESTRICTED_SIG_DEF_HELPTEXT :Show electric signals with routing restriction programs using the default signal graphics with a blue signal post, instead of using any NewGRF signal graphics. This is to make it easier to visually distinguish restricted signals.
|
||||||
|
|
||||||
STR_CONFIG_SETTING_LANDSCAPE :Landscape: {STRING2}
|
STR_CONFIG_SETTING_LANDSCAPE :Landscape: {STRING2}
|
||||||
STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Landscapes define basic gameplay scenarios with different cargos and town growth requirements. NewGRF and Game Scripts allow finer control though
|
STR_CONFIG_SETTING_LANDSCAPE_HELPTEXT :Landscapes define basic gameplay scenarios with different cargos and town growth requirements. NewGRF and Game Scripts allow finer control though
|
||||||
|
@@ -5671,11 +5671,19 @@ static void GraphicsNew(ByteReader *buf)
|
|||||||
/* Load <num> sprites starting from <replace>, then skip <skip_num> sprites. */
|
/* Load <num> sprites starting from <replace>, then skip <skip_num> sprites. */
|
||||||
grfmsg(2, "GraphicsNew: Replacing sprites %d to %d of %s (type 0x%02X) at SpriteID 0x%04X", offset, offset + num - 1, action5_type->name, type, replace);
|
grfmsg(2, "GraphicsNew: Replacing sprites %d to %d of %s (type 0x%02X) at SpriteID 0x%04X", offset, offset + num - 1, action5_type->name, type, replace);
|
||||||
|
|
||||||
for (; num > 0; num--) {
|
for (uint16 n = num; n > 0; n--) {
|
||||||
_cur.nfo_line++;
|
_cur.nfo_line++;
|
||||||
LoadNextSprite(replace == 0 ? _cur.spriteid++ : replace++, _cur.file_index, _cur.nfo_line, _cur.grf_container_ver);
|
LoadNextSprite(replace == 0 ? _cur.spriteid++ : replace++, _cur.file_index, _cur.nfo_line, _cur.grf_container_ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == 0x04 && (_cur.grffile->is_ottdfile || _cur.grfconfig->ident.grfid == BSWAP32(0xFF4F4701))) {
|
||||||
|
/* Signal graphics action 5: Fill duplicate signal sprite block if this is a baseset GRF or OpenGFX */
|
||||||
|
const SpriteID end = offset + num;
|
||||||
|
for (SpriteID i = offset; i < end; i++) {
|
||||||
|
DupSprite(SPR_SIGNALS_BASE + i, SPR_DUP_SIGNALS_BASE + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (type == 0x0D) _loaded_newgrf_features.shore = SHORE_REPLACE_ACTION_5;
|
if (type == 0x0D) _loaded_newgrf_features.shore = SHORE_REPLACE_ACTION_5;
|
||||||
|
|
||||||
_cur.skip_sprites = skip_num;
|
_cur.skip_sprites = skip_num;
|
||||||
|
@@ -1987,6 +1987,8 @@ static void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track trac
|
|||||||
SignalType type = GetSignalType(tile, track);
|
SignalType type = GetSignalType(tile, track);
|
||||||
SignalVariant variant = GetSignalVariant(tile, track);
|
SignalVariant variant = GetSignalVariant(tile, track);
|
||||||
|
|
||||||
|
bool show_restricted = (variant == SIG_ELECTRIC) && IsRestrictedSignal(tile) && (GetExistingTraceRestrictProgram(tile, track) != NULL);
|
||||||
|
|
||||||
SpriteID sprite = GetCustomSignalSprite(rti, tile, type, variant, condition);
|
SpriteID sprite = GetCustomSignalSprite(rti, tile, type, variant, condition);
|
||||||
bool is_custom_sprite = (sprite != 0);
|
bool is_custom_sprite = (sprite != 0);
|
||||||
if (sprite != 0) {
|
if (sprite != 0) {
|
||||||
@@ -2003,11 +2005,21 @@ static void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track trac
|
|||||||
} else if (type == SIGTYPE_PROG && variant == SIG_ELECTRIC) {
|
} else if (type == SIGTYPE_PROG && variant == SIG_ELECTRIC) {
|
||||||
sprite = SPR_PROGSIGNAL_BASE + 16 + image * 2 + condition;
|
sprite = SPR_PROGSIGNAL_BASE + 16 + image * 2 + condition;
|
||||||
is_custom_sprite = false;
|
is_custom_sprite = false;
|
||||||
}
|
} else {
|
||||||
|
uint origin_slot = GetOriginFileSlot(sprite);
|
||||||
extern uint _first_user_grf_file_index;
|
extern uint _first_user_grf_file_index;
|
||||||
if (!is_custom_sprite) is_custom_sprite = (GetOriginFileSlot(sprite) >= _first_user_grf_file_index);
|
extern uint _opengfx_grf_file_index;
|
||||||
|
if (!is_custom_sprite) is_custom_sprite = origin_slot != _opengfx_grf_file_index && (origin_slot >= _first_user_grf_file_index);
|
||||||
|
}
|
||||||
|
|
||||||
if (!is_custom_sprite && variant == SIG_ELECTRIC && IsRestrictedSignal(tile) && GetExistingTraceRestrictProgram(tile, track) != NULL) {
|
if (is_custom_sprite && show_restricted && _settings_client.gui.show_restricted_signal_default) {
|
||||||
|
/* Use duplicate sprite block, instead of GRF-specified signals */
|
||||||
|
sprite = (type == SIGTYPE_NORMAL && variant == SIG_ELECTRIC) ? SPR_DUP_ORIGINAL_SIGNALS_BASE : SPR_DUP_SIGNALS_BASE - 16;
|
||||||
|
sprite += type * 16 + variant * 64 + image * 2 + condition + (IsSignalSpritePBS(type) ? 64 : 0);
|
||||||
|
is_custom_sprite = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_custom_sprite && show_restricted) {
|
||||||
if (type == SIGTYPE_PBS || type == SIGTYPE_PBS_ONEWAY) {
|
if (type == SIGTYPE_PBS || type == SIGTYPE_PBS_ONEWAY) {
|
||||||
static const SubSprite lower_part = { -50, -10, 50, 50 };
|
static const SubSprite lower_part = { -50, -10, 50, 50 };
|
||||||
static const SubSprite upper_part = { -50, -50, 50, -11 };
|
static const SubSprite upper_part = { -50, -50, 50, -11 };
|
||||||
|
@@ -1480,6 +1480,7 @@ static SettingsContainer &GetSettingsTree()
|
|||||||
graphics->Add(new SettingEntry("gui.show_vehicle_route_steps"));
|
graphics->Add(new SettingEntry("gui.show_vehicle_route_steps"));
|
||||||
graphics->Add(new SettingEntry("gui.show_vehicle_route"));
|
graphics->Add(new SettingEntry("gui.show_vehicle_route"));
|
||||||
graphics->Add(new SettingEntry("gui.dash_level_of_route_lines"));
|
graphics->Add(new SettingEntry("gui.dash_level_of_route_lines"));
|
||||||
|
graphics->Add(new SettingEntry("gui.show_restricted_signal_default"));
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsPage *sound = main->Add(new SettingsPage(STR_CONFIG_SETTING_SOUND));
|
SettingsPage *sound = main->Add(new SettingsPage(STR_CONFIG_SETTING_SOUND));
|
||||||
|
@@ -168,6 +168,7 @@ struct GUISettings {
|
|||||||
uint8 graph_line_thickness; ///< the thickness of the lines in the various graph guis
|
uint8 graph_line_thickness; ///< the thickness of the lines in the various graph guis
|
||||||
bool show_train_length_in_details; ///< show train length in vehicle details window top widget
|
bool show_train_length_in_details; ///< show train length in vehicle details window top widget
|
||||||
bool show_vehicle_group_in_details; ///< show vehicle group in vehicle details window top widget
|
bool show_vehicle_group_in_details; ///< show vehicle group in vehicle details window top widget
|
||||||
|
bool show_restricted_signal_default; ///< Show restricted electric signals using the default sprite
|
||||||
uint8 osk_activation; ///< Mouse gesture to trigger the OSK.
|
uint8 osk_activation; ///< Mouse gesture to trigger the OSK.
|
||||||
bool show_vehicle_route_steps; ///< when a window related to a specific vehicle is focused, show route steps
|
bool show_vehicle_route_steps; ///< when a window related to a specific vehicle is focused, show route steps
|
||||||
bool show_vehicle_list_company_colour; ///< show the company colour of vehicles which have an owner different to the owner of the vehicle list
|
bool show_vehicle_list_company_colour; ///< show the company colour of vehicles which have an owner different to the owner of the vehicle list
|
||||||
|
@@ -3888,6 +3888,14 @@ strhelp = STR_CONFIG_SETTING_SHOW_VEHICLE_LIST_COMPANY_COLOUR_HELPTEXT
|
|||||||
proc = RedrawScreen
|
proc = RedrawScreen
|
||||||
cat = SC_BASIC
|
cat = SC_BASIC
|
||||||
|
|
||||||
|
[SDTC_BOOL]
|
||||||
|
var = gui.show_restricted_signal_default
|
||||||
|
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
||||||
|
def = false
|
||||||
|
str = STR_CONFIG_SETTING_SHOW_RESTRICTED_SIG_DEF
|
||||||
|
strhelp = STR_CONFIG_SETTING_SHOW_RESTRICTED_SIG_DEF_HELPTEXT
|
||||||
|
proc = RedrawScreen
|
||||||
|
|
||||||
; For the dedicated build we'll enable dates in logs by default.
|
; For the dedicated build we'll enable dates in logs by default.
|
||||||
[SDTC_BOOL]
|
[SDTC_BOOL]
|
||||||
ifdef = DEDICATED
|
ifdef = DEDICATED
|
||||||
|
@@ -322,8 +322,14 @@ static const SpriteID SPR_ZONING_INNER_HIGHLIGHT_WHITE = SPR_ZONING_INNER_H
|
|||||||
static const SpriteID SPR_TRACERESTRICT_BASE = SPR_ZONING_INNER_HIGHLIGHT_BASE + ZONING_INNER_HIGHLIGHT_SPRITE_COUNT;
|
static const SpriteID SPR_TRACERESTRICT_BASE = SPR_ZONING_INNER_HIGHLIGHT_BASE + ZONING_INNER_HIGHLIGHT_SPRITE_COUNT;
|
||||||
static const uint16 TRACERESTRICT_SPRITE_COUNT = 2;
|
static const uint16 TRACERESTRICT_SPRITE_COUNT = 2;
|
||||||
|
|
||||||
|
/* Duplicated signal sprites */
|
||||||
|
static const SpriteID SPR_DUP_ORIGINAL_SIGNALS_BASE = SPR_TRACERESTRICT_BASE + TRACERESTRICT_SPRITE_COUNT;
|
||||||
|
static const uint16 DUP_ORIGINAL_SIGNALS_SPRITE_COUNT = 16;
|
||||||
|
static const SpriteID SPR_DUP_SIGNALS_BASE = SPR_DUP_ORIGINAL_SIGNALS_BASE + DUP_ORIGINAL_SIGNALS_SPRITE_COUNT;
|
||||||
|
static const uint16 DUP_SIGNALS_SPRITE_COUNT = PRESIGNAL_SEMAPHORE_AND_PBS_SPRITE_COUNT;
|
||||||
|
|
||||||
/* From where can we start putting NewGRFs? */
|
/* From where can we start putting NewGRFs? */
|
||||||
static const SpriteID SPR_NEWGRFS_BASE = SPR_TRACERESTRICT_BASE + TRACERESTRICT_SPRITE_COUNT;
|
static const SpriteID SPR_NEWGRFS_BASE = SPR_DUP_SIGNALS_BASE + DUP_SIGNALS_SPRITE_COUNT;
|
||||||
|
|
||||||
/* Manager face sprites */
|
/* Manager face sprites */
|
||||||
static const SpriteID SPR_GRADIENT = 874; // background gradient behind manager face
|
static const SpriteID SPR_GRADIENT = 874; // background gradient behind manager face
|
||||||
|
Reference in New Issue
Block a user