private void Update() { mm = FindObjectOfType <ModMenu>(); if (mm != null) { if (mmAdded == false) { mm.mods.Add(base.gameObject.name); mmAdded = true; } } }
private void PopulateList(List <string> mods) { Dictionary <string, string> modProps = new Dictionary <string, string>(); foreach (string mod in mods) { string modname = ConfigHelper.ModDisplayName(mod); modProps.Add("<b>" + modname + "</b>", mod); } ModMenu.DataSource = modProps; ModMenu.DataBind(); }
public static bool Load(UnityModManager.ModEntry modEntry) { var harmony = HarmonyInstance.Create(modEntry.Info.Id); harmony.PatchAll(); mod = modEntry; ModMenu.AddButton(harmony, "Body Motions...", BtnBodyMotions_Action); BodyTellManager.OnUpdate += HandDotUpdateHook.UpdateTests; return(true); }
public static bool Load(UnityModManager.ModEntry modEntry) { var harmony = HarmonyInstance.Create(modEntry.Info.Id); harmony.PatchAll(); mod = modEntry; config = new ConfigFile(mod); config.Load(); ModMenu.AddButton(harmony, "GUI Appearance...", BtnCustomize_Action); return(true); }
public static bool Load(UnityModManager.ModEntry modEntry) { harmony = HarmonyInstance.Create(modEntry.Info.Id); harmony.PatchAll(); mod = modEntry; config = new ConfigFile(mod); config.Load(); ModMenu.AddButton(harmony, "Saved Body Parts...", SavedBodyParts_Action); pointMenu = new Menu("Saved Body Parts"); pointMenu.SetBackButton(DialogType.OwnProfile); pointMenu.TwoColumns = true; pointMenu.DialogClose += PointMenu_DialogClose; MenuButton mbtn; mbtn = new MenuButton("HeadTop", "(XA0) Hat"); mbtn.Action += Mbtn_Action; pointMenu.Add(mbtn); mbtn = new MenuButton("Head", "(XA1) Head"); mbtn.Action += Mbtn_Action; pointMenu.Add(mbtn); mbtn = new MenuButton("ArmLeft", "(XA2) Left Arm"); mbtn.Action += Mbtn_Action; pointMenu.Add(mbtn); mbtn = new MenuButton("TorsoUpper", "(XA3) Upper Torso"); mbtn.Action += Mbtn_Action; pointMenu.Add(mbtn); mbtn = new MenuButton("ArmRight", "(XA4) Right Arm"); mbtn.Action += Mbtn_Action; pointMenu.Add(mbtn); mbtn = new MenuButton("TorsoLower", "(XA5) Lower Torso"); mbtn.Action += Mbtn_Action; pointMenu.Add(mbtn); mbtn = new MenuButton("LegLeft", "(XA6,8) Left Leg"); mbtn.Action += Mbtn_Action; pointMenu.Add(mbtn); mbtn = new MenuButton("LegRight", "(XA7,9) Right Leg"); mbtn.Action += Mbtn_Action; pointMenu.Add(mbtn); regex = new Regex("^xa([0-9]) ?(.*)$"); regexForIn = new Regex(" in ([0-9]*.?[0-9]*)s?$"); BodyTellManager.ToldByBody += BodyTellManager_ToldByBody; return(true); }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { ModMenu detail = new ModMenu(); detail.menuName = this.txtMenuName.Text.Trim(); detail.menuTarget = this.txtMenuLink.Text.Trim(); detail.isShow = (this.cbIsVisible.Checked == true ? 1 : 0); detail.orderIndex = Convert.ToInt32(this.txtSort.Text.Trim()); detail.parentMenuId = Convert.ToInt32(this.ddlParentMenu.SelectedValue); if (this._menuId != null) { int menuId = Convert.ToInt32(this._menuId); detail.uniqueId = menuId; this._menu.Update(detail); ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('修改成功');layer_close_refresh();</script>"); } else { this._menu.Add(detail); ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('添加成功');layer_close_refresh();</script>"); //JSUtility.ReplaceOpenerParentWindow("menuTree.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindDDL(); if (this._menuId != null) { int menuId = Convert.ToInt32(this._menuId); ModMenu detail = _menu.GetModel(menuId); this.Model = detail; this.txtMenuName.Text = detail.menuName; this.txtMenuLink.Text = detail.menuTarget; this.txtSort.Text = detail.orderIndex.ToString(); this.cbIsVisible.Checked = (detail.isShow == 1 ? true : false); this.ddlParentMenu.SelectedValue = detail.parentMenuId.ToString(); this._pageTitle = "修改菜单项"; } else { txtMenuName.Focus(); } } }
private void BtnDebug(object sender, RoutedEventArgs e) { ModMenu mm = new ModMenu(contentControl, _library); contentControl.Content = mm; }
/// Load GUIStyle public static void Start() { ModMenu.instance = (ModMenu)UnityEngine.Object.FindObjectOfType(typeof(ModMenu)); if (ModMenu.instance != null) { return; } GameObject gameObject = new GameObject(); UnityEngine.Object.DontDestroyOnLoad(gameObject); ModMenu.instance = gameObject.AddComponent <ModMenu>(); if (BgStyle == null) { BgStyle = new GUIStyle(); BgStyle.normal.background = BackTexture; BgStyle.onNormal.background = BackTexture; BgStyle.active.background = BackTexture; BgStyle.onActive.background = BackTexture; BgStyle.normal.textColor = Color.white; BgStyle.onNormal.textColor = Color.white; BgStyle.active.textColor = Color.white; BgStyle.onActive.textColor = Color.white; BgStyle.fontSize = 18; BgStyle.fontStyle = FontStyle.Normal; BgStyle.alignment = TextAnchor.UpperCenter; } if (LabelStyle == null) { LabelStyle = new GUIStyle(); LabelStyle.normal.textColor = Color.white; LabelStyle.onNormal.textColor = Color.white; LabelStyle.active.textColor = Color.white; LabelStyle.onActive.textColor = Color.white; LabelStyle.fontSize = 18; LabelStyle.fontStyle = FontStyle.Normal; LabelStyle.alignment = TextAnchor.UpperCenter; } if (OffStyle == null) { OffStyle = new GUIStyle(); OffStyle.normal.background = OffTexture; OffStyle.onNormal.background = OffTexture; OffStyle.active.background = OffPressTexture; OffStyle.onActive.background = OffPressTexture; OffStyle.normal.textColor = Color.white; OffStyle.onNormal.textColor = Color.white; OffStyle.active.textColor = Color.white; OffStyle.onActive.textColor = Color.white; OffStyle.fontSize = 18; OffStyle.fontStyle = FontStyle.Normal; OffStyle.alignment = TextAnchor.MiddleCenter; } if (OnStyle == null) { OnStyle = new GUIStyle(); OnStyle.normal.background = OnTexture; OnStyle.onNormal.background = OnTexture; OnStyle.active.background = OnPressTexture; OnStyle.onActive.background = OnPressTexture; OnStyle.normal.textColor = Color.white; OnStyle.onNormal.textColor = Color.white; OnStyle.active.textColor = Color.white; OnStyle.onActive.textColor = Color.white; OnStyle.fontSize = 18; OnStyle.fontStyle = FontStyle.Normal; OnStyle.alignment = TextAnchor.MiddleCenter; } if (BtnStyle == null) { BtnStyle = new GUIStyle(); BtnStyle.normal.background = BtnTexture; BtnStyle.onNormal.background = BtnTexture; BtnStyle.active.background = BtnPressTexture; BtnStyle.onActive.background = BtnPressTexture; BtnStyle.normal.textColor = Color.white; BtnStyle.onNormal.textColor = Color.white; BtnStyle.active.textColor = Color.white; BtnStyle.onActive.textColor = Color.white; BtnStyle.fontSize = 18; BtnStyle.fontStyle = FontStyle.Normal; BtnStyle.alignment = TextAnchor.MiddleCenter; } }