For a forum that prides itself on trying new things, for the love of all that is novel and interesting, please can we have a new QotM? - Krill

Create an account  

 
Context / Help

I'll commit asap
Reply

(December 17th, 2013, 15:09)VM Wrote: I am missing CreateButtonForm, and its components.

Try now!
Reply

To bind Button to UIButton help content create a button with ID like this:

Code:
Button farmerButton = new Button() { X = 4, Y = 27, Width = 203, Height = 14, ID = "farmerbutton" };
farmerButton.OnClick += new ButtonClickedHandler(farmerButton_OnClick);
Buttons.Add(farmerButton.ID, farmerButton);

And have UIButton with same ID. I will keep working on the mechanics (effect, graphics, race variables etc.) as well as adding content.

All the buttons for UI are already created, so I'm not sure if its worth to create a function to do the above in less lines of code, like
Button fb = CreateButton("farmerbutton", "farmerButton_OnClick");
Besides, adjusting the coordinates etc. is faster from the code. So Why did I add X and Y to UIButton? I have no idea, it seemed like a good idea at the time :P
Reply

It is a good idea. If we put all button specifics into UIRules, the whole UI becomes skinnable.
Reply

I modified the UIRules.xml as well. Be careful when committing.
Reply

(December 19th, 2013, 03:43)VM Wrote: I modified the UIRules.xml as well. Be careful when committing.

I see now from 194 that I messed up few lines of your changes in terrainspecials. Sorry! That was due to my first ever code merge with svntortoise. I did not know it would be submitted so I wasn't super careful about it, but now I know how it works so no problem.

Was there a problem with XML too? That may be because the folder I had the project in didn't allow me to commit to SF, so I had to make a new folder that would work with SF, and update all the changes I made into that folder, which was confusing! Then I might have used some old version of the XML that had been edited with something else than reMoM. Anyway, that should not happen again either since now I have a working project directory.
Reply



Forum Jump: