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!
Lab Assistant
Original Poster
#1 Old 7th Jun 2017 at 7:44 AM
Default help in the mod on 'visual studio'
Hello, please help solve the problem, I decompiled the dll, then with the help of notepad ++ did the edits, but when I try to compile, I get the errors 'ID required', 'required;', Invalid element "<" in expression, Invalid element ">" in expression. Even pure not touched only Decompiled file in vs produces the same errors. I made by everything is like the article "Sims 3: Creating a game compatible Visual Studio project" did not help.
Advertisement
Scholar
#2 Old 7th Jun 2017 at 1:07 PM
Use the core modding tutorials to learn how to decompile DLLs. What kind of changes are you looking to make? If you want unprotected DLLs they're already available in Nraas github page I think.
Scholar
#3 Old 7th Jun 2017 at 1:09 PM
Can you elaborate how you decompiled? You may have typed the space bar in the wrong place. That happened to me a few times.
Lab Assistant
Original Poster
#4 Old 7th Jun 2017 at 6:28 PM
Quote: Originally posted by skydome
Can you elaborate how you decompiled? You may have typed the space bar in the wrong place. That happened to me a few times.

decompile in ILSpy Master Binaries. This is excluded even just received file after decompile, gives the same errors as the one I corrected.
Scholar
#5 Old 7th Jun 2017 at 7:01 PM
I am not really experienced with core modding that much tho I built a few for personal use. I used this tutorial to decompile the dlls.
http://www.modthesims.info/showthread.php?t=354419
It's very helpful.
I did not use ILspy to decompile DLLs.
Hopefully someone with ILspy experience can help you out.
Good luck and Happy Simming
Virtual gardener
staff: administrator
#6 Old 7th Jun 2017 at 7:59 PM
I'm using ILspy, and from what I understand, you want to export all the DLL files within, say, the SimIFace DLL file? because that's not going to work out And those DLL files (The main ones, SimIFace, SimsGameplay, etc.) Are references for the script to recognise what methods you're using

Iiiif we're talking core mods here, I would indeed recommend checking out Skydome's link! ^- ~
Lab Assistant
Original Poster
#7 Old 7th Jun 2017 at 9:39 PM
Quote: Originally posted by skydome
I am not really experienced with core modding that much tho I built a few for personal use. I used this tutorial to decompile the dlls.
http://www.modthesims.info/showthread.php?t=354419
It's very helpful.
I did not use ILspy to decompile DLLs.
Hopefully someone with ILspy experience can help you out.
Good luck and Happy Simming

I'm tired with this case, can have an easier way?
Lab Assistant
Original Poster
#8 Old 7th Jun 2017 at 10:56 PM
Quote: Originally posted by Greenplumbbob
I'm using ILspy, and from what I understand, you want to export all the DLL files within, say, the SimIFace DLL file? because that's not going to work out And those DLL files (The main ones, SimIFace, SimsGameplay, etc.) Are references for the script to recognise what methods you're using

Iiiif we're talking core mods here, I would indeed recommend checking out Skydome's link! ^- ~

I do not understand, why I have such a problem with compiling to dll?
Virtual gardener
staff: administrator
#9 Old 8th Jun 2017 at 1:54 PM
Can you explain how you decompile everything and setting things up in steps? maybe it's the way you set things up that might be the issue here?
Lab Assistant
Original Poster
#10 Old 9th Jun 2017 at 2:29 PM
Quote: Originally posted by Greenplumbbob
Can you explain how you decompile everything and setting things up in steps? maybe it's the way you set things up that might be the issue here?

I do not touch the links in the script at all, and I want to get SimIFace.dll from SimIFace.cs maybe my program is not configured so errors. What should be the settings, you can imagine them in the screenshot?
Virtual gardener
staff: administrator
#11 Old 9th Jun 2017 at 6:24 PM
Ohh wait you're trying to decompile the SimIface as a Cs, that's never gonna work, since the SimIFace is basically the 'package' of all the methods the game uses. If you really want to decompile something you want to use the methods instead. So let's say... Audio or additionalSlotPlacementCheck. Then you click on, audio and highlight it blue. Then CTRL+S to save the code.

However, what I meant in the step by step was your step by step setup. So basically what I meant was :

- I open visual studio
- I import the dll files

etc. Since I'm actually really confused on what you're trying to do here
Lab Assistant
Original Poster
#12 Old 9th Jun 2017 at 7:16 PM
Quote: Originally posted by Greenplumbbob
Ohh wait you're trying to decompile the SimIface as a Cs, that's never gonna work, since the SimIFace is basically the 'package' of all the methods the game uses. If you really want to decompile something you want to use the methods instead. So let's say... Audio or additionalSlotPlacementCheck. Then you click on, audio and highlight it blue. Then CTRL+S to save the code.

However, what I meant in the step by step was your step by step setup. So basically what I meant was :

- I open visual studio
- I import the dll files

etc. Since I'm actually really confused on what you're trying to do here

I compiled part of the code that I changed, but the mod does not work, which instance should I specify?
Virtual gardener
staff: administrator
#13 Old 9th Jun 2017 at 9:38 PM
With instances, are we talking about the 'Using' here or something entirely different?
Lab Assistant
Original Poster
#14 Old 12th Jun 2017 at 10:13 PM Last edited by whiteman-Dara : 12th Jun 2017 at 10:34 PM.
Quote: Originally posted by Greenplumbbob
With instances, are we talking about the 'Using' here or something entirely different?

The fact is that the method does not replace the original in the game, and in fact, how to let the game, know that need to read the method from the documents directory, and not from the scripts.package in the root folder of the base game.
Scholar
#15 Old 13th Jun 2017 at 1:32 AM
Quote: Originally posted by whiteman-Dara
The fact is that the method does not replace the original in the game, and in fact, how to let the game, know that need to read the method from the documents directory, and not from the scripts.package in the root folder of the base game.


The mods folder is given more priority by the game so if you have a file of the same name in your mods folder the game reads that instead of the file in the root folder.
Lab Assistant
Original Poster
#16 Old 13th Jun 2017 at 2:28 PM
Quote: Originally posted by skydome
The mods folder is given more priority by the game so if you have a file of the same name in your mods folder the game reads that instead of the file in the root folder.

In the main file there are more than 500 methods and in my mod 1 I can not recompile everything because of errors in vs, but how to make my method read along with the rest, rather than being overwritten by the same from scripts.package
Scholar
#17 Old 14th Jun 2017 at 1:58 AM
Quote: Originally posted by whiteman-Dara
In the main file there are more than 500 methods and in my mod 1 I can not recompile everything because of errors in vs, but how to make my method read along with the rest, rather than being overwritten by the same from scripts.package


I'm getting kinda confused here, have you checked the tutorials in this site? What kind of errors in Visual Studio are we talking here?

Look at this tutorial first http://modthesims.info/wiki.php?tit..._Studio_project

