Merge branch 'save_ext' into jgrpp
# Conflicts: # config.lib # src/misc_gui.cpp # src/network/network_gui.cpp # src/settings_type.h # src/smallmap_gui.cpp # src/smallmap_gui.h # src/station_cmd.cpp # src/toolbar_gui.cpp # src/vehicle_gui.cpp # src/window.cpp
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "linkgraph/linkgraph_gui.h"
|
||||
#include "tilehighlight_func.h"
|
||||
#include "hotkeys.h"
|
||||
#include "guitimer_func.h"
|
||||
|
||||
#include "saveload/saveload.h"
|
||||
|
||||
@@ -211,10 +212,11 @@ enum {
|
||||
|
||||
struct MainWindow : Window
|
||||
{
|
||||
uint refresh;
|
||||
GUITimer refresh;
|
||||
|
||||
static const uint LINKGRAPH_REFRESH_PERIOD = 0xff;
|
||||
static const uint LINKGRAPH_DELAY = 0xf;
|
||||
/* Refresh times in milliseconds */
|
||||
static const uint LINKGRAPH_REFRESH_PERIOD = 7650;
|
||||
static const uint LINKGRAPH_DELAY = 450;
|
||||
|
||||
MainWindow(WindowDesc *desc) : Window(desc)
|
||||
{
|
||||
@@ -227,14 +229,14 @@ struct MainWindow : Window
|
||||
|
||||
this->viewport->map_type = (ViewportMapType) _settings_client.gui.default_viewport_map_mode;
|
||||
this->viewport->overlay = new LinkGraphOverlay(this, WID_M_VIEWPORT, 0, 0, 3);
|
||||
this->refresh = LINKGRAPH_DELAY;
|
||||
this->refresh.SetInterval(LINKGRAPH_DELAY);
|
||||
}
|
||||
|
||||
virtual void OnTick()
|
||||
virtual void OnRealtimeTick(uint delta_ms)
|
||||
{
|
||||
if (--this->refresh > 0) return;
|
||||
if (!this->refresh.Elapsed(delta_ms)) return;
|
||||
|
||||
this->refresh = LINKGRAPH_REFRESH_PERIOD;
|
||||
this->refresh.SetInterval(LINKGRAPH_REFRESH_PERIOD);
|
||||
|
||||
if (this->viewport->overlay->GetCargoMask() == 0 ||
|
||||
this->viewport->overlay->GetCompanyMask() == 0) {
|
||||
@@ -430,7 +432,7 @@ struct MainWindow : Window
|
||||
this->viewport->scrollpos_y += ScaleByZoom(delta.y, this->viewport->zoom);
|
||||
this->viewport->dest_scrollpos_x = this->viewport->scrollpos_x;
|
||||
this->viewport->dest_scrollpos_y = this->viewport->scrollpos_y;
|
||||
this->refresh = LINKGRAPH_DELAY;
|
||||
this->refresh.SetInterval(LINKGRAPH_DELAY);
|
||||
}
|
||||
|
||||
virtual void OnMouseWheel(int wheel)
|
||||
@@ -449,7 +451,7 @@ struct MainWindow : Window
|
||||
if (this->viewport != NULL) {
|
||||
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_M_VIEWPORT);
|
||||
nvp->UpdateViewportCoordinates(this);
|
||||
this->refresh = LINKGRAPH_DELAY;
|
||||
this->refresh.SetInterval(LINKGRAPH_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user