File diff r23482:de566f8c088d → r23483:3733e6b8ff17
src/company_gui.cpp
Show inline comments
 
@@ -2384,17 +2384,15 @@ struct CompanyWindow : Window
 

	
 
					size->width = max(size->width, GetStringBoundingBox(STR_COMPANY_VIEW_SHARES_OWNED_BY).width);
 
				}
 
				break;
 
			}
 

	
 
#ifdef ENABLE_NETWORK
 
			case WID_C_HAS_PASSWORD:
 
				*size = maxdim(*size, GetSpriteSize(SPR_LOCK));
 
				break;
 
#endif /* ENABLE_NETWORK */
 
		}
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		const Company *c = Company::Get((CompanyID)this->window_number);
 
@@ -2495,19 +2493,17 @@ struct CompanyWindow : Window
 
						y += FONT_HEIGHT_NORMAL;
 
					}
 
				}
 
				break;
 
			}
 

	
 
#ifdef ENABLE_NETWORK
 
			case WID_C_HAS_PASSWORD:
 
				if (_networking && NetworkCompanyIsPassworded(c->index)) {
 
					DrawSprite(SPR_LOCK, PAL_NONE, r.left, r.top);
 
				}
 
				break;
 
#endif /* ENABLE_NETWORK */
 
		}
 
	}
 

	
 
	virtual void SetStringParameters(int widget) const
 
	{
 
		switch (widget) {
 
@@ -2591,13 +2587,12 @@ struct CompanyWindow : Window
 
				break;
 

	
 
			case WID_C_SELL_SHARE:
 
				DoCommandP(0, this->window_number, 0, CMD_SELL_SHARE_IN_COMPANY | CMD_MSG(STR_ERROR_CAN_T_SELL_25_SHARE_IN));
 
				break;
 

	
 
#ifdef ENABLE_NETWORK
 
			case WID_C_COMPANY_PASSWORD:
 
				if (this->window_number == _local_company) ShowNetworkCompanyPasswordWindow(this);
 
				break;
 

	
 
			case WID_C_COMPANY_JOIN: {
 
				this->query_widget = WID_C_COMPANY_JOIN;
 
@@ -2611,13 +2606,12 @@ struct CompanyWindow : Window
 
				} else {
 
					/* just send the join command */
 
					NetworkClientRequestMove(company);
 
				}
 
				break;
 
			}
 
#endif /* ENABLE_NETWORK */
 
		}
 
	}
 

	
 
	virtual void OnHundredthTick()
 
	{
 
		/* redraw the window every now and then */
 
@@ -2649,17 +2643,15 @@ struct CompanyWindow : Window
 
				break;
 

	
 
			case WID_C_COMPANY_NAME:
 
				DoCommandP(0, 0, 0, CMD_RENAME_COMPANY | CMD_MSG(STR_ERROR_CAN_T_CHANGE_COMPANY_NAME), NULL, str);
 
				break;
 

	
 
#ifdef ENABLE_NETWORK
 
			case WID_C_COMPANY_JOIN:
 
				NetworkClientRequestMove((CompanyID)this->window_number, str);
 
				break;
 
#endif /* ENABLE_NETWORK */
 
		}
 
	}
 

	
 

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