(If you're using VS2015 than 1 or 2 step might be different but you can post here about any queries.)

Then this one for practice

http://modthesims.info/wiki.php?tit...ripting_Modding

Why do you think you have to compile the main file?? You only have to compile your file.
Lab Assistant
Original Poster
#18 Old 15th Jun 2017 at 8:17 PM
Quote: Originally posted by skydome
I'm getting kinda confused here, have you checked the tutorials in this site? What kind of errors in Visual Studio are we talking here?

Look at this tutorial first http://modthesims.info/wiki.php?tit..._Studio_project

(If you're using VS2015 than 1 or 2 step might be different but you can post here about any queries.)

Then this one for practice

http://modthesims.info/wiki.php?tit...ripting_Modding

Why do you think you have to compile the main file?? You only have to compile your file.

I read these the tutorials! Example:"Identifier expected","Invalid expression term '>' ",
"Invalid expression term '<' ", " ; expected " . Because my mod with one method does not work, reads the method from the main file and not from my file. What are you offering?
Scholar
#19 Old 16th Jun 2017 at 12:12 AM
So you're getting an error basically right? Well you'll have to fix your error or it won't compile. Why don't you post the code for your mod? We'll see what the problem is. Have you made mods before? Or is this your first time?
Lab Assistant
Original Poster
#20 Old 16th Jun 2017 at 1:50 AM
Quote: Originally posted by skydome
So you're getting an error basically right? Well you'll have to fix your error or it won't compile. Why don't you post the code for your mod? We'll see what the problem is. Have you made mods before? Or is this your first time?

I do not understand where this error comes from, I get it, even if I did not edit the code, just decompiled, the code is too large to be represented here, I'm trying to compile all methods at once, because one method does not work in the game. And why does vs create only one references in dll, does not create a references to system and system.Xml? I made, did changes to gameplay and ui resources, a global ones with code changes this will be the first.
Scholar
#21 Old 16th Jun 2017 at 5:37 AM
Quote: Originally posted by whiteman-Dara
I do not understand where this error comes from, I get it, even if I did not edit the code, just decompiled, the code is too large to be represented here, I'm trying to compile all methods at once, because one method does not work in the game. And why does vs create only one references in dll, does not create a references to system and system.Xml? I made, did changes to gameplay and ui resources, a global ones with code changes this will be the first.


Wait you're making changes directly to the resources? No you're not supposed to do that. The recource files like Gameplaysystems, Scriptcore etc are only used as reference to create your mod. Unless you're trying to make a core mod, in that case check out the core modding tutorial link I posted in the previous post. Core modding is pretty difficult tbh. You can't directly change the resource files with visual studio.

Are you making a core mod? Or script mod?
What do you mean decompile all methods at once? I do not understand.

Can you walk me through what you're trying to do? What you have done? How you did it?
Lab Assistant
Original Poster
#22 Old 17th Jun 2017 at 2:52 PM
skydome, I meant in the gameplay of the folders and ui exported the resources to an empty file in the document directory.
I think it's a fashion script.
This means that in ILSpy_Master_Binaries open the dll file, select it and click File / Save Code ...
The resulting file will have all the methods. When I try to compile, I get an error: 'ICASUINode' is inaccessible due to its protection level.
Quote:
using Sims3.SimIFace;
using Sims3.SimIFace.CAS;
using Sims3.UI.Hud;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;

namespace Sims3.UI.CAS
{
public class CASBasics : Window, ICASUINode
{
private enum ControlIDs : uint
{
InvalidCharacterWindow = 16u,
DoneButton = 98277120u,
FirstNameTextEdit,
LastNameTextEdit,
GenderMaleButton,
GenderFemaleButton,
AgeToddlerButton,
AgeChildButton,
AgeTeenButton,
AgeYoungAdultButton,
AgeAdultButton,
AgeElderButton,
RandomizeNameButton,
SkinToneSlider = 98277136u,
SkinToneRamp,
SkinToneSwatchButton,
SkinToneSwatch,
CustomContentIcon,
ThinHeavySlider,
MuscleSlider,
MuscleDefinitionSlider = 170510192u,
BreastSizeSlider = 170871392u,
SkinToneGridHolder = 98277143u,
SkinToneGrid,
ThinHeavyHolder,
MuscleHolder,
BodyModifierWindow,
MuscleDefinitionHolder = 170871312u,
BreastSizeHolder = 170871376u,
SupernaturalTypeButton = 224269920u,
SupernaturalTypePopup = 224615632u,
SupernaturalTypePopupItemGrid = 224269936u,
BufferedThumbnailWindow = 224273248u,
SupernaturalTypeText = 224337504u,
WitchButton = 224337440u,
FairyButton = 224337424u,
WerewolfButton = 224337392u,
HumanButton = 224348352u,
GhostButton = 224777360u,
GenieButton = 224780368u,
VampireButton = 224863552u,
MummyButton,
FrankensteinButton,
GhostDeathTypeSelectionWindow = 224777216u,
GhostDeathTypeSelectionWindow_ItemGrid = 228231280u,
HumanBasicsWindow = 228219856u,
HumanBasicsButton = 228218416u,
FairyBasicsButton,
GhostBasicsButton,
FairyWingSelectorWindow = 228218736u,
FairyWingSelectorItemGrid,
FairyWingColorPickerButton = 228230016u,
SkinToneText = 228852464u,
SupernaturalTypeHeaderText = 230395088u,
GridItemGlowWindow = 231002384u
}

private const string kPrefix = "UI/Controllers/CasBasics:";

private const string kEP07Prefix = "UI/Controllers/CasBasicsEP07:";

private const string kEP07TooltipPrefix = "UI/Tooltip/CAS/CasBasicsEP07:";

private const int kSliderMaxValue = 256;

private const float kSliderMaxFloat = 256f;

private const int kSliderHalfValue = 128;

protected const float kSliderHalfFloat = 128f;

private const float kScrollbarPadding = 19f;

private const int kMaxNameLengthNormal = 13;

private const int kMaxNameLengthShort = 10;

private const long kBreastSliderInstanceID = 6997618900402679873L;

private const uint kBaseHeight = 438u;

private const uint kSliderIncrement = 50u;

private const uint kTopSliderHolderPosition = 30u;

private WindowBase mInvalidCharacterWindow;

private Button mDoneButton;

private TextEdit mFirstNameTextEdit;

private TextEdit mLastNameTextEdit;

private Button mGenderMaleButton;

private Button mGenderFemaleButton;

private Button mAgeToddlerButton;

private Button mAgeChildButton;

private Button mAgeTeenButton;

private Button mAgeYoungAdultButton;

private Button mAgeAdultButton;

private Button mAgeElderButton;

private float mPanelHeight;

private Slider mSkinToneSlider;

private Slider mThinHeavySlider;

private Slider mMuscleSlider;

private Slider mMuscleDefinitionSlider;

private Slider mBreastSizeSlider;

private ImageDrawable mRampDrawable;

private CustomContentIcon mCustomContentIcon;

private Window mSkinToneGridWindow;

private Window mSkinToneSwatch;

private Button mSkinToneSwatchButton;

private ItemGrid mSkinToneGrid;

private Window mThinHeavyHolder;

private Window mMuscleHolder;

private Window mMuscleDefinitionHolder;

private Window mBreastSizeHolder;

private float mSkin;

private int mRampIndex;

private FacialBlendData mBreastSizeBlendData;

private FadeEffect mFadeEffect;

private float mFadeTime;

private CASState mTargetState;

private bool mFirstSliderChange;

private Button mSupernaturalTypeButton;

private Window mSupernaturalTypePopup;

private ItemGrid mSupernatrualTypePopupItemGrid;

private Dictionary<WindowBase, SimOutfit> mThumbOutfits = new Dictionary<WindowBase, SimOutfit>();

private Text mSupernaturalTypeName;

private Window mGhostDeathTypeSelectionWindow;

private ItemGrid mGhostDeathTypeItemGrid;

private Window mHumanBasicsWindow;

private Button mHumanBasicsButton;

private Button mFairyBasicsButton;

private Button mGhostBasicsButton;

private Window mFairWingSelectionWindow;

private ItemGrid mFairyWingSelectionItemGrid;

private Button mFairyWingColorPickerButton;

private Vector3 mOriginalFairyWingColor;

private WingTypes mOriginalWingType;

private float mPerceivedLuminance;

private Text mSkinToneText;

private ICASModel mModel;

private int mNonTransformedMax;

private static bool mShowedWerewolfMsg = false;

private static string[] mGhostDeathNames = new string[]
{
"GhostDeath01",
"GhostDeath02",
"GhostDeath03",
"GhostDeath04",
"GhostDeath05",
"GhostDeath06",
"GhostDeath07",
"GhostDeath09",
"GhostDeath10",
"GhostDeath11",
"GhostDeath12",
"GhostDeath13",
"GhostDeath14"
};

private static string[] mAdultWingIconNames = new string[]
{
"FairyWings01",
"FairyWings02",
"FairyWings03",
"FairyWings04",
"FairyWings05",
"FairyWings06"
};

private static string[] mChildWingIconNames = new string[]
{
"FairyWings07",
"FairyWings08",
"FairyWings09",
"FairyWings10",
"FairyWings11",
"FairyWings12"
};

private static Layout sBasicsLayout = null;

internal static CASBasics gSingleton = null;

private bool mWerewolfIsTransformed;

public event UINodeShutdownCallback UINodeShutdown
{
[MethodImpl(MethodImplOptions.Synchronized)]
add
{
this.UINodeShutdown = (UINodeShutdownCallback)Delegate.Combine(this.UINodeShutdown, value);
}
[MethodImpl(MethodImplOptions.Synchronized)]
remove
{
this.UINodeShutdown = (UINodeShutdownCallback)Delegate.Remove(this.UINodeShutdown, value);
}
}

public static string LocalizeString(string name, params object[] parameters)
{
return Responder.Instance.LocalizationModel.LocalizeString("UI/Controllers/CasBasics:" + name, parameters);
}

public static string LocalizeEP07String(string name, params object[] parameters)
{
return Responder.Instance.LocalizationModel.LocalizeString("UI/Controllers/CasBasicsEP07:" + name, parameters);
}

public static string LocalizeEP07Tooltip(string name, params object[] parameters)
{
return Responder.Instance.LocalizationModel.LocalizeString("UI/Tooltip/CAS/CasBasicsEP07:" + name, parameters);
}

internal static void Load()
{
ResourceKey resKey = ResourceKey.CreateUILayoutKey("CASBasics", 0u);
CASBasics.sBasicsLayout = UIManager.LoadLayoutAndAddToWindow(resKey, UICategory.CAS);
CASBasics.gSingleton = (CASBasics.sBasicsLayout.GetWindowByExportID(1) as CASBasics);
}

private static void Unload()
{
CASBasics.gSingleton = null;
if (CASBasics.sBasicsLayout != null)
{
CASBasics.sBasicsLayout.Shutdown();
CASBasics.sBasicsLayout.Dispose();
CASBasics.sBasicsLayout = null;
}
}

public static int GetMaxNameLength()
{
string locale = StringTable.GetLocale();
string key;
switch (key = locale)
{
case "ja-jp":
case "zh-cn":
case "zh-sg":
case "zh-tw":
case "zh-hk":
case "ko-kr":
return 10;
}
return 13;
}

public CASBasics(uint winHandle) : base(winHandle)
{
}

public override void Init()
{
this.mModel = Responder.Instance.CASModel;
this.mWerewolfIsTransformed = this.mModel.CurrentlyEditingTransformedWerewolf();
foreach (object current in base.EffectList)
{
this.mFadeEffect = (current as FadeEffect);
if (this.mFadeEffect != null)
{
this.mFadeTime = this.mFadeEffect.Duration;
break;
}
}
base.FadeTransitionFinished += new UIEventHandler<UIHandledEventArgs>(this.OnFadeFinished);
this.mBreastSizeBlendData = new FacialBlendData(new BlendUnit(new ResourceKey(6997618900402679873uL, 3039776853u, 0u)));
this.mInvalidCharacterWindow = base.GetChildByID(16u, true);
this.mDoneButton = (base.GetChildByID(98277120u, true) as Button);
this.mFirstNameTextEdit = (base.GetChildByID(98277121u, true) as TextEdit);
this.mLastNameTextEdit = (base.GetChildByID(98277122u, true) as TextEdit);
this.mGenderMaleButton = (base.GetChildByID(98277123u, true) as Button);
this.mGenderFemaleButton = (base.GetChildByID(98277124u, true) as Button);
this.mAgeToddlerButton = (base.GetChildByID(98277125u, true) as Button);
this.mAgeChildButton = (base.GetChildByID(98277126u, true) as Button);
this.mAgeTeenButton = (base.GetChildByID(98277127u, true) as Button);
this.mAgeYoungAdultButton = (base.GetChildByID(98277128u, true) as Button);
this.mAgeAdultButton = (base.GetChildByID(98277129u, true) as Button);
this.mAgeElderButton = (base.GetChildByID(98277130u, true) as Button);
Button button = base.GetChildByID(98277131u, true) as Button;
button.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnRandomizeNameClick);
ICASModel cASModel = Responder.Instance.CASModel;
if (cASModel.CurrentlyEditingTransformedWerewolf())
{
this.mGenderFemaleButton.Enabled = false;
this.mGenderMaleButton.Enabled = false;
this.mGenderFemaleButton.TooltipText = (this.mGenderMaleButton.TooltipText = CASBasics.LocalizeEP07String("GenderSwapDisabled", new object[0]));
}
uint maxNameLength = (uint)CASBasics.GetMaxNameLength();
this.mFirstNameTextEdit.MaxTextLength = maxNameLength;
this.mLastNameTextEdit.MaxTextLength = maxNameLength;
CASBasics.SetupTextEdit(this.mFirstNameTextEdit, cASModel.FirstName);
this.mFirstNameTextEdit.TextAccept += new UIEventHandler<UITextEditAcceptEventArgs>(this.OnNameTextEditAccept);
this.mFirstNameTextEdit.TextChange += new UIEventHandler<UITextChangeEventArgs>(this.OnNameTextEditChange);
this.mFirstNameTextEdit.TextEditTab += new UIEventHandler<UIEventArgs>(this.OnNameTextEditTab);
this.mFirstNameTextEdit.TextValidate += new UIEventHandler<UITextValidateEventArgs>(this.OnNameTextEditValidate);
CASBasics.SetupTextEdit(this.mLastNameTextEdit, cASModel.LastName);
this.mLastNameTextEdit.TextAccept += new UIEventHandler<UITextEditAcceptEventArgs>(this.OnNameTextEditAccept);
this.mLastNameTextEdit.TextChange += new UIEventHandler<UITextChangeEventArgs>(this.OnNameTextEditChange);
this.mLastNameTextEdit.TextEditTab += new UIEventHandler<UIEventArgs>(this.OnNameTextEditTab);
this.mLastNameTextEdit.TextValidate += new UIEventHandler<UITextValidateEventArgs>(this.OnNameTextEditValidate);
this.mGenderMaleButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnGenderButtonClick);
this.mGenderFemaleButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnGenderButtonClick);
this.mAgeToddlerButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnAgeButtonClick);
this.mAgeChildButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnAgeButtonClick);
this.mAgeTeenButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnAgeButtonClick);
this.mAgeYoungAdultButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnAgeButtonClick);
this.mAgeAdultButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnAgeButtonClick);
this.mAgeElderButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnAgeButtonClick);
this.mDoneButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnDoneButtonClick);
this.mPanelHeight = base.Area.Height;
this.mSkinToneSlider = (base.GetChildByID(98277136u, true) as Slider);
this.mSkinToneSlider.SliderValueChange += new UIEventHandler<UIValueChangedEventArgs>(this.OnSkinToneSliderChanged);
this.mSkinToneSlider.MouseDown += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseDown);
this.mSkinToneSlider.MouseUp += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseUp);
this.mCustomContentIcon = (base.GetChildByID(98277140u, true) as CustomContentIcon);
this.mThinHeavySlider = (base.GetChildByID(98277141u, true) as Slider);
this.mThinHeavySlider.SliderValueChange += new UIEventHandler<UIValueChangedEventArgs>(this.OnThinHeavySliderChanged);
this.mThinHeavySlider.MouseDown += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseDown);
this.mThinHeavySlider.MouseUp += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseUp);
this.mMuscleSlider = (base.GetChildByID(98277142u, true) as Slider);
this.mMuscleSlider.SliderValueChange += new UIEventHandler<UIValueChangedEventArgs>(this.OnMuscleSliderChanged);
this.mMuscleSlider.MouseDown += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseDown);
this.mMuscleSlider.MouseUp += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseUp);
this.mNonTransformedMax = this.mMuscleSlider.MaxValue;
if (cASModel.CurrentlyEditingTransformedWerewolf())
{
this.mMuscleSlider.MaxValue = (int)((float)this.mNonTransformedMax * 1.25f);
this.mMuscleSlider.Invalidate();
}
this.mMuscleDefinitionSlider = (base.GetChildByID(170510192u, true) as Slider);
this.mMuscleDefinitionSlider.SliderValueChange += new UIEventHandler<UIValueChangedEventArgs>(this.OnMuscleDefinitionSliderChanged);
this.mMuscleDefinitionSlider.MouseDown += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseDown);
this.mMuscleDefinitionSlider.MouseUp += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseUp);
this.mBreastSizeSlider = (base.GetChildByID(170871392u, true) as Slider);
this.mBreastSizeSlider.SliderValueChange += new UIEventHandler<UIValueChangedEventArgs>(this.OnBreastSizeSliderChanged);
this.mBreastSizeSlider.MouseDown += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseDown);
this.mBreastSizeSlider.MouseUp += new UIEventHandler<UIMouseEventArgs>(this.OnSliderMouseUp);
Window window = base.GetChildByID(98277137u, true) as Window;
this.mRampDrawable = (window.Drawable as ImageDrawable);
this.mSkinToneGridWindow = (base.GetChildByID(98277143u, true) as Window);
this.mSkinToneGrid = (base.GetChildByID(98277144u, true) as ItemGrid);
this.mSkinToneGrid.Visible = true;
this.mSkinToneGrid.ItemClicked += new ItemGrid.ItemGridItemClickedEventHandler(this.OnGridSelect);
this.mSkinToneSwatch = (base.GetChildByID(98277139u, true) as Window);
this.mSkinToneSwatchButton = (base.GetChildByID(98277138u, true) as Button);
this.mSkinToneSwatchButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnSwatchButtonClick);
this.mThinHeavyHolder = (base.GetChildByID(98277145u, true) as Window);
this.mMuscleHolder = (base.GetChildByID(98277146u, true) as Window);
this.mMuscleDefinitionHolder = (base.GetChildByID(170871312u, true) as Window);
this.mBreastSizeHolder = (base.GetChildByID(170871376u, true) as Window);
this.mSkinToneText = (base.GetChildByID(228852464u, true) as Text);
this.mSupernaturalTypeButton = (base.GetChildByID(224269920u, true) as Button);
this.mSupernaturalTypeButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnSupernaturalTypeButtonPressed);
this.mSupernaturalTypePopup = (base.GetChildByID(224615632u, true) as Window);
this.mSupernaturalTypePopup.Tick += new UIEventHandler<UIEventArgs>(this.OnSupernaturalTypePopupFocusLost);
this.mSupernatrualTypePopupItemGrid = (base.GetChildByID(224269936u, true) as ItemGrid);
this.mSupernaturalTypeName = (base.GetChildByID(224337504u, true) as Text);
this.SetSupernaturalTypeNameCaption();
if (cASModel.CurrentlyEditingTransformedWerewolf())
{
this.mSupernaturalTypeButton.Enabled = false;
this.mSupernaturalTypeButton.TooltipText = CASBasics.LocalizeEP07String("DisabledWhileTransformed", new object[0]);
this.mSupernaturalTypeName.TooltipText = CASBasics.LocalizeEP07String("DisabledWhileTransformed", new object[0]);
}
if (!GameUtils.IsInstalled((ProductVersion)16384u))
{
Text text = base.GetChildByID(230395088u, true) as Text;
text.Enabled = false;
text.Visible = false;
this.mSupernaturalTypeButton.Enabled = false;
this.mSupernaturalTypeButton.Visible = false;
this.mSupernaturalTypeName.Visible = false;
}
Button button2 = base.GetChildByID(224337440u, true) as Button;
button2.Tag = OccultTypes.Witch;
button2.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOccultTypeSelected);
button2.TooltipText = CASBasics.LocalizeEP07String(OccultTypes.Witch.ToString(), new object[0]);
button2 = (base.GetChildByID(224337424u, true) as Button);
button2.Tag = OccultTypes.Fairy;
button2.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOccultTypeSelected);
button2.TooltipText = CASBasics.LocalizeEP07String(OccultTypes.Fairy.ToString(), new object[0]);
button2 = (base.GetChildByID(224777360u, true) as Button);
button2.Tag = OccultTypes.Ghost;
button2.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOccultTypeSelected);
button2.TooltipText = CASBasics.LocalizeEP07String(OccultTypes.Ghost.ToString(), new object[0]);
button2 = (base.GetChildByID(224337392u, true) as Button);
button2.Tag = OccultTypes.Werewolf;
button2.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOccultTypeSelected);
button2.TooltipText = CASBasics.LocalizeEP07String(OccultTypes.Werewolf.ToString(), new object[0]);
button2 = (base.GetChildByID(224780368u, true) as Button);
button2.Tag = OccultTypes.Genie;
button2.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOccultTypeSelected);
button2.TooltipText = CASBasics.LocalizeEP07String(OccultTypes.Genie.ToString(), new object[0]);
if (!GameUtils.IsInstalled((ProductVersion)2048u))
{
button2.TooltipText = CASBasics.LocalizeEP07String("EPNotInstalled", new object[0]);
button2.Enabled = false;
}
button2 = (base.GetChildByID(224348352u, true) as Button);
button2.Tag = OccultTypes.None;
button2.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOccultTypeSelected);
button2.TooltipText = CASBasics.LocalizeEP07String(0.ToString(), new object[0]);
button2 = (base.GetChildByID(224863552u, true) as Button);
button2.Tag = OccultTypes.Vampire;
button2.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnOccultTypeSelected);
button2.TooltipText = CASBasics.LocalizeEP07String(OccultTypes.Vampire.ToString(), new object[0]);
this.mHumanBasicsWindow = (base.GetChildByID(228219856u, true) as Window);
this.mHumanBasicsButton = (base.GetChildByID(228218416u, true) as Button);
this.mHumanBasicsButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnHumanBasicsClick);
this.mFairyBasicsButton = (base.GetChildByID(228218417u, true) as Button);
this.mFairyBasicsButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnSupernaturalBasicsClick);
this.mGhostBasicsButton = (base.GetChildByID(228218418u, true) as Button);
this.mGhostBasicsButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnSupernaturalBasicsClick);
this.InitGhostUI();
this.InitFairyUI();
this.PopulateGrid();
this.SetupControlValues();
this.UpdateAgeSelectionButtons();
this.UpdateAgeTooltip();
cASModel.OnSimPreviewChange += new SimPreviewChangeDelegate(this.OnSimPreviewChange);
cASModel.OnSimAddedToHousehold += new SimAddedToHouseholdDelegate(this.OnSimAddedToHousehold);
cASModel.OnSimDeleted += new SimDeletedDelegate(this.OnSimDeleted);
cASModel.OnSimLoaded += new SimLoadedDelegate(this.OnSimLoaded);
cASModel.OnSimRandomized += new SimRandomizedDelegate(this.OnSimRandomized);
cASModel.OnSimAgeGenderChanged += new SimAgeGenderChanged(this.OnSimAgeGenderChanged);
cASModel.OnSimPreviewLoadFinished += new SimPreviewLoadFinished(this.OnSimPreviewLoadFinished);
cASModel.OnDynamicUpdateCurrentSimThumbnail += new DynamicUpdateCurrentSimThumbnailDelegate(this.OnDynamicUpdateCurrentSimThumbnail);
cASModel.OccultTypeSelected += new OccultTypeChosenDelegate(this.OnOccultTypeSelected);
cASModel.OnSimReplaced += new SimReplacedDelegate(this.OnSimReplaced);
cASModel.OnUpdateThumbnails += new UpdateThumbnailsDelegate(this.OnDynamicUpdateCurrentSimThumbnail);
Simulator.AddObject(new OneShotFunctionTask(new Function(this.DynamicUpdateCurrentSimThumbnailTask), StopWatch.TickStyles.Seconds, 2.5f));
this.SetSupernaturalTypeNameCaption();
cASModel.UpdateVisualsToCurrent();
this.UpdateOccultDependentUI(cASModel.CurrentOccultType);
CASController singleton = CASController.Singleton;
CASController expr_CD8 = singleton;
expr_CD8.OnEditWerewolfTransformed = (CASController.EditWerewolfTransformed)Delegate.Combine(expr_CD8.OnEditWerewolfTransformed, new CASController.EditWerewolfTransformed(this.OnEditWerewolfTransformed));
CASController expr_CFB = singleton;
expr_CFB.OnEditWerewolfTransformedDone = (CASController.EditWerewolfTransformedDone)Delegate.Combine(expr_CFB.OnEditWerewolfTransformedDone, new CASController.EditWerewolfTransformedDone(this.OnEditWerewolfTransformedDone));
}

