Changeset - r14050:b7e0ee8ee2b9
[Not reviewed]
master
0 4 0
rubidium - 14 years ago 2009-12-22 18:34:07
rubidium@openttd.org
(svn r18603) -Codechange: move getting the song name to music_gui.cpp
4 files changed with 18 insertions and 17 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -588,7 +588,7 @@ STR_MUSIC_RULER_MARKER                  
 
STR_MUSIC_TRACK_NONE                                            :{TINYFONT}{DKGREEN}--
 
STR_MUSIC_TRACK_DIGIT                                           :{TINYFONT}{DKGREEN}{ZEROFILL_NUM}
 
STR_MUSIC_TITLE_NONE                                            :{TINYFONT}{DKGREEN}------
 
STR_MUSIC_TITLE_NAME                                            :{TINYFONT}{DKGREEN}"{STRING1}"
 
STR_MUSIC_TITLE_NAME                                            :{TINYFONT}{DKGREEN}"{RAW_STRING}"
 
STR_MUSIC_TRACK                                                 :{TINYFONT}{BLACK}Track
 
STR_MUSIC_XTITLE                                                :{TINYFONT}{BLACK}Title
 
STR_MUSIC_SHUFFLE                                               :{TINYFONT}{BLACK}Shuffle
 
@@ -609,7 +609,7 @@ STR_MUSIC_TOOLTIP_SHOW_MUSIC_TRACK_SELEC
 

	
 
# Playlist window
 
STR_PLAYLIST_MUSIC_PROGRAM_SELECTION                            :{WHITE}Music Programme Selection
 
STR_PLAYLIST_TRACK_NAME                                         :{TINYFONT}{LTBLUE}{ZEROFILL_NUM} "{STRING1}"
 
STR_PLAYLIST_TRACK_NAME                                         :{TINYFONT}{LTBLUE}{ZEROFILL_NUM} "{RAW_STRING}"
 
STR_PLAYLIST_TRACK_INDEX                                        :{TINYFONT}{BLACK}Track Index
 
STR_PLAYLIST_PROGRAM                                            :{TINYFONT}{BLACK}Programme - '{STRING}'
 
STR_PLAYLIST_CLEAR                                              :{TINYFONT}{BLACK}Clear
src/music_gui.cpp
Show inline comments
 
@@ -24,6 +24,17 @@
 
#include "table/strings.h"
 
#include "table/sprites.h"
 

	
 
/**
 
 * Get the name of the song.
 
 * @param index of the song.
 
 * @return the name of the song.
 
 */
 
static const char *GetSongName(int index)
 
{
 
	return _origin_songs_specs[index].song_name;
 
}
 

	
 

	
 
static byte _music_wnd_cursong;
 
static bool _song_is_active;
 
static byte _cur_playlist[NUM_SONGS_PLAYLIST];
 
@@ -267,8 +278,7 @@ struct MusicTrackSelectionWindow : publi
 
				for (uint i = 1; i <= NUM_SONGS_AVAILABLE; i++) {
 
					SetDParam(0, i);
 
					SetDParam(1, 2);
 
					SetDParam(2, SPECSTR_SONGNAME);
 
					SetDParam(3, i);
 
					SetDParamStr(2, GetSongName(i - 1));
 
					Dimension d2 = GetStringBoundingBox(STR_PLAYLIST_TRACK_NAME);
 
					d.width = max(d.width, d2.width);
 
					d.height += d2.height;
 
@@ -290,8 +300,7 @@ struct MusicTrackSelectionWindow : publi
 
				for (uint i = 1; i <= NUM_SONGS_AVAILABLE; i++) {
 
					SetDParam(0, i);
 
					SetDParam(1, 2);
 
					SetDParam(2, SPECSTR_SONGNAME);
 
					SetDParam(3, i);
 
					SetDParamStr(2, GetSongName(i - 1));
 
					DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_PLAYLIST_TRACK_NAME);
 
					y += FONT_HEIGHT_SMALL;
 
				}
 
@@ -305,8 +314,7 @@ struct MusicTrackSelectionWindow : publi
 
					uint i = *p;
 
					SetDParam(0, i);
 
					SetDParam(1, 2);
 
					SetDParam(2, SPECSTR_SONGNAME);
 
					SetDParam(3, i);
 
					SetDParamStr(2, GetSongName(i - 1));
 
					DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_PLAYLIST_TRACK_NAME);
 
					y += FONT_HEIGHT_SMALL;
 
				}
 
@@ -477,8 +485,7 @@ struct MusicWindow : public Window {
 
			case MW_TRACK_NAME: {
 
				Dimension d = GetStringBoundingBox(STR_MUSIC_TITLE_NONE);
 
				for (int i = 0; i < NUM_SONGS_AVAILABLE; i++) {
 
					SetDParam(0, SPECSTR_SONGNAME);
 
					SetDParam(1, i);
 
					SetDParamStr(0, GetSongName(i));
 
					d = maxdim(d, GetStringBoundingBox(STR_MUSIC_TITLE_NAME));
 
				}
 
				d.width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
 
@@ -528,8 +535,7 @@ struct MusicWindow : public Window {
 
				StringID str = STR_MUSIC_TITLE_NONE;
 
				if (_song_is_active != 0 && _music_wnd_cursong != 0) {
 
					str = STR_MUSIC_TITLE_NAME;
 
					SetDParam(0, SPECSTR_SONGNAME);
 
					SetDParam(1, _music_wnd_cursong);
 
					SetDParamStr(0, GetSongName(_music_wnd_cursong - 1));
 
				}
 
				DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_CENTER);
 
			} break;
src/strings.cpp
Show inline comments
 
@@ -18,7 +18,6 @@
 
#include "waypoint_base.h"
 
#include "industry.h"
 
#include "newgrf_text.h"
 
#include "music.h"
 
#include "fileio_func.h"
 
#include "group.h"
 
#include "signs_base.h"
 
@@ -1200,9 +1199,6 @@ static char *GetSpecialNameString(char *
 

	
 
		case 3: // President name
 
			return GenPresidentName(buff, GetInt32(&argv), last);
 

	
 
		case 4: // song names
 
			return strecpy(buff, _origin_songs_specs[GetInt32(&argv) - 1].song_name, last);
 
	}
 

	
 
	/* town name? */
src/strings_type.h
Show inline comments
 
@@ -84,7 +84,6 @@ enum SpecialStrings {
 

	
 
	SPECSTR_ANDCO_NAME         = 0x70E6,
 
	SPECSTR_PRESIDENT_NAME     = 0x70E7,
 
	SPECSTR_SONGNAME           = 0x70E8,
 

	
 
	/* reserve MAX_LANG strings for the *.lng files */
 
	SPECSTR_LANGUAGE_START     = 0x7100,
0 comments (0 inline, 0 general)