changeset 812 | 65ecc321b3db |
parent 788 | 951b52443d48 |
child 833 | b8b8fb18ad51 |
811:a66557df4e7e | 812:65ecc321b3db |
---|---|
622 {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_WARN_INCOME_LESS, "train_income_warn", &_patches.train_income_warn, 0, 0, 0, NULL}, |
622 {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_WARN_INCOME_LESS, "train_income_warn", &_patches.train_income_warn, 0, 0, 0, NULL}, |
623 {PE_UINT8, PF_MULTISTRING | PF_PLAYERBASED, STR_CONFIG_PATCHES_ORDER_REVIEW, "order_review_system", &_patches.order_review_system,0,2, 1, NULL}, |
623 {PE_UINT8, PF_MULTISTRING | PF_PLAYERBASED, STR_CONFIG_PATCHES_ORDER_REVIEW, "order_review_system", &_patches.order_review_system,0,2, 1, NULL}, |
624 {PE_BOOL, 0, STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES, "never_expire_vehicles", &_patches.never_expire_vehicles,0,0,0, NULL}, |
624 {PE_BOOL, 0, STR_CONFIG_PATCHES_NEVER_EXPIRE_VEHICLES, "never_expire_vehicles", &_patches.never_expire_vehicles,0,0,0, NULL}, |
625 |
625 |
626 {PE_UINT16, PF_0ISDIS | PF_PLAYERBASED, STR_CONFIG_PATCHES_LOST_TRAIN_DAYS, "lost_train_days", &_patches.lost_train_days, 180,720, 60, NULL}, |
626 {PE_UINT16, PF_0ISDIS | PF_PLAYERBASED, STR_CONFIG_PATCHES_LOST_TRAIN_DAYS, "lost_train_days", &_patches.lost_train_days, 180,720, 60, NULL}, |
627 {PE_BOOL, 0, STR_CONFIG_PATCHES_AUTORENEW_VEHICLE,"autorenew", &_patches.autorenew, 0, 0, 0, NULL}, |
627 {PE_BOOL, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_VEHICLE,"autorenew", &_patches.autorenew, 0, 0, 0, NULL}, |
628 {PE_INT16, 0, STR_CONFIG_PATCHES_AUTORENEW_MONTHS, "autorenew_months", &_patches.autorenew_months, -12, 12, 1, NULL}, |
628 {PE_INT16, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_MONTHS, "autorenew_months", &_patches.autorenew_months, -12, 12, 1, NULL}, |
629 {PE_CURRENCY, 0, STR_CONFIG_PATCHES_AUTORENEW_MONEY,"autorenew_money", &_patches.autorenew_money, 0, 2000000, 100000, NULL}, |
629 {PE_CURRENCY, PF_PLAYERBASED, STR_CONFIG_PATCHES_AUTORENEW_MONEY,"autorenew_money", &_patches.autorenew_money, 0, 2000000, 100000, NULL}, |
630 |
630 |
631 {PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_TRAINS, "max_trains", &_patches.max_trains, 0,240, 10, NULL}, |
631 {PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_TRAINS, "max_trains", &_patches.max_trains, 0,240, 10, NULL}, |
632 {PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_ROADVEH, "max_roadveh", &_patches.max_roadveh, 0,240, 10, NULL}, |
632 {PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_ROADVEH, "max_roadveh", &_patches.max_roadveh, 0,240, 10, NULL}, |
633 {PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_AIRCRAFT, "max_aircraft", &_patches.max_aircraft, 0,240, 10, NULL}, |
633 {PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_AIRCRAFT, "max_aircraft", &_patches.max_aircraft, 0,240, 10, NULL}, |
634 {PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_SHIPS, "max_ships", &_patches.max_ships, 0,240, 10, NULL}, |
634 {PE_UINT8, 0, STR_CONFIG_PATCHES_MAX_SHIPS, "max_ships", &_patches.max_ships, 0,240, 10, NULL}, |
698 case PE_BOOL: return *(bool*)pe->variable; |
698 case PE_BOOL: return *(bool*)pe->variable; |
699 case PE_UINT8: return *(uint8*)pe->variable; |
699 case PE_UINT8: return *(uint8*)pe->variable; |
700 case PE_INT16: return *(int16*)pe->variable; |
700 case PE_INT16: return *(int16*)pe->variable; |
701 case PE_UINT16: return *(uint16*)pe->variable; |
701 case PE_UINT16: return *(uint16*)pe->variable; |
702 case PE_INT32: return *(int32*)pe->variable; |
702 case PE_INT32: return *(int32*)pe->variable; |
703 case PE_CURRENCY: return (*(int64*)pe->variable) * GetCurrentCurrencyRate(); |
703 case PE_CURRENCY: return (*(int32*)pe->variable) * GetCurrentCurrencyRate(); |
704 default: |
704 default: |
705 NOT_REACHED(); |
705 NOT_REACHED(); |
706 } |
706 } |
707 |
707 |
708 /* useless, but avoids compiler warning this way */ |
708 /* useless, but avoids compiler warning this way */ |
742 *(uint16*)pe->variable = (uint16)pe->min; |
742 *(uint16*)pe->variable = (uint16)pe->min; |
743 else |
743 else |
744 *(uint16*)pe->variable = (uint16)val; |
744 *(uint16*)pe->variable = (uint16)val; |
745 break; |
745 break; |
746 |
746 |
747 case PE_CURRENCY: |
|
747 case PE_INT32: if ((int32)val > (int32)pe->max) |
748 case PE_INT32: if ((int32)val > (int32)pe->max) |
748 *(int32*)pe->variable = (int32)pe->max; |
749 *(int32*)pe->variable = (int32)pe->max; |
749 else if ((int32)val < (int32)pe->min) |
750 else if ((int32)val < (int32)pe->min) |
750 *(int32*)pe->variable = (int32)pe->min; |
751 *(int32*)pe->variable = (int32)pe->min; |
751 else |
752 else |
752 *(int32*)pe->variable = val; |
753 *(int32*)pe->variable = val; |
753 break; |
|
754 |
|
755 case PE_CURRENCY: if ((int64)val > (int64)pe->max) |
|
756 *(int64*)pe->variable = (int64)pe->max; |
|
757 else if ((int64)val < (int64)pe->min) |
|
758 *(int64*)pe->variable = (int64)pe->min; |
|
759 else |
|
760 *(int64*)pe->variable = val; |
|
761 break; |
754 break; |
762 default: |
755 default: |
763 NOT_REACHED(); |
756 NOT_REACHED(); |
764 } |
757 } |
765 } |
758 } |
1398 len = 4; |
1391 len = 4; |
1399 edittext = true; |
1392 edittext = true; |
1400 } |
1393 } |
1401 break; |
1394 break; |
1402 } |
1395 } |
1403 |
1396 |
1404 if(edittext) { |
1397 if(edittext) { |
1405 WP(w,def_d).data_2 = line; |
1398 WP(w,def_d).data_2 = line; |
1406 ShowQueryString( |
1399 ShowQueryString( |
1407 str, |
1400 str, |
1408 STR_CURRENCY_CHANGE_PARAMETER, |
1401 STR_CURRENCY_CHANGE_PARAMETER, |
1410 250, // characters up to this width pixels, whichever is satisfied first |
1403 250, // characters up to this width pixels, whichever is satisfied first |
1411 w->window_class, |
1404 w->window_class, |
1412 w->window_number); |
1405 w->window_number); |
1413 if (str != STR_CONFIG_PATCHES_INT32) DeleteName(str); |
1406 if (str != STR_CONFIG_PATCHES_INT32) DeleteName(str); |
1414 } |
1407 } |
1415 |
1408 |
1416 w->flags4 |= 5 << WF_TIMEOUT_SHL; |
1409 w->flags4 |= 5 << WF_TIMEOUT_SHL; |
1417 SetWindowDirty(w); |
1410 SetWindowDirty(w); |
1418 } break; |
1411 } break; |
1419 |
1412 |
1420 case WE_ON_EDIT_TEXT: { |
1413 case WE_ON_EDIT_TEXT: { |
1442 if (val == 1999) val = 0; |
1435 if (val == 1999) val = 0; |
1443 _currency_specs[23].to_euro = val; |
1436 _currency_specs[23].to_euro = val; |
1444 break; |
1437 break; |
1445 } |
1438 } |
1446 MarkWholeScreenDirty(); |
1439 MarkWholeScreenDirty(); |
1447 |
1440 |
1448 |
1441 |
1449 } break; |
1442 } break; |
1450 |
1443 |
1451 case WE_TIMEOUT: |
1444 case WE_TIMEOUT: |
1452 WP(w,def_d).data_1 = 0; |
1445 WP(w,def_d).data_1 = 0; |
1453 SetWindowDirty(w); |
1446 SetWindowDirty(w); |