private void InitGhostUI()
{
this.mGhostDeathTypeSelectionWindow = (base.GetChildByID(224777216u, true) as Window);
this.mGhostDeathTypeItemGrid = (base.GetChildByID(228231280u, true) as ItemGrid);
this.mGhostDeathTypeItemGrid.MouseWheel += new UIEventHandler<UIMouseEventArgs>(this.mGhostDeathTypeItemGrid_MouseWheel);
this.PopulateGhostGrid();
}

private void mGhostDeathTypeItemGrid_MouseWheel(WindowBase sender, UIMouseEventArgs eventArgs)
{
int num = -(eventArgs.MouseWheelDelta / 100);
if (num == 0)
{
num = ((eventArgs.MouseWheelDelta < 0) ? -1 : 1);
}
if ((num < 0 && !this.mGhostDeathTypeItemGrid.VScrollbar.AtTop()) || (num > 0 && !this.mGhostDeathTypeItemGrid.VScrollbar.AtBottom()))
{
int num2 = num * this.mGhostDeathTypeItemGrid.VScrollbar.ArrowDelta;
num2 = ((this.mGhostDeathTypeItemGrid.VScrollbar.Value + num2 < this.mGhostDeathTypeItemGrid.VScrollbar.MinValue) ? (this.mGhostDeathTypeItemGrid.VScrollbar.MinValue - this.mGhostDeathTypeItemGrid.VScrollbar.Value) : num2);
num2 = ((this.mGhostDeathTypeItemGrid.VScrollbar.Value + num2 > this.mGhostDeathTypeItemGrid.VScrollbar.UpperBoundValue - this.mGhostDeathTypeItemGrid.VScrollbar.VisibleRange) ? (this.mGhostDeathTypeItemGrid.VScrollbar.UpperBoundValue - this.mGhostDeathTypeItemGrid.VScrollbar.VisibleRange - this.mGhostDeathTypeItemGrid.VScrollbar.Value) : num2);
this.mGhostDeathTypeItemGrid.Position = new Vector2(this.mGhostDeathTypeItemGrid.Position.x, this.mGhostDeathTypeItemGrid.Position.y - (float)num2);
}
}

