More Notifification

More Notifification 1.0.4

hello
i would very much like to use this mod
my objective is to be notified about simple events such as trade deals and open borders expired

I read all the posts and the contents of the "how to use" folder
but as a newbie i do not understand how to make this work

can you kindly explain how this can be used in layman terms :)

thank you
 
first I need to know if you can code in lua, if you don't want or can't I can do it for you,
second the notification for trade deals and open borders expired is already in the exemple of the mod, so if you want to modify it you can use my/FearSunn's code, it's at line 529 of NotificationForMoreNotification.lua
 
first I need to know if you can code in lua, if you don't want or can't I can do it for you,
second the notification for trade deals and open borders expired is already in the exemple of the mod, so if you want to modify it you can use my/FearSunn's code, it's at line 529 of NotificationForMoreNotification.lua


Thank you very much (Merci beaucoup d'avoir accepté de m'aider.)

I have never coded un LUA, I have some limited exposure to coding so I can find my way through files and try to edit.

I found a section starting from 529 to 714 for deal expired (trade and borders).
From my limited knowledge I believe it defines 3 functions called GetRessourcesFromExpiredDeals, OnDiplomacyDealExpired and ProcessEvent

I also found another portion of code from lines 1 to 162 that seem to define generic functions and interactions, that are required for all notifications? Is that correct?

If that is correct, where do I take it from here?

