Newb Help: Button not working

LordBudigert

Chieftain
Joined
May 7, 2014
Messages
8
Location
Texas
Was hoping somebody could have a look at this and see if they can see what's wrong with it. Attached the mod as well.

I have just about given up and posted this in the requests forum as well.. but, basically what I want is a notification window that will come up to the side of the screen (so I can still click and play) when I click a button, listing all City States by sortable columns with the Influence meter bar, the icons for their quests, and, ideally, small icon buttons for gifting, DOW, etc. (the options that come up when you click the CS banner in game)

Thanks in advance! :)

CS_Manager.xml

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

<Context> 
	<Box Style="BGBlock_ClearTopBar" />
	<Grid Size="400,270" Anchor="C,C" Style="Grid9DetailFive140" ConsumeMouse="1"> 
	<Label ID="Message" Anchor="C,C" Font="TwCenMT24" FontStyle="Shadow" ColorSet="Beige_Black_Alpha" String="TXT_KEY_TEST_DIALOG_HELLO_LEADER"/> 
	<GridButton ID="OK" Size="140,36" Anchor="C,B" Offset="0,50" Style="BaseButton" ToolTip="TXT_KEY_TEST_DIALOG_BUTTON_OK_TT"> 
	<Label Anchor="C,C" Offset="0,-2" 
String="TXT_KEY_TEST_DIALOG_BUTTON_OK" Font="TwCenMT24" 
FontStyle="Shadow" ColorSet="Beige_Black_Alpha" /> 
 </GridButton> 
 </Grid> 
</Context>

CS_ManagerText.xml

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

<GameData>
	<Language_en_US>
		<Row Tag="TXT_KEY_TEST_DIALOG_MESSAGE">
			<Text>Hello World!</Text>
		</Row>
		
		<Row Tag="TXT_KEY_TEST_DIALOG_BUTTON_OK"> 
			<Text>OK</Text> 
		</Row>
		
		<Row Tag="TXT_KEY_TEST_DIALOG_BUTTON_OK_TT"> 
			<Text>Left Click to Close</Text> 
		</Row> 
 
		<Row Tag="TXT_KEY_TEST_DIALOG_HELLO_LEADER"> 
			<Text>Hello {1_LeaderName}</Text> 
		</Row>
	</Language_en_US>
</GameData>

And in CS_Manager.lua

Code:
function Show()
	ContextPtr:SetHide(false);
end
	
function Hide()
	ContextPtr:SetHide(true);
end

function OnOK() 
 Hide();
end 
Controls.OK:RegisterCallback(Mouse.eLClick, OnOK);
 
local leaderName = GameInfo.Leaders[Players[Game.GetActivePlayer()]:GetLeaderType()].Description 
Controls.Message:LocalizeAndSetText("TXT_KEY_TEST_DIALOG_HELLO_LEADER", leaderName);



So, my problem is the button doesn't work; the box/MOD won't close.. and the correct text isn't showing within the box. I am a long way from where this mod is supposed to end up.. :D
 

Attachments

Back
Top Bottom