Apply clang-format.

This commit is contained in:
Aaron van Geffen 2020-01-20 22:35:51 +01:00
parent 914c07a711
commit acc6cffad3
3 changed files with 30 additions and 18 deletions

View file

@ -913,7 +913,7 @@ static void window_options_mouseup(rct_window* w, rct_widgetindex widgetIndex)
window_close_by_class(WC_SCENARIO_SELECT);
break;
case WIDX_TITLE_SEQUENCE_RANDOM:
gConfigInterface.random_title_sequence ^=1;
gConfigInterface.random_title_sequence ^= 1;
config_save_default();
w->Invalidate();
break;
@ -1914,8 +1914,8 @@ static void window_options_invalidate(rct_window* w)
widget_set_checkbox_value(w, WIDX_AUTO_OPEN_SHOPS, gConfigGeneral.auto_open_shops);
widget_set_checkbox_value(w, WIDX_TITLE_SEQUENCE_RANDOM, gConfigInterface.random_title_sequence);
widget_set_checkbox_value(w, WIDX_ALLOW_EARLY_COMPLETION, gConfigGeneral.allow_early_completion);
//Disable title sequence dropdown if set to random
// Disable title sequence dropdown if set to random
if (gConfigInterface.random_title_sequence)
{
w->disabled_widgets |= (1 << WIDX_TITLE_SEQUENCE_DROPDOWN);

View file

@ -3893,7 +3893,7 @@ enum
STR_CANNOT_BUILD_PATH_ADDITIONS_ON_LEVEL_CROSSINGS = 6347,
STR_REMOVE_LEVEL_CROSSING_FIRST = 6348,
STR_OPTIONS_RANDOM_TITLE_SEQUENCE = 6349,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working

View file

@ -228,47 +228,59 @@ void TitleScreen::TitleInitialise()
}
if (gConfigInterface.random_title_sequence)
{
bool RCT1Installed = false, RCT1AAInstalled = false, RCT1LLInstalled = false;
int RCT1Count = 0;
size_t scenarioCount = scenario_repository_get_count();
for (size_t s = 0; s < scenarioCount; s++ ) {
if (scenario_repository_get_by_index(s)->source_game == SCENARIO_SOURCE_RCT1) {
for (size_t s = 0; s < scenarioCount; s++)
{
if (scenario_repository_get_by_index(s)->source_game == SCENARIO_SOURCE_RCT1)
{
RCT1Count++;
}
if (scenario_repository_get_by_index(s)->source_game == SCENARIO_SOURCE_RCT1_AA) {
if (scenario_repository_get_by_index(s)->source_game == SCENARIO_SOURCE_RCT1_AA)
{
RCT1AAInstalled = true;
}
if (scenario_repository_get_by_index(s)->source_game == SCENARIO_SOURCE_RCT1_LL) {
if (scenario_repository_get_by_index(s)->source_game == SCENARIO_SOURCE_RCT1_LL)
{
RCT1LLInstalled = true;
}
}
//Mega Park can show up in the scenario list even if RCT1 has been uninstalled, so it must be greater than 1
if (RCT1Count > 1) {
// Mega Park can show up in the scenario list even if RCT1 has been uninstalled, so it must be greater than 1
if (RCT1Count > 1)
{
RCT1Installed = true;
}
int32_t random = 0;
bool safeSequence = false;
std::string RCT1String = format_string(STR_TITLE_SEQUENCE_RCT1, gCommonFormatArgs);
std::string RCT1AAString = format_string(STR_TITLE_SEQUENCE_RCT1_AA, gCommonFormatArgs);
std::string RCT1LLString = format_string(STR_TITLE_SEQUENCE_RCT1_AA_LL, gCommonFormatArgs);
//Ensure the random sequence chosen isn't from RCT1 or expansion if the player doesn't have it installed
while (!safeSequence) {
// Ensure the random sequence chosen isn't from RCT1 or expansion if the player doesn't have it installed
while (!safeSequence)
{
size_t total = TitleSequenceManager::GetCount();
random = util_rand() % (int32_t)total;
const utf8* scName = title_sequence_manager_get_name(random);
safeSequence = true;
if (scName == RCT1String) {
if (scName == RCT1String)
{
safeSequence = RCT1Installed;
} if (scName == RCT1AAString) {
}
if (scName == RCT1AAString)
{
safeSequence = RCT1AAInstalled;
} if (scName == RCT1LLString) {
}
if (scName == RCT1LLString)
{
safeSequence = RCT1LLInstalled;
}
}
ChangePresetSequence(random);
}
size_t seqId = title_get_config_sequence();
if (seqId == SIZE_MAX)