(In French: quelles parties du fichier conserver, doit on simplement editer et sauver ces deux sections sous //Mods avec le modinfo corespondant, ou y a t il d'autres modifications à apporter à d'autres fichiers, ailleurs)

Many thanks again for your kind assistance.
(I am using English as I think it is required by forum rules.)
 
do you want to extract the deal expired notification without other notifications? if that's the case you should just active the mod "notification for more notification after erasing every undesired event in the initialize function
it should look like this:
Code:
function Initialize()
   
   
    Events.PhaseBegin.Add(                                  OnPhaseBegin );
    GameEvents.PlayerTurnStarted.Add(                      SetActivePlayer );
   
   
    -- Initialize deal expired Notification
    GameEvents.PlayerTurnStarted.Add(                       GetRessourcesFromExpiredDeals );
    Events.DiplomacyDealExpired.Add(                        OnDiplomacyDealExpired );
end
Initialize()

and it should work
 
Hello,

Understood.

Now should I put all the files included in the zip (both folders More Notification and NotificationsforMoreNotifications) under /users/.../Mods ?

Is there anything else to do?


Also does it work on existing saved games or only new ones?

Thanks again for your time and kind answer....
 
that should be it yes, there should be no problem with saved game but you'll need to add <AffectsSavedGames>0</AffectsSavedGames> in both modinfo files, it should be beside <CompatibleVersions>2.0</CompatibleVersions> :
Code:
<CompatibleVersions>2.0</CompatibleVersions>
<AffectsSavedGames>0</AffectsSavedGames>
 
Hello
I wish to report that everything is working now, thanks to your kind assistance.
Many thanks again for sharing this awesome extension!!
 
Hi, I don't have the new DLC unfortunately, so I would need you to get to the error (when the popups should appear) and then send me the lua.log in the log folder beside the mod folder
thx for reporting it.
 
Here is the lua.log with only your mod active. There are no errors in the log but the popup does not work.
Spoiler Lua.log :

DebugHotloadCache: GameDebug initialized!
Test: Test.LUA loaded!
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
AdvancedSetup: There are 6 participating players.
AdvancedSetup: Building Game Setup
AdvancedSetup: Player Count Changed
AdvancedSetup: There are 6 participating players.
AdvancedSetup: Player Count Changed
AdvancedSetup: There are 6 participating players.
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
AdvancedSetup: Player Count Changed
AdvancedSetup: There are 2 participating players.
JoiningRoom: OnFinishedGameplayContentConfigure() g_waitingForContentConfigure=true
AdvancedSetup: Hiding Game Setup
LoadScreen: true
LoadScreen: false
LoadScreen: true
LoadScreen: true
LoadScreen: true
GenerateRandomMap: Map Seed = -351039566
Map Script: Generating Continents Map
Map Script: Generating Plot Types
Map Script: Existing Ratio 17.636363636364
Map Script: New Mountains 0
Map Script: Mountain Set 1
Map Script: Generating Terrain Types
Map Script: -
Map Script: - Desert Percentage: 25
Map Script: --- Latitude Readout ---
Map Script: - All Grass End Latitude: 0.1
Map Script: - Desert Start Latitude: 0.2
Map Script: - Desert End Latitude: 0.5
Map Script: - Tundra Start Latitude: 0.65
Map Script: - Snow Start Latitude: 0.8
Map Script: - - - - - - - - - - - - - -
Map Script: Expanding coasts
Map Script: After Adding Hills: 209
Map Script: Desired Volcanoes: 1.552
Map Script: Continent Boundary Plots: 0
Map Script: Boundary Plots Per Volcano: 0
Map Script: Continent Edge Volcanoes Placed: 0
Map Script: Volcano Placed at (x, y): 28, 12
Map Script: Volcano Placed at (x, y): 12, 18
Map Script: Total Volcanoes Placed: 2
Map Script: Map Generation - Adding Rivers
Map Script: Map Generation - Adding Lakes
Map Script: 2 lakes added
Map Script: Adding Features
Map Script: Permanent Ice Tiles: 25.74
Map Script: iPhaseIndex: 7, iIceTilesToAdd: 25.74, RandomEventEnum: 30
Map Script: iPhaseIndex: 6, iIceTilesToAdd: 25.74, RandomEventEnum: 29
Map Script: iPhaseIndex: 5, iIceTilesToAdd: 25.74, RandomEventEnum: 28
Map Script: iPhaseIndex: 4, iIceTilesToAdd: 17.16, RandomEventEnum: 27
Map Script: iPhaseIndex: 3, iIceTilesToAdd: 17.16, RandomEventEnum: 26
Map Script: iPhaseIndex: 2, iIceTilesToAdd: 17.16, RandomEventEnum: 25
Map Script: iPhaseIndex: 1, iIceTilesToAdd: 17.16, RandomEventEnum: 24
Map Script: Number of Tiles: 323
Map Script: Number of Forests: 59
Map Script: Percent Forests: 18.266253869969
Map Script: Number of Jungles: 42
Map Script: Percent Jungles: 13.003095975232
Map Script: Percent of Junglable: 40.384615384615
Map Script: Number of Marshes: 10
Map Script: Adding cliffs
Map Script: In NaturalWonderGenerator.Create()
Map Script: Placing 2 Natural Wonders
Map Script: Feature Type: 6, Valid Hexes: 31
Map Script: Feature Type: 7, Valid Hexes: 2
Map Script: Feature Type: 8, Valid Hexes: 12
Map Script: Feature Type: 9, Valid Hexes: 2
Map Script: Feature Type: 10, Valid Hexes: 0
Map Script: Feature Type: 11, Valid Hexes: 29
Map Script: Feature Type: 12, Valid Hexes: 1
Map Script: Feature Type: 13, Valid Hexes: 0
Map Script: Feature Type: 14, Valid Hexes: 2
Map Script: Feature Type: 15, Valid Hexes: 10
Map Script: Feature Type: 16, Valid Hexes: 40
Map Script: Feature Type: 17, Valid Hexes: 3
Map Script: Feature Type: 18, Valid Hexes: 50
Map Script: Feature Type: 19, Valid Hexes: 0
Map Script: Feature Type: 20, Valid Hexes: 0
Map Script: Feature Type: 21, Valid Hexes: 36
Map Script: Feature Type: 22, Valid Hexes: 0
Map Script: Feature Type: 23, Valid Hexes: 12
Map Script: Feature Type: 24, Valid Hexes: 0
Map Script: Feature Type: 25, Valid Hexes: 20
Map Script: Feature Type: 26, Valid Hexes: 3
Map Script: Feature Type: 27, Valid Hexes: 2
Map Script: Feature Type: 28, Valid Hexes: 0
Map Script: Feature Type: 29, Valid Hexes: 0
Map Script: Feature Type: 36, Valid Hexes: 6
Map Script: Feature Type: 37, Valid Hexes: 64
Map Script: Feature Type: 38, Valid Hexes: 0
Map Script: Feature Type: 39, Valid Hexes: 29
Map Script: Feature Type: 40, Valid Hexes: 58
Map Script: Feature Type: 41, Valid Hexes: 3
Map Script: Feature Type: 42, Valid Hexes: 0
Map Script: Feature Type: 43, Valid Hexes: 15
Map Script: Feature Type: 44, Valid Hexes: 64
Map Script: Feature Type: 45, Valid Hexes: 3
Map Script: Num wonders with valid location: 24
Map Script: Selected Wonder = 9, Random Score = 97
Map Script: Set Wonder with Feature ID of 15 at location (29, 16)
Map Script: Selected Wonder = 27, Random Score = 96
Map Script: Set Wonder with Feature ID of 39 at location (13, 15)
Map Script: Adding Features from Continents
Map Script: Full-Map Fissure Placed at (x, y): 34, 14
Map Script: Full-Map Fissure Placed at (x, y): 35, 16
Map Script: Number of Oasis: 0
Map Script: Number of Fissures: 2
Map Script: Map Generation - Marking Coastal Lowlands
Map Script: 37 Coastal Lowland tiles added
Map Script: 4510075330370f eligible coastal tiles
Map Script: In ResourceGenerator.Create()
Map Script: Placing resources
Map Script: Creating start plot database.
Map Script: Major Start X: 8 Major Start Y: 11
Map Script: Major Start X: 42 Major Start Y: 19
Map Script: Minor Start X: 28 Minor Start Y: 11
Map Script: Minor Start X: 35 Minor Start Y: 11
Map Script: Minor Start X: 40 Minor Start Y: 9
Map Script: -------------------------------
Map Script: Map Generation - Adding Goodies
Map Script: -------------------------------
MNScripts: load MNScript.lua
WorldCongress: Initializing World Congress Lua
MapLabelManager: OCÉANO ÍNDICO (-nan, -nan)
NotificationPanel: Loading NotificationPanel.lua
MapSearchPanel: Created SearchContext 'MapSearch_Primary'
MapSearchPanel: Created SearchContext 'MapSearch_Suggestions'
MapPinPopup: initializing MapTacks.IconOptions(0)
MapPinPopup: Selected 14 columns
InGame: Loading InGame UI - C:/Users/Javi/Documents/My Games/Sid Meier's Civilization VI/Mods/NotificationsForMoreNotification/NotificationsForMoreNotification
NotificationsForMoreNotification: NotificationsForMoreNotifidcation.lua loaded
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/DedicationPopup
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/DisloyalCityChooser
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/EraProgressPanel
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/EraReviewPopup
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/ExpansionIntro
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/GovernorAssignmentChooser
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/GovernorPanel
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/HistoricMoments
InGame: Loading InGame UI - ../../../DLC/Expansion2/UI/Additions/WorldCrisisPopup
InGame: Loading InGame UI - ../../../DLC/Ethiopia/UI/Additions/SecretSocietyPopup
TutorialUIRoot: Tutorial: Firaxis in game tutorial prompts.
TutorialUIRoot: Version: 1
TutorialUIRoot: Loading bank of items for tutorial scenario: 'BASE'
NotificationPanel: NOTIFICATION_DISCOVER_CONTINENT
NotificationPanel: Notififcation Done
MapLabelManager: OCÉANO ÍNDICO (-330.38079833984, 321.80368041992)
MapLabelManager: OCÉANO ÍNDICO (176.34320068359, 411.31628417969)
MapLabelManager: OCÉANO ÍNDICO (878.59423828125, 524.20904541016)
MapLabelManager: OCÉANO ÍNDICO (-670.76776123047, -577.98071289063)
MapLabelManager: OCÉANO ÍNDICO (158.30999755859, -437.20776367188)
MapLabelManager: OCÉANO ÍNDICO (-1085.9722900391, 526.21246337891)
MapLabelManager: OCÉANO ÍNDICO (1288.4318847656, -505.20458984375)
LoadScreen: OnLoadGameViewStateDone
NotificationsForMoreNotification: Phase has Begun
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_TILE_OWNERSHIP_CHANGED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_TILE_OWNERSHIP_CHANGED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_TILE_OWNERSHIP_CHANGED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_TILE_OWNERSHIP_CHANGED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_TILE_OWNERSHIP_CHANGED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_TILE_OWNERSHIP_CHANGED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_PRIDE_MOMENT_RECORDED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CHOOSE_TECH
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CHOOSE_CITY_PRODUCTION
NotificationPanel: Notififcation Done
PlotInfo: PlotInfo::OnCitySelectionChanged 0 65536 9 11 0 true false
PlotInfo: PlotInfo::OnCitySelectionChanged 0 65536 0 0 0 false false
NotificationsForMoreNotification: Phase has Begun
NotificationsForMoreNotification: Phase has Begun
NotificationPanel: NOTIFICATION_DISCOVER_GOODY_HUT
NotificationPanel: Notififcation Done
NotificationsForMoreNotification: Phase has Begun
NotificationsForMoreNotification: Phase has Begun
NotificationPanel: NOTIFICATION_CHOOSE_CITY_PRODUCTION
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_POPULATION_CHANGED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_CUSTOM_TILE_OWNERSHIP_CHANGED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
PlotInfo: PlotInfo::OnCitySelectionChanged 0 65536 9 11 0 true false
PlotInfo: PlotInfo::OnCitySelectionChanged 0 65536 0 0 0 false false
MapLabelManager: OCÉANO ÍNDICO (-330.38079833984, 321.80368041992)
MapLabelManager: OCÉANO ÍNDICO (176.34320068359, 411.31628417969)
MapLabelManager: OCÉANO ÍNDICO (878.59423828125, 524.20904541016)
MapLabelManager: OCÉANO ÍNDICO (-670.76776123047, -577.98071289063)
MapLabelManager: OCÉANO ÍNDICO (158.30999755859, -437.20776367188)
MapLabelManager: OCÉANO ÍNDICO (-1085.9722900391, 526.21246337891)
MapLabelManager: OCÉANO ÍNDICO (1288.4318847656, -505.20458984375)
NotificationPanel: NOTIFICATION_COMMAND_UNITS
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_PRIDE_MOMENT_RECORDED
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_GOVERNOR_APPOINTMENT_AVAILABLE
NotificationPanel: Notififcation Done
NotificationPanel: NOTIFICATION_SECRETSOCIETY_DISCOVERED
NotificationPanel: Notififcation Done


I think the problem is the new DLC adds files that alter the NotificationPanel.lua
that your mod is overwriting.

Here are the new files that the DLC brings in case they serve as a reference:

Spoiler DLC\Ethiopia\UI\Additions\DiplomacyActionView_SecretSocietyRow.lua :

-- Copyright (c) Firaxis Games 2020

-- ===========================================================================
function Refresh(selectedPlayerID:number)

local pSelectedPlayer:table = Players[selectedPlayerID];
local pSelectedPlayerGovs:table = pSelectedPlayer:GetGovernors();

local eSecretSociety:number = pSelectedPlayerGovs:GetSecretSociety();
if eSecretSociety ~= -1 then
local pLocalPlayer:table = Players[Game.GetLocalPlayer()];
local pLocalPlayerGovs:table = pSelectedPlayer:GetGovernors();

if pLocalPlayerGovs:IsAwareOfSecretSociety(eSecretSociety) then
-- Known Secret Society
local kSocietyDef:table = GameInfo.SecretSocieties[eSecretSociety];
Controls.SecretSocietyIcon:SetText(kSocietyDef.IconString);
Controls.SecretSocietyText:SetText(Locale.Lookup(kSocietyDef.Name));
Controls.SecretSocietyText:SetToolTipString("");
else
-- Unknown Secret Society
Controls.SecretSocietyIcon:SetText("");
Controls.SecretSocietyText:SetText(Locale.Lookup("LOC_SECRETSOCIETY_DIPLO_UNKNOWN_NAME"));
Controls.SecretSocietyText:SetToolTipString(Locale.Lookup("LOC_SECRETSOCIETY_DIPLO_UNKNOWN_DESCRIPTION"));
end
else
-- No Secret Society
Controls.SecretSocietyIcon:SetText("");
Controls.SecretSocietyText:SetText(Locale.Lookup("LOC_SECRETSOCIETY_DIPLO_NONE_NAME"));
Controls.SecretSocietyText:SetToolTipString("");
end
end

-- ===========================================================================
function Initialize()
-- Set this context to autosize
ContextPtr:SetAutoSize(true);

LuaEvents.DiploScene_RefreshOverviewRows.Add(Refresh);
end
Initialize();


Spoiler DLC\Ethiopia\UI\Additions\DiplomacyActionView_SecretSocietyRow.xml :

<?xml version="1.0" encoding="utf-8" ?>
<Context xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="..\..\..\..\CivTech\Libs\ForgeUI\ForgeUI_Assets\Controls.xsd" Style="FontNormal16" FontStyle="Shadow">

<Container ID="Top" Size="auto,auto" AutoSizePadding="0,2">
<Image Offset="20,10" Size="22,22" Texture="SecretSocieties_Stats22"/>
<Label Offset="60,10" Style="FontNormal16" String="LOC_SECRETSOCIETY"/>
<Container Size="200,26" Offset="214,6">
<Label ID="SecretSocietyIcon" Offset="0,7"/>
<Label ID="SecretSocietyText" Offset="36,5" Style="FontNormal16" WrapWidth="240"/>
</Container>
</Container>

</Context>


Spoiler DLC\Ethiopia\UI\Additions\SecretSocietyPopup.lua :

-- Copyright 2020, Firaxis Games

-- ===========================================================================
-- CONSTANTS
-- ===========================================================================

local kJoinedImages:table = {};
kJoinedImages["SECRETSOCIETY_OWLS_OF_MINERVA"] = "GovernorSelectedSTK_OwlsOfMinerva";
kJoinedImages["SECRETSOCIETY_HERMETIC_ORDER"] = "GovernorSelectedSTK_HermeticOrder";
kJoinedImages["SECRETSOCIETY_VOIDSINGERS"] = "GovernorSelectedSTK_VoidSingers";
kJoinedImages["SECRETSOCIETY_SANGUINE_PACT"] = "GovernorSelectedSTK_SanguinePact";

-- ===========================================================================
function OnContinueButton()
Close();
end

-- ===========================================================================
function OnOpenGovernorsButton()
Close();
LuaEvents.GovernorPanel_Open();
end

-- ===========================================================================
function Open()
UIManager:QueuePopup(ContextPtr, PopupPriority.Low);
end

-- ===========================================================================
function Close()
UIManager:DequeuePopup(ContextPtr);
end

-- ===========================================================================
function OnInputHandler( pInputStruct:table )
local uiMsg :number = pInputStruct:GetMessageType();
if uiMsg == KeyEvents.KeyUp and pInputStruct:GetKey() == Keys.VK_ESCAPE then
Close();
return true;
end
return false;
end

-- ===========================================================================
function OnInit(isReload:boolean)
LateInitialize();
end

-- ===========================================================================
function OnSecretSocietyDiscovered( pNotification:table )
if pNotification == nil then
return;
end

local eType:number = pNotification:GetType();
if eType ~= NotificationTypes.SECRETSOCIETY_DISCOVERED then
return;
end

local ePlayer:number = pNotification:GetValue( "PARAM_DATA0" );
local eSociety:number = pNotification:GetValue( "PARAM_DATA1" );

if ePlayer ~= Game.GetLocalPlayer() then
return;
end
local kPlayer:table = Players[ePlayer];
if kPlayer == nil then
return;
end
local kPlayerGovernors:table = kPlayer:GetGovernors();
if kPlayerGovernors == nil then
return;
end
local kSocietyDef:table = GameInfo.SecretSocieties[eSociety];
if kSocietyDef == nil then
return;
end

Controls.EventTitle:SetText(Locale.ToUpper("LOC_DISCOVERED_SOCIETY"));
Controls.EventDescription:SetText(Locale.Lookup("LOC_DISCOVERED_SOCIETY_DESC", kSocietyDef.Name));

Controls.SocietyImage:SetTexture("SecretSocieties_EventsFG_Discover");
local memberSocietyHash = kPlayerGovernors:GetSecretSociety();
local kMemberSocietyDef:table = GameInfo.SecretSocieties[memberSocietyHash];
if (kMemberSocietyDef ~= nil) then
Controls.SocietyDescription:SetText(Locale.Lookup("LOC_DISCOVERED_SOCIETY_WHILE_MEMBER_OF_ANOTHER", kSocietyDef.Name, kMemberSocietyDef.Name));
else
Controls.SocietyDescription:SetText(Locale.Lookup(kSocietyDef.DiscoveryText));
end

Open();
end

-- ===========================================================================
function OnSecretSocietyJoined( pNotification:table )
if pNotification == nil then
return;
end

local eType:number = pNotification:GetType();
if eType ~= NotificationTypes.SECRETSOCIETY_JOINED then
return;
end

local ePlayer:number = pNotification:GetValue( "PARAM_DATA0" );
local eSociety:number = pNotification:GetValue( "PARAM_DATA1" );

if ePlayer ~= Game.GetLocalPlayer() then
return;
end

local kSocietyDef:table = GameInfo.SecretSocieties[eSociety];
if kSocietyDef == nil then
return;
end

Controls.EventTitle:SetText(Locale.ToUpper("LOC_JOINED_SOCIETY"));
Controls.EventDescription:SetText(Locale.Lookup("LOC_JOINED_SOCIETY_DESC", kSocietyDef.Name));

Controls.SocietyImage:SetTexture(kJoinedImages[kSocietyDef.SecretSocietyType]);
Controls.SocietyDescription:SetText(Locale.Lookup(kSocietyDef.MembershipText));

Open();
end

-- ===========================================================================
function Subscribe()
LuaEvents.NotificationPanel_SecretSocietyDiscovered.Add( OnSecretSocietyDiscovered );
LuaEvents.NotificationPanel_SecretSocietyJoined.Add( OnSecretSocietyJoined );
end

-- ===========================================================================
function Unsubscribe()
LuaEvents.NotificationPanel_SecretSocietyDiscovered.Remove( OnSecretSocietyDiscovered );
LuaEvents.NotificationPanel_SecretSocietyJoined.Remove( OnSecretSocietyJoined );
end

-- ===========================================================================
function OnShutdown()
Unsubscribe();
end

-- ===========================================================================
function LateInitialize()
Subscribe();
end

-- ===========================================================================
function Initialize()
ContextPtr:SetInitHandler( OnInit );
ContextPtr:SetInputHandler( OnInputHandler, true );
ContextPtr:SetShutdown( OnShutdown );

Controls.OpenGovernorsButton:RegisterCallback( Mouse.eLClick, OnOpenGovernorsButton );
Controls.ContinueButton:RegisterCallback( Mouse.eLClick, OnContinueButton );
end
Initialize();


Spoiler DLC\Ethiopia\UI\Additions\SecretSocietyPopup.xml :

<?xml version="1.0" encoding="utf-8"?>
<Context>

<Container Style="FullScreenVignetteConsumer"/>

<Grid ID="DropShadow" Size="595,768" Anchor="C,C" Offset="0,0" Style="DropShadow2" Color="255,255,255,200">
<Grid ID="Window" Size="parent-5,parent+8" Anchor="C,C" Offset="0,0" SizePadding="0,20" Style="EventPopupFrame">

<Grid Style="EventPopupTitleBar" Size="parent-32,65" Offset="0,17" Anchor="C,T">
<Label ID="EventTitle" Style="EventPopupTitle" Offset="0,2" Align="Center" WrapWidth="420" String="LOC_DISCOVERED_SOCIETY" Anchor="C,C"/>
</Grid>

<Container ID="DescriptionContainer" Size="parent-32,60" Offset="0,80" Anchor="C,T">
<Label ID="EventDescription" Style="EventPopupDescription" Align="Center" WrapWidth="parent-40" Anchor="C,C"/>
<Line Start="1,0" End="parent-2,0" Width="2" Color="35,66,92,150" Anchor="C,B"/>
</Container>

<Image ID="SocietyImage" Size="296,360" Texture="SecretSocieties_EventsFG_Discover" Anchor="C,T" Offset="0,140"/>

<Grid Style="EventPopupEffectsDeco" Anchor="C,B" Offset="0,115" Size="parent-50,160" AutoSizePadding="0,10">
<ScrollPanel Size="parent-25,parent-10" Anchor="C,C" Vertical="1" AutoScrollBar="1">
<ScrollBar Size="11,100" Anchor="R,C" Offset="0,0" Style="ScrollVerticalBar" />
<Label ID="SocietyDescription" Style="EventPopupEffects" Size="parent,auto" Align="Center" WrapWidth="parent-50" Anchor="C,C"/>
</ScrollPanel>
</Grid>

<Stack ID="ButtonStack" Anchor="C,B" Offset="0,26" StackPadding="4" StackGrowth="Down">
<GridButton ID="OpenGovernorsButton" Style="MainButton" Size="270,40" Anchor="C,T" Offset="0,0" String="LOC_GO_TO_GOVERNORS"/>
<GridButton ID="ContinueButton" Style="MainButton" Size="270,40" Anchor="C,T" Offset="0,0" String="LOC_CONTINUE"/>
</Stack>
</Grid>
</Grid>

</Context>


Spoiler DLC\Ethiopia\UI\Loaders\TechAndCivicUnlockables_Ethiopia.lua :

-- Copyright 2020, Firaxis Games

-- ===========================================================================
-- Filter out base items from the list that also contain a replacement,
-- or which are excluded entirely (with no replacement) by a player trait.
-- This method does NOT maintain ordering.
-- ===========================================================================
function RemoveReplacedUnlockables(kUnlockables:table, playerId:number)
local kHasTraitMap:table = GetTraitMapForPlayer(playerId);

local kUnlockMap:table = {};
for i,v in ipairs(kUnlockables) do
kUnlockMap[v[2]] = v;
end

for row in GameInfo.BuildingReplaces() do
-- Only show the original buildings in the tech tree instead of the secret society building replacements
if(row.CivUniqueBuildingType == "BUILDING_ALCHEMICAL_SOCIETY") or (row.CivUniqueBuildingType == "BUILDING_GILDED_VAULT") then
kUnlockMap[row.CivUniqueBuildingType] = nil;
elseif(kUnlockMap[row.CivUniqueBuildingType]) then
kUnlockMap[row.ReplacesBuildingType] = nil;
end
end

for row in GameInfo.DistrictReplaces() do
if(kUnlockMap[row.CivUniqueDistrictType]) then
kUnlockMap[row.ReplacesDistrictType] = nil;
end
end

for row in GameInfo.ExcludedDistricts() do
if(kHasTraitMap[row.TraitType]) then
kUnlockMap[row.DistrictType] = nil;
end
end

for row in GameInfo.UnitReplaces() do
if(kUnlockMap[row.CivUniqueUnitType]) then
kUnlockMap[row.ReplacesUnitType] = nil;
end
end

local kResults:table = {};
for k,v in pairs(kUnlockables) do
if(kUnlockMap[v[2]])then
table.insert(kResults, v);
end
end

return kResults;
end


Spoiler DLC\Ethiopia\UI\Replacements\NotificationPanel_Ethiopia.lua :

-- Copyright 2018, Firaxis Games

-- This file is being included into the base NotificationPanel file using the wildcard include setup in NotificationPanel.lua
-- Refer to the bottom of NotificationPanel.lua to see how that's happening
-- DO NOT include any NotificationPanel files here or it will cause problems
--include("NotificationPanel_Expansion1");

-- ===========================================================================
-- CACHE BASE FUNCTIONS
-- ===========================================================================
local BASE_RegisterHandlers = RegisterHandlers;

-- ===========================================================================
function OnActivateSecretSocietyDiscovered( notificationEntry )
if (notificationEntry ~= nil and notificationEntry.m_PlayerID == Game.GetLocalPlayer()) then

local pNotification :table = GetActiveNotificationFromEntry(notificationEntry);
if pNotification ~= nil then
LuaEvents.NotificationPanel_SecretSocietyDiscovered(pNotification);
end
end
end

-- ===========================================================================
function OnActivateSecretSocietyJoined( notificationEntry )
if (notificationEntry ~= nil and notificationEntry.m_PlayerID == Game.GetLocalPlayer()) then

local pNotification :table = GetActiveNotificationFromEntry(notificationEntry);
if pNotification ~= nil then
LuaEvents.NotificationPanel_SecretSocietyJoined(pNotification);
end
end
end

-- ===========================================================================
-- HELPER: Get seceret society name from notification.
function GetSocietyName( pNotification:table )
local eSociety:number = pNotification:GetValue( "PARAM_DATA1" );
local kSocietyDef:table = GameInfo.SecretSocieties[eSociety];
if kSocietyDef == nil then
UI.DataError("Unknown secret society name (for notification) using enum: ",eSociety);
return;
end
return kSocietyDef.Name;
end

-- ===========================================================================
-- Overrides to apply specific strings for secret society notifications.
-- ===========================================================================
function ApplyNotificationTextOverrides( notificationEntry:NotificationType, pNotification:table, messageName:string, summary:string )
if notificationEntry.m_TypeName == "NOTIFICATION_SECRETSOCIETY_DISCOVERED" then
local societyName :string = GetSocietyName(pNotification);
summary = Locale.Lookup( "LOC_DISCOVERED_SOCIETY_DESC", societyName );
end

if notificationEntry.m_TypeName == "NOTIFICATION_SECRETSOCIETY_JOINED" then
local societyName :string = GetSocietyName(pNotification);
summary = Locale.Lookup( "LOC_JOINED_SOCIETY_DESC", societyName );
end

return messageName, summary;
end


-- ===========================================================================
-- Almost duplicate from the default "Add" except special logic for adding icons
-- TODO: Remove this and return to using the default "Add" notification
-- handler once the DB is updated to support "Icon" entries in the Notifications.
-- ===========================================================================
function OnSecretSocietyAddNotification( pNotification:table )
local typeName :string = pNotification:GetTypeName();
if typeName == nil then
UI.DataError("NIL notification type name for notification ID:"..tostring(pNotification:GetID()));
return;
end

local playerID :number = pNotification:GetPlayerID();
local notificationID :number = pNotification:GetID();
local notificationGroupID :number = pNotification:GetGroup();

-- Explict ICON lookup based on type (only change from Add)
local notificationPrimaryIconName:string = "";
if typeName == "NOTIFICATION_SECRETSOCIETY_DISCOVERED" then
notificationPrimaryIconName = "ICON_NOTIFICATION_SECRETSOCIETY_CONTACT";
elseif typeName == "NOTIFICATION_SECRETSOCIETY_JOINED" then
notificationPrimaryIconName = "ICON_NOTIFICATION_SECRETSOCIETY_LEADER_JOINED";
end

local notificationEntry :NotificationType = AddNotificationEntry(playerID, typeName, notificationID, notificationGroupID, notificationPrimaryIconName);
if (notificationEntry == nil) then
return; -- Didn't add it for some reason. It was either filtered out or possibly already in the list.
end
local kHandlers :NotificationHandler= GetHandler( pNotification:GetType() );

notificationEntry.m_kHandlers = kHandlers;

-- Only add a visual entry for this notification if:
-- It is not a blocking type (otherwise assume the ActionPanel is displaying it)
-- It is the first notification entry in a group
-- The icon is displayable in the current mode.
if ( table.count(notificationEntry.m_IDs)==1
and pNotification:GetEndTurnBlocking() == EndTurnBlockingTypes.NO_ENDTURN_BLOCKING
and pNotification:IsIconDisplayable() ) then

notificationEntry.m_Instance = m_genericItemIM:GetInstance();
notificationEntry.m_InstanceManager = m_genericItemIM;
notificationEntry.m_Instance.m_MouseIn = false; -- Manually track since 2 different, overlapping objects are tracking if a pointer is in/out

if notificationEntry.m_Instance then
-- Use the (collapse) button as the actual mouse-in area, but a larger rectangle will
-- track the mouse out, since the player may be interacting with the extended
-- information that flew out to the left of the notification.

if pNotification:IsValidForPhase() then
notificationEntry.m_Instance.MouseInArea:RegisterCallback( Mouse.eLClick, function() kHandlers.TryActivate(notificationEntry); end );
notificationEntry.m_Instance.MouseInArea:RegisterCallback( Mouse.eRClick, function() kHandlers.TryDismiss(notificationEntry); end );
notificationEntry.m_Instance.MouseOutArea:RegisterCallback( Mouse.eLClick, function() OnClickMouseOutArea(notificationEntry); end );
notificationEntry.m_Instance.MouseOutArea:RegisterCallback( Mouse.eRClick, function() OnClickMouseOutArea(notificationEntry, true); end );
else
--A notification in the wrong phase can be dismissed but not activated.
local messageName:string = Locale.Lookup(pNotification:GetMessage());
notificationEntry.m_Instance.MouseInArea:RegisterCallback( Mouse.eLClick, OnDoNothing );
notificationEntry.m_Instance.MouseInArea:RegisterCallback( Mouse.eRClick, function() kHandlers.TryDismiss(notificationEntry); end );
notificationEntry.m_Instance.MouseOutArea:RegisterCallback( Mouse.eLClick, OnDoNothing );
notificationEntry.m_Instance.MouseOutArea:RegisterCallback( Mouse.eRClick, function() kHandlers.TryDismiss(notificationEntry); end );
local toolTip:string = messageName .. "[NEWLINE]" .. Locale.Lookup("LOC_NOTIFICATION_WRONG_PHASE_TT", messageName);
notificationEntry.m_Instance.MouseInArea:SetToolTipString(toolTip);
end
notificationEntry.m_Instance.MouseInArea:RegisterMouseEnterCallback( function() OnMouseEnterNotification( notificationEntry.m_Instance ); end );
notificationEntry.m_Instance.MouseOutArea:RegisterMouseExitCallback( function() OnMouseExitNotification( notificationEntry.m_Instance ); end );

--Set the notification icon
if (notificationEntry.m_IconName ~= nil) then
local textureOffsetX, textureOffsetY, textureSheet = IconManager:FindIconAtlas(notificationEntry.m_IconName,40);
if (textureOffsetX ~= nil) then
notificationEntry.m_Instance.Icon:SetTexture( textureOffsetX, textureOffsetY, textureSheet );
end
else
if(notificationEntry.m_TypeName ~= nil) then
local iconName :string = DATA_ICON_PREFIX .. notificationEntry.m_TypeName;
local textureOffsetX, textureOffsetY, textureSheet = IconManager:FindIconAtlas(iconName,40);
if (textureOffsetX ~= nil) then
notificationEntry.m_Instance.Icon:SetTexture( textureOffsetX, textureOffsetY, textureSheet );
end
end
end

-- If notification is auto generated, it will have an internal count.
notificationEntry.m_isAuto = pNotification:IsAutoNotify();

-- Sets current phase state.
notificationEntry.m_kHandlers.OnPhaseBegin( playerID, notificationID );

-- Reset animation control
notificationEntry.m_Instance.NotificationSlide:Stop();
notificationEntry.m_Instance.NotificationSlide:SetToBeginning();
end
end

-- Update size of notification
RealizeStandardNotification( playerID, notificationID );

end


-- ===========================================================================
-- TODO: Remove once "Icon" is honored in the XML, the purpose of this is to
-- just add the default handlers but override "Add" so it can do some
-- custom setting for the Secret Society icons (which need to exist
-- for MP games.)
function MakeHandlersWithSecretSocietyAddOverride()
local handlers = MakeDefaultHandlers();
handlers.Add = OnSecretSocietyAddNotification;
return handlers;
end

-- ===========================================================================
function RegisterHandlers()

BASE_RegisterHandlers();

g_notificationHandlers[NotificationTypes.SECRETSOCIETY_DISCOVERED] = MakeHandlersWithSecretSocietyAddOverride();
g_notificationHandlers[NotificationTypes.SECRETSOCIETY_JOINED] = MakeHandlersWithSecretSocietyAddOverride();

g_notificationHandlers[NotificationTypes.SECRETSOCIETY_DISCOVERED].Activate = OnActivateSecretSocietyDiscovered;
g_notificationHandlers[NotificationTypes.SECRETSOCIETY_JOINED].Activate = OnActivateSecretSocietyJoined;

end

I hope this helps you. If you need something else do not hesitate to ask for it, and thanks for your work.

Regards
 
Hi, I think you found it it's the NotificationPanel_Ethiopia.lua the problem, I can't really test it. it works in vanilla.

I just copy paste the NotificationPanel_Ethiopia.lua at the end of my code.
 

Attachments

I just looked the notification files and it seem there is some updates so I will update my mod, thx for reporting the issue.
 
I just modified the mod so it's updated, I think it should be even more compatible with the new DLC, now you can erase custom notification stack too and I remove barbarian camp notification, could you let me now if it works with the DLC?
 

Attachments

I just modified the mod so it's updated, I think it should be even more compatible with the new DLC, now you can erase custom notification stack too and I remove barbarian camp notification, could you let me now if it works with the DLC?
I did a quick test and it works with the DLC.
Keep it up, thanks!
 
Back
Top Bottom