public Window_ViewerEditProp(EditPropsActions action, EditProp prop, Viewer viewer = null) { this.action = action; this.prop = prop; this.doCloseButton = true; Viewers.RefreshViewers(); if (viewer == null) { allViewers = true; viewerBuffer = "<b>All Viewers</b>"; } else { allViewers = false; this.viewer = viewer; viewerBuffer = "<b>" + viewer.username + "</b>"; } if (viewer != null && action == EditPropsActions.Set) { if (prop == EditProp.Coins) { amount = viewer.GetViewerCoins(); } else if (prop == EditProp.Karma) { amount = viewer.GetViewerKarma(); } } }
public void OpenEditProp(EditPropsActions action, EditProp prop) { Find.WindowStack.TryRemove(typeof(Window_ViewerEditProp)); Window_ViewerEditProp window; if (selectedViewer != null) { window = new Window_ViewerEditProp(action, prop, selectedViewer); } else { window = new Window_ViewerEditProp(action, prop); } Find.WindowStack.Add(window); }