From 59202f97f86e7a9810f942b82efb244f28b936e6 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 18 Aug 2015 18:11:50 +0200 Subject: [PATCH] Make the string for 'Default audio device' translatable, fix comment --- data/language/english_uk.txt | 2 ++ src/audio/audio.c | 5 +++-- src/windows/options.c | 8 ++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/data/language/english_uk.txt b/data/language/english_uk.txt index f39d020b6a..bdeb3e3aa8 100644 --- a/data/language/english_uk.txt +++ b/data/language/english_uk.txt @@ -3848,3 +3848,5 @@ STR_5506 :Guests ignore intensities STR_5507 :Handymen mow grass by default STR_5508 :Allow loading files with incorrect checksums STR_5509 :{SMALLFONT}{BLACK}Allows loading scenarios and saves that have an incorrect checksum, like the scenarios from the demo or damaged saves. +STR_5510 :Default sound device +STR_5511 :(UNKNOWN) diff --git a/src/audio/audio.c b/src/audio/audio.c index e16613cf7e..75e4be97d8 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -22,6 +22,7 @@ #include "../config.h" #include "../interface/viewport.h" #include "../interface/window.h" +#include "../localisation/language.h" #include "../platform/platform.h" #include "../ride/ride.h" #include "../world/map.h" @@ -69,11 +70,11 @@ void audio_get_devices() gAudioDeviceCount++; gAudioDevices = malloc(gAudioDeviceCount * sizeof(audio_device)); - strcpy(gAudioDevices[0].name, "Default sound device"); + strcpy(gAudioDevices[0].name, language_get_string(5510)); for (i = 1; i < gAudioDeviceCount; i++) { const char *utf8_name = SDL_GetAudioDeviceName(i - 1, SDL_FALSE); if (utf8_name == NULL) - utf8_name = "(UNKNOWN)"; + utf8_name = language_get_string(5511); strcpy(gAudioDevices[i].name, utf8_name); } diff --git a/src/windows/options.c b/src/windows/options.c index 8659a794eb..abdccf5799 100644 --- a/src/windows/options.c +++ b/src/windows/options.c @@ -1117,7 +1117,7 @@ static void window_options_invalidate(rct_window *w) widget_set_checkbox_value(w, WIDX_DAY_NIGHT_CHECKBOX, gConfigGeneral.day_night_cycle); widget_set_checkbox_value(w, WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners); - // construction marker: celsius/fahrenheit + // construction marker: white/translucent window_options_display_widgets[WIDX_CONSTRUCTION_MARKER].image = STR_WHITE + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8); window_options_display_widgets[WIDX_RESOLUTION].type = WWT_DROPDOWN; @@ -1170,7 +1170,11 @@ static void window_options_invalidate(rct_window *w) RCT2_GLOBAL(0x013CE952, uint16) = STR_SOUND_NONE; } else { - RCT2_GLOBAL(0x013CE952, uint16) = 1170; + if (currentSoundDevice == 0) + RCT2_GLOBAL(0x013CE952, uint16) = 5510; + else + RCT2_GLOBAL(0x013CE952, uint16) = 1170; + RCT2_GLOBAL(0x013CE952 + 2, uint32) = (uint32)gAudioDevices[currentSoundDevice].name; }