forked from Azurency/Civ6-UIFiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenVFX.lua
58 lines (49 loc) · 2.59 KB
/
GenVFX.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
-- ===========================================================================
-- Generic VFX triggers
-- ===========================================================================
include("TabSupport");
include("InstanceManager");
include("SupportFunctions");
include("AnimSidePanelSupport");
include("TeamSupport");
-- ===========================================================================
-- CONSTANTS
-- ===========================================================================
-- ===========================================================================
-- VARIABLES
-- ===========================================================================
-- ===========================================================================
-- Handle City Added to Map
-- ===========================================================================
function OnCityAddedToMap( ownerPlayerID:number, cityID:number, cityX:number, cityY:number )
WorldView.PlayEffectAtXY("CITY_CREATED", cityX, cityY);
end
-- ===========================================================================
-- Handle District Added to Map
-- ===========================================================================
function OnDistrictAddedToMap( playerID: number, districtID : number, cityID :number, districtX : number, districtY : number, districtType:number, iEra:number, iCivType:number, percentComplete:number, iAppeal:number, bPillaged:number )
if (WorldView.HasAssetForDistrict(districtType)) then
-- Check for a city at the location, they have an underlying district, but we don't want to show an effect for it.
local pCity : object = CityManager.GetCityAt(districtX, districtY);
if pCity == nil then
WorldView.PlayEffectAtXY("DISTRICT_CREATED", districtX, districtY);
end
end
end
-- ===========================================================================
-- Handle Building / Wonder Added to Map
-- ===========================================================================
function OnBuildingAddedToMap( plotX:number, plotY:number, buildingType:number, playerType:number, pctComplete:number, bPillaged:number )
if (WorldView.HasAssetForWonder(buildingType)) then
WorldView.PlayEffectAtXY("WONDER_CREATED", plotX, plotY);
else
WorldView.PlayEffectAtXY("BUILDING_CREATED", plotX, plotY);
end
end
-- ===========================================================================
function Initialize()
Events.CityAddedToMap.Add( OnCityAddedToMap );
Events.DistrictAddedToMap.Add( OnDistrictAddedToMap );
Events.BuildingAddedToMap.Add( OnBuildingAddedToMap );
end
Initialize();