private void OnMouseWheel(WindowBase sender, UIMouseEventArgs eventArgs)
{
eventArgs.Handled = false;
}

private void PopulateGhostGrid()
{
string ghostDeathTypeString = Responder.Instance.CASModel.GhostDeathTypeString;
List<string> deathTypeNames = Responder.Instance.CASModel.GetDeathTypeNames();
Dictionary<string, uint> deathTypeMap = Responder.Instance.CASModel.GetDeathTypeMap();
foreach (string current in deathTypeNames)
{
ResourceKey resKey = ResourceKey.CreateUILayoutKey("GenericSupernaturalItem", 0u);
WindowBase windowByExportID = UIManager.LoadLayout(resKey).GetWindowByExportID(1);
if (windowByExportID != null)
{
windowByExportID.FocusAcquired += new UIEventHandler<UIFocusChangeEventArgs>(this.OnSupernaturalGenericItem_FocusAcquired);
windowByExportID.FocusLost += new UIEventHandler<UIFocusChangeEventArgs>(this.OnSupernaturalGenericItem_FocusLost);
windowByExportID.MouseWheel += new UIEventHandler<UIMouseEventArgs>(this.OnMouseWheel);
Button button = windowByExportID.GetChildByIndex(0u) as Button;
if (button != null)
{
button.MouseWheel += new UIEventHandler<UIMouseEventArgs>(this.OnMouseWheel);
button.Tag = current;
button.TooltipText = current;
button.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnDeathTypeButtonClick);
IconDrawable iconDrawable = button.Drawable as IconDrawable;
if (iconDrawable != null && deathTypeMap.ContainsKey(current))
{
uint num = deathTypeMap[current];
if ((ulong)num < (ulong)((long)CASBasics.mGhostDeathNames.Length))
{
ResourceKey resKey2 = ResourceKey.CreatePNGKey(CASBasics.mGhostDeathNames[(int)((UIntPtr)num)], 0u);
iconDrawable.Image = UIManager.LoadUIImage(resKey2);
}
}
if (ghostDeathTypeString == current)
{
button.Selected = true;
}
this.mGhostDeathTypeItemGrid.AddItem(new ItemGridCellItem(windowByExportID, current));
}
}
}
foreach (ItemGridCellItem current2 in this.mGhostDeathTypeItemGrid.Items)
{
WindowBase mWin = current2.mWin;
if (mWin != null)
{
Button button2 = mWin.GetChildByIndex(0u) as Button;
Window window = mWin.GetChildByID(231002384u, true) as Window;
window.Visible = button2.Selected;
window.MouseWheel += new UIEventHandler<UIMouseEventArgs>(this.OnMouseWheel);
}
}
}

private void InitFairyUI()
{
this.mFairWingSelectionWindow = (base.GetChildByID(228218736u, true) as Window);
this.mFairyWingSelectionItemGrid = (base.GetChildByID(228218737u, true) as ItemGrid);
this.mFairyWingColorPickerButton = (base.GetChildByID(228230016u, true) as Button);
this.mFairyWingColorPickerButton.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnColorPickerClick);
this.PopulateFairyWingItemGrid();
}

private void PopulateFairyWingItemGrid()
{
this.mFairyWingSelectionItemGrid.Clear();
foreach (WingTypes wingTypes in Enum.GetValues(typeof(WingTypes)))
{
if (wingTypes != 6)
{
ResourceKey resKey = ResourceKey.CreateUILayoutKey("GenericSupernaturalItem", 0u);
WindowBase windowByExportID = UIManager.LoadLayout(resKey).GetWindowByExportID(1);
windowByExportID.FocusAcquired += new UIEventHandler<UIFocusChangeEventArgs>(this.OnSupernaturalGenericItem_FocusAcquired);
windowByExportID.FocusLost += new UIEventHandler<UIFocusChangeEventArgs>(this.OnSupernaturalGenericItem_FocusLost);
CASAgeGenderFlags age = Responder.Instance.CASModel.Age;
if (windowByExportID != null)
{
Button button = windowByExportID.GetChildByIndex(0u) as Button;
if (button != null)
{
button.Tag = wingTypes;
button.TooltipText = CASBasics.LocalizeEP07Tooltip(wingTypes.ToString(), new object[0]);
button.Click += new UIEventHandler<UIButtonClickEventArgs>(this.OnFairyWingButtonClick);
string name;
if (age == CASAgeGenderFlags.Child)
{
name = CASBasics.mChildWingIconNames[wingTypes];
}
else
{
name = CASBasics.mAdultWingIconNames[wingTypes];
}
IconDrawable iconDrawable = button.Drawable as IconDrawable;
ResourceKey resKey2 = ResourceKey.CreatePNGKey(name, 0u);
iconDrawable.Image = UIManager.LoadUIImage(resKey2);
if (Responder.Instance.CASModel.CurrentWingType == wingTypes)
{
button.Selected = true;
}
this.mFairyWingSelectionItemGrid.AddItem(new ItemGridCellItem(windowByExportID, wingTypes));
}
}
}
}
foreach (ItemGridCellItem current in this.mFairyWingSelectionItemGrid.Items)
{
WindowBase mWin = current.mWin;
if (mWin != null)
{
Button button2 = mWin.GetChildByIndex(0u) as Button;
Window window = mWin.GetChildByID(231002384u, true) as Window;
window.Visible = button2.Selected;
}
}
}

public override void Dispose()
{
ICASModel cASModel = Responder.Instance.CASModel;
cASModel.OnSimPreviewChange -= new SimPreviewChangeDelegate(this.OnSimPreviewChange);
cASModel.OnSimAddedToHousehold -= new SimAddedToHouseholdDelegate(this.OnSimAddedToHousehold);
cASModel.OnSimDeleted -= new SimDeletedDelegate(this.OnSimDeleted);
cASModel.OnSimLoaded -= new SimLoadedDelegate(this.OnSimLoaded);
cASModel.OnSimRandomized -= new SimRandomizedDelegate(this.OnSimRandomized);
cASModel.OnSimAgeGenderChanged -= new SimAgeGenderChanged(this.OnSimAgeGenderChanged);
cASModel.OnSimPreviewLoadFinished -= new SimPreviewLoadFinished(this.OnSimPreviewLoadFinished);
cASModel.OnDynamicUpdateCurrentSimThumbnail -= new DynamicUpdateCurrentSimThumbnailDelegate(this.OnDynamicUpdateCurrentSimThumbnail);
cASModel.OccultTypeSelected -= new OccultTypeChosenDelegate(this.OnOccultTypeSelected);
cASModel.OnSimReplaced -= new SimReplacedDelegate(this.OnSimReplaced);
cASModel.OnUpdateThumbnails -= new UpdateThumbnailsDelegate(this.OnDynamicUpdateCurrentSimThumbnail);
CASController singleton = CASController.Singleton;
CASController expr_D8 = singleton;
expr_D8.OnEditWerewolfTransformed = (CASController.EditWerewolfTransformed)Delegate.Remove(expr_D8.OnEditWerewolfTransformed, new CASController.EditWerewolfTransformed(this.OnEditWerewolfTransformed));
CASController expr_FA = singleton;
expr_FA.OnEditWerewolfTransformedDone = (CASController.EditWerewolfTransformedDone)Delegate.Remove(expr_FA.OnEditWerewolfTransformedDone, new CASController.EditWerewolfTransformedDone(this.OnEditWerewolfTransformedDone));
base.Dispose();
}

private void PopulateGrid()
{
IUIManager iUIManager = (IUIManager)AppDomain.CurrentDomain.GetData("UIManager");
ICASModel cASModel = Responder.Instance.CASModel;
List<ResourceKey> skinToneRamps = cASModel.GetSkinToneRamps();
this.mSkinToneGrid.Clear();
if (skinToneRamps != null)
{
ResourceKey resKey = ResourceKey.CreateUILayoutKey("CASSkinTonePreset", 0u);
foreach (ResourceKey current in skinToneRamps)
{
if (current.InstanceId != 5388694181538607522uL && current.InstanceId != 3067435768076268991uL)
{
ResourceKey skinToneRampKey = CASUtils.GetSkinToneRampKey(current);
if (!(skinToneRampKey == ResourceKey.kInvalidResourceKey))
{
skinToneRampKey.TypeId = 796721156u;
Window window = UIManager.LoadLayout(resKey).GetWindowByExportID(1) as Window;
if (!(window == null))
{
Color shadeColor = iUIManager.PickPixel(skinToneRampKey, 0.5f, 0.5f);
Window window2 = window.GetChildByID(2u, true) as Window;
if (window2 != null)
{
window2.ShadeColor = shadeColor;
}
CustomContentIcon customContentIcon = window.GetChildByID(3u, true) as CustomContentIcon;
if (customContentIcon != null)
{
customContentIcon.ContentType = UIUtils.GetCustomContentType(current);
}
this.mSkinToneGrid.AddItem(new ItemGridCellItem(window, current));
}
}
}
}
}
}

public static void SetupTextEdit(TextEdit textEdit, string startingValue)
{
if (startingValue != string.Empty && startingValue != null)
{
CASBasics.OnTextEditFirstMouseDown(textEdit, null);
textEdit.Caption = startingValue;
return;
}
textEdit.MouseDown += new UIEventHandler<UIMouseEventArgs>(CASBasics.OnTextEditFirstMouseDown);
}

