cleanup of the updateDiplomacy functions

Summary: Following d9d1f1bbeb the diplomacy window is updated on each
tick, so we can remove the old updateDiplomacy function which now only
updates the player data, and rename updateDiplomacyPanel to
updateDiplomacy for consistency with other windows.

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D172
This was SVN commit r19257.
This commit is contained in:
mimo 2017-03-01 20:15:12 +00:00
parent 3be6460e88
commit 1022619d98
4 changed files with 5 additions and 16 deletions

View file

@ -115,10 +115,7 @@ function updateCounters()
}
}
else if (!diplomacyCeasefireCounter.hidden)
{
diplomacyCeasefireCounter.hidden = true;
updateDiplomacy();
}
g_ResearchListTop = 4;
if (linesCount)

View file

@ -314,10 +314,10 @@ function openDiplomacy()
g_IsDiplomacyOpen = true;
updateDiplomacyPanel(true);
updateDiplomacy(true);
}
function updateDiplomacyPanel(opening = false)
function updateDiplomacy(opening = false)
{
if (g_ViewedPlayer < 1 || !g_IsDiplomacyOpen)
return;

View file

@ -331,7 +331,7 @@ var g_NotificationsTypes =
"status": notification.status
});
updateDiplomacy();
updatePlayerData();
},
"tribute": function(notification, player)
{
@ -514,14 +514,6 @@ function handleNotifications()
}
}
/**
* Updates playerdata cache and refresh diplomacy panel.
*/
function updateDiplomacy()
{
updatePlayerData();
}
/**
* Displays all active counters (messages showing the remaining time) for wonder-victory, ceasefire etc.
*/

View file

@ -521,7 +521,7 @@ function playerFinished(player, won)
if (player == Engine.GetPlayerID())
reportGame();
updateDiplomacy();
updatePlayerData();
updateChatAddressees();
if (player != g_ViewedPlayer)
@ -846,7 +846,7 @@ function updateGUIObjects()
global.music.setState(global.music.states[battleState]);
}
updateDiplomacyPanel();
updateDiplomacy();
}
function onReplayFinished()