From debcea9b2862d27b75bebbe0510cbb33f46ca146 Mon Sep 17 00:00:00 2001 From: Ewaken Date: Sat, 22 Jun 2024 15:34:01 +0200 Subject: [PATCH] v1.1.1: update french translation + FIX luxury resources text --- TPE/TopPanel_Text.xml | 20 ++++++++++---------- TPE/UI/TopPanelExtension.lua | 33 ++++++++++++++++++++++----------- TopPanelPro.modinfo | 2 +- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/TPE/TopPanel_Text.xml b/TPE/TopPanel_Text.xml index 44fa380..1a64bb9 100644 --- a/TPE/TopPanel_Text.xml +++ b/TPE/TopPanel_Text.xml @@ -8,7 +8,7 @@ [ICON_RESOURCE_TOYS] Number of Luxury Resources Owned:({1_Type} type) - [ICON_RESOURCE_TOYS] Ressources de luxes possedées:({1_Type} type) + [ICON_RESOURCE_TOYS] Nombre de ressource de luxe possédé : ({1_Type} différentes) [NEWLINE][NEWLINE]自己额外的奢侈品[NEWLINE] @@ -17,7 +17,7 @@ [NEWLINE][NEWLINE]Own Extra Luxury Resources[NEWLINE] - [NEWLINE][NEWLINE]Mes ressources de luxes en trop[NEWLINE] + [NEWLINE][NEWLINE]Ressources de luxe en double[NEWLINE] [NEWLINE][NEWLINE]队友额外的奢侈品 @@ -26,13 +26,13 @@ [NEWLINE][NEWLINE]Team Extra Luxury Resources - [NEWLINE][NEWLINE]Ressources de luxes de mes coéquipiers en surplus + [NEWLINE][NEWLINE]Ressources de luxe en double de l'équipe [NEWLINE][NEWLINE]World Extra Luxury Resources - [NEWLINE][NEWLINE]Ressources de luxes en surplus chez les autres joueurs + [NEWLINE][NEWLINE]Ressources de luxe en double des autres joueurs [NEWLINE]队友可用的战略[NEWLINE] @@ -41,13 +41,13 @@ [NEWLINE][NEWLINE]Team Extra Strategic Resources - [NEWLINE][NEWLINE]Ressources stratégiques de mes coéquipiers en surplus + [NEWLINE][NEWLINE]Ressources stratégiques de l'équipe [NEWLINE][NEWLINE]World Extra Strategic Resources - [NEWLINE][NEWLINE]Ressources stratégiques en surplus chez les autres joueurs + [NEWLINE][NEWLINE]Ressources stratégiques en double des autres joueurs +{1_Num} [Icon_ProductionLarge] 生产力 @@ -65,7 +65,7 @@ Total Production of the Empire - Production globale dans mon Empire + Production totale 生产力成长曲线 @@ -74,7 +74,7 @@ Production Growth Curve - Courbe de croissance de la production + Historique de la production +{1_Num} [Icon_FoodLarge] 食物 @@ -92,7 +92,7 @@ Total Food of the Empire - Nourriture globale dans mon Empire + Production de nourriture totale {1_Num} [Icon_Citizen] 人口 @@ -110,7 +110,7 @@ Total Citizen of the Empire - Nombre de citoyens dans mon Empire + Population totale \ No newline at end of file diff --git a/TPE/UI/TopPanelExtension.lua b/TPE/UI/TopPanelExtension.lua index 27327b2..98f47c0 100644 --- a/TPE/UI/TopPanelExtension.lua +++ b/TPE/UI/TopPanelExtension.lua @@ -310,17 +310,23 @@ function RefreshLuxuryResourcesType() local LUXURYWorldtext = Locale.Lookup("LOC_TOP_PANEL_WORLD_MORE_LUXURY_NAME") local TeamMore = false local WorldMore = false + local localPlayerId = Game.GetLocalPlayer() + local localTeam = Players[localPlayerId]:GetTeam() + local localPlayerDiplomacy = localPlayerId:GetDiplomacy() - for j, playerID in ipairs(PlayerManager.GetAliveMajorIDs()) do - if Players[Game.GetLocalPlayer()]:GetTeam() == Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then -- 是队友 - local LUXURYstr = GetMoreLUXURYstr(playerID) + for j, playerId in ipairs(PlayerManager.GetAliveMajorIDs()) do + local playerTeam = Players[playerId]:GetTeam() + + if localTeam == playerTeam and localPlayerId ~= playerId then -- 是队友 + local LUXURYstr = GetMoreLUXURYstr(playerId) if LUXURYstr then TeamMore = true LUXURYtext = LUXURYtext..LUXURYstr end end - if Players[Game.GetLocalPlayer()]:GetTeam() ~= Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then - local LUXURYstr = GetMoreLUXURYstr(playerID) + + if localTeam ~= playerTeam and localPlayerId ~= playerId and localPlayerDiplomacy:IsAtWarWith( playerId ) == false then + local LUXURYstr = GetMoreLUXURYstr(playerId) if LUXURYstr then WorldMore = true LUXURYWorldtext = LUXURYWorldtext..LUXURYstr @@ -330,11 +336,13 @@ function RefreshLuxuryResourcesType() if TeamMore == true and isLuxuriesTradingAllowed == true then sToolTopText = sToolTopText..LUXURYtext - sYieldPerTurnText = sYieldPerTurnText.."[icon_PressureHigh]" end if WorldMore == true and isLuxuriesTradingAllowed == true then sToolTopText = sToolTopText..LUXURYWorldtext + end + + if ((TeamMore == true or WorldMore == true) and isLuxuriesTradingAllowed == true) then sYieldPerTurnText = sYieldPerTurnText.."[icon_PressureHigh]" end @@ -350,7 +358,6 @@ end -- =========================================================================== function GetMoreLUXURYstr(playerID) - local pPlayerConfig = PlayerConfigurations[playerID]; local leaderType = PlayerConfigurations[playerID]:GetLeaderTypeName(); local LeaderName = Locale.Lookup(GameInfo.Leaders[leaderType].Name); @@ -395,8 +402,9 @@ end -- =========================================================================== function IsTradableResources(Resource) local localPlayerID = Game.GetLocalPlayer() + local localPlayerTeam = Players[localPlayerID]:GetTeam() for j, playerID in ipairs(PlayerManager.GetAliveMajorIDs()) do - if Players[Game.GetLocalPlayer()]:GetTeam() == Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then -- 是队友 + if localPlayerTeam == Players[playerID]:GetTeam() and localPlayerID ~= playerID then -- 是队友 local pForDeal :table = DealManager.GetWorkingDeal(DealDirection.OUTGOING, localPlayerID, playerID); local possibleResources :table = DealManager.GetPossibleDealItems(localPlayerID, playerID, DealItemTypes.RESOURCES, pForDeal); if (possibleResources ~= nil) then @@ -522,9 +530,11 @@ if BaseFile == "TopPanel_Expansion2" then local WorldStrategicYtext = Locale.Lookup("LOC_TOP_PANEL_WORLD_MORE_STRATEGIC_NAME") local TeamMore = false local WorldMore = false + local localPlayerTeam = Players[localPlayerID]:GetTeam() for j, playerID in ipairs(PlayerManager.GetAliveMajorIDs()) do - if Players[Game.GetLocalPlayer()]:GetTeam() == Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then -- 是队友 + local playerTeam = Players[playerID]:GetTeam() + if localPlayerTeam == playerTeam and localPlayerID ~= playerID then -- 是队友 local Strategicstr = GetMoreStrategicstr(playerID,resource) if Strategicstr ~= 0 then TeamMore = true @@ -532,7 +542,7 @@ if BaseFile == "TopPanel_Expansion2" then end end - if Players[Game.GetLocalPlayer()]:GetTeam() ~= Players[playerID]:GetTeam() and Game.GetLocalPlayer() ~= playerID then + if localPlayerTeam ~= playerTeam and localPlayerID ~= playerID then local Strategicstr = GetMoreStrategicstr(playerID,resource) if Strategicstr ~= 0 then WorldMore = true @@ -626,7 +636,8 @@ end -- 判断队友是否解锁了资源 -- =========================================================================== function GetTeamVisibleResources(playerID) - if Players[Game.GetLocalPlayer()]:GetTeam() == Players[playerID]:GetTeam() or playerID == Game.GetLocalPlayer() then -- 是队友 + local localPlayerId = Game.GetLocalPlayer() + if Players[localPlayerId]:GetTeam() == Players[playerID]:GetTeam() or playerID == localPlayerId then -- 是队友 local pPlayerResources = Players[playerID]:GetResources(); for i, kdate in ipairs(g_TopPanelResources) do if pPlayerResources:IsResourceVisible(kdate.Hash) then diff --git a/TopPanelPro.modinfo b/TopPanelPro.modinfo index 60e997d..384377a 100644 --- a/TopPanelPro.modinfo +++ b/TopPanelPro.modinfo @@ -18,7 +18,7 @@ [icon_You]Add indicators for Food, Production, Population, and Luxury Resources to the Top Panel. - [icon_You]Ajoute des indicateurs pour la Nourriture, la Production, la Population, and les ressources de luxes dans le panneau du haut. + [icon_You]Ajoute des indicateurs pour la nourriture, la production, la population et les ressources de luxe sur le panneau supérieur. [icon_You]新增顶栏额外内容:食物、生产力、人口、奢侈品。