summaryrefslogtreecommitdiff
path: root/src/fios_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2016-09-04 12:57:20 +0000
committeralberth <alberth@openttd.org>2016-09-04 12:57:20 +0000
commitdf9a9f074a55a839a5f311e5c0837342192e720d (patch)
tree3cf68517d98ae01eea8e74db9569b6e09b8905cb /src/fios_gui.cpp
parent88bdf482c0dc96661e3c8e89df44dcacea0199d7 (diff)
downloadopenttd-df9a9f074a55a839a5f311e5c0837342192e720d.tar.xz
(svn r27649) -Codechange: Introduce detailed file type enum, rebuild FiosType with it.
Diffstat (limited to 'src/fios_gui.cpp')
-rw-r--r--src/fios_gui.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index e902941d6..a4e495b49 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -186,12 +186,19 @@ static const NWidgetPart _nested_save_dialog_widgets[] = {
EndContainer(),
};
-/** Colours for fios types, indexed by #FiosType. */
-const TextColour _fios_colours[] = {
- TC_LIGHT_BLUE, TC_DARK_GREEN, TC_DARK_GREEN, TC_ORANGE, TC_LIGHT_BROWN,
- TC_ORANGE, TC_LIGHT_BROWN, TC_ORANGE, TC_ORANGE, TC_YELLOW
+/** Text colours of #DetailedFileType fios entries in the window. */
+static const TextColour _fios_colours[] = {
+ TC_LIGHT_BROWN, // DFT_OLD_GAME_FILE
+ TC_ORANGE, // DFT_GAME_FILE
+ TC_YELLOW, // DFT_HEIGHTMAP_BMP
+ TC_ORANGE, // DFT_HEIGHTMAP_PNG
+ TC_LIGHT_BLUE, // DFT_FIOS_DRIVE
+ TC_DARK_GREEN, // DFT_FIOS_PARENT
+ TC_DARK_GREEN, // DFT_FIOS_DIR
+ TC_ORANGE, // DFT_FIOS_DIRECT
};
+
/**
* Sort the collected list save games prior to displaying it in the save/load gui.
* @param [inout] file_list List of save game files found in the directory.
@@ -368,7 +375,7 @@ public:
if (item == this->selected) {
GfxFillRect(r.left + 1, y, r.right, y + this->resize.step_height, PC_DARK_BLUE);
}
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, item->title, _fios_colours[item->type]);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, item->title, _fios_colours[GetDetailedFileType(item->type)]);
y += this->resize.step_height;
if (y >= this->vscroll->GetCapacity() * this->resize.step_height + r.top + WD_FRAMERECT_TOP) break;
}
@@ -575,7 +582,8 @@ public:
this->selected = file;
_load_check_data.Clear();
- if (file->type == FIOS_TYPE_FILE || file->type == FIOS_TYPE_SCENARIO) {
+ if (GetDetailedFileType(file->type) == DFT_GAME_FILE) {
+ /* Other detailed file types cannot be checked before. */
SaveOrLoad(name, SL_LOAD_CHECK, NO_DIRECTORY, false);
}