private void SetupControlValues()
{
ICASModel cASModel = Responder.Instance.CASModel;
this.mGenderMaleButton.Selected = (cASModel.Gender == CASAgeGenderFlags.Male);
this.mGenderFemaleButton.Selected = (cASModel.Gender == CASAgeGenderFlags.Female);
CASAgeGenderFlags age = cASModel.Age;
this.mAgeToddlerButton.Selected = (age == CASAgeGenderFlags.Toddler);
this.mAgeChildButton.Selected = (age == CASAgeGenderFlags.Child);
this.mAgeTeenButton.Selected = (age == CASAgeGenderFlags.Teen);
this.mAgeYoungAdultButton.Selected = (age == CASAgeGenderFlags.YoungAdult);
this.mAgeAdultButton.Selected = (age == CASAgeGenderFlags.Adult);
this.mAgeElderButton.Selected = (age == CASAgeGenderFlags.Elder);
bool visible = true;
bool visible2 = true;
if (age < CASAgeGenderFlags.Teen || age == CASAgeGenderFlags.Elder)
{
visible = false;
}
if (age == CASAgeGenderFlags.Toddler)
{
visible2 = false;
}
this.mThinHeavyHolder.Visible = visible2;
this.mMuscleHolder.Visible = visible;
this.SetupTertiarySliderVisibility(age, cASModel.Gender);
if (cASModel.Gender == CASAgeGenderFlags.Female)
{
this.mBreastSizeSlider.Value = (int)(this.mBreastSizeBlendData.Value * 256f);
}
this.mMuscleDefinitionSlider.Value = (int)(cASModel.SecondaryNormalMapWeights[0] * 256f);
WindowBase childByID = base.GetChildByID(98277147u, true);
if (childByID != null)
{
childByID.Visible = (this.mThinHeavyHolder.Visible || this.mMuscleHolder.Visible);
}
float morphThin = cASModel.GetMorphThin();
float morphFat = cASModel.GetMorphFat();
if (morphThin > 0f)
{
this.mThinHeavySlider.Value = 128 - (int)Math.Round((double)(morphThin * 128f));
}
else
{
this.mThinHeavySlider.Value = 128 + (int)Math.Round((double)(morphFat * 128f));
}
float morphFit = cASModel.GetMorphFit();
this.mMuscleSlider.Value = (int)Math.Round((double)(morphFit * 256f));
this.mSkin = cASModel.GetSkinTone();
this.mSkinToneSlider.Value = (int)Math.Round((double)(this.mSkin * 256f));
ResourceKey key = cASModel.GetSkinToneKey();
List<ResourceKey> skinToneRamps = cASModel.GetSkinToneRamps();
this.mRampIndex = skinToneRamps.FindIndex((ResourceKey tempKey) => tempKey == key);
int num = 0;
foreach (ItemGridCellItem current in this.mSkinToneGrid.Items)
{
if ((ResourceKey)current.mTag == key)
{
break;
}
num++;
}
this.mSkinToneGrid.SelectedItem = num;
this.SetSkinToneRamp(key);
this.mSkinToneSwatchButton.Visible = true;
this.mSkinToneSlider.Visible = true;
this.mSkinToneText.Visible = true;
this.SetupWindowHeight();
}

private void SetupTertiarySliderVisibility(CASAgeGenderFlags age, CASAgeGenderFlags gender)
{
bool visible = true;
bool visible2 = gender == CASAgeGenderFlags.Female;
if (age < CASAgeGenderFlags.Teen)
{
visible2 = false;
visible = false;
}
this.mMuscleDefinitionHolder.Visible = visible;
this.mBreastSizeHolder.Visible = visible2;
this.DisableSliderVisibility(Responder.Instance.CASModel.CurrentOccultType);
}

private void SetupWindowHeight()
{
OccultTypes currentOccultType = Responder.Instance.CASModel.CurrentOccultType;
if (this.mGhostDeathTypeSelectionWindow.Visible && currentOccultType == OccultTypes.Ghost)
{
Rect area = base.Area;
Vector2 bottomRight = area.BottomRight;
Vector2 topLeft = area.TopLeft;
area.Set(topLeft.x, topLeft.y, bottomRight.x, 588f);
base.Area = area;
return;
}
this.SetupWindowHeightFromVisibleSliderCount();
}

private void SetupWindowHeightFromVisibleSliderCount()
{
List<Window> list = new List<Window>();
if (this.mThinHeavyHolder.Visible)
{
list.Add(this.mThinHeavyHolder);
}
if (this.mMuscleHolder.Visible)
{
list.Add(this.mMuscleHolder);
}
if (this.mMuscleDefinitionHolder.Visible)
{
list.Add(this.mMuscleDefinitionHolder);
}
if (this.mBreastSizeHolder.Visible)
{
list.Add(this.mBreastSizeHolder);
}
Rect area = base.Area;
Vector2 bottomRight = area.BottomRight;
Vector2 topLeft = area.TopLeft;
area.Set(topLeft.x, topLeft.y, bottomRight.x, (float)(438L + (long)list.Count * 50L));
base.Area = area;
uint num = 30u;
foreach (Window current in list)
{
area = current.Area;
bottomRight = area.BottomRight;
topLeft = area.TopLeft;
float height = area.Height;
area.Set(topLeft.x, num, bottomRight.x, num + height);
current.Area = area;
num += 50u;
}
}

private bool IAmSenderAndFocusChangedWindow(WindowBase sender, WindowBase FocusChangeWindow)
{
bool flag = false;
bool flag2 = false;
bool flag3 = false;
if (sender == this || base.GetChildByID(sender.ID, true) != null)
{
flag = true;
}
if (FocusChangeWindow == this || base.GetChildByID(FocusChangeWindow.ID, true) != null)
{
flag2 = true;
}
if (FocusChangeWindow.ID == sender.ID)
{
flag3 = true;
}
return flag && flag2 && flag3;
}

private void OnSupernaturalGenericItem_FocusAcquired(WindowBase sender, UIFocusChangeEventArgs eventArgs)
{
if (this.IAmSenderAndFocusChangedWindow(sender, eventArgs.FocusChangeWindow))
{
GrowEffect growEffect = sender.EffectList[0] as GrowEffect;
growEffect.TriggerEffect(false);
}
}

private void OnSupernaturalGenericItem_FocusLost(WindowBase sender, UIFocusChangeEventArgs eventArgs)
{
if (this.IAmSenderAndFocusChangedWindow(sender, eventArgs.FocusChangeWindow))
{
GrowEffect growEffect = sender.EffectList[0] as GrowEffect;
growEffect.TriggerEffect(true);
}
}

private void OnEditWerewolfTransformed(bool nowTransformed)
{
ICASModel arg_0A_0 = Responder.Instance.CASModel;
if (nowTransformed)
{
this.mMuscleSlider.MaxValue = (int)((float)this.mNonTransformedMax * 1.25f);
this.mMuscleSlider.Invalidate();
this.mGenderFemaleButton.Enabled = false;
this.mGenderMaleButton.Enabled = false;
this.mSupernaturalTypeButton.Enabled = false;
this.mSupernaturalTypeButton.TooltipText = CASBasics.LocalizeEP07String("DisabledWhileTransformed", new object[0]);
this.mDoneButton.Enabled = false;
this.mSupernaturalTypeName.TooltipText = CASBasics.LocalizeEP07String("DisabledWhileTransformed", new object[0]);
this.mGenderFemaleButton.TooltipText = (this.mGenderMaleButton.TooltipText = CASBasics.LocalizeEP07String("GenderSwapDisabled", new object[0]));
}
else
{
this.mMuscleSlider.MaxValue = this.mNonTransformedMax;
this.mMuscleSlider.Invalidate();
this.mGenderFemaleButton.Enabled = true;
this.mGenderMaleButton.Enabled = true;
this.mDoneButton.Enabled = true;
this.mSupernaturalTypeButton.Enabled = true;
this.mSupernaturalTypeButton.TooltipText = string.Empty;
this.mSupernaturalTypeName.TooltipText = string.Empty;
this.mGenderFemaleButton.TooltipText = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Basics:Female", new object[0]);
this.mGenderMaleButton.TooltipText = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Basics:Male", new object[0]);
}
this.mWerewolfIsTransformed = nowTransformed;
}

private void OnEditWerewolfTransformedDone()
{
this.mDoneButton.Enabled = true;
}

private void OnOccultTypeSelected(OccultTypes currentType)
{
this.mSkinToneSwatchButton.Enabled = true;
this.mGenderFemaleButton.Enabled = true;
this.mGenderMaleButton.Enabled = true;
this.mGenderFemaleButton.TooltipText = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Basics:Female", new object[0]);
this.mGenderMaleButton.TooltipText = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Basics:Male", new object[0]);
this.DisableSliderVisibility(currentType);
this.EnableSliderVisibility(currentType);
this.OnDynamicUpdateCurrentSimThumbnail();
}

private void OnSimReplaced(int simIndex)
{
this.UpdateFromModel();
this.OnDynamicUpdateCurrentSimThumbnail();
}

private void OnFairyWingButtonClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
Window window;
foreach (ItemGridCellItem current in this.mFairyWingSelectionItemGrid.Items)
{
WindowBase mWin = current.mWin;
if (mWin != null)
{
window = (mWin.GetChildByID(231002384u, true) as Window);
window.Visible = false;
}
}
Button button = sender as Button;
if (button != null)
{
button.Selected = true;
}
window = (sender.Parent.GetChildByID(231002384u, true) as Window);
window.Visible = true;
WingTypes newType = (WingTypes)sender.Tag;
Responder.Instance.CASModel.RequestSetFairyWings(newType);
}

private void OnToggleToTransformed(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
Responder.Instance.CASModel.SetVisualOverride(Responder.Instance.CASModel.CurrentOccultType);
}

private void OnToggleToHuman(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
Responder.Instance.CASModel.SetVisualOverride(OccultTypes.None);
}

private void OnGridSelect(ItemGrid sender, ItemGridCellClickEvent itemClicked)
{
Audio.StartSound("ui_tertiary_button");
ICASModel cASModel = Responder.Instance.CASModel;
ResourceKey resourceKey = (ResourceKey)itemClicked.mTag;
cASModel.RequestSetSkinTonePreset(new SkinTonePreset
{
skinToneResourceKey = resourceKey,
amount = this.mSkin
});
this.SetSkinToneRamp(resourceKey);
this.mSkinToneGridWindow.Visible = false;
this.mSkinToneSwatchButton.Selected = false;
}

private void OnSwatchButtonClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
this.mSkinToneGridWindow.Visible = eventArgs.ButtonSelected;
}

private void OnDoneButtonClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
CASController.Singleton.SetCurrentState(new CASState(CASTopState.CreateASim, CASMidState.Summary, CASPhysicalState.None, CASClothingState.None));
eventArgs.Handled = true;
}

