Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Virtual gardener
staff: administrator
#26 Old 15th Jul 2018 at 4:06 PM
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.
Advertisement
Space Pony
Original Poster
#27 Old 15th Jul 2018 at 4:45 PM Last edited by Battery : 15th Jul 2018 at 5:51 PM.
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.
Space Pony
Original Poster
#28 Old 15th Jul 2018 at 5:54 PM
@Lyralei

ok i have quickly assembled 2 examples for simple menues one for the dictionary variant and one for the pointer variant.
Attached files:
File Type: 7z  Dictionary and Pointer Menu.7z (1.2 KB, 9 downloads) - View custom content
Virtual gardener
staff: administrator
#29 Old 16th Jul 2018 at 11:45 AM
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.
Space Pony
Original Poster
#30 Old 16th Jul 2018 at 11:56 AM
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 ?
Virtual gardener
staff: administrator
#31 Old 16th Jul 2018 at 12:21 PM
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
Space Pony
Original Poster
#32 Old 16th Jul 2018 at 12:38 PM Last edited by Battery : 16th Jul 2018 at 12:50 PM.
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:
File Type: 7z  ObjectPickerExample.7z (1.3 KB, 7 downloads) - View custom content
Space Pony
Original Poster
#33 Old 17th Jul 2018 at 9:25 AM Last edited by Battery : 17th Jul 2018 at 9:43 AM.
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
Virtual gardener
staff: administrator
#34 Old 17th Jul 2018 at 12:52 PM
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!
Space Pony
Original Poster
#35 Old 22nd Jul 2018 at 6:06 PM Last edited by Battery : 22nd Jul 2018 at 7:50 PM.
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.
Field Researcher
#36 Old 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.
Space Pony
Original Poster
#37 Old 9th Aug 2020 at 8:35 AM
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)

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);
			}
		}
Screenshots
Field Researcher
#38 Old 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!
Space Pony
Original Poster
#39 Old 9th Aug 2020 at 3:11 PM
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
Field Researcher
#40 Old 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)
Space Pony
Original Poster
#41 Old 9th Aug 2020 at 3:38 PM Last edited by Battery : 9th Aug 2020 at 6:34 PM.
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
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 Old 9th Aug 2020 at 6:22 PM
Ah, I see how that works now - thanks!
Page 2 of 2
Back to top