Ticket #1773: patch_notiftreasure.diff
File patch_notiftreasure.diff, 1.2 KB (added by , 11 years ago) |
---|
-
binaries/data/mods/public/simulation/components/ResourceGatherer.js
167 167 { 168 168 var cmpResourceSupply = Engine.QueryInterface(target, IID_ResourceSupply); 169 169 var type = cmpResourceSupply.GetType(); 170 var amount = cmpResourceSupply.GetCurrentAmount(); 170 171 171 172 if (type.generic != "treasure") return false; 172 173 … … 174 175 175 176 var cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); 176 177 cmpPlayer.AddResource(type.specific, status.amount); 178 179 // GUI notification giving information about the resource collected 180 var message = "You found " + amount + " units of " + type.specific + " !" 181 var notification = {"player": cmpPlayer.GetPlayerID(), "message": message }; 182 var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); 183 cmpGUIInterface.PushNotification(notification); 177 184 178 185 var cmpStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker); 179 186 if (cmpStatisticsTracker)