|
@@ -10,13 +10,12 @@
|
|
|
#include "stdafx.h"
|
|
|
#include "core/bitmath_func.hpp"
|
|
|
|
|
|
#include "currency.h"
|
|
|
#include "news_func.h"
|
|
|
#include "settings_type.h"
|
|
|
#include "date_func.h"
|
|
|
#include "string_type.h"
|
|
|
#include "timer/timer.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
|
|
|
#include "table/strings.h"
|
|
|
|
|
@@ -126,14 +125,14 @@ uint64 GetMaskOfAllowedCurrencies()
|
|
|
uint64 mask = 0LL;
|
|
|
uint i;
|
|
|
|
|
|
for (i = 0; i < CURRENCY_END; i++) {
|
|
|
Year to_euro = _currency_specs[i].to_euro;
|
|
|
|
|
|
if (to_euro != CF_NOEURO && to_euro != CF_ISEURO && _cur_year >= to_euro) continue;
|
|
|
if (to_euro == CF_ISEURO && _cur_year < 2000) continue;
|
|
|
if (to_euro != CF_NOEURO && to_euro != CF_ISEURO && TimerGameCalendar::year >= to_euro) continue;
|
|
|
if (to_euro == CF_ISEURO && TimerGameCalendar::year < 2000) continue;
|
|
|
SetBit(mask, i);
|
|
|
}
|
|
|
SetBit(mask, CURRENCY_CUSTOM); // always allow custom currency
|
|
|
return mask;
|
|
|
}
|
|
|
|
|
@@ -141,13 +140,13 @@ uint64 GetMaskOfAllowedCurrencies()
|
|
|
* Verify if the currency chosen by the user is about to be converted to Euro
|
|
|
*/
|
|
|
static IntervalTimer<TimerGameCalendar> _check_switch_to_euro({TimerGameCalendar::YEAR, TimerGameCalendar::Priority::NONE}, [](auto)
|
|
|
{
|
|
|
if (_currency_specs[_settings_game.locale.currency].to_euro != CF_NOEURO &&
|
|
|
_currency_specs[_settings_game.locale.currency].to_euro != CF_ISEURO &&
|
|
|
_cur_year >= _currency_specs[_settings_game.locale.currency].to_euro) {
|
|
|
TimerGameCalendar::year >= _currency_specs[_settings_game.locale.currency].to_euro) {
|
|
|
_settings_game.locale.currency = 2; // this is the index of euro above.
|
|
|
AddNewsItem(STR_NEWS_EURO_INTRODUCTION, NT_ECONOMY, NF_NORMAL);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
/**
|