public static void OnGridPresetsClick(ItemGrid sender, ItemGridCellClickEvent itemClicked) { try { CASMakeup ths = CASMakeup.gSingleton; if (ths == null) { return; } ths.UpdatePresetState(); if (itemClicked.mTag is ResourceKey) { ResourceKey mTag = (ResourceKey)itemClicked.mTag; ColorInfo info = ColorInfo.FromResourceKey(mTag); CASPart part = (CASPart)ths.mGridMakeupParts.SelectedTag; ths.SetMakeupColors(part, info.Colors, true, false); Audio.StartSound("ui_tertiary_button"); ths.mCurrentPreset = new CASPartPreset(part, null); } } catch (Exception e) { Common.Exception("OnGridPresetsClick", e); } }
public static void OnHornColorGridClicked(ItemGrid sender, ItemGridCellClickEvent itemClicked) { try { CAPUnicorn ths = CAPUnicorn.gSingleton; if (ths == null) { return; } CASPartPreset tag = itemClicked.mTag as CASPartPreset; ths.mCurrentHornColorPreset = tag; // Custom Responder.Instance.CASModel.RequestRemoveCASPart(ths.GetWornHornPart()); Responder.Instance.CASModel.RequestAddCASPart(tag.mPart, false); Responder.Instance.CASModel.RequestCommitPresetToPart(tag.mPart, tag.mPresetString); CustomContentIcon childByID = itemClicked.mWin.GetChildByID(0x23, true) as CustomContentIcon; if (UIUtils.ExtractCustomContentType(childByID.ContentType) == ResourceKeyContentCategory.kInstalled) { ths.mHornColorDeleteButton.Enabled = false; } else { ths.mHornColorDeleteButton.Enabled = true; } Audio.StartSound("ui_tertiary_button"); } catch (Exception e) { Common.Exception("OnHornColorGridClicked", e); } }
public static void OnHornColorGridClicked(ItemGrid sender, ItemGridCellClickEvent itemClicked) { try { CAPUnicorn ths = CAPUnicorn.gSingleton; if (ths == null) return; CASPartPreset tag = itemClicked.mTag as CASPartPreset; ths.mCurrentHornColorPreset = tag; // Custom Responder.Instance.CASModel.RequestRemoveCASPart(ths.GetWornHornPart()); Responder.Instance.CASModel.RequestAddCASPart(tag.mPart, false); Responder.Instance.CASModel.RequestCommitPresetToPart(tag.mPart, tag.mPresetString); CustomContentIcon childByID = itemClicked.mWin.GetChildByID(0x23, true) as CustomContentIcon; if (UIUtils.ExtractCustomContentType(childByID.ContentType) == ResourceKeyContentCategory.kInstalled) { ths.mHornColorDeleteButton.Enabled = false; } else { ths.mHornColorDeleteButton.Enabled = true; } Audio.StartSound("ui_tertiary_button"); } catch (Exception e) { Common.Exception("OnHornColorGridClicked", e); } }
public static void OnGridPresetsClick(ItemGrid sender, ItemGridCellClickEvent itemClicked) { try { CASMakeup ths = CASMakeup.gSingleton; if (ths == null) return; ths.UpdatePresetState(); if (itemClicked.mTag is ResourceKey) { ResourceKey mTag = (ResourceKey)itemClicked.mTag; ColorInfo info = ColorInfo.FromResourceKey(mTag); CASPart part = (CASPart)ths.mGridMakeupParts.SelectedTag; ths.SetMakeupColors(part, info.Colors, true, false); Audio.StartSound("ui_tertiary_button"); ths.mCurrentPreset = new CASPartPreset(part, null); } } catch (Exception e) { Common.Exception("OnGridPresetsClick", e); } }
public static void OnTypesGridItemClicked(WindowBase sender, ItemGridCellClickEvent itemClicked) { try { CASHair ths = CASHair.gSingleton; CASPartPreset part = itemClicked.mTag as CASPartPreset; if (part != null) { if (itemClicked.mButton == MouseKeys.kMouseLeft) { ths.mSavedPresetId = part.mPresetId; if (part.mPresetString != null) { if (part.mPart.Key != ths.GetWornPart().Key) { Responder.Instance.CASModel.RequestAddCASPart(part.mPart, part.mPresetString); } else { Responder.Instance.CASModel.RequestCommitPresetToPart(part.mPart, part.mPresetString); } } ths.mHairStylesGrid.SelectedItem = -1; ths.mDesignButton.Enabled = CASHair.PartIsHat(part.mPart); ths.mHairTypesGrid.RemoveTempItem(); ths.mSaveButton.Enabled = false; ObjectDesigner.SetCASPart(part.mPart.Key); if (UIUtils.GetCustomContentType(part.mPart.Key, part.mPresetId) == ResourceKeyContentCategory.kLocalUserCreated) { ths.mHatsDeleteButton.Enabled = true; ths.mHatsShareButton.Enabled = true; ths.mUndoOnDelete = true; } else { ths.mUndoOnDelete = false; ths.mHatsDeleteButton.Enabled = false; ths.mHatsShareButton.Enabled = false; } Audio.StartSound("ui_tertiary_button"); } else if (itemClicked.mButton == MouseKeys.kMouseRight) { CASBase.Blacklist(new CASParts.Wrapper(part.mPart), ((itemClicked.mModifiers & Modifiers.kModifierMaskControl) == Modifiers.kModifierMaskControl), PopulateTypesGrid); } } } catch (Exception e) { Common.Exception("OnTypesGridItemMouseDown", e); } }
private void OnGridItemDoubleClickedEx(ItemGrid sender, ItemGridCellClickEvent itemClicked) { try { bool clear = false; if (!mBlockInput) { ISimTravelInfo mTag = itemClicked.mTag as ISimTravelInfo; if (mActivator == mTag) { if (sender.ID == 0xbd) { clear = true; mSimTravelInfoList[0].Add(mActivator); mSimTravelInfoList[0].AddRange(mSimTravelInfoList[1]); mSimTravelInfoList[1].Clear(); } else { while (mSimTravelInfoList[0].Remove(mActivator)) { ; } PopulateGrids(); return; } } } OnGridItemDoubleClicked(sender, itemClicked); if (clear) { mSimListGrid[0x1].Clear(); } if (GameStates.sTravelData != null) { mAcceptButton.Enabled = (mSimListGrid[1].Count == GameStates.sTravelData.mTravelerIds.Count); } } catch (Exception e) { Common.Exception("OnGridItemDoubleClickedEx", e); } }
public static void OnGridPartsClick(ItemGrid sender, ItemGridCellClickEvent args) { try { CASMakeup ths = CASMakeup.gSingleton; if (ths == null) { return; } if (args.mTag is CASPart) { CASModelProxy cASModel = new CASModelProxy(Responder.Instance.CASModel); List <CASPart> wornParts = cASModel.GetWornParts(CASMakeup.sCategory); CASPart tag = (CASPart)args.mTag; if (tag.Key == ths.kInvalidCASPart.Key) { foreach (CASPart wornPart in wornParts) { cASModel.RequestRemoveCASPart(wornPart); } } else if (wornParts.Contains(tag)) { if (args.mButton == MouseKeys.kMouseRight) { cASModel.RequestRemoveCASPart(tag); } else { Color[] makeupColors = ths.GetMakeupColors(CASMakeup.sCategory); ths.SetMakeupColors(tag, makeupColors, false, false); } } else { cASModel.RequestAddCASPart(tag, false); ths.mCurrentPreset = new CASPartPreset(tag, null); } Audio.StartSound("ui_tertiary_button"); } } catch (Exception e) { Common.Exception("OnGridPartsClick", e); } }
public static void OnSimGridClicked(ItemGrid sender, ItemGridCellClickEvent itemClicked) { try { CASLoadSim ths = CASLoadSim.gSingleton; if (ths == null) { return; } ICASModel cASModel = Responder.Instance.CASModel; if (ths.mLoading) { ths.mSimGrid.SelectedItem = ths.mPreviousSelection; } else { if (itemClicked.mTag is CASLoadSim.SimDescriptionKeyPair) { CASLoadSim.SimDescriptionKeyPair tag = (CASLoadSim.SimDescriptionKeyPair)itemClicked.mTag; if (tag.mSimDesc.IsValid) { ths.mCurrSimDescKeyPair = tag; // Custom RequestLoadSim(tag.mSimDesc, false); ths.SetCustomButtonStates(); ths.UpdateTooltips(tag.mSimDesc.Species); } } ths.mPreviousSelection = sender.SelectedItem; ths.mLoading = true; UIManager.SetOverrideCursor(0x1003); Audio.StartSound("ui_secondary_button"); } } catch (Exception e) { Common.Exception("OnSimGridClicked", e); } }
public static void OnSimGridClicked(ItemGrid sender, ItemGridCellClickEvent itemClicked) { try { CASLoadSim ths = CASLoadSim.gSingleton; if (ths == null) return; ICASModel cASModel = Responder.Instance.CASModel; if (ths.mLoading) { ths.mSimGrid.SelectedItem = ths.mPreviousSelection; } else { if (itemClicked.mTag is CASLoadSim.SimDescriptionKeyPair) { CASLoadSim.SimDescriptionKeyPair tag = (CASLoadSim.SimDescriptionKeyPair)itemClicked.mTag; if (tag.mSimDesc.IsValid) { ths.mCurrSimDescKeyPair = tag; // Custom RequestLoadSim(tag.mSimDesc, false); ths.SetCustomButtonStates(); ths.UpdateTooltips(tag.mSimDesc.Species); } } ths.mPreviousSelection = sender.SelectedItem; ths.mLoading = true; UIManager.SetOverrideCursor(0x1003); Audio.StartSound("ui_secondary_button"); } } catch (Exception e) { Common.Exception("OnSimGridClicked", e); } }
private void OnDestinationGridItemClickedEx(ItemGrid sender, ItemGridCellClickEvent itemClicked) { try { bool wasClear = (mSimListGrid[1].Count == 0); Audio.StartSound("ui_secondary_button"); UpdateDestination(itemClicked.mTag as IDestinationInfo); if (wasClear) { mSimListGrid[1].Clear(); } if (GameStates.sTravelData != null) { mAcceptButton.Enabled = (mSimListGrid[1].Count == GameStates.sTravelData.mTravelerIds.Count); } } catch (Exception e) { Common.Exception("OnDestinationGridItemClicked", e); } }
private void OnPresetGridSelect(ItemGrid sender, ItemGridCellClickEvent args) { CASPartPreset mTag = args.mTag as CASPartPreset; if (mTag != null) { this.SelectItem(this.GetCurrentTemplatePart(), mTag); CustomContentIcon childByID = args.mWin.GetChildByID(0x23, true) as CustomContentIcon; if (childByID != null) { this.mDeleteButton.Enabled = childByID.Localuser; } Audio.StartSound("ui_tertiary_button"); } }
private void OnPartsGridSelect(ItemGrid sender, ItemGridCellClickEvent args) { this.mSaveButton.Enabled = false; if (args.mTag is CASPart) { sender.RemoveTempItem(); CASPart mTag = (CASPart) args.mTag; if (mTag.Key == this.kInvalidCASPart.Key) { this.ClearAllParts(); this.ClearTemplates(); this.CurrentPreset.mPresetId = 0x0; this.mDeleteButton.Enabled = false; this.mShareButton.Enabled = false; this.mTattooPresetsGrid.SelectedItem = 0xffffffff; this.mTattooPresetsGrid.Clear(); if (!this.AdvancedMode) { List<CASPart> wornParts = Responder.Instance.CASModel.GetWornParts(BodyTypes.Tattoo); if (((wornParts == null) || (wornParts.Count == 0x0)) || ((wornParts.Count == 0x1) && (wornParts[0x0].Key == this.mActiveTattooPart.Key))) { this.mRemoveAllButton.Enabled = false; } this.CurrentPreset.mPresetString = CASUtils.PartDataGetPreset(this.mActiveTattooPart.Key, 0x0); Responder.Instance.CASModel.RequestRemoveCASPart(this.mActiveTattooPart); } else { this.ActiveLayer = 0x0; this.SelectItem(this.mTemplateParts[this.ActiveLayer].mTemplatePart, null); } Audio.StartSound("ui_tertiary_button"); } else if (args.mWin.Enabled) { CASPartPreset preset = new CASPartPreset(mTag, CASUtils.PartDataGetPresetId(mTag.Key, 0x0), CASUtils.PartDataGetPreset(mTag.Key, 0x0)); this.CurrentPreset.mPresetId = 0x0; this.mScaleSlider.Value = (this.mScaleSlider.MaxValue - this.mScaleSlider.MinValue) * this.mTunedScales[this.mActiveTattooID]; this.UpdateScaleFromSlider(); if (!this.AdvancedMode) { this.ClearTemplates(); this.ClearAllParts(); this.mOpacitySlider.Value = (this.mOpacitySlider.MaxValue + this.mOpacitySlider.MinValue) / 0x2; } this.SetPart(mTag, this.ActiveLayer); this.SelectItem(mTag, preset); CustomContentIcon childByID = args.mWin.GetChildByID(0x23, true) as CustomContentIcon; if (childByID != null) { this.mDeleteButton.Enabled = childByID.Localuser; this.mShareButton.Enabled = this.mDeleteButton.Enabled; } this.PopulatePresetsGrid(mTag, this.mFilter); } else { for (int i = 0x0; i < 0x5L; i++) { if (this.mLayerButtons[i].Tag is CASPart) { CASPart tag = (CASPart) this.mLayerButtons[i].Tag; if (tag.Key == mTag.Key) { this.ActiveLayer = i; break; } } } } } else { CASPartPreset preset2 = args.mTag as CASPartPreset; if (preset2 != null) { ICASModel cASModel = Responder.Instance.CASModel; this.ClearTemplates(); this.ClearAllParts(); this.UpdateCurrentDataFromCompositePreset(preset2); this.UpdateModel(!this.AdvancedMode); this.mTattooPresetsGrid.SelectedItem = 0xffffffff; this.mTattooPresetsGrid.Clear(); this.mSaveButton.Enabled = false; CustomContentIcon icon2 = args.mWin.GetChildByID(0x23, true) as CustomContentIcon; if ((icon2 != null) && !this.AdvancedMode) { this.mDeleteButton.Enabled = icon2.Localuser; this.mShareButton.Enabled = this.mDeleteButton.Enabled; } if (this.AdvancedMode) { this.ActiveLayer = 0x0; this.AddUndoRedoStep(); } if (!this.AdvancedMode) { this.mRemoveAllButton.Enabled = true; } Audio.StartSound("ui_tertiary_button"); } } this.UpdateLayerEditButtons(); }
public static void OnGridPartsClick(ItemGrid sender, ItemGridCellClickEvent args) { try { CASMakeup ths = CASMakeup.gSingleton; if (ths == null) return; if (args.mTag is CASPart) { CASModelProxy cASModel = new CASModelProxy(Responder.Instance.CASModel); List<CASPart> wornParts = cASModel.GetWornParts(CASMakeup.sCategory); CASPart tag = (CASPart)args.mTag; if (tag.Key == ths.kInvalidCASPart.Key) { foreach (CASPart wornPart in wornParts) { cASModel.RequestRemoveCASPart(wornPart); } } else if (wornParts.Contains(tag)) { if (args.mButton == MouseKeys.kMouseRight) { cASModel.RequestRemoveCASPart(tag); } else { Color[] makeupColors = ths.GetMakeupColors(CASMakeup.sCategory); ths.SetMakeupColors(tag, makeupColors, false, false); } } else { cASModel.RequestAddCASPart(tag, false); ths.mCurrentPreset = new CASPartPreset(tag, null); } Audio.StartSound("ui_tertiary_button"); } } catch (Exception e) { Common.Exception("OnGridPartsClick", e); } }