Wedding Cutscene

naonauno
Author
Description
This script is the WIP of the new Wedding Cutscene event.
Tags
cutscene
event
wedding
Script Details
Version
v4
Visibility
Public
Created
Apr 04, 2025
Last Updated
Apr 11, 2025
Collaborators
1
Script Content
2672 characters
-- UI Enhancement Script
-- Description: Enhances the game UI with additional information and controls
-- Configuration
local config = {
showExtraInfo = true, -- Show additional building information
enhancedTooltips = true, -- Show enhanced tooltips
quickAccessBar = true -- Add quick access bar
}
-- Called when the script is first loaded
function OnInit()
print("UI enhancement script initialized!")
if config.showExtraInfo then
EnableExtraInfo()
end
if config.enhancedTooltips then
EnableEnhancedTooltips()
end
if config.quickAccessBar then
CreateQuickAccessBar()
end
end
-- Enable extra information display on buildings
function EnableExtraInfo()
UI.RegisterBuildingInfoCallback(OnBuildingInfoRequest)
print("Extra building info enabled")
end
-- Enable enhanced tooltips
function EnableEnhancedTooltips()
UI.RegisterTooltipCallback(OnTooltipRequest)
print("Enhanced tooltips enabled")
end
-- Create quick access bar
function CreateQuickAccessBar()
local bar = UI.CreateElement("Panel", "QuickAccessBar")
bar:SetPosition(100, 100)
bar:SetSize(400, 50)
-- Add buttons to the bar
AddQuickAccessButton(bar, "Market", 10, OpenMarketView)
AddQuickAccessButton(bar, "Dynasty", 70, OpenDynastyView)
AddQuickAccessButton(bar, "Politics", 130, OpenPoliticsView)
print("Quick access bar created")
end
-- Helper to add buttons to the quick access bar
function AddQuickAccessButton(parent, text, xPos, clickCallback)
local button = UI.CreateElement("Button", "QuickButton_" .. text)
button:SetParent(parent)
button:SetPosition(xPos, 10)
button:SetSize(50, 30)
button:SetText(text)
button:RegisterCallback("OnClick", clickCallback)
end
-- Called when building info is requested
function OnBuildingInfoRequest(buildingId)
local building = Game.GetBuilding(buildingId)
local info = {}
info.income = building:GetDailyIncome()
info.employees = building:GetEmployeeCount()
info.efficiency = building:GetEfficiency()
return info
end
-- Called when a tooltip is requested
function OnTooltipRequest(objectId, objectType)
if objectType == "Building" then
return GetBuildingTooltip(objectId)
elseif objectType == "Character" then
return GetCharacterTooltip(objectId)
end
return nil
end
-- Called when the script is unloaded
function OnShutdown()
UI.UnregisterCallbacks()
UI.DestroyElement("QuickAccessBar")
print("UI enhancements removed")
end
Collaborators

naonauno
Owner
No additional collaborators yet.