File diff r23123:aa31147b532e → r23124:8fa6d269005b
src/graph_gui.cpp
Show inline comments
 
@@ -530,25 +530,25 @@ public:
 

	
 
	virtual OverflowSafeInt64 GetGraphData(const Company *c, int j)
 
	{
 
		return INVALID_DATAPOINT;
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
	{
 
		/* Clicked on legend? */
 
		if (widget == WID_CV_KEY_BUTTON) ShowGraphLegend();
 
	}
 

	
 
	virtual void OnTick()
 
	virtual void OnGameTick()
 
	{
 
		this->UpdateStatistics(false);
 
	}
 

	
 
	/**
 
	 * Some data on this window has become invalid.
 
	 * @param data Information about the changed data.
 
	 * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
 
	 */
 
	virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
 
	{
 
		if (!gui_scope) return;
 
@@ -989,27 +989,27 @@ struct PaymentRatesGraphWindow : BaseGra
 
			default:
 
				if (widget >= WID_CPR_CARGO_FIRST) {
 
					int i = widget - WID_CPR_CARGO_FIRST;
 
					ToggleBit(_legend_excluded_cargo, _sorted_cargo_specs[i]->Index());
 
					this->ToggleWidgetLoweredState(widget);
 
					this->UpdateExcludedData();
 
					this->SetDirty();
 
				}
 
				break;
 
		}
 
	}
 

	
 
	virtual void OnTick()
 
	virtual void OnGameTick()
 
	{
 
		/* Override default OnTick */
 
		/* Override default OnGameTick */
 
	}
 

	
 
	/**
 
	 * Some data on this window has become invalid.
 
	 * @param data Information about the changed data.
 
	 * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
 
	 */
 
	virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
 
	{
 
		if (!gui_scope) return;
 
		this->OnHundredthTick();
 
	}
 
@@ -1230,25 +1230,25 @@ public:
 
			SetDParam(1, c->index);
 
			SetDParam(2, _performance_titles[widest_title]);
 
			widest_width = max(widest_width, GetStringBoundingBox(STR_COMPANY_LEAGUE_COMPANY_NAME).width);
 
		}
 

	
 
		this->text_width = widest_width + 30; // Keep some extra spacing
 

	
 
		size->width = WD_FRAMERECT_LEFT + this->ordinal_width + WD_FRAMERECT_RIGHT + this->icon_width + WD_FRAMERECT_LEFT + this->text_width + WD_FRAMERECT_RIGHT;
 
		size->height = WD_FRAMERECT_TOP + this->line_height * MAX_COMPANIES + WD_FRAMERECT_BOTTOM;
 
	}
 

	
 

	
 
	virtual void OnTick()
 
	virtual void OnGameTick()
 
	{
 
		if (this->companies.NeedResort()) {
 
			this->SetDirty();
 
		}
 
	}
 

	
 
	/**
 
	 * Some data on this window has become invalid.
 
	 * @param data Information about the changed data.
 
	 * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details.
 
	 */
 
	virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
 
@@ -1463,25 +1463,25 @@ struct PerformanceRatingDetailWindow : W
 
		/* Check which button is clicked */
 
		if (IsInsideMM(widget, WID_PRD_COMPANY_FIRST, WID_PRD_COMPANY_LAST + 1)) {
 
			/* Is it no on disable? */
 
			if (!this->IsWidgetDisabled(widget)) {
 
				this->RaiseWidget(this->company + WID_PRD_COMPANY_FIRST);
 
				this->company = (CompanyID)(widget - WID_PRD_COMPANY_FIRST);
 
				this->LowerWidget(this->company + WID_PRD_COMPANY_FIRST);
 
				this->SetDirty();
 
			}
 
		}
 
	}
 

	
 
	virtual void OnTick()
 
	virtual void OnGameTick()
 
	{
 
		if (_pause_mode != PM_UNPAUSED) return;
 

	
 
		/* Update the company score every 5 days */
 
		if (--this->timeout == 0) {
 
			this->UpdateCompanyStats();
 
			this->SetDirty();
 
		}
 
	}
 

	
 
	/**
 
	 * Some data on this window has become invalid.