jreddin1
June 14th, 2015, 22:18
For those that are using 5E, you probably noticed that window titles moved from being vertical, and on the side to being horizontal and across the top. As part of my quest to figure out how to do things in FG, I dug around and, after way longer than it should have taken, I came up with the following lua function that you can call from the title control (i.e. setIconByRulset(self) :
function setIconByRuleset(wc)
if(wc.hasIcon() == false) then
Debug.console("setIcon - no icon", wc);
return;
end;
local rset = User.getRulesetName();
Debug.console("setIconbyRuleset rulsetName", rset);
if(rset == "5E") then
wc.setIcon("Icon_for_5E", true);
else
wc.setIcon("Icon_for_CoreRPG", true);
end
end;
Of course, to make this work, you need to have the following in your extension.xml/base.xml/etc.:
<icon file="graphics/someIcon5E.png" name="Icon_for_5E" />
<icon file="graphics/someIconCoreRPG.png" name="Icon_for_CoreRPG" />
Feedback is appreciated (even negative, condescending, hateful, or troll. I have thick skin).
function setIconByRuleset(wc)
if(wc.hasIcon() == false) then
Debug.console("setIcon - no icon", wc);
return;
end;
local rset = User.getRulesetName();
Debug.console("setIconbyRuleset rulsetName", rset);
if(rset == "5E") then
wc.setIcon("Icon_for_5E", true);
else
wc.setIcon("Icon_for_CoreRPG", true);
end
end;
Of course, to make this work, you need to have the following in your extension.xml/base.xml/etc.:
<icon file="graphics/someIcon5E.png" name="Icon_for_5E" />
<icon file="graphics/someIconCoreRPG.png" name="Icon_for_CoreRPG" />
Feedback is appreciated (even negative, condescending, hateful, or troll. I have thick skin).