1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-03 03:49:12 +00:00

Compare commits

...

9 Commits

Author SHA1 Message Date
736998b595 Codechange: Use span instead of raw pointer for animated cursors. (#14575)
This allows the terminator entry to be removed.
2025-09-02 21:48:24 +01:00
7d4282b341 Fix #14569: Ensure music playlist window is large enough. (#14570)
Take number of tracks allowed in custom playlist into account, instead of just the number of tracks loaded.
2025-09-02 20:18:33 +01:00
Cornelius Diekmann
dd426bb8c7 Codefix f6555cf: fix comment track vs. tile (#14571) 2025-09-02 13:55:08 +02:00
Loïc Guilloux
7a6e04561d Fix #14278, ccd586a7: [Script] Don't set members inside operator new() (#14568) 2025-09-02 12:58:31 +02:00
translators
fce2748bb7 Update: Translations from eints
portuguese: 5 changes by jcteotonio
2025-09-02 04:39:43 +00:00
960b840291 Fix 6d6e64b1f0: Road stop properties 0x13/0x14 were not skipped properly. (#14567)
These properties where changed to be variable length for consistency, but ignoring them treated them as fixed length.
2025-09-01 18:52:55 +01:00
73045f9b0e Fix #13922: Ensure music track no widget is wide enough for track no. (#14566) 2025-09-01 08:44:33 +00:00
translators
4c77026167 Update: Translations from eints
galician: 2 changes by pvillaverde
vietnamese: 24 changes by MagicalDrizzle
french: 1 change by ottdfevr
2025-09-01 04:42:09 +00:00
ff5e067341 Fix 7b60e5ccad: Badge filters were only applied to trains. (#14565) 2025-08-31 23:04:48 +01:00
22 changed files with 101 additions and 93 deletions

View File

@@ -58,7 +58,7 @@ HSQUIRRELVM sq_open(SQInteger initialstacksize)
SQVM *v;
sq_new(ss, SQSharedState);
v = (SQVM *)SQ_MALLOC(sizeof(SQVM));
new (v) SQVM(ss);
new (v, sizeof(SQVM)) SQVM(ss);
ss->_root_vm = v;
if(v->Init(nullptr, initialstacksize)) {
return v;
@@ -76,7 +76,7 @@ HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize)
ss=_ss(friendvm);
v= (SQVM *)SQ_MALLOC(sizeof(SQVM));
new (v) SQVM(ss);
new (v, sizeof(SQVM)) SQVM(ss);
if(v->Init(friendvm, initialstacksize)) {
friendvm->Push(v);

View File

@@ -13,7 +13,7 @@ private:
public:
static SQArray* Create(SQSharedState *ss,SQInteger nInitialSize){
SQArray *newarray=(SQArray*)SQ_MALLOC(sizeof(SQArray));
new (newarray) SQArray(ss,nInitialSize);
new (newarray, sizeof(SQArray)) SQArray(ss,nInitialSize);
return newarray;
}
#ifndef NO_GARBAGE_COLLECTOR

View File

@@ -34,7 +34,7 @@ struct SQClass : public CHAINABLE_OBJ
public:
static SQClass* Create(SQSharedState *ss,SQClass *base) {
SQClass *newclass = (SQClass *)SQ_MALLOC(sizeof(SQClass));
new (newclass) SQClass(ss, base);
new (newclass, sizeof(SQClass)) SQClass(ss, base);
return newclass;
}
~SQClass();
@@ -90,7 +90,7 @@ public:
SQInteger size = calcinstancesize(theclass);
SQInstance *newinst = (SQInstance *)SQ_MALLOC(size);
new (newinst) SQInstance(ss, theclass,size);
new (newinst, size) SQInstance(ss, theclass,size);
if(theclass->_udsize) {
newinst->_userpointer = ((unsigned char *)newinst) + (size - theclass->_udsize);
}
@@ -100,7 +100,7 @@ public:
{
SQInteger size = calcinstancesize(_class);
SQInstance *newinst = (SQInstance *)SQ_MALLOC(size);
new (newinst) SQInstance(ss, this,size);
new (newinst, size) SQInstance(ss, this,size);
if(_class->_udsize) {
newinst->_userpointer = ((unsigned char *)newinst) + (size - _class->_udsize);
}

View File

@@ -11,7 +11,7 @@ private:
public:
static SQClosure *Create(SQSharedState *ss,SQFunctionProto *func){
SQClosure *nc=(SQClosure*)SQ_MALLOC(sizeof(SQClosure));
new (nc) SQClosure(ss,func);
new (nc, sizeof(SQClosure)) SQClosure(ss,func);
return nc;
}
void Release() override {
@@ -49,7 +49,7 @@ private:
public:
static SQGenerator *Create(SQSharedState *ss,SQClosure *closure){
SQGenerator *nc=(SQGenerator*)SQ_MALLOC(sizeof(SQGenerator));
new (nc) SQGenerator(ss,closure);
new (nc, sizeof(SQGenerator)) SQGenerator(ss,closure);
return nc;
}
~SQGenerator()
@@ -85,7 +85,7 @@ public:
static SQNativeClosure *Create(SQSharedState *ss,SQFUNCTION func)
{
SQNativeClosure *nc=(SQNativeClosure*)SQ_MALLOC(sizeof(SQNativeClosure));
new (nc) SQNativeClosure(ss,func);
new (nc, sizeof(SQNativeClosure)) SQNativeClosure(ss,func);
return nc;
}
SQNativeClosure *Clone()

View File

@@ -99,8 +99,9 @@ public:
{
SQFunctionProto *f;
//I compact the whole class and members in a single memory allocation
f = (SQFunctionProto *)sq_vm_malloc(_FUNC_SIZE(ninstructions,nliterals,nparameters,nfunctions,noutervalues,nlineinfos,nlocalvarinfos,ndefaultparams));
new (f) SQFunctionProto(ninstructions, nliterals, nparameters, nfunctions, noutervalues, nlineinfos, nlocalvarinfos, ndefaultparams);
SQInteger size = _FUNC_SIZE(ninstructions, nliterals, nparameters, nfunctions, noutervalues, nlineinfos, nlocalvarinfos, ndefaultparams);
f = (SQFunctionProto *)sq_vm_malloc(size);
new (f, size) SQFunctionProto(ninstructions, nliterals, nparameters, nfunctions, noutervalues, nlineinfos, nlocalvarinfos, ndefaultparams);
return f;
}
void Release() override {

View File

@@ -91,7 +91,8 @@ SQUnsignedInteger TranslateIndex(const SQObjectPtr &idx)
SQWeakRef *SQRefCounted::GetWeakRef(SQObjectType type)
{
if(!_weakref) {
sq_new(_weakref,SQWeakRef);
_weakref = (SQWeakRef *)sq_vm_malloc(sizeof(SQWeakRef));
new (_weakref, sizeof(SQWeakRef)) SQWeakRef();
_weakref->_obj._type = type;
_weakref->_obj._unVal.pRefCounted = this;
}

View File

@@ -64,22 +64,19 @@ struct SQRefCounted
virtual void Release()=0;
/* Placement new/delete to prevent memory leaks if constructor throws an exception. */
inline void *operator new(size_t size, SQRefCounted *place)
inline void *operator new([[maybe_unused]] size_t size, void *ptr, [[maybe_unused]] size_t real_size)
{
place->size = size;
return place;
assert(size <= real_size);
return ptr;
}
inline void operator delete(void *ptr, SQRefCounted *place)
inline void operator delete(void *ptr, void *, size_t real_size)
{
SQ_FREE(ptr, place->size);
SQ_FREE(ptr, real_size);
}
/* Never used but required. */
inline void operator delete(void *) { NOT_REACHED(); }
private:
size_t size = 0;
};
struct SQWeakRef : SQRefCounted

View File

@@ -553,7 +553,7 @@ SQString *SQStringTable::Add(std::string_view new_string)
}
SQString *t=(SQString *)SQ_MALLOC(len+sizeof(SQString));
new (t) SQString(new_string);
new (t, len+sizeof(SQString)) SQString(new_string);
t->_next = _strings[slot];
_strings[slot] = t;
_slotused++;

View File

@@ -46,7 +46,7 @@ public:
static SQTable* Create(SQSharedState *ss,SQInteger nInitialSize)
{
SQTable *newtable = (SQTable*)SQ_MALLOC(sizeof(SQTable));
new (newtable) SQTable(ss, nInitialSize);
new (newtable, sizeof(SQTable)) SQTable(ss, nInitialSize);
newtable->_delegate = nullptr;
return newtable;
}

View File

@@ -14,7 +14,7 @@ struct SQUserData : SQDelegable
static SQUserData* Create(SQSharedState *ss, SQInteger size)
{
SQUserData* ud = (SQUserData*)SQ_MALLOC(sizeof(SQUserData)+(size-1));
new (ud) SQUserData(ss, size);
new (ud, sizeof(SQUserData)+(size-1)) SQUserData(ss, size);
return ud;
}
#ifndef NO_GARBAGE_COLLECTOR

View File

@@ -1436,12 +1436,14 @@ struct BuildVehicleWindow : Window {
this->eng_list.clear();
BadgeTextFilter btf(this->string_filter, GSF_ROADVEHICLES);
BadgeDropdownFilter bdf(this->badge_filter_choices);
for (const Engine *e : Engine::IterateType(VEH_ROAD)) {
if (!this->show_hidden_engines && e->IsVariantHidden(_local_company)) continue;
EngineID eid = e->index;
if (!IsEngineBuildable(eid, VEH_ROAD, _local_company)) continue;
if (this->filter.roadtype != INVALID_ROADTYPE && !HasPowerOnRoad(e->u.road.roadtype, this->filter.roadtype)) continue;
if (!bdf.Filter(e->badges)) continue;
/* Filter by name or NewGRF extra text */
if (!FilterByText(e) && !btf.Filter(e->badges)) continue;
@@ -1460,11 +1462,13 @@ struct BuildVehicleWindow : Window {
this->eng_list.clear();
BadgeTextFilter btf(this->string_filter, GSF_SHIPS);
BadgeDropdownFilter bdf(this->badge_filter_choices);
for (const Engine *e : Engine::IterateType(VEH_SHIP)) {
if (!this->show_hidden_engines && e->IsVariantHidden(_local_company)) continue;
EngineID eid = e->index;
if (!IsEngineBuildable(eid, VEH_SHIP, _local_company)) continue;
if (!bdf.Filter(e->badges)) continue;
/* Filter by name or NewGRF extra text */
if (!FilterByText(e) && !btf.Filter(e->badges)) continue;
@@ -1486,6 +1490,7 @@ struct BuildVehicleWindow : Window {
const Station *st = this->listview_mode ? nullptr : Station::GetByTile(TileIndex(this->window_number));
BadgeTextFilter btf(this->string_filter, GSF_AIRCRAFT);
BadgeDropdownFilter bdf(this->badge_filter_choices);
/* Make list of all available planes.
* Also check to see if the previously selected plane is still available,
@@ -1497,6 +1502,7 @@ struct BuildVehicleWindow : Window {
if (!IsEngineBuildable(eid, VEH_AIRCRAFT, _local_company)) continue;
/* First VEH_END window_numbers are fake to allow a window open for all different types at once */
if (!this->listview_mode && !CanVehicleUseStation(eid, st)) continue;
if (!bdf.Filter(e->badges)) continue;
/* Filter by name or NewGRF extra text */
if (!FilterByText(e) && !btf.Filter(e->badges)) continue;

View File

@@ -1659,15 +1659,15 @@ static void SetCursorSprite(CursorID cursor, PaletteID pal)
static void SwitchAnimatedCursor()
{
const AnimCursor *cur = _cursor.animate_cur;
if (cur == nullptr || cur->sprite == AnimCursor::LAST) cur = _cursor.animate_list;
if (_cursor.animate_cur == std::end(_cursor.animate_list)) {
_cursor.animate_cur = std::begin(_cursor.animate_list);
}
assert(!_cursor.sprites.empty());
SetCursorSprite(cur->sprite, _cursor.sprites[0].image.pal);
SetCursorSprite(_cursor.animate_cur->sprite, _cursor.sprites[0].image.pal);
_cursor.animate_timeout = cur->display_time;
_cursor.animate_cur = cur + 1;
_cursor.animate_timeout = _cursor.animate_cur->display_time;
++_cursor.animate_cur;
}
void CursorTick()
@@ -1710,11 +1710,11 @@ void SetMouseCursor(CursorID sprite, PaletteID pal)
* @param table Array of animation states.
* @see SetMouseCursor
*/
void SetAnimatedMouseCursor(const AnimCursor *table)
void SetAnimatedMouseCursor(std::span<const AnimCursor> table)
{
assert(!_cursor.sprites.empty());
_cursor.animate_list = table;
_cursor.animate_cur = nullptr;
_cursor.animate_cur = std::end(table);
_cursor.sprites[0].image.pal = PAL_NONE;
SwitchAnimatedCursor();
}

View File

@@ -169,7 +169,7 @@ void DrawOverlappedWindowForAll(int left, int top, int right, int bottom);
void SetMouseCursorBusy(bool busy);
void SetMouseCursor(CursorID cursor, PaletteID pal);
void SetAnimatedMouseCursor(const AnimCursor *table);
void SetAnimatedMouseCursor(std::span<const AnimCursor> table);
void CursorTick();
void UpdateCursorSize();
bool ChangeResInGame(int w, int h);

View File

@@ -108,8 +108,7 @@ enum WindowKeyCodes : uint16_t {
/** A single sprite of a list of animated cursors */
struct AnimCursor {
static const CursorID LAST = std::numeric_limits<CursorID>::max();
CursorID sprite; ///< Must be set to LAST_ANIM when it is the last sprite of the loop
CursorID sprite; ///< Must be set to LAST_ANIM when it is the last sprite of the loop
uint8_t display_time; ///< Amount of ticks this sprite will be shown
};
@@ -139,8 +138,8 @@ struct CursorVars {
Point draw_pos, draw_size; ///< position and size bounding-box for drawing
const AnimCursor *animate_list; ///< in case of animated cursor, list of frames
const AnimCursor *animate_cur; ///< in case of animated cursor, current frame
std::span<const AnimCursor> animate_list{}; ///< in case of animated cursor, list of frames
std::span<const AnimCursor>::iterator animate_cur = std::end(animate_list); ///< in case of animated cursor, current frame
uint animate_timeout; ///< in case of animated cursor, number of ticks to show the current cursor
bool visible; ///< cursor is visible

View File

@@ -1326,7 +1326,7 @@ STR_CONFIG_SETTING_CONSTRUCTION_SPEED :Vitesse de cons
STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :Limite le nombre d'actions de constructions pour les IAs
STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :Pannes des véhicules{NBSP}: {STRING}
STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Contrôle la fréquence des pannes des véhicule incorrectement entretenus
STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Contrôle la fréquence des pannes des véhicules incorrectement entretenus
STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Multiplicateur de subvention{NBSP}: {STRING}
STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Définit combien rapportent les lignes subventionnées

View File

@@ -1691,6 +1691,8 @@ STR_CONFIG_SETTING_SCROLLMODE_LMB :Move-lo mapa co
STR_CONFIG_SETTING_SMOOTH_SCROLLING :Desprazamento de vista suave: {STRING}
STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Controla como a vista principal se despraza a unha posición específica cando se fai clic no minimapa ou cando se emprega un comando para desprazarse a un obxecto específico sobre o mapa. Se se activa, a vista desprázase suavemente, se se desactiva salta directamente
STR_CONFIG_SETTING_TOOLBAR_DROPDOWN_AUTOSELECT :Comportamento tradicional de selección do menú da barra de ferramentas: {STRING}
STR_CONFIG_SETTING_TOOLBAR_DROPDOWN_AUTOSELECT_HELPTEXT :Escoller o comportamento de selección dos menús da barra de ferramentas. Se está desactivado, os menús permanecerán abertos ata que se faga unha selección. Se está activado, os menús activaranse ao soltar o botón do rato.
STR_CONFIG_SETTING_MEASURE_TOOLTIP :Mostrar medidas ao usar as ferramentas de construción: {STRING}
STR_CONFIG_SETTING_MEASURE_TOOLTIP_HELPTEXT :Amosa as distancias en cadros e as diferencias de cota ao arrastrar durante as operacións de construción

View File

@@ -201,7 +201,7 @@ STR_COLOUR_SECONDARY_GREEN :Verde
STR_COLOUR_SECONDARY_DARK_GREEN :Verde Escuro
STR_COLOUR_SECONDARY_BLUE :Azul
STR_COLOUR_SECONDARY_CREAM :Creme
STR_COLOUR_SECONDARY_MAUVE :Lilás
STR_COLOUR_SECONDARY_MAUVE :Malva
STR_COLOUR_SECONDARY_PURPLE :Roxo
STR_COLOUR_SECONDARY_ORANGE :Laranja
STR_COLOUR_SECONDARY_BROWN :Castanho
@@ -737,7 +737,7 @@ STR_MUSIC_TOOLTIP_SELECT_NEW_STYLE_MUSIC :{BLACK}Seleccio
STR_MUSIC_TOOLTIP_SELECT_EZY_STREET_STYLE :{BLACK}Seleccionar programa 'Ezy Street'
STR_MUSIC_TOOLTIP_SELECT_CUSTOM_1_USER_DEFINED :{BLACK}Seleccionar programa 'Personalizado 1'
STR_MUSIC_TOOLTIP_SELECT_CUSTOM_2_USER_DEFINED :{BLACK}Seleccionar programa 'Personalizado 2'
STR_MUSIC_TOOLTIP_TOGGLE_PROGRAM_SHUFFLE :{BLACK}Alternar programa aleatório
STR_MUSIC_TOOLTIP_TOGGLE_PROGRAM_SHUFFLE :{BLACK}Ligar/Desligar reprodução aleatória
STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELECTION :{BLACK}Mostrar janela de selecção de faixas de música
# Playlist window
@@ -1398,8 +1398,8 @@ STR_CONFIG_SETTING_PERCENTAGE :{COMMA}%
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS :Ângulo de inclínação para veículos rodoviários: {STRING}
STR_CONFIG_SETTING_ROAD_VEHICLE_SLOPE_STEEPNESS_HELPTEXT :Declive de um mosaico inclinado para um veiculo de estrada. Valores mais altos tornam mais difícil de subir.
STR_CONFIG_SETTING_FORBID_90_DEG :Proibir comboios fazer curvas de 90º: {STRING}
STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Curvas de 90 graus ocorrem quando uma pista horizontal é diretamente seguida por outra vertical num mosaico adjacente, fazendo com que o comboio vire 90 graus quando atravessa a fronteira dos mosaicos, ao invés dos habituais 45 graus para outras combinações de pistas
STR_CONFIG_SETTING_FORBID_90_DEG :Proibir comboios de fazer curvas de 90º: {STRING}
STR_CONFIG_SETTING_FORBID_90_DEG_HELPTEXT :Curvas de 90 graus ocorrem quando uma linha horizontal é diretamente seguida por outra vertical num mosaico adjacente, fazendo com que o comboio vire 90 graus quando atravessa a aresta dos mosaicos, ao invés dos habituais 45 graus para outras combinações de linhas
STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS :Permitir juntar estações não adjacentes: {STRING}
STR_CONFIG_SETTING_DISTANT_JOIN_STATIONS_HELPTEXT :Permite acrescentar partes a uma estação sem tocar diretamente nas partes já existentes, fazendo Ctrl+Clique enquanto coloca as novas partes
@@ -3883,7 +3883,7 @@ STR_STATION_VIEW_GROUP_D_S_V :Destino-Origem-
STR_STATION_VIEW_GROUP_D_V_S :Destino-Via-Origem
###length 8
STR_CARGO_RATING_APPALLING :Inexistente
STR_CARGO_RATING_APPALLING :Péssimo
STR_CARGO_RATING_VERY_POOR :Muito Fraco
STR_CARGO_RATING_POOR :Fraco
STR_CARGO_RATING_MEDIOCRE :Medíocre

View File

@@ -622,8 +622,14 @@ STR_GRAPH_COMPANY_VALUES_CAPTION :{WHITE}Biểu
STR_GRAPH_LAST_24_MINUTES_TIME_LABEL :{TINY_FONT}{BLACK}24 phút cuối
STR_GRAPH_LAST_72_MINUTES_TIME_LABEL :{TINY_FONT}{BLACK}72 phút cuối
STR_GRAPH_LAST_288_MINUTES_TIME_LABEL :{TINY_FONT}{BLACK}288 phút cuối
STR_GRAPH_LAST_24_MONTHS :{TINY_FONT}{BLACK}2 năm (theo từng tháng)
STR_GRAPH_LAST_24_QUARTERS :{TINY_FONT}{BLACK}6 năm (theo từng quý)
STR_GRAPH_LAST_24_YEARS :{TINY_FONT}{BLACK}24 năm (theo từng năm)
STR_GRAPH_TOGGLE_RANGE :Bật/tắt đồ thị cho khoảng dữ liệu này
STR_GRAPH_SELECT_SCALE :Chỉnh tỷ lệ chiều ngang của đồ thị
STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION :{WHITE}Bảng Giá Cước Vận Chuyển Hàng Hóa
STR_GRAPH_CARGO_PAYMENT_RATES_DAYS :{TINY_FONT}{BLACK}Số ngày trong trung chuyển
@@ -631,8 +637,8 @@ STR_GRAPH_CARGO_PAYMENT_RATES_SECONDS :{TINY_FONT}{BLA
STR_GRAPH_CARGO_PAYMENT_RATES_TITLE :{TINY_FONT}{BLACK}Tiền trả khi vận chuyển 10 đơn vị (hay 10,000 lít) hàng hóa trên mỗi 20 ô
STR_GRAPH_CARGO_ENABLE_ALL :{TINY_FONT}{BLACK}Toàn bộ
STR_GRAPH_CARGO_DISABLE_ALL :{TINY_FONT}{BLACK}Không
STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Hiển thị toàn bộ loại hàng trên đồ thị tỉ lệ trả tiền của loại hàng
STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Không hiển thị các loại hàng trên đồ thị tỉ lệ trả tiền của loại hàng
STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL :{BLACK}Hiển thị toàn bộ loại hàng trên đồ thị
STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Không hiển thị các loại hàng trên đồ thị
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Bật/tắt đồ thị cho hàng hóa này
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
@@ -642,6 +648,9 @@ STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Đã vận chuy
STR_GRAPH_INDUSTRY_RANGE_DELIVERED :Đã giao
STR_GRAPH_INDUSTRY_RANGE_WAITING :Đang chờ...
STR_GRAPH_TOWN_CARGO_CAPTION :{WHITE}{TOWN} - Lịch sử hàng hoá
STR_GRAPH_TOWN_RANGE_PRODUCED :Nguồn cung
STR_GRAPH_TOWN_RANGE_TRANSPORTED :Đã vận chuyển
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Hiện chi tiết đánh giá chỉ số năng suất
@@ -1033,6 +1042,7 @@ STR_GAME_OPTIONS_CURRENCY_MYR :Ringgit Malaysi
STR_GAME_OPTIONS_CURRENCY_LVL :Lát-vi-a Lats
STR_GAME_OPTIONS_CURRENCY_PTE :Escudo Bồ Đào Nha
STR_GAME_OPTIONS_CURRENCY_UAH :Hryvnia Ukraina
STR_GAME_OPTIONS_CURRENCY_VND :Việt Nam Đồng
STR_GAME_OPTIONS_AUTOSAVE_FRAME :Lưu tự động
STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :Lựa chọn khoảng thời gian tự động lưu
@@ -1680,6 +1690,8 @@ STR_CONFIG_SETTING_SCROLLMODE_LMB :Kéo cuộn b
STR_CONFIG_SETTING_SMOOTH_SCROLLING :Cuộn uyển chuyển cửa sổ: {STRING}
STR_CONFIG_SETTING_SMOOTH_SCROLLING_HELPTEXT :Điều khiển cách màn hình chính cuộn tới vị trí cụ thể khi nháy chuột vào bản đồ nhỏ hoặc khi gõ lệnh cuộn tới đối tượng trên bản đồ. Nếu bật, thì sẽ cuộn trượt, nếu tắt thì nhảy thẳng tới vị trí đó.
STR_CONFIG_SETTING_TOOLBAR_DROPDOWN_AUTOSELECT :Hành vi khi chọn menu từ thanh công cụ truyền thông: {STRING}
STR_CONFIG_SETTING_TOOLBAR_DROPDOWN_AUTOSELECT_HELPTEXT :Chọn hành vi lựa chọn của menu thanh công cụ. Nếu tắt, menu thanh công cụ sẽ còn hiển thị cho đến khi đã chọn một lựa chọn. Nếu bật, menu thanh công cụ sẽ hiển thị khi thả nút chuột.
STR_CONFIG_SETTING_MEASURE_TOOLTIP :Hiện bảng đo lường khi dùng các công cụ xây dựng: {STRING}
STR_CONFIG_SETTING_MEASURE_TOOLTIP_HELPTEXT :Hiển thị khoảng cách ô và chênh lệch độ cao khi kéo thả trong khi xây dựng
@@ -3698,6 +3710,8 @@ STR_TOWN_VIEW_CENTER_TOOLTIP :{BLACK}Xem trun
STR_TOWN_VIEW_LOCAL_AUTHORITY_BUTTON :{BLACK}Chính quyền địa phương
STR_TOWN_VIEW_LOCAL_AUTHORITY_TOOLTIP :{BLACK}Xem thông tin về Chính quyền địa phương
STR_TOWN_VIEW_RENAME_TOOLTIP :{BLACK}Đổi tên đô thị
STR_TOWN_VIEW_CARGO_GRAPH :Đồ thị hàng hoá
STR_TOWN_VIEW_CARGO_GRAPH_TOOLTIP :Hiển thị đồ thị lịch sử hàng hoá của thị trấn
STR_TOWN_VIEW_EXPAND_BUTTON :{BLACK}Mở rộng
STR_TOWN_VIEW_EXPAND_TOOLTIP :{BLACK}Tăng quy mô đô thị
@@ -5248,6 +5262,11 @@ STR_ERROR_START_AND_END_MUST_BE_IN :{WHITE}Điểu
STR_ERROR_ENDS_OF_BRIDGE_MUST_BOTH :{WHITE}... hai đầu cầu phải được gá vào đất
STR_ERROR_BRIDGE_TOO_LONG :{WHITE}... cầu quá dài
STR_ERROR_BRIDGE_THROUGH_MAP_BORDER :{WHITE}Cầu có thể vượt quá phạm vi bản đồ
STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION :{WHITE}Cầu quá thấp cho ga
STR_ERROR_BRIDGE_TOO_LOW_FOR_ROADSTOP :{WHITE}Cầu quá thấp cho điểm dừng chân
STR_ERROR_BRIDGE_TOO_LOW_FOR_BUOY :{WHITE}Cầu quá thấp cho phao
STR_ERROR_BRIDGE_TOO_LOW_FOR_RAIL_WAYPOINT :{WHITE}Cầu quá thấp cho điểm mốc đường ray
STR_ERROR_BRIDGE_TOO_LOW_FOR_ROAD_WAYPOINT :{WHITE}Cầu quá thấp cho điểm mốc đường
# Tunnel related errors
STR_ERROR_CAN_T_BUILD_TUNNEL_HERE :{WHITE}Không thể đào hầm ở đây...
@@ -5403,7 +5422,7 @@ STR_ERROR_NO_STOP_COMPATIBLE_TRAM_TYPE :{WHITE}Không c
STR_ERROR_NO_STOP_ARTICULATED_VEHICLE :{WHITE}Không có điểm dừng phù hợp với xe kéo rơ moóc.{}Xe kéo rơ moóc cần điểm dừng ngắn trên đường, không phải bến dừng
STR_ERROR_AIRPORT_NO_PLANES :{WHITE}Không thể hạ cánh máy bay tại bãi đỗ trực thăng này
STR_ERROR_AIRPORT_NO_HELICOPTERS :{WHITE}Không thể hạ cánh trực thăng ở sân bay này
STR_ERROR_NO_RAIL_WAYPOINT :{WHITE}Không có điểm mốc tàu hỏa
STR_ERROR_NO_RAIL_WAYPOINT :{WHITE}Không có điểm mốc đường ray
STR_ERROR_NO_ROAD_WAYPOINT :{WHITE}Không có điểm mốc đường bộ
STR_ERROR_NO_BUOY :{WHITE}Không có cái phao nào
@@ -5864,6 +5883,8 @@ STR_SAVEGAME_NAME_SPECTATOR :Tham quan, {1:S
# Viewport strings
STR_VIEWPORT_TOWN_POP :{TOWN} ({COMMA})
STR_VIEWPORT_TOWN_CITY :{TOWN} {CITY_ICON}
STR_VIEWPORT_TOWN_CITY_POP :{TOWN} ({COMMA}) {CITY_ICON}
STR_VIEWPORT_STATION :{STATION} {STATION_FEATURES}
# Simple strings to get specific types of data

View File

@@ -539,10 +539,10 @@ struct MusicTrackSelectionWindow : public Window {
Dimension d = {0, 0};
for (const auto &song : _music.music_set) {
Dimension d2 = GetStringBoundingBox(GetString(STR_PLAYLIST_TRACK_NAME, song.tracknr, 2, song.songname));
d.width = std::max(d.width, d2.width);
d.height += d2.height;
d = maxdim(d, GetStringBoundingBox(GetString(STR_PLAYLIST_TRACK_NAME, song.tracknr, 2, song.songname)));
}
d.height *= std::max(NUM_SONGS_AVAILABLE, NUM_SONGS_PLAYLIST);
d.width += padding.width;
d.height += padding.height;
size = maxdim(size, d);
@@ -711,6 +711,7 @@ struct MusicWindow : public Window {
case WID_M_TRACK_NR: {
Dimension d = GetStringBoundingBox(STR_MUSIC_TRACK_NONE);
d = maxdim(d, GetStringBoundingBox(GetString(STR_MUSIC_TRACK_DIGIT, GetParamMaxDigits(2, FS_SMALL), 2)));
d.width += padding.width;
d.height += padding.height + WidgetDimensions::scaled.fullbevel.bottom;
size = maxdim(size, d);

View File

@@ -51,9 +51,7 @@ static ChangeInfoResult IgnoreRoadStopProperty(uint prop, ByteReader &buf)
case 0x13:
case 0x14:
buf.ReadWord();
buf.ReadWord();
buf.ReadWord();
buf.Skip(buf.ReadExtendedByte());
break;
case 0x16: // Badge list

View File

@@ -217,9 +217,9 @@ inline void SetTrackReservation(Tile t, TrackBits b)
/**
* Try to reserve a specific track on a tile
* @pre IsPlainRailTile(t) && HasTrack(tile, t)
* @pre IsPlainRailTile(tile) && HasTrack(tile, t)
* @param tile the tile
* @param t the rack to reserve
* @param t the track to reserve
* @return true if successful
*/
inline bool TryReserveTrack(Tile tile, Track t)
@@ -236,7 +236,7 @@ inline bool TryReserveTrack(Tile tile, Track t)
/**
* Lift the reservation of a specific track on a tile
* @pre IsPlainRailTile(t) && HasTrack(tile, t)
* @pre IsPlainRailTile(tile) && HasTrack(tile, t)
* @param tile the tile
* @param t the track to free
*/

View File

@@ -14,67 +14,49 @@
* is to be displayed.
*/
/**
* Creates two array entries that define one
* status of the cursor.
* @param Sprite The Sprite to be displayed
* @param display_time The Number of ticks to display the sprite
*/
#define ANIM_CURSOR_LINE(Sprite, display_time) { Sprite, display_time },
/**
* This indicates the termination of the cursor list
*/
#define ANIM_CURSOR_END() ANIM_CURSOR_LINE(AnimCursor::LAST, 0)
/**
* Animated cursor elements for demolition
*/
static const AnimCursor _demolish_animcursor[] = {
ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_FIRST, 8)
ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_1, 8)
ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_2, 8)
ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_LAST, 8)
ANIM_CURSOR_END()
static constexpr AnimCursor _demolish_animcursor[] = {
{SPR_CURSOR_DEMOLISH_FIRST, 8},
{SPR_CURSOR_DEMOLISH_1, 8},
{SPR_CURSOR_DEMOLISH_2, 8},
{SPR_CURSOR_DEMOLISH_LAST, 8},
};
/**
* Animated cursor elements for lower land
*/
static const AnimCursor _lower_land_animcursor[] = {
ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_FIRST, 10)
ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_1, 10)
ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_LAST, 29)
ANIM_CURSOR_END()
static constexpr AnimCursor _lower_land_animcursor[] = {
{SPR_CURSOR_LOWERLAND_FIRST, 10},
{SPR_CURSOR_LOWERLAND_1, 10},
{SPR_CURSOR_LOWERLAND_LAST, 29},
};
/**
* Animated cursor elements for raise land
*/
static const AnimCursor _raise_land_animcursor[] = {
ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_FIRST, 10)
ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_1, 10)
ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_LAST, 29)
ANIM_CURSOR_END()
static constexpr AnimCursor _raise_land_animcursor[] = {
{SPR_CURSOR_RAISELAND_FIRST, 10},
{SPR_CURSOR_RAISELAND_1, 10},
{SPR_CURSOR_RAISELAND_LAST, 29},
};
/**
* Animated cursor elements for the goto icon
*/
static const AnimCursor _order_goto_animcursor[] = {
ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_FIRST, 10)
ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_1, 10)
ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_LAST, 29)
ANIM_CURSOR_END()
static constexpr AnimCursor _order_goto_animcursor[] = {
{SPR_CURSOR_PICKSTATION_FIRST, 10},
{SPR_CURSOR_PICKSTATION_1, 10},
{SPR_CURSOR_PICKSTATION_LAST, 29},
};
/**
* Animated cursor elements for the build signal icon
*/
static const AnimCursor _build_signals_animcursor[] = {
ANIM_CURSOR_LINE(SPR_CURSOR_BUILDSIGNALS_FIRST, 20)
ANIM_CURSOR_LINE(SPR_CURSOR_BUILDSIGNALS_LAST, 20)
ANIM_CURSOR_END()
static constexpr AnimCursor _build_signals_animcursor[] = {
{SPR_CURSOR_BUILDSIGNALS_FIRST, 20},
{SPR_CURSOR_BUILDSIGNALS_LAST, 20},
};
/**
@@ -82,7 +64,7 @@ static const AnimCursor _build_signals_animcursor[] = {
* definitions we have above. This is the only thing that is
* accessed directly from other files
*/
static const AnimCursor * const _animcursors[] = {
static constexpr std::span<const AnimCursor> _animcursors[] = {
_demolish_animcursor,
_lower_land_animcursor,
_raise_land_animcursor,