private static void OnTextEditFirstMouseDown(WindowBase sender, UIMouseEventArgs eventArgs)
{
TextEdit textEdit = sender as TextEdit;
if (textEdit != null && !textEdit.Enabled)
{
textEdit.Enabled = true;
textEdit.Caption = string.Empty;
textEdit.TextStyle = 103722498u;
UIManager.SetFocus(InputContext.kICKeyboard, textEdit);
textEdit.MouseDown -= new UIEventHandler<UIMouseEventArgs>(CASBasics.OnTextEditFirstMouseDown);
}
}

private void OnRandomizeNameClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
if (!this.mFirstNameTextEdit.Enabled)
{
CASBasics.OnTextEditFirstMouseDown(this.mFirstNameTextEdit, null);
CASBasics.OnTextEditFirstMouseDown(this.mLastNameTextEdit, null);
}
CASController expr_2A = CASController.Singleton;
expr_2A.OnSimFirstNameChanged = (SimNameChanged)Delegate.Combine(expr_2A.OnSimFirstNameChanged, new SimNameChanged(this.OnSimNameChanged));
Responder.Instance.CASModel.RequestRandomizeName();
}

private void OnSimNameChanged(string firstName, string lastName, CASAgeGenderFlags age, CASAgeGenderFlags gender, string astrologySign)
{
CASController expr_05 = CASController.Singleton;
expr_05.OnSimFirstNameChanged = (SimNameChanged)Delegate.Remove(expr_05.OnSimFirstNameChanged, new SimNameChanged(this.OnSimNameChanged));
this.UpdateFromModel();
}

private void OnAgeButtonClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
CASAgeGenderFlags cASAgeGenderFlags = CASAgeGenderFlags.Adult;
switch (sender.ID)
{
case 98277125u:
cASAgeGenderFlags = CASAgeGenderFlags.Toddler;
break;
case 98277126u:
cASAgeGenderFlags = CASAgeGenderFlags.Child;
break;
case 98277127u:
cASAgeGenderFlags = CASAgeGenderFlags.Teen;
break;
case 98277128u:
cASAgeGenderFlags = CASAgeGenderFlags.YoungAdult;
break;
case 98277129u:
cASAgeGenderFlags = CASAgeGenderFlags.Adult;
break;
case 98277130u:
cASAgeGenderFlags = CASAgeGenderFlags.Elder;
break;
}
ICASModel cASModel = Responder.Instance.CASModel;
if (cASModel.Age != cASAgeGenderFlags)
{
this.SetupTertiarySliderVisibility(cASAgeGenderFlags, cASModel.Gender);
CASPuck.UpdateWerewolfButton();
CASPuck.ShowInputBlocker();
cASModel.Age = cASAgeGenderFlags;
CASController singleton = CASController.Singleton;
singleton.OnSimFirstNameChanged(cASModel.FirstName, cASModel.LastName, cASAgeGenderFlags, cASModel.Gender, "Gemini");
singleton.RefreshCamera(CASCameraLerp.AutoLerp);
this.SetupWindowHeight();
}
}

private void OnGenderButtonClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
CASAgeGenderFlags cASAgeGenderFlags;
if (sender.ID == 98277123u)
{
cASAgeGenderFlags = CASAgeGenderFlags.Male;
}
else
{
cASAgeGenderFlags = CASAgeGenderFlags.Female;
}
ICASModel cASModel = Responder.Instance.CASModel;
this.SetupTertiarySliderVisibility(cASModel.Age, cASAgeGenderFlags);
if (cASModel.Gender != cASAgeGenderFlags)
{
CASPuck.ShowInputBlocker();
cASModel.Gender = cASAgeGenderFlags;
CASController singleton = CASController.Singleton;
singleton.OnSimFirstNameChanged(cASModel.FirstName, cASModel.LastName, cASModel.Age, cASAgeGenderFlags, "Gemini");
}
this.SetupWindowHeight();
}

private void OnNameTextEditChange(WindowBase sender, UITextChangeEventArgs eventArgs)
{
ICASModel cASModel = Responder.Instance.CASModel;
CASController singleton = CASController.Singleton;
if (sender.ID == 98277121u)
{
cASModel.FirstName = sender.Caption;
}
else
{
cASModel.LastName = sender.Caption;
}
if (sender == this.mFirstNameTextEdit && singleton.OnSimFirstNameChanged != null)
{
singleton.OnSimFirstNameChanged(this.mFirstNameTextEdit.Caption, cASModel.LastName, cASModel.Age, cASModel.Gender, cASModel.Zodiac.ToString());
}
if (sender == this.mLastNameTextEdit && singleton.OnSimLastNameChanged != null)
{
singleton.OnSimLastNameChanged(cASModel.FirstName, this.mLastNameTextEdit.Caption, cASModel.Age, cASModel.Gender, cASModel.Zodiac.ToString());
}
}

private void OnNameTextEditAccept(WindowBase sender, UITextEditAcceptEventArgs eventArgs)
{
sender.Caption = sender.Caption.Trim();
ICASModel cASModel = Responder.Instance.CASModel;
if (sender.ID == 98277121u)
{
cASModel.FirstName = sender.Caption;
}
else
{
cASModel.LastName = sender.Caption;
}
CASController singleton = CASController.Singleton;
singleton.OnSimFirstNameChanged(cASModel.FirstName, cASModel.LastName, cASModel.Age, cASModel.Gender, "Gemini");
}

private void OnNameTextEditValidate(WindowBase sender, UITextValidateEventArgs eventArgs)
{
eventArgs.TextValidated = CASController.IsNameValid(eventArgs.TextChange);
eventArgs.Handled = true;
this.mInvalidCharacterWindow.Visible = !eventArgs.TextValidated;
}

private void OnSimPreviewChange(int simIndex)
{
this.OnDynamicUpdateCurrentSimThumbnail();
this.UpdateFromModel();
}

private void OnSimAddedToHousehold(int simIndex)
{
this.UpdateFromModel();
}

private void OnSimDeleted(int newSimIndex)
{
this.UpdateFromModel();
}

private void OnSimLoaded(ResourceKey key)
{
this.OnDynamicUpdateCurrentSimThumbnail();
this.UpdateFromModel();
}

private void OnSimRandomized()
{
this.OnDynamicUpdateCurrentSimThumbnail();
this.UpdateFromModel();
}

private void OnSimPreviewLoadFinished()
{
this.OnDynamicUpdateCurrentSimThumbnail();
this.UpdateFromModel();
}

private void OnSimAgeGenderChanged(CASAgeGenderFlags age, CASAgeGenderFlags gender)
{
this.UpdateAgeTooltip();
CASPuck.HideInputBlockerWhenReady();
}

private void OnNameTextEditTab(WindowBase sender, UIEventArgs args)
{
if (sender == this.mFirstNameTextEdit)
{
if (!this.mLastNameTextEdit.Enabled)
{
CASBasics.OnTextEditFirstMouseDown(this.mLastNameTextEdit, null);
}
UIManager.SetFocus(InputContext.kICKeyboard, this.mLastNameTextEdit);
this.mLastNameTextEdit.CursorIndex = (uint)this.mLastNameTextEdit.Caption.Length;
return;
}
if (sender == this.mLastNameTextEdit)
{
if (!this.mFirstNameTextEdit.Enabled)
{
CASBasics.OnTextEditFirstMouseDown(this.mFirstNameTextEdit, null);
}
UIManager.SetFocus(InputContext.kICKeyboard, this.mFirstNameTextEdit);
this.mFirstNameTextEdit.CursorIndex = (uint)this.mFirstNameTextEdit.Caption.Length;
}
}

private void OnSkinToneSliderChanged(WindowBase sender, UIValueChangedEventArgs eventArgs)
{
Slider slider = sender as Slider;
if (slider == null)
{
return;
}
float num = (float)slider.Value / 256f;
if (num != this.mSkin)
{
ICASModel cASModel = Responder.Instance.CASModel;
IUIManager iUIManager = (IUIManager)AppDomain.CurrentDomain.GetData("UIManager");
this.mSkin = num;
ResourceKey skinToneRampKey = CASUtils.GetSkinToneRampKey(cASModel.GetSkinToneKey());
skinToneRampKey.TypeId = 796721156u;
Color shadeColor = iUIManager.PickPixel(skinToneRampKey, this.mSkin, this.mSkin);
this.mSkinToneSwatch.ShadeColor = shadeColor;
cASModel.RequestSkinTone(this.mSkin, this.mFirstSliderChange);
this.mFirstSliderChange = false;
}
}

private void OnThinHeavySliderChanged(WindowBase sender, UIValueChangedEventArgs eventArgs)
{
Slider slider = sender as Slider;
if (slider == null)
{
return;
}
int value = slider.Value;
float num;
float num2;
if (value < 128)
{
num = 0f;
num2 = (float)(128 - value) / 128f;
}
else
{
num2 = 0f;
num = (float)(value - 128) / 128f;
}
ICASModel cASModel = Responder.Instance.CASModel;
float morphThin = cASModel.GetMorphThin();
float morphFat = cASModel.GetMorphFat();
if (num2 != morphThin || num != morphFat)
{
cASModel.RequestMorphThinFat(num2, num, this.mFirstSliderChange);
this.mFirstSliderChange = false;
}
}

private void OnMuscleSliderChanged(WindowBase sender, UIValueChangedEventArgs eventArgs)
{
Slider slider = sender as Slider;
if (slider == null)
{
return;
}
ICASModel cASModel = Responder.Instance.CASModel;
float num = (float)slider.Value / 256f;
if (num != cASModel.GetMorphFit())
{
cASModel.RequestMorphFit(num, this.mFirstSliderChange);
this.mFirstSliderChange = false;
}
}

private void OnMuscleDefinitionSliderChanged(WindowBase sender, UIValueChangedEventArgs eventArgs)
{
Slider slider = sender as Slider;
if (slider == null)
{
return;
}
ICASModel cASModel = Responder.Instance.CASModel;
float value = (float)slider.Value / 256f;
cASModel.RequestSecondaryNormalMapWeight(0u, value, false);
}

private void OnBreastSizeSliderChanged(WindowBase sender, UIValueChangedEventArgs eventArgs)
{
Slider slider = sender as Slider;
if (slider == null)
{
return;
}
ICASModel cASModel = Responder.Instance.CASModel;
if (cASModel.Gender == CASAgeGenderFlags.Female)
{
float num = (float)slider.Value / 256f;
this.mBreastSizeBlendData.Value = num;
float num2 = num;
if (num2 < 0f)
{
num2 = 0f;
}
else if (num2 < 0.5f)
{
num2 *= 2f;
}
else
{
num2 = 1.5f - num2;
}
cASModel.RequestSecondaryNormalMapWeight(1u, num2, true);
}
}

private void OnSliderMouseUp(WindowBase sender, UIMouseEventArgs eventArgs)
{
if (!this.mFirstSliderChange && CASController.Singleton.OnBodyTypeChanged != null)
{
CASController.Singleton.OnBodyTypeChanged();
}
this.mFirstSliderChange = false;
}

private void OnSliderMouseDown(WindowBase sender, UIMouseEventArgs eventArgs)
{
this.mFirstSliderChange = true;
}

