private static void OnAcceptClick(WindowBase sender, UIButtonClickEventArgs eventArgs) { try { CASTattoo ths = CASTattoo.gSingleton; if (ths.HasAnyPartsInUse()) { Responder.Instance.CASModel.RequestFinalizeCommitPresetToPart(); AdvancedMode = false; ths.PopulateTattooGrid(false, true); ths.mTattooGrid.ShowSelectedItem(false); } else { ths.ClearAllParts(); ths.ClearTemplates(); ths.CurrentPreset.mPresetId = 0x0; ths.CurrentPreset.mPresetString = CASUtils.PartDataGetPreset(ths.mActiveTattooPart.Key, 0x0); AdvancedMode = false; ths.mRemoveTattooOnUndo = true; Responder.Instance.CASModel.RequestUndo(); } eventArgs.Handled = true; } catch (Exception e) { Common.Exception("OnAcceptClick", e); } }
private static void SetActiveTattooType(CASTattoo ths, CASTattoo.TattooID tattooID, bool forceRefresh) { if ((ths.mActiveTattooID != tattooID) || forceRefresh) { ths.mActiveTattooID = tattooID; bool flag = false; foreach (CASPart part in ths.mTattooParts) { if (part.Key.InstanceId == (ulong)ths.mActiveTattooID) { ths.mActiveTattooPart = part; flag = true; break; } } if (flag) { SetTattooCam(ths, ths.mActiveTattooID); ths.UpdateCurrentPreset(); ths.ClearTemplates(); ths.PopulateTattooGrid(true); } } }