Changeset - r13261:41545c6cff72
[Not reviewed]
master
0 1 0
alberth - 15 years ago 2009-10-17 07:47:59
alberth@openttd.org
(svn r17780) -Codechange: A bit more code style in the autoreplace window.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/autoreplace_gui.cpp
Show inline comments
 
@@ -141,13 +141,13 @@ class ReplaceVehicleWindow : public Wind
 
		GUIEngineList *list = &this->engines[i];
 
		list->Clear();
 

	
 
		const Engine *e;
 
		FOR_ALL_ENGINES_OF_TYPE(e, type) {
 
			EngineID eid = e->index;
 
			if (type == VEH_TRAIN && !GenerateReplaceRailList(eid, draw_left, this->replace_engines)) continue; // special rules for trains
 
			if (type == VEH_TRAIN && !this->GenerateReplaceRailList(eid, draw_left, this->replace_engines)) continue; // special rules for trains
 

	
 
			if (draw_left) {
 
				const GroupID selected_group = this->sel_group;
 
				const uint num_engines = GetGroupNumEngines(_local_company, selected_group, eid);
 

	
 
				/* Skip drawing the engines we don't have any of and haven't set for replacement */
 
@@ -167,13 +167,13 @@ class ReplaceVehicleWindow : public Wind
 
	void GenerateLists()
 
	{
 
		EngineID e = this->sel_engine[0];
 

	
 
		if (this->update_left == true) {
 
			/* We need to rebuild the left engines list */
 
			GenerateReplaceVehList(true);
 
			this->GenerateReplaceVehList(true);
 
			this->vscroll.SetCount(this->engines[0].Length());
 
			if (this->reset_sel_engine && this->sel_engine[0] == INVALID_ENGINE && this->engines[0].Length() != 0) {
 
				this->sel_engine[0] = this->engines[0][0];
 
			}
 
		}
 

	
 
@@ -181,13 +181,13 @@ class ReplaceVehicleWindow : public Wind
 
			/* Either we got a request to rebuild the right engines list, or the left engines list selected a different engine */
 
			if (this->sel_engine[0] == INVALID_ENGINE) {
 
				/* Always empty the right engines list when nothing is selected in the left engines list */
 
				this->engines[1].Clear();
 
				this->sel_engine[1] = INVALID_ENGINE;
 
			} else {
 
				GenerateReplaceVehList(false);
 
				this->GenerateReplaceVehList(false);
 
				this->vscroll2.SetCount(this->engines[1].Length());
 
				if (this->reset_sel_engine && this->sel_engine[1] == INVALID_ENGINE && this->engines[1].Length() != 0) {
 
					this->sel_engine[1] = this->engines[1][0];
 
				}
 
			}
 
		}
0 comments (0 inline, 0 general)