private void SetSkinToneRamp(ResourceKey myKey)
{
if (myKey.InstanceId != 0uL)
{
IUIManager iUIManager = (IUIManager)AppDomain.CurrentDomain.GetData("UIManager");
ResourceKey skinToneRampKey = CASUtils.GetSkinToneRampKey(myKey);
if (skinToneRampKey == ResourceKey.kInvalidResourceKey)
{
return;
}
this.mCustomContentIcon.ContentType = UIUtils.GetCustomContentType(myKey);
skinToneRampKey.TypeId = 796721156u;
Color shadeColor = iUIManager.PickPixel(skinToneRampKey, this.mSkin, this.mSkin);
this.mSkinToneSwatch.ShadeColor = shadeColor;
Window window = base.GetChildByID(98277137u, true) as Window;
if (window != null)
{
ImageDrawable imageDrawable = window.Drawable as ImageDrawable;
if (imageDrawable != null)
{
imageDrawable.Image = UIManager.LoadUIImage(skinToneRampKey);
window.Invalidate();
}
}
}
}

private void OnUndo()
{
this.UpdateFromModel();
}

private void OnRedo()
{
this.UpdateFromModel();
}

private void OnFadeFinished(WindowBase sender, UIHandledEventArgs args)
{
if (!base.Visible)
{
Responder.Instance.CASModel.UndoSelected -= new UndoRedoSelected(this.OnUndo);
Responder.Instance.CASModel.RedoSelected -= new UndoRedoSelected(this.OnRedo);
if (this.UINodeShutdown != null)
{
this.UINodeShutdown(this.mTargetState);
}
CASController.Singleton.Activate(false);
Simulator.AddObject(new OneShotFunctionTask(new Function(CASBasics.Unload)));
return;
}
this.mFadeEffect.Duration = this.mFadeTime;
}

private void OnSupernaturalTypeButtonPressed(WindowBase sender, UIHandledEventArgs args)
{
this.mSupernaturalTypePopup.Visible = !this.mSupernaturalTypePopup.Visible;
}

private void OnOccultTypeSelected(WindowBase sender, UIHandledEventArgs args)
{
CASController singleton = CASController.Singleton;
singleton.OnOccultAboutToChange((OccultTypes)sender.Tag);
Simulator.AddObject(new OneShotFunctionWithParams(new FunctionWithParam(this.DoSelectOccultType), sender.Tag));
}

private void OnDynamicUpdateCurrentSimThumbnail()
{
Simulator.AddObject(new OneShotFunctionTask(new Function(this.DynamicUpdateCurrentSimThumbnailTask)));
}

private void OnSupernaturalBasicsClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
this.mHumanBasicsWindow.Visible = false;
this.mFairWingSelectionWindow.Visible = false;
this.mGhostDeathTypeSelectionWindow.Visible = false;
this.mHumanBasicsWindow.Enabled = false;
this.mFairWingSelectionWindow.Enabled = false;
this.mGhostDeathTypeSelectionWindow.Enabled = false;
OccultTypes currentOccultType = Responder.Instance.CASModel.CurrentOccultType;
if (currentOccultType != OccultTypes.Ghost)
{
if (currentOccultType == OccultTypes.Fairy)
{
this.mFairWingSelectionWindow.Visible = true;
this.mFairWingSelectionWindow.Enabled = true;
this.mFairyWingSelectionItemGrid.Clear();
this.PopulateFairyWingItemGrid();
}
}
else
{
this.mGhostDeathTypeSelectionWindow.Visible = true;
this.mGhostDeathTypeSelectionWindow.Enabled = true;
this.UpdateGhostDeathTypeFromModel();
this.mGhostDeathTypeItemGrid.Clear();
this.PopulateGhostGrid();
}
this.SetupWindowHeight();
}

private void OnHumanBasicsClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
{
this.mHumanBasicsWindow.Visible = true;
this.mHumanBasicsWindow.Enabled = true;
this.mFairWingSelectionWindow.Visible = false;
this.mGhostDeathTypeSelectionWindow.Visible = false;
this.mFairWingSelectionWindow.Enabled = false;
this.mGhostDeathTypeSelectionWindow.Enabled = false;
this.SetupWindowHeight();
}

private void OnGhostDeathTypeDropDown_SelectionChange(WindowBase sender, UISelectionChangeEventArgs eventArgs)
{
}

private void OnDeathTypeButtonClick(WindowBase sender, UIButtonClickEventArgs args)
{
string text = (string)sender.Tag;
text.Replace(" ", string.Empty);
Responder.Instance.CASModel.GhostDeathTypeString = text;
this.OnDynamicUpdateCurrentSimThumbnail();
Window window;
foreach (ItemGridCellItem current in this.mGhostDeathTypeItemGrid.Items)
{
WindowBase mWin = current.mWin;
if (mWin != null)
{
window = (mWin.GetChildByID(231002384u, true) as Window);
window.Visible = false;
}
}
Button button = sender as Button;
if (button != null)
{
button.Selected = true;
}
window = (sender.Parent.GetChildByID(231002384u, true) as Window);
window.Visible = true;
}

private void OnColorPickerClick(WindowBase sender, UIButtonClickEventArgs args)
{
this.mOriginalFairyWingColor = Responder.Instance.CASModel.CurrentWingColor;
this.mOriginalWingType = Responder.Instance.CASModel.CurrentWingType;
Simulator.AddObject(new OneShotFunctionTask(new Function(this.ShowColorPickerTask)));
args.Handled = true;
}

private void OnSupernaturalTypePopupFocusLost(WindowBase sender, UIEventArgs args)
{
if (this.mSupernaturalTypePopup.Visible)
{
Vector2 vector = UIManager.GetCursorPosition();
vector = this.mSupernaturalTypePopup.ScreenToWindow(vector);
if (!this.mSupernaturalTypePopup.Area.Contains(vector))
{
this.HidePopup();
}
}
}

private void ShowColorPickerTask()
{
CASSingleColorPickerDialog.OnColorChanged += new CASSingleColorPickerDialog.ColorChanged(this.OnColorChanged);
CASSingleColorPickerDialog.OnDialogClosed += new CASSingleColorPickerDialog.DialogClosed(this.OnDialogClosed);
Vector3 currentWingColor = Responder.Instance.CASModel.CurrentWingColor;
Color color = new Color((int)(currentWingColor.x * 255f), (int)(currentWingColor.y * 255f), (int)(currentWingColor.z * 255f), 1);
string titleText = CASBasics.LocalizeEP07String("FairyWingColorPicker", new object[0]);
CASSingleColorPickerDialog.Show(color, titleText, false, null);
CASSingleColorPickerDialog.OnColorChanged -= new CASSingleColorPickerDialog.ColorChanged(this.OnColorChanged);
CASSingleColorPickerDialog.OnDialogClosed -= new CASSingleColorPickerDialog.DialogClosed(this.OnDialogClosed);
}

private void OnColorChanged(Color color)
{
Vector3 vector = new Vector3((float)color.Red / 255f, (float)color.Green / 255f, (float)color.Blue / 255f);
this.mPerceivedLuminance = Color.CalculatePerceivedLuminence(vector);
Responder.Instance.CASModel.SetFairyWingColor(vector, this.mPerceivedLuminance);
}

private void OnDialogClosed(bool accept, bool colorChanged, Color color)
{
if (colorChanged)
{
ICASModel arg_10_0 = Responder.Instance.CASModel;
if (accept)
{
Vector3 vector = new Vector3((float)color.Red / 255f, (float)color.Green / 255f, (float)color.Blue / 255f);
this.mPerceivedLuminance = Color.CalculatePerceivedLuminence(vector);
Responder.Instance.CASModel.RequestSetFairyWings(vector, this.mOriginalFairyWingColor);
return;
}
Responder.Instance.CASModel.SetFairyWingColor(this.mOriginalFairyWingColor, this.mPerceivedLuminance);
Responder.Instance.CASModel.SetFairyWingType(this.mOriginalWingType);
}
}

private void DisableSliderVisibility(OccultTypes currentType)
{
this.SetupWindowHeight();
}

private void EnableSliderVisibility(OccultTypes currentType)
{
this.SetupWindowHeight();
}

private void DoSelectOccultType(object newType)
{
CASPuck.ShowInputBlocker();
OccultTypes occultTypes = (OccultTypes)newType;
if (occultTypes == OccultTypes.Werewolf && !CASBasics.mShowedWerewolfMsg)
{
CASBasics.mShowedWerewolfMsg = true;
string titleText = CASBasics.LocalizeEP07String("WerewolfSelectedTNSText", new object[0]);
StyledNotification.Format format = new StyledNotification.Format(titleText, StyledNotification.NotificationStyle.kSystemMessage);
StyledNotification.Show(format, "Select_Werewolf");
}
Responder.Instance.CASModel.RequestSetOccultType(occultTypes);
for (int i = 0; i < 30; i++)
{
Simulator.Sleep(0u);
}
while (Responder.Instance.CASModel.IsProcessing())
{
Simulator.Sleep(0u);
}
this.UpdateOccultDependentUI(occultTypes);
Responder.Instance.CASModel.UpdateVisualsToCurrent();
this.SetSupernaturalTypeNameCaption();
this.HidePopup();
this.UpdateFromModel();
this.mGenderFemaleButton.Enabled = true;
this.mGenderMaleButton.Enabled = true;
this.mGenderFemaleButton.TooltipText = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Basics:Female", new object[0]);
this.mGenderMaleButton.TooltipText = Responder.Instance.LocalizationModel.LocalizeString("Ui/Tooltip/CAS/Basics:Male", new object[0]);
CASPuck.HideInputBlockerWhenReadyWithCallback(new Function(this.OnDynamicUpdateCurrentSimThumbnail));
}

private void UpdateVisualOverrides()
{
OccultTypes currentOccultType = Responder.Instance.CASModel.CurrentOccultType;
if (currentOccultType <= OccultTypes.Genie)
{
if (currentOccultType != OccultTypes.None)
{
if (currentOccultType == OccultTypes.Vampire)
{
Responder.Instance.CASModel.SetVisualOverride(OccultTypes.Vampire);
return;
}
if (currentOccultType != OccultTypes.Genie)
{
return;
}
Responder.Instance.CASModel.SetVisualOverride(OccultTypes.Genie);
return;
}
}
else if (currentOccultType <= OccultTypes.Ghost)
{
if (currentOccultType == OccultTypes.Werewolf)
{
Responder.Instance.CASModel.SetVisualOverride(OccultTypes.Werewolf);
return;
}
if (currentOccultType != OccultTypes.Ghost)
{
return;
}
Responder.Instance.CASModel.SetVisualOverride(OccultTypes.Ghost);
return;
}
else if (currentOccultType != OccultTypes.Fairy && currentOccultType != OccultTypes.Witch)
{
return;
}
Responder.Instance.CASModel.SetVisualOverride(OccultTypes.None);
}

private void UpdateGhostDeathTypeFromModel()
{
}

