Merge branch 'master' into jgrpp
# Conflicts: # config.lib # projects/openttd_vs140.vcxproj # projects/openttd_vs140.vcxproj.filters # projects/openttd_vs141.vcxproj # projects/openttd_vs141.vcxproj.filters # projects/openttd_vs142.vcxproj # projects/openttd_vs142.vcxproj.filters # src/aircraft_cmd.cpp # src/base_station_base.h # src/core/pool_type.hpp # src/disaster_vehicle.cpp # src/economy.cpp # src/engine.cpp # src/group.h # src/group_cmd.cpp # src/group_gui.cpp # src/lang/english.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/network/network_command.cpp # src/network/network_server.cpp # src/openttd.cpp # src/order_cmd.cpp # src/road_cmd.cpp # src/saveload/afterload.cpp # src/saveload/cargopacket_sl.cpp # src/saveload/linkgraph_sl.cpp # src/saveload/order_sl.cpp # src/saveload/station_sl.cpp # src/saveload/town_sl.cpp # src/saveload/vehicle_sl.cpp # src/screenshot.cpp # src/screenshot.h # src/settings_gui.cpp # src/settings_type.h # src/smallmap_gui.cpp # src/station.cpp # src/station_cmd.cpp # src/table/settings.ini # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train.h # src/train_cmd.cpp # src/train_gui.cpp # src/vehicle.cpp # src/vehicle_base.h # src/vehiclelist.cpp # src/window_type.h
This commit is contained in:
@@ -273,8 +273,9 @@ private:
|
||||
AbstractFileType abstract_filetype; /// Type of file to select.
|
||||
SaveLoadOperation fop; ///< File operation to perform.
|
||||
FileList fios_items; ///< Save game list.
|
||||
FiosItem o_dir;
|
||||
FiosItem o_dir; ///< Original dir (home dir for this browser)
|
||||
const FiosItem *selected; ///< Selected game in #fios_items, or \c nullptr.
|
||||
const FiosItem *highlighted; ///< Item in fios_items highlighted by mouse pointer, or \c nullptr.
|
||||
Scrollbar *vscroll;
|
||||
|
||||
StringFilter string_filter; ///< Filter for available games.
|
||||
@@ -449,6 +450,8 @@ public:
|
||||
|
||||
if (item == this->selected) {
|
||||
GfxFillRect(r.left + 1, y, r.right, y + this->resize.step_height, PC_DARK_BLUE);
|
||||
} else if (item == this->highlighted) {
|
||||
GfxFillRect(r.left + 1, y, r.right, y + this->resize.step_height, PC_VERY_DARK_BLUE);
|
||||
}
|
||||
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, item->title, _fios_colours[GetDetailedFileType(item->type)]);
|
||||
y += this->resize.step_height;
|
||||
@@ -729,6 +732,33 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void OnMouseLoop() override
|
||||
{
|
||||
const Point pt{ _cursor.pos.x - this->left, _cursor.pos.y - this->top };
|
||||
const int widget = GetWidgetFromPos(this, pt.x, pt.y);
|
||||
|
||||
if (widget == WID_SL_DRIVES_DIRECTORIES_LIST) {
|
||||
int y = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_SL_DRIVES_DIRECTORIES_LIST, WD_FRAMERECT_TOP);
|
||||
if (y == INT_MAX) return;
|
||||
|
||||
/* Get the corresponding non-filtered out item from the list */
|
||||
int i = 0;
|
||||
while (i <= y) {
|
||||
if (!this->fios_items_shown[i]) y++;
|
||||
i++;
|
||||
}
|
||||
const FiosItem *file = this->fios_items.Get(y);
|
||||
|
||||
if (file != this->highlighted) {
|
||||
this->highlighted = file;
|
||||
this->SetWidgetDirty(WID_SL_DRIVES_DIRECTORIES_LIST);
|
||||
}
|
||||
} else if (this->highlighted != nullptr) {
|
||||
this->highlighted = nullptr;
|
||||
this->SetWidgetDirty(WID_SL_DRIVES_DIRECTORIES_LIST);
|
||||
}
|
||||
}
|
||||
|
||||
EventState OnKeyPress(WChar key, uint16 keycode) override
|
||||
{
|
||||
if (keycode == WKC_ESC) {
|
||||
|
Reference in New Issue
Block a user