summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-04-27 17:32:10 +0000
committerfrosch <frosch@openttd.org>2010-04-27 17:32:10 +0000
commit8a9e1d4596676e769b728d1b0931f2cdae92d853 (patch)
tree8d969f15b0bbb5656000d9136b60f9804e0fb868
parent7579079874a36670aca6cfe9b565e0f5e2ed8f99 (diff)
downloadopenttd-8a9e1d4596676e769b728d1b0931f2cdae92d853.tar.xz
(svn r19733) -Change: Set var 60+x parameters in the inspect window per feature.
-rw-r--r--src/newgrf_debug_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp
index ec2c6a5a1..b53c2ae5b 100644
--- a/src/newgrf_debug_gui.cpp
+++ b/src/newgrf_debug_gui.cpp
@@ -243,7 +243,7 @@ struct NewGRFInspectWindow : Window {
static const int BOTTOM_OFFSET = 5; ///< Position of bottom edge
/** The value for the variable 60 parameters. */
- static byte var60params[0x20];
+ static byte var60params[GSF_FAKE_END][0x20];
/** The currently editted parameter, to update the right one. */
byte current_edit_param;
@@ -319,7 +319,7 @@ struct NewGRFInspectWindow : Window {
this->DrawString(r, i++, "Variables:");
for (const NIVariable *niv = nif->variables; niv->name != NULL; niv++) {
bool avail = true;
- uint param = HasVariableParameter(niv->var) ? NewGRFInspectWindow::var60params[niv->var - 0x60] : 0;
+ uint param = HasVariableParameter(niv->var) ? NewGRFInspectWindow::var60params[index][niv->var - 0x60] : 0;
uint value = nih->Resolve(index, niv->var, param, &avail);
if (!avail) continue;
@@ -441,7 +441,7 @@ struct NewGRFInspectWindow : Window {
{
if (StrEmpty(str)) return;
- NewGRFInspectWindow::var60params[this->current_edit_param - 0x60] = strtol(str, NULL, 16);
+ NewGRFInspectWindow::var60params[GetFeatureIndex(this->window_number)][this->current_edit_param - 0x60] = strtol(str, NULL, 16);
this->SetDirty();
}
@@ -451,7 +451,7 @@ struct NewGRFInspectWindow : Window {
}
};
-/* static */ byte NewGRFInspectWindow::var60params[0x20] = { 0 }; // Use spec to have 0s in whole array
+/* static */ byte NewGRFInspectWindow::var60params[GSF_FAKE_END][0x20] = { {0} }; // Use spec to have 0s in whole array
static const NWidgetPart _nested_newgrf_inspect_widgets[] = {
NWidget(NWID_HORIZONTAL),