private void UpdateOccultDependentUI(OccultTypes oldType)
{
this.mHumanBasicsButton.Visible = false;
this.mGhostBasicsButton.Visible = false;
this.mFairyBasicsButton.Visible = false;
this.mHumanBasicsButton.Enabled = false;
this.mGhostBasicsButton.Enabled = false;
this.mFairyBasicsButton.Enabled = false;
OccultTypes currentOccultType = Responder.Instance.CASModel.CurrentOccultType;
if (currentOccultType != OccultTypes.Ghost)
{
if (currentOccultType == OccultTypes.Fairy)
{
this.mHumanBasicsButton.Visible = true;
this.mFairyBasicsButton.Visible = true;
this.mHumanBasicsButton.Enabled = true;
this.mFairyBasicsButton.Enabled = true;
}
}
else
{
this.mHumanBasicsButton.Visible = true;
this.mGhostBasicsButton.Visible = true;
this.mHumanBasicsButton.Enabled = true;
this.mGhostBasicsButton.Enabled = true;
}
this.UpdateAgeSelectionButtons();
}

private void UpdateAgeSelectionButtons()
{
OccultTypes currentOccultType = Responder.Instance.CASModel.CurrentOccultType;
if (currentOccultType <= OccultTypes.Genie)
{
if (currentOccultType != OccultTypes.None && currentOccultType != OccultTypes.Vampire && currentOccultType != OccultTypes.Genie)
{
return;
}
}
else if (currentOccultType <= OccultTypes.Ghost)
{
if (currentOccultType != OccultTypes.Werewolf)
{
if (currentOccultType != OccultTypes.Ghost)
{
return;
}
}
else
{
if (this.mWerewolfIsTransformed)
{
this.mAgeToddlerButton.Enabled = false;
this.mAgeChildButton.Enabled = false;
this.mAgeTeenButton.Enabled = false;
this.mAgeYoungAdultButton.Enabled = false;
this.mAgeAdultButton.Enabled = false;
this.mAgeElderButton.Enabled = false;
this.UpdateAgeTooltip();
return;
}
this.mAgeToddlerButton.Enabled = true;
this.mAgeChildButton.Enabled = true;
this.mAgeTeenButton.Enabled = true;
this.mAgeYoungAdultButton.Enabled = true;
this.mAgeAdultButton.Enabled = true;
this.mAgeElderButton.Enabled = true;
return;
}
}
else if (currentOccultType != OccultTypes.Fairy && currentOccultType != OccultTypes.Witch)
{
return;
}
this.mAgeToddlerButton.Enabled = true;
this.mAgeChildButton.Enabled = true;
this.mAgeTeenButton.Enabled = true;
this.mAgeYoungAdultButton.Enabled = true;
this.mAgeAdultButton.Enabled = true;
this.mAgeElderButton.Enabled = true;
}

private void HidePopup()
{
this.mSupernaturalTypePopup.Visible = false;
}

private void SetSupernaturalTypeNameCaption()
{
OccultTypes currentOccultType = Responder.Instance.CASModel.CurrentOccultType;
string name = currentOccultType.ToString();
if (currentOccultType == OccultTypes.None)
{
name = 0.ToString();
}
this.mSupernaturalTypeName.Caption = CASBasics.LocalizeEP07String(name, new object[0]);
}

private void UpdateFromModel()
{
Simulator.AddObject(new OneShotFunctionTask(new Function(this.HandleUpdateFromModel)));
}

private void HandleUpdateFromModel()
{
ICASModel cASModel = Responder.Instance.CASModel;
while (cASModel.IsProcessing())
{
Simulator.Sleep(0u);
}
this.mFirstNameTextEdit.Caption = cASModel.FirstName;
this.mLastNameTextEdit.Caption = cASModel.LastName;
this.SetSupernaturalTypeNameCaption();
Responder.Instance.CASModel.UpdateVisualsToCurrent();
this.UpdateOccultDependentUI(cASModel.CurrentOccultType);
this.SetupControlValues();
}

private void UpdateAgeTooltip()
{
ILocalizationModel localizationModel = Responder.Instance.LocalizationModel;
CASAgeGenderFlags gender = Responder.Instance.CASModel.Gender;
if (gender != CASAgeGenderFlags.Male && gender == CASAgeGenderFlags.Female)
{
this.mAgeYoungAdultButton.TooltipText = localizationModel.LocalizeString("UI/Feedback/CAS:YoungAdult_Female", new object[0]);
this.mAgeAdultButton.TooltipText = localizationModel.LocalizeString("UI/Feedback/CAS:Adult_Female", new object[0]);
this.mAgeElderButton.TooltipText = localizationModel.LocalizeString("UI/Feedback/CAS:Elder_Female", new object[0]);
}
else
{
this.mAgeYoungAdultButton.TooltipText = localizationModel.LocalizeString("UI/Feedback/CAS:YoungAdult", new object[0]);
this.mAgeAdultButton.TooltipText = localizationModel.LocalizeString("UI/Feedback/CAS:Adult", new object[0]);
this.mAgeElderButton.TooltipText = localizationModel.LocalizeString("UI/Feedback/CAS:Elder", new object[0]);
}
if (Responder.Instance.CASModel.CurrentOccultType == OccultTypes.Werewolf)
{
if (this.mWerewolfIsTransformed)
{
this.mAgeToddlerButton.TooltipText = CASBasics.LocalizeEP07Tooltip("DisabledWhileTransformed", new object[0]);
this.mAgeChildButton.TooltipText = CASBasics.LocalizeEP07Tooltip("DisabledWhileTransformed", new object[0]);
this.mAgeTeenButton.TooltipText = CASBasics.LocalizeEP07Tooltip("DisabledWhileTransformed", new object[0]);
this.mAgeYoungAdultButton.TooltipText = CASBasics.LocalizeEP07Tooltip("DisabledWhileTransformed", new object[0]);
this.mAgeAdultButton.TooltipText = CASBasics.LocalizeEP07Tooltip("DisabledWhileTransformed", new object[0]);
this.mAgeElderButton.TooltipText = CASBasics.LocalizeEP07Tooltip("DisabledWhileTransformed", new object[0]);
return;
}
this.mAgeToddlerButton.TooltipText = localizationModel.LocalizeString(7910245267444548691uL);
this.mAgeChildButton.TooltipText = localizationModel.LocalizeString(500530120883980433uL);
this.mAgeTeenButton.TooltipText = localizationModel.LocalizeString(14567006414377803977uL);
}
}

private void DynamicUpdateCurrentSimThumbnailTask()
{
if (CASBasics.gSingleton == null)
{
return;
}
ICASModel cASModel = Responder.Instance.CASModel;
while (cASModel.IsProcessing())
{
Simulator.Sleep(0u);
}
this.DynamicUpdateCurrentSimThumbnail();
}

public void DynamicUpdateCurrentSimThumbnail()
{
if (CASBasics.gSingleton == null)
{
return;
}
try
{
ICASModel cASModel = Responder.Instance.CASModel;
ISimDescription currentSimDescription = cASModel.CurrentSimDescription;
int arg_26_0 = cASModel.PreviewSimIndex;
if (this.mSupernaturalTypeButton != null && currentSimDescription != null)
{
MultiDrawable multiDrawable = this.mSupernaturalTypeButton.Drawable as MultiDrawable;
if (multiDrawable != null)
{
ImageDrawable imageDrawable = multiDrawable[1u] as ImageDrawable;
if (imageDrawable != null)
{
OccultTypes currentOccultType = Responder.Instance.CASModel.CurrentOccultType;
string text = "Select_";
if (currentOccultType == OccultTypes.None)
{
text += "Human";
}
else
{
text += Responder.Instance.CASModel.CurrentOccultType.ToString();
}
imageDrawable.Image = UIManager.LoadUIImage(ResourceKey.CreatePNGKey(text, 0u));
this.mSupernaturalTypeButton.Invalidate();
}
}
}
}
catch (Exception)
{
}
}

public void SetState(CASState state)
{
CASMidState mMidState = state.mMidState;
if (mMidState == CASMidState.Basics)
{
Responder.Instance.CASModel.UndoSelected -= new UndoRedoSelected(this.OnUndo);
Responder.Instance.CASModel.RedoSelected -= new UndoRedoSelected(this.OnRedo);
Responder.Instance.CASModel.UndoSelected += new UndoRedoSelected(this.OnUndo);
Responder.Instance.CASModel.RedoSelected += new UndoRedoSelected(this.OnRedo);
CASController.Singleton.mCurrUINode = this;
CASController.Singleton.SetFullbodyCam(true);
return;
}
Audio.StartSound("ui_hardwindow_close");
this.mTargetState = state;
if (this.mFadeEffect == null || !base.Visible)
{
Responder.Instance.CASModel.UndoSelected -= new UndoRedoSelected(this.OnUndo);
Responder.Instance.CASModel.RedoSelected -= new UndoRedoSelected(this.OnRedo);
if (this.UINodeShutdown != null)
{
this.UINodeShutdown(state);
}
CASController.Singleton.Activate(false);
CASBasics.Unload();
return;
}
base.Visible = false;
}

public void Activate(bool fastTransition)
{
if (this.mFadeEffect != null)
{
if (fastTransition)
{
this.mFadeEffect.Duration = 0f;
}
else
{
this.mFadeEffect.Duration = this.mFadeTime;
}
}
base.Visible = true;
Audio.StartSound("ui_hardwindow_open");
}
}
}

I did not even change it yet only decompiled.
Scholar
#23 Old 17th Jun 2017 at 10:41 PM
Wow that's such a huge mod.
It sounds like you need the unprotected DLL files instead of the ones you extract from your game root directory.

https://github.com/Chain-Reaction/N.../Sims3/Compiler

Download the files from this link. Use these files instead of the ones we normally use.
Virtual gardener
staff: administrator
#24 Old 17th Jun 2017 at 11:50 PM
I agree with skydome, first try the unprotected DLL files, (so don't use the ones you already exported!!, the one that can be found in-game!) But I do have one question, why are you trying to re-compile something that's already been compiled? Because if you will compile it now, (IF you manage to succeed in compiling it, and getting rid of the error of course ) it will certainly break your CAS.
Lab Assistant
Original Poster
#25 Old 18th Jun 2017 at 12:30 AM
Quote: Originally posted by skydome
Wow that's such a huge mod.
It sounds like you need the unprotected DLL files instead of the ones you extract from your game root directory.

https://github.com/Chain-Reaction/N.../Sims3/Compiler

Download the files from this link. Use these files instead of the ones we normally use.

I can not use them, since I'm doing mod on an earlier version of the game, and then gradually I'll get to the latest version. Can I download non-protected dll for version 1.38.151 for example?
Quote: Originally posted by Greenplumbbob
I agree with skydome, first try the unprotected DLL files, (so don't use the ones you already exported!!, the one that can be found in-game!) But I do have one question, why are you trying to re-compile something that's already been compiled? Because if you will compile it now, (IF you manage to succeed in compiling it, and getting rid of the error of course ) it will certainly break your CAS.

To show that it's not my fault, what the script does not compile.
Page 1 of 2
Back to top