Closed ZaneDubya closed 9 years ago
Awesome! I'm on vacation but will try to get your P R in ASAP!
-Zane
On Jul 1, 2015, at 3:30 PM, Eskymák notifications@github.com wrote:
Hmm? ;-) https://github.com/Eskymak/UltimaXNA/tree/OptionsGump
— Reply to this email directly or view it on GitHub.
Would be nice if some can make categories switching code so I can make those "tabs" actually working. I need just like two categories in order to have template I can use for rest of categories.
btw, I am using Gump Studio for design and all positioning and then just placing values to UltimaXNA gump code.
@Eskymak, back as of today and I will get working on your PRs this evening.
Regarding the 'category switching code', have you considering placing the gumplings on different Pages?
Re: horizontal sliders, I think I've implemented something like that for the skill selection in the character creation gump. Are you looking for something different?
I wonder if it would be possible to import gump studio creations...
@ZaneDubya Thanks, I just looked on pagination once again and finally got how it works. So this part is done. :-D I will take another look at sliders, just haven't seen them used anywhere.
Gumpstudio can export similar, but not compatible code.
//Gumpstudio output for button
AddButton(0, 40, 218, 217, (int)Buttons.SoundButton, GumpButtonType.Page, 0);
//UltimaXNA button
AddControl(new Button(this, 0, 40, 218, 217, ButtonTypes.SwitchPage, 1, (int)Buttons.Sound));
Cool!
I think that renaming the XNA Client's enums and changing the ctors for the gumplings could definitely make it easier to import things from Gumpstudio. If you want to, you might look into that when you've completed the options menu. :)
@Eskymak @ZaneDubya Gump studio has the ability to create explort plugins. Thats how the RunUO code is produced. Might be easier to just create it that way (or both)
yes, I already did it, It is very easy to create export plugin, when I get home I will post example solution :)
Sound options category almost done!
Just need to figure out, how to actualy get values from control elements :-D
@Eskymak Awesome! Try the HSliderBar.Value property?
@ZaneDubya And how to choose from which slider to get value? Have same issue with checkboxes and cannot find any gump from which to take example code, because we probably doesnt have any.
AddControl(new HSliderBar(this, 60, 200, 150, 0, 100, Settings.Audio.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1);
AddControl(new CheckBox(this, 60, 80, 210, 211, Settings.Audio.SoundOn, 61), 1);
CheckBox actually has some id defined but have no clue how to work with that :-/
Thanks
I suggest keeping a local reference to the child control if you want to use it after it is created.
m_VolumeMusic = (HSliderBar)AddControl(new HSliderBar(this, 60, 200, 150, 0, 100, Settings.Audio.MusicVolume, HSliderBarStyle.MetalWidgetRecessedBar), 1);
and then, in Update():
Config.AudioSettings.MusicVolume = m_VolumeMusic.Value;
@ZaneDubya Great, it works!! Thanks
@Eskymak To connect the 'active tab' with the page, you might try using a GumpPicResized control, with gumpID set to the same gump used by the center of the ResizePic. :)
@Eskymak If you want to do it the RunUO way, you need to add each of those buttons to each page, with the active button per page being on top. The when the page switches, it renders the buttons associated with that page, with the active one on top. Basically, each page contains the entire gump, plus it's page only content.
I don't think it should be done this way, just sayin ;)
@ZaneDubya Thanks, I will look at it :-) @jeffboulanger Yep I was also considering to do it like this if I will be unable to do it more sophisticated.
I also have more dirty ways to do it on my mind :D
Guys, please look at my solution, if it is acceptable. It just works. :-) https://github.com/Eskymak/UltimaXNA/blob/OptionsGump/dev/Ultima/UI/WorldGumps/OptionsGump.cs
@Eskymak Outstanding work! Do you want to keep working on this before merging your current changes?
@ZaneDubya I am fine with merge, since I believe, that ability to change settings without need to modify code can make our lives easier. Thanks! :)
Note and TODO: * Volume values have no effect for now, is there any way place where volume is set in current audio code? * Values next to sliders are not updated with slider movement * Menu Bar is not opened/closed while appropriate checkbox state is changed - re-login is needed * Many setting values are saved in weird configuration file category for now (needs to bring some order into it)
Merged with Master. As I said, looking good!
2) I have not found OnUpdate event in sliders code, so I placed Update into options gump code 3) TopMenu will now be shown/disposed after applying/saving changes
e281882939794c244f482fcfe022327c56eafbb9
@jeffboulanger You mentioned a month ago about how RunUO builds its [props menu programmatically - do you think it would be feasible to do something like that for the Settings screen, using attributes? Would it take a ton of time to load/build the menu, or is reflection pretty fast for ~100 items?
Although the options gump does not yet contain all the configuration options that can be changed, we now have a solid core that we can build on. I'm closing this issue as implemented.
As a player, I want to be able to change settings from within the program.