Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: binaries/data/mods/public/art/textures/ui/session/portraits/technologies/shared_los.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
|
|
|
35 | 35 | this.cheatsEnabled = false; |
36 | 36 | this.cheatTimeMultiplier = 1; |
37 | 37 | this.heroes = []; |
| 38 | this.sharedLos = false; |
38 | 39 | this.resourceNames = { |
39 | 40 | "food": markForTranslation("Food"), |
40 | 41 | "wood": markForTranslation("Wood"), |
… |
… |
|
453 | 454 | if (!cmpPlayerManager) |
454 | 455 | return; |
455 | 456 | |
456 | | var sharedLos = []; |
| 457 | var cmpTechnologyManager = Engine.QueryInterface(this.entity, IID_TechnologyManager); |
| 458 | if (!cmpTechnologyManager) |
| 459 | return; |
| 460 | |
| 461 | var sharedLosArr = []; |
457 | 462 | for (var i = 0; i < cmpPlayerManager.GetNumPlayers(); ++i) |
458 | | if (this.IsMutualAlly(i)) |
459 | | sharedLos.push(i); |
| 463 | if ( (this.IsMutualAlly(i) && this.sharedLos) || (i == this.GetPlayerID()) ) |
| 464 | sharedLosArr.push(i); |
460 | 465 | |
461 | | cmpRangeManager.SetSharedLos(this.playerID, sharedLos); |
| 466 | cmpRangeManager.SetSharedLos(this.playerID, sharedLosArr); |
462 | 467 | }; |
463 | 468 | |
464 | 469 | Player.prototype.GetFormations = function() |
… |
… |
|
788 | 793 | this.startingTechnologies = techs; |
789 | 794 | }; |
790 | 795 | |
791 | | Engine.RegisterComponentType(IID_Player, "Player", Player); |
| 796 | Player.prototype.OnValueModification = function(msg) |
| 797 | { |
| 798 | if (msg.component != "Player") |
| 799 | return; |
| 800 | |
| 801 | var oldSharedLos = this.sharedLos; |
| 802 | this.sharedLos = ApplyValueModificationsToPlayer("Player/sharedLos", this.sharedLos, this.entity); |
| 803 | |
| 804 | if (oldSharedLos != this.sharedLos) |
| 805 | this.UpdateSharedLos(); |
| 806 | }; |
| 807 | |
| 808 | Engine.RegisterComponentType(IID_Player, "Player", Player); |
| 809 | No newline at end of file |