File diff r11916:e3a8d08bf479 → r11917:612c11f7ab47
src/industry_gui.cpp
Show inline comments
 
@@ -482,19 +482,19 @@ public:
 
	IndustryViewWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
 
	{
 
		this->flags4 |= WF_DISABLE_VP_SCROLL;
 
		this->editbox_line = 0;
 
		this->clicked_line = 0;
 
		this->clicked_button = 0;
 
		InitializeWindowViewport(this, 3, 17, 254, 86, GetIndustry(window_number)->xy + TileDiffXY(1, 1), ZOOM_LVL_INDUSTRY);
 
		InitializeWindowViewport(this, 3, 17, 254, 86, Industry::Get(window_number)->xy + TileDiffXY(1, 1), ZOOM_LVL_INDUSTRY);
 
		this->FindWindowPlacementAndResize(desc);
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		Industry *i = GetIndustry(this->window_number);
 
		Industry *i = Industry::Get(this->window_number);
 
		const IndustrySpec *ind = GetIndustrySpec(i->type);
 
		int y = this->widget[IVW_INFO].top + 1;
 
		bool first = true;
 
		bool has_accept = false;
 

	
 
		SetDParam(0, this->window_number);
 
@@ -591,13 +591,13 @@ public:
 
		Industry *i;
 

	
 
		switch (widget) {
 
			case IVW_INFO: {
 
				int line, x;
 

	
 
				i = GetIndustry(this->window_number);
 
				i = Industry::Get(this->window_number);
 

	
 
				/* We should work if needed.. */
 
				if (!IsProductionAlterable(i)) return;
 
				x = pt.x;
 
				line = (pt.y - this->production_offset_y) / 10;
 
				if (pt.y >= this->production_offset_y && IsInsideMM(line, 0, 2) && i->produced_cargo[line] != CT_INVALID) {
 
@@ -625,13 +625,13 @@ public:
 
						ShowQueryString(STR_CONFIG_SETTING_INT32, STR_CONFIG_GAME_PRODUCTION, 10, 100, this, CS_ALPHANUMERAL, QSF_NONE);
 
					}
 
				}
 
			} break;
 

	
 
			case IVW_GOTO:
 
				i = GetIndustry(this->window_number);
 
				i = Industry::Get(this->window_number);
 
				if (_ctrl_pressed) {
 
					ShowExtraViewPortWindow(i->xy + TileDiffXY(1, 1));
 
				} else {
 
					ScrollMainWindowToTile(i->xy + TileDiffXY(1, 1));
 
				}
 
				break;
 
@@ -657,13 +657,13 @@ public:
 
	}
 

	
 
	virtual void OnQueryTextFinished(char *str)
 
	{
 
		if (StrEmpty(str)) return;
 

	
 
		Industry *i = GetIndustry(this->window_number);
 
		Industry *i = Industry::Get(this->window_number);
 
		int line = this->editbox_line;
 

	
 
		i->production_rate[line] = ClampU(atoi(str), 0, 255);
 
		UpdateIndustryProduction(i);
 
		this->SetDirty();
 
	}