Creating an NRaas project Overwatch + A Question on Combining/Removing Delegates

Talk nerdy to us here.
Post Reply
icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

Overwatch + A Question on Combining/Removing Delegates

Post by icarus_allsorts » March 9th, 2015, 4:53 am

Hey there! Was wondering if I should just upload the version of Overwatch with the fix for the bar moonlighting issue (was away for some time after that, should have asked this question before I left now that I think about it), or if there are other upcoming updates to it in which case I should just leave it be as it is since my changes have already been merged to the source? On the subject of the moonlighting fix, I couldn't really decide between using ImmediateEventListener or DelayedEventListener in this case so I just used the former, but would there be a significant difference/benefit in perhaps using Delayed instead?

And since it's been a while since I've posted here, there's something totally unrelated that I could use some help/explanation with. In Sims3.UI.ObjectPickerDialog, there's this part in the constructor that I want to emulate/change

this.mTable.SelectionChanged += new ObjectPicker.ObjectPickerSelectionChanged(this.OnSelectionChanged);

but whenever I try to combine/remove delegates or do anything at all with mTable.SelectionChanged, I keep getting a "Ambiguity between Sims3.UI.ObjectPicker.SelectionChanged and Sims3.UI.ObjectPicker.SelectionChanged" error which I have no idea what to do about. I've run into this similar 'ambiguity' issue in the past and have yet to find a way to get past it so I could really appreciate some insight into this.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7568
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » March 9th, 2015, 7:01 am

A version is in the pipeline but is side tracked (the same can be said about many other versions :D). I will definitely get it out before I go out of town myself on the 21st.

As for the UI errors, that DLL is the most annoying of the bunch and often has to be manually patched and recompiled. Are you using the DLL's I provided in the source?

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7568
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » March 9th, 2015, 7:02 am

Oh and the listeners. Immediate should be used for listeners you need to run on the active thread and for the code to process now, such as a user setting off the event in this case. Delayed is pushed to the simulator and run whenever the user's computer gets to it. Useful for running code when Sims are instantiated and such.

icarus_allsorts
Reactions:
Posts: 213
Joined: March 8th, 2012, 6:00 pm

Post by icarus_allsorts » March 9th, 2015, 8:23 am

RE Overwatch: Oh ok, I'll leave that to you then (wasn't meaning to rush you, sorry!). Considering that it's a minor task, I was guessing Delayed would be preferable, but I thought of that minuscule chance of there happens to be an active sim that stops moonlighting at the exact moment the game loads... but even then the Listener would have been set up at by the time the game reaches that point, or is that not a guarantee?

And it turns out I was still using dlls I unprotected myself with the simlogical tool, switching to the one provided in the source did solve the error. Thanks! I'm curious as to what exactly had to be patched and recompiled in this case though? Pretty sure I've run into like errors with delegates like this in other portions of the code, but I guess using the source dlls in that case will solve those as well.

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7568
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » March 10th, 2015, 4:18 pm

No worries, always ok to do inquires about versions. Better than our code clashing. Some of the new OW code is in the source, some isn't.

Yes delayed is preferable wherever possible but in this case I think immediate is fine. If the user is playing on a computer that is on life support, they may not get their funds for several Sim hours and will probably come and tell us it's not fixed. Anything the user will notice if it lags you don't want to run on the simulator.

Glad my DLL's fixed it. I had to manually decompile the UI DLL and patch it a few times. There's still a few instances that need attention in it. The simlogical DLL unprotects too much and in UI's case (and a few of the others I believe) this severely breaks it.

Post Reply