1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
SamuXarick fdebff87e9
Merge 57cea4e98c into 7eb042feac 2025-07-24 04:48:49 +00:00
translators 7eb042feac Update: Translations from eints
english (us): 5 changes by 2TallTyler
2025-07-24 04:46:38 +00:00
SamuXarick 57cea4e98c Add: [Script] Auto-convert ObjectType bool to integer when setting values for items in lists via [] 2025-05-29 22:35:20 +01:00
2 changed files with 27 additions and 8 deletions

View File

@ -634,8 +634,11 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Display
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Toggle graph of this cargo type STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Toggle graph of this cargo type
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING} STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_CAPTION :{WHITE}{INDUSTRY} - Cargo History
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produced STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Produced
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transported STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Transported
STR_GRAPH_INDUSTRY_RANGE_DELIVERED :Delivered
STR_GRAPH_INDUSTRY_RANGE_WAITING :Waiting
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Show detailed performance ratings STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Show detailed performance ratings
@ -4023,6 +4026,8 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producti
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Production last minute: STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Production last minute:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transported) STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% transported)
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Center the main view on industry location. Ctrl+Click to open a new viewport on industry location STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Center the main view on industry location. Ctrl+Click to open a new viewport on industry location
STR_INDUSTRY_VIEW_CARGO_GRAPH :{BLACK}Cargo Graph
STR_INDUSTRY_VIEW_CARGO_GRAPH_TOOLTIP :{BLACK}Shows the graph of industry cargo history
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}% STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}The industry has announced imminent closure! STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}The industry has announced imminent closure!

View File

@ -858,18 +858,32 @@ SQInteger ScriptList::_get(HSQUIRRELVM vm)
SQInteger ScriptList::_set(HSQUIRRELVM vm) SQInteger ScriptList::_set(HSQUIRRELVM vm)
{ {
if (sq_gettype(vm, 2) != OT_INTEGER) return SQ_ERROR; if (sq_gettype(vm, 2) != OT_INTEGER) return SQ_ERROR;
if (sq_gettype(vm, 3) != OT_INTEGER && sq_gettype(vm, 3) != OT_NULL) {
SQInteger idx;
sq_getinteger(vm, 2, &idx);
/* Retrieve the return value */
SQInteger val;
switch (sq_gettype(vm, 3)) {
case OT_NULL:
this->RemoveItem(idx);
return 0;
case OT_BOOL: {
SQBool v;
sq_getbool(vm, 3, &v);
val = v ? 1 : 0;
break;
}
case OT_INTEGER:
sq_getinteger(vm, 3, &val);
break;
default:
return sq_throwerror(vm, "you can only assign integers to this list"); return sq_throwerror(vm, "you can only assign integers to this list");
} }
SQInteger idx, val;
sq_getinteger(vm, 2, &idx);
if (sq_gettype(vm, 3) == OT_NULL) {
this->RemoveItem(idx);
return 0;
}
sq_getinteger(vm, 3, &val);
if (!this->HasItem(idx)) { if (!this->HasItem(idx)) {
this->AddItem(idx, val); this->AddItem(idx, val);
return 0; return 0;