Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3252 closed defect (fixed)

[PATCH] getTradingTooltip is wrong

Reported by: elexis Owned by: sanderd17
Priority: Should Have Milestone: Alpha 19
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

The tooltip of the trade cart always says that the current player / observer profits, since it always uses the hardcoded string "you":

	var tooltip = sprintf(translate("%(gain)s (%(player)s)"), {
		gain: gainString,
		player: translate("you")
	});

It basically acts as if one could only click the own trade carts. A simple check is missing. If the trade cart belongs to another player than that playername should be displayed instead.

Attachments (2)

t3252_fix_trade_tooltip.patch (1.7 KB ) - added by elexis 9 years ago.
Fixes the two issues described above. (Attempts to use the correct playername, and succeeds if #3253 is committed).
t3252_clean_trade_tooltip.patch (1.6 KB ) - added by elexis 9 years ago.
The string "You" will now only appear in singleplayer, in order to prevent confusion with players who might call themselves "You".

Download all attachments as: .zip

Change History (7)

comment:1 by elexis, 9 years ago

The other problem with this tooltip is it has "player X" hardcoded and doesn't use (nor attempt to use) the actual playername:

player: sprintf(translate("player %(name)s"), { name: gain.market1Owner })

So this second bug is not related to #3253.

Last edited 9 years ago by elexis (previous) (diff)

by elexis, 9 years ago

Fixes the two issues described above. (Attempts to use the correct playername, and succeeds if #3253 is committed).

comment:2 by elexis, 9 years ago

Keywords: patch review added; simple removed
Milestone: BacklogAlpha 19
Summary: getTradingTooltip says "you" profit from other trade carts[PATCH] getTradingTooltip is wrong

comment:3 by sanderd17, 9 years ago

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 16659:

Fix player names in trade tooltips. Patch by elexis. Fixes #3252

comment:4 by sanderd17, 9 years ago

Keywords: review removed

by elexis, 9 years ago

The string "You" will now only appear in singleplayer, in order to prevent confusion with players who might call themselves "You".

comment:5 by leper, 9 years ago

In 16661:

Use the actual player name in MP. Patch by elexis. Refs #3252.

Note: See TracTickets for help on using tickets.