src/misc_gui.cpp
changeset 7486 d130c10f4dab
parent 7449 5cedaf2c861c
child 7487 9ef3bd32c2eb
equal deleted inserted replaced
7485:68e3df6c477e 7486:d130c10f4dab
   102 
   102 
   103 	p = GetPlayer(IsValidPlayer(_local_player) ? _local_player : PLAYER_FIRST);
   103 	p = GetPlayer(IsValidPlayer(_local_player) ? _local_player : PLAYER_FIRST);
   104 	t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   104 	t = ClosestTownFromTile(tile, _patches.dist_local_authority);
   105 
   105 
   106 	old_money = p->player_money;
   106 	old_money = p->player_money;
   107 	p->player_money = 0x7fffffff;
   107 	p->player_money = INT64_MAX;
   108 	costclear = DoCommand(tile, 0, 0, 0, CMD_LANDSCAPE_CLEAR);
   108 	costclear = DoCommand(tile, 0, 0, 0, CMD_LANDSCAPE_CLEAR);
   109 	p->player_money = old_money;
   109 	p->player_money = old_money;
   110 
   110 
   111 	/* Because build_date is not set yet in every TileDesc, we make sure it is empty */
   111 	/* Because build_date is not set yet in every TileDesc, we make sure it is empty */
   112 	td.build_date = 0;
   112 	td.build_date = 0;
   608 
   608 
   609 	w->desc_flags = WDF_STD_BTN | WDF_DEF_WIDGET;
   609 	w->desc_flags = WDF_STD_BTN | WDF_DEF_WIDGET;
   610 }
   610 }
   611 
   611 
   612 
   612 
   613 void ShowEstimatedCostOrIncome(int32 cost, int x, int y)
   613 void ShowEstimatedCostOrIncome(Money cost, int x, int y)
   614 {
   614 {
   615 	StringID msg = STR_0805_ESTIMATED_COST;
   615 	StringID msg = STR_0805_ESTIMATED_COST;
   616 
   616 
   617 	if (cost < 0) {
   617 	if (cost < 0) {
   618 		cost = -cost;
   618 		cost = -cost;
   620 	}
   620 	}
   621 	SetDParam(0, cost);
   621 	SetDParam(0, cost);
   622 	ShowErrorMessage(INVALID_STRING_ID, msg, x, y);
   622 	ShowErrorMessage(INVALID_STRING_ID, msg, x, y);
   623 }
   623 }
   624 
   624 
   625 void ShowCostOrIncomeAnimation(int x, int y, int z, int32 cost)
   625 void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
   626 {
   626 {
   627 	StringID msg;
   627 	StringID msg;
   628 	Point pt = RemapCoords(x,y,z);
   628 	Point pt = RemapCoords(x,y,z);
   629 
   629 
   630 	msg = STR_0801_COST;
   630 	msg = STR_0801_COST;
   634 	}
   634 	}
   635 	SetDParam(0, cost);
   635 	SetDParam(0, cost);
   636 	AddTextEffect(msg, pt.x, pt.y, 0x250);
   636 	AddTextEffect(msg, pt.x, pt.y, 0x250);
   637 }
   637 }
   638 
   638 
   639 void ShowFeederIncomeAnimation(int x, int y, int z, int32 cost)
   639 void ShowFeederIncomeAnimation(int x, int y, int z, Money cost)
   640 {
   640 {
   641 	Point pt = RemapCoords(x,y,z);
   641 	Point pt = RemapCoords(x,y,z);
   642 
   642 
   643 	SetDParam(0, cost);
   643 	SetDParam(0, cost);
   644 	AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250);
   644 	AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250);