Pink Petal Games
Game Editing And Additions => User Mods => Topic started by: Anon21 on July 24, 2011, 07:35:18 AM
-
This is the XML from building_setup_screen.xml that sets up the Advertising Budget Slider ... in theory.
<Slider Name = "AdvertisingSlider"
XPos = "24"
YPos = "143"
Width = "324"
MinValue = "0"
MaxValue = "2000"
Value = "0"
Increment = "100"
LiveUpdate = "true"
Hidden = "false"
Disabled = "false"
/>
However it appears that the values for Min Max and Increment are not actually used in the code
// let's limit advertising budget to multiples of 50 gold (~3 added customers), from 0 - 2000
int advert = g_Brothels.GetBrothel(g_CurrBrothel)->m_AdvertisingBudget / 50;
advert = SliderRange(advertsli_id, 0, (2000 / 50), advert, 4); // set slider min/max range
ss.str("");
ss << "Advertising Budget: " << (advert * 50) << " gold / week";
EditTextItem(ss.str(), advertamt_id);
Anyway, when I added the slider to the Mayor screen it turned out that the Increment value from the XML is not actually used. The min and max values are, though. So this is what that XML ended up looking like...
<Slider Name = "BribeSlider"
XPos = "8"
YPos = "220"
Width = "328"
MinValue = "0"
MaxValue = "60"
Value = "0"
Increment = "50"
LiveUpdate = "true"
Hidden = "false"
Disabled = "false"
/>
(The 'x 50' is hardcoded in cScreenMayor.cpp)
-
Kewl "_"
Did you get any further with the image click event?
-
Kewl "_"
Did you get any further with the image click event?
Nah, I commented out all the code. I might get further by adding the image handling code to the Button object, but that's on the backburner for now.