summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-04-24 13:39:11 +0000
committerrubidium <rubidium@openttd.org>2010-04-24 13:39:11 +0000
commitf56ebd81c35beb0094c487cc3dc45dc0427fae46 (patch)
tree36776a247dae7d416030b82239b506698c94ce29 /src/misc_gui.cpp
parent21883a84d7883df5feb25d6536ec8f67a053fe42 (diff)
downloadopenttd-f56ebd81c35beb0094c487cc3dc45dc0427fae46.tar.xz
(svn r19709) -Feature: NewGRF debugging/inspecting of (primarily) enabled callbacks and values of variables
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 477c187ba..fe108c553 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -35,6 +35,7 @@
#include "querystring_gui.h"
#include "console_func.h"
#include "core/geometry_func.hpp"
+#include "newgrf_debug.h"
#include "table/strings.h"
@@ -65,6 +66,7 @@ static const NWidgetPart _nested_land_info_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY),
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_LAND_AREA_INFORMATION_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
+ NWidget(WWT_DEBUGBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, LIW_BACKGROUND), EndContainer(),
};
@@ -87,6 +89,7 @@ class LandInfoWindow : public Window {
public:
char landinfo_data[LAND_INFO_LINE_END][LAND_INFO_LINE_BUFF_SIZE];
+ TileIndex tile;
virtual void OnPaint()
{
@@ -135,7 +138,7 @@ public:
}
}
- LandInfoWindow(TileIndex tile) : Window() {
+ LandInfoWindow(TileIndex tile) : Window(), tile(tile) {
Town *t = ClosestTownFromTile(tile, _settings_game.economy.dist_local_authority);
/* Because build_date is not set yet in every TileDesc, we make sure it is empty */
@@ -315,6 +318,16 @@ public:
DEBUG(misc, LANDINFOD_LEVEL, "m7 = %#x", _me[tile].m7);
#undef LANDINFOD_LEVEL
}
+
+ virtual bool IsNewGRFInspectable() const
+ {
+ return ::IsNewGRFInspectable(GetGrfSpecFeature(this->tile), this->tile);
+ }
+
+ virtual void ShowNewGRFInspectWindow() const
+ {
+ ::ShowNewGRFInspectWindow(GetGrfSpecFeature(this->tile), this->tile);
+ }
};
static void Place_LandInfo(TileIndex tile)