- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Utility Library Package
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- Utility Library Package
#26
15th Jul 2018 at 4:06 PM
Posts: 3,860
Thanks: 8537 in 67 Posts
Hi @Battery!
Looking through the documentary (And also using your dll as a reference to see what is being told) I was wondering what exactly was being meant with 'tasks'. I guess since i'm a bit unfamiliar with the Simulator function it probably confuses me But is it a small tool that reads XML files, create objects, and whatever the simulator function provides by itself? And if so, do you just make an array of those multiple functions (IF you're using XML files, having objects created, etc). or do they work differently?
Then, regarding the UI, so I have a visualized idea of which menu is added.... When you're talking about a menu, these types of menus are the ones that are added right? (Just got some random pics from the interwebs :P):
And then of course just regular notifications. But for me the thumbnail menu will be incredibly useful to me, which, looking at your code I think you added it? But just asking because I totally suck at making forms in C# without knowing what I'm doing visually Guess it might be because I do 3D modeling pretty much everyday + drawing and somehow decided to learn coding along the years.
Looking through the documentary (And also using your dll as a reference to see what is being told) I was wondering what exactly was being meant with 'tasks'. I guess since i'm a bit unfamiliar with the Simulator function it probably confuses me But is it a small tool that reads XML files, create objects, and whatever the simulator function provides by itself? And if so, do you just make an array of those multiple functions (IF you're using XML files, having objects created, etc). or do they work differently?
Then, regarding the UI, so I have a visualized idea of which menu is added.... When you're talking about a menu, these types of menus are the ones that are added right? (Just got some random pics from the interwebs :P):
And then of course just regular notifications. But for me the thumbnail menu will be incredibly useful to me, which, looking at your code I think you added it? But just asking because I totally suck at making forms in C# without knowing what I'm doing visually Guess it might be because I do 3D modeling pretty much everyday + drawing and somehow decided to learn coding along the years.
Advertisement
#27
15th Jul 2018 at 4:45 PM
Last edited by Battery : 15th Jul 2018 at 5:51 PM.
Posts: 433
Thanks: 792 in 6 Posts
Quote: Originally posted by Lyralei
Hi @Battery! Looking through the documentary (And also using your dll as a reference to see what is being told) I was wondering what exactly was being meant with 'tasks'. I guess since i'm a bit unfamiliar with the Simulator function it probably confuses me But is it a small tool that reads XML files, create objects, and whatever the simulator function provides by itself? And if so, do you just make an array of those multiple functions (IF you're using XML files, having objects created, etc). or do they work differently? Then, regarding the UI, so I have a visualized idea of which menu is added.... When you're talking about a menu, these types of menus are the ones that are added right? (Just got some random pics from the interwebs :P): And then of course just regular notifications. But for me the thumbnail menu will be incredibly useful to me, which, looking at your code I think you added it? But just asking because I totally suck at making forms in C# without knowing what I'm doing visually Guess it might be because I do 3D modeling pretty much everyday + drawing and somehow decided to learn coding along the years. |
Hey @Lyralei
the tasks thing unfortunatly have nothing to do with xml reading by it self, it is a wrapper tha allows you to run a method on the simulator meaning it wont bother the main thread and wont cause stuttering there. Yes it is of course possible to add pictures to the menues what kind of menu would you like, a selection menu where you can pick an item an then the menu closes an something happens with the selected item or a menu where you can click an item an and action is performed right away ?
Oh and yes these are the menus that are added to answer your question rather late ...
im working on improving the documentation as of now i have just covered the basics and while that all makes sense to me i need to improve it alot.
#28
15th Jul 2018 at 5:54 PM
Posts: 433
Thanks: 792 in 6 Posts
@Lyralei
ok i have quickly assembled 2 examples for simple menues one for the dictionary variant and one for the pointer variant.
ok i have quickly assembled 2 examples for simple menues one for the dictionary variant and one for the pointer variant.
Attached files:
Dictionary and Pointer Menu.7z (1.2 KB, 9 downloads) - View custom content | ||
Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2018-07-15 12:42:22 ....A 3384 1050 DictionaryExample.cs 2018-07-15 12:49:50 ....A 1740 PointerExample.cs ------------------- ----- ------------ ------------ ------------------------ 5124 1050 2 files, 0 folders |
#29
16th Jul 2018 at 11:45 AM
Posts: 3,860
Thanks: 8537 in 67 Posts
Thanks for the quick reply! @Battery !
That was really helpful! Am having a blast with the library! Will let you how it goes when testing this out in-game. I was indeed working on a grocery-store wise menu (So thumbnail, name of the object which is obviously called from the NMGP, and price) Hopefully I can help out a little with the Documentary and give some feedback if you like.
That was really helpful! Am having a blast with the library! Will let you how it goes when testing this out in-game. I was indeed working on a grocery-store wise menu (So thumbnail, name of the object which is obviously called from the NMGP, and price) Hopefully I can help out a little with the Documentary and give some feedback if you like.
#30
16th Jul 2018 at 11:56 AM
Posts: 433
Thanks: 792 in 6 Posts
Quote: Originally posted by Lyralei
Thanks for the quick reply! @Battery ! That was really helpful! Am having a blast with the library! Will let you how it goes when testing this out in-game. I was indeed working on a grocery-store wise menu (So thumbnail, name of the object which is obviously called from the NMGP, and price) Hopefully I can help out a little with the Documentary and give some feedback if you like. |
Allright i see if i can assemble an example that fits the discription you gave me thou this would work a bit different since its not an option menu but rather a picker.
And thanks for the help offer i think feedback is really needed to improve this mod.
One thing though i may sound stupid, but what is NMGP ?
#31
16th Jul 2018 at 12:21 PM
Posts: 3,860
Thanks: 8537 in 67 Posts
It's not necessarily any coding related thing and maybe not necessarily interesting for the library itself, but this is basically used for food, books, etc mods (Also EA's way of getting list items) But it's sort of a, what I like to call a 'data shopping list' that refers to all the OBJDs so the list menu knows which object is suppose to be loaded in. CCloader is based on making this non-override possible. http://modthesims.info/showthread.p...050#post4917050
And thanks for the examples! IF it was up to me I could also do it the old way, but it's always great to try new things
And thanks for the examples! IF it was up to me I could also do it the old way, but it's always great to try new things
#32
16th Jul 2018 at 12:38 PM
Last edited by Battery : 16th Jul 2018 at 12:50 PM.
Posts: 433
Thanks: 792 in 6 Posts
Quote: Originally posted by Lyralei
It's not necessarily any coding related thing and maybe not necessarily interesting for the library itself, but this is basically used for food, books, etc mods (Also EA's way of getting list items) But it's sort of a, what I like to call a 'data shopping list' that refers to all the OBJDs so the list menu knows which object is suppose to be loaded in. CCloader is based on making this non-override possible. http://modthesims.info/showthread.p...050#post4917050 And thanks for the examples! IF it was up to me I could also do it the old way, but it's always great to try new things |
Oh well then you probably wont need this example its really similar to the "old way" of gettings menus to work but with my mods "framework" but i have posted it anyway in case someone was wondering
Thanks for the explanation i didnt know this existed
Attached files:
ObjectPickerExample.7z (1.3 KB, 7 downloads) - View custom content | ||
Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2018-07-16 07:36:06 ....A 3063 1162 ObjectPickerExample.cs ------------------- ----- ------------ ------------ ------------------------ 3063 1162 1 files, 0 folders |
#33
17th Jul 2018 at 9:25 AM
Last edited by Battery : 17th Jul 2018 at 9:43 AM.
Posts: 433
Thanks: 792 in 6 Posts
Well ok i just woke up an realized that there would be a much better way to set variables.
bool Variable= true;
MainMenu.AddMenuObject( new bUI.SetObjectValue("Description Text", ()=>{return Variable.ToString();}, ()=> {test =!test;} ) );
where bUI.SetObjectValue(string DescriptionText, Method that returns your Value as String, Method that sets your Value)
Thats better than the dictionary or the pointer approch right ??
If so i will do a mini update soon (so no versionnumber increase this wont break anything you might have done with the utility until now).
Oh and if you should use this mod, please tell me, i will download your mods and keep them to check for compatibility if i made upgradesto the utility mod and make changes to my mod if necessary.
Thanks for reading
Battery
bool Variable= true;
MainMenu.AddMenuObject( new bUI.SetObjectValue("Description Text", ()=>{return Variable.ToString();}, ()=> {test =!test;} ) );
where bUI.SetObjectValue(string DescriptionText, Method that returns your Value as String, Method that sets your Value)
Thats better than the dictionary or the pointer approch right ??
If so i will do a mini update soon (so no versionnumber increase this wont break anything you might have done with the utility until now).
Oh and if you should use this mod, please tell me, i will download your mods and keep them to check for compatibility if i made upgradesto the utility mod and make changes to my mod if necessary.
Thanks for reading
Battery
#34
17th Jul 2018 at 12:52 PM
Posts: 3,860
Thanks: 8537 in 67 Posts
That is a pretty neat way of doing it! Although this could well be the '2 different styles people like to code as', where some like to go super small (which usually makes things loading), whereas others tend to go somewhat bigger. But I think that's not a bad approach! Usually i'm more of the longer approach (Which not sure if that's because of my javascript background else I have no idea what I'm writing down).
Although for a library I think that's certainly not a bad idea!
Although for a library I think that's certainly not a bad idea!
#35
22nd Jul 2018 at 6:06 PM
Last edited by Battery : 22nd Jul 2018 at 7:50 PM.
Posts: 433
Thanks: 792 in 6 Posts
Thanks for the imput Lyralei i implementet this way for version 1.0.0 and up.
I have Added the Cycleable MenuObject for Version 1.0.1
CyclableMenuOption(string Descriptor, IList Collection, object CurrentObject, Action<object> SetValueAction)
Example:
public string SelectedDay = "Monday";
CyclableMenuOption("Weekday", new String[]{"Monday","Tuesday","Wednesday","Thursday ","Friday"},SelectedDay,(x)=>
{
SelectedDay = (string)x;
}));
This will let the user select one day from Monday to Friday left clicking the option will move one day ahead while a right click will move the selection one day back.
I have Added the Cycleable MenuObject for Version 1.0.1
CyclableMenuOption(string Descriptor, IList Collection, object CurrentObject, Action<object> SetValueAction)
Example:
public string SelectedDay = "Monday";
CyclableMenuOption("Weekday", new String[]{"Monday","Tuesday","Wednesday","Thursday ","Friday"},SelectedDay,(x)=>
{
SelectedDay = (string)x;
}));
This will let the user select one day from Monday to Friday left clicking the option will move one day ahead while a right click will move the selection one day back.
Field Researcher
#36
9th Aug 2020 at 1:00 AM
Hello @Battery! I hope this is still the right place to ask questions about this mod? Thank you for sharing it, it looks like it's going to make menus so much easier!
I'm using version 1.02b4 to make a menu for choosing a sim from a set of possibilities; I've followed your Object Picker example and written a row-populating method, a method to run after making a selection, and a method to display the menu, but the MenuContainer constructor (is that the right thing to call it?) seems to be expecting my row-populating method to have a different return type than it does - is declaring that method as a public static list and the post-selection method as a public static void still correct? I notice the version I've been using is newer than the example, so I wondered if something changed.
I'm using version 1.02b4 to make a menu for choosing a sim from a set of possibilities; I've followed your Object Picker example and written a row-populating method, a method to run after making a selection, and a method to display the menu, but the MenuContainer constructor (is that the right thing to call it?) seems to be expecting my row-populating method to have a different return type than it does - is declaring that method as a public static list and the post-selection method as a public static void still correct? I notice the version I've been using is newer than the example, so I wondered if something changed.
#37
9th Aug 2020 at 8:35 AM
Posts: 433
Thanks: 792 in 6 Posts
Hey @lizcandor,
thanks for checking out the mod. I indeed change it around a bit. I guess you are using the 7. Overload of the ctor ?
This one:
if so here is a populating method you can use you need to have a List that contains your sims (in the example below its called Simlist)
You can then act upon the selection with a method like this
thanks for checking out the mod. I indeed change it around a bit. I guess you are using the 7. Overload of the ctor ?
This one:
if so here is a populating method you can use you need to have a List that contains your sims (in the example below its called Simlist)
Code:
static List<List<ObjectPicker.RowInfo>> Populate() { List<List<ObjectPicker.RowInfo>> rinfolist = new List<List<ObjectPicker.RowInfo>>(); rinfolist.Add(Battery.UI.Menus.MenuFormattingUtil.F_ColorCodeSimList(Simlist)); return rinfolist; }
You can then act upon the selection with a method like this
Code:
static void OnEnd(List<ObjectPicker.RowInfo> Selection) { for (int i = 0; i < Selection.Count; i++) { MessageUtil.WriteNotification((Selection[i].Item as Sim).FullName); } }
Field Researcher
#38
9th Aug 2020 at 2:43 PM
Ah, I see, my populate method just returns a list instead of a list of lists - I'll give that a try! Thank you!
#39
9th Aug 2020 at 3:11 PM
Posts: 433
Thanks: 792 in 6 Posts
Yes just a short explanation. the top level list is for the different tabs each sub list contains the menu entries for that specific tab
so list[0][1] would be the second menu entry of the first Menu Tab
so list[0][1] would be the second menu entry of the first Menu Tab
Field Researcher
#40
9th Aug 2020 at 3:27 PM
The menu appeared, and had the sims on it that it was supposed to! Yaaay! Now to make the post-selection method actually do something instead of just saying "hi I ran", that should be the easy part. This is great!
Another question: does the way to add column info also change? I'd like to add some text about each sim in the list as well, and making the column info also a list of lists doesn't seem to be the right way to do that.
(Also that's good to know about how the list levels work, I was wondering how to navigate that)
Another question: does the way to add column info also change? I'd like to add some text about each sim in the list as well, and making the column info also a list of lists doesn't seem to be the right way to do that.
(Also that's good to know about how the list levels work, I was wondering how to navigate that)
#41
9th Aug 2020 at 3:38 PM
Last edited by Battery : 9th Aug 2020 at 6:34 PM.
Posts: 433
Thanks: 792 in 6 Posts
Here i modified the ColorCode Method to include a description next to the Thumbnail and name you can modify it further to fit your needs
It is important to note that every MenuEntry within a Tab has to have the same Column configuration !
You can also set the number of possible selections by setting mc.mSelectable to your desired value.
Code:
public static List<ObjectPicker.RowInfo> F_ColorCodeSimList(List<Sim> SimList) { List<ObjectPicker.RowInfo> rinfo = new List<ObjectPicker.RowInfo>(); List<ObjectPicker.ColumnInfo> cinfo; foreach (Sim sim in SimList) { cinfo = new List<ObjectPicker.ColumnInfo>(); if (sim.IsFemale) { cinfo.Add(new ObjectPicker.ThumbAndTextColumn(sim.SimDescription.GetThumbnailKey(ThumbnailSize.Large, 0), sim.LastName + ", " + sim.FirstName)); cinfo.Add(new ObjectPicker.TextColumn("Your Desciption Here")); // Put Your Description Text here (replace "Your Desciption Here") cinfo[0].mbOverrideTextColor = true; cinfo[0].TextColor = new Color(255, 105, 180); cinfo[0].mbOverrideTextStyle = true; cinfo[0].TextStyle = 2u; rinfo.Add(new ObjectPicker.RowInfo(sim, cinfo)); } else { cinfo.Add(new ObjectPicker.ThumbAndTextColumn(sim.SimDescription.GetThumbnailKey(ThumbnailSize.Large, 0), sim.LastName + ", " + sim.FirstName)); cinfo.Add(new ObjectPicker.TextColumn("Your Desciption Here")); // Put Your Description Text here (replace "Your Desciption Here") cinfo[0].mbOverrideTextColor = true; cinfo[0].TextColor = new Color(65, 105, 225); cinfo[0].mbOverrideTextStyle = true; cinfo[0].TextStyle = 2u; rinfo.Add(new ObjectPicker.RowInfo(sim, cinfo)); } } return rinfo; }
It is important to note that every MenuEntry within a Tab has to have the same Column configuration !
You can also set the number of possible selections by setting mc.mSelectable to your desired value.
Field Researcher
#42
9th Aug 2020 at 6:22 PM
Ah, I see how that works now - thanks!
Who Posted
|