Grakl
Chieftain
Hello, maybe someone can shed some light on an issue I'm having on my mod. What I'm trying to do is add a UI button in the "City" view that allows me to make a city I own a puppet. Sounds easy right?
Alright, I've included "CityView.xml" and CityView.lua" in my ModBuddy project. Here's the current updates to CityView.xml
That part works, which is fantastic. When I load my mod and start a game. BAM! There's a button that says "Make Puppet". Good deal. Now, just to make baby steps I want to change the text of my new "Make Puppet" button when I click some other button. For my test, I used "OnBuyPlotClick" in the CityView.lua.
Now, as you can see, I have a "Controls.PuppetizeCityLabel:SetText("")" commented out. It simply doesn't work. The uncommented line "Controls.EndTurnText:SetText("")" does though. It does in fact change the "End Turn" button text to "Boosh". So I know the lua changes are taking affect.
Does anyone have any idea why my own control isn't being affected? Thanks for any help.
Alright, I've included "CityView.xml" and CityView.lua" in my ModBuddy project. Here's the current updates to CityView.xml
Code:
<GridButton ID="PuppetizeCityButton" Anchor="C,B" Size="280,36" Offset="0,250" Style="BaseButton" ToolTip="Make Puppet" Hidden="0">
<Label ID="PuppetizeCityLabel" Anchor="C,C" Offset="0,-2" String="Make Puppet" Color0="255.255.200.255" Color1="0.0.0.128" Color2="255.255.200.255" Font="TwCenMT24" FontStyle="SoftShadow"/>
</GridButton>
That part works, which is fantastic. When I load my mod and start a game. BAM! There's a button that says "Make Puppet". Good deal. Now, just to make baby steps I want to change the text of my new "Make Puppet" button when I click some other button. For my test, I used "OnBuyPlotClick" in the CityView.lua.
Code:
function OnBuyPlotClick()
local city = UI.GetHeadSelectedCity();
if (city == nil) then
return;
end;
UI.SetInterfaceMode(InterfaceModeTypes.INTERFACEMODE_PURCHASE_PLOT);
UpdateWorkingHexes();
--Controls.PuppetizeCityLabel:SetText("Boosh");
Controls.EndTurnText:SetText("Boosh");
--Network.SendCityBuyPlot(city:GetID(), -1, -1);
--UpdateBuyPlotButton();
end
Now, as you can see, I have a "Controls.PuppetizeCityLabel:SetText("")" commented out. It simply doesn't work. The uncommented line "Controls.EndTurnText:SetText("")" does though. It does in fact change the "End Turn" button text to "Boosh". So I know the lua changes are taking affect.
Does anyone have any idea why my own control isn't being affected? Thanks for any help.