protected override void OnMenuUpdate(MenuUpdate menu) { bool forceRefresh = false; // base.OnMenuUpdate(menu); // Planet selection change if (menu.PlanetMenuSel != _cachedLocalMenuUpdate.PlanetMenuSel) { _timeSincePlanetSelChanged = _time; } // Weapon menu selection change if (menu.WeaponMenuWeaponSel != _cachedLocalMenuUpdate.WeaponMenuWeaponSel) { _timeSinceWeaponMenuSelChanged = _time; } // forceRefresh = _time - _timeSincePlanetSelChanged < Config.MenuForceRefreshPeriod || _time - _timeSinceWeaponMenuSelChanged < Config.MenuForceRefreshPeriod; menu.Write(forceRefresh); }
public static void Read(this MenuUpdate player) { IntPtr menuStart = GetMenuStart(GetMapId()); if (menuStart == IntPtr.Zero) { return; } player.StartMenuSel = PCSX2.Read <byte>(menuStart + STARTMENU_SEL_OFFSET); player.WeaponMenuSubmenuIndex = PCSX2.Read <byte>(menuStart + WEAPONMENU_SUBMENU_INDEX_OFFSET); player.WeaponMenuSubmenuSel = PCSX2.Read <byte>(menuStart + WEAPONMENU_SUBMENU_SEL_OFFSET); player.WeaponMenuWeaponSel = PCSX2.Read <byte>(menuStart + WEAPONMENU_WEAPON_SEL_OFFSET); player.WeaponMenuOmegaSel = PCSX2.Read <byte>(menuStart + WEAPONMENU_OMEGA_SEL_OFFSET); player.WeaponMenuAlphaSel = PCSX2.Read <byte>(menuStart + WEAPONMENU_ALPHA_SEL_OFFSET); player.SkillsMenuSel = PCSX2.Read <byte>(menuStart + SKILLSMENU_SEL_OFFSET); player.ChallengeMenuSel = PCSX2.Read <byte>(menuStart + CHALLENGEMENU_SEL_OFFSET); player.ChangeChallengeDialogSel = PCSX2.Read <byte>(menuStart + CHANGECHALLENGEDIALOG_SEL_OFFSET); player.PlanetMenuSel = PCSX2.Read <byte>(menuStart + PLANETMENU_SEL_OFFSET); player.ChangePlanetDialogSel = PCSX2.Read <byte>(menuStart + CHANGEPLANETDIALOG_SEL_OFFSET); player.PlanetChallengeMenuSel = PCSX2.Read <byte>(menuStart + PLANETMENU_CHALLENGE_SEL_OFFSET); player.SaveMenuSel = PCSX2.Read <byte>(menuStart + SAVEMENU_SEL_OFFSET); player.DifficultySel = PCSX2.Read <byte>(menuStart + DIFFICULTYMENU_SEL_OFFSET); }
public ActionResult DeleteConfirmed(int id) { MenuUpdate menuUpdate = db.MenuUpdate.Find(id); db.MenuUpdate.Remove(menuUpdate); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: Manage/MenuUpdates/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MenuUpdate menuUpdate = db.MenuUpdate.Find(id); if (menuUpdate == null) { return(HttpNotFound()); } return(View(menuUpdate)); }
public static bool RestMenu(List <MenuData> menuData, List <StockData> stockData) { Console.Clear(); Console.WriteLine("Menu Manager:"); Console.WriteLine("Choose an option:"); Console.WriteLine("1) Add to the menu"); Console.WriteLine("2) Remove from the menu"); Console.WriteLine("3) Update the menu"); Console.WriteLine("4) Exit"); Console.WriteLine("Current Menu:"); if (menuData.Count > 0) { foreach (MenuData m in menuData) { if (m != menuData[0]) { Console.Write($"{m.menu_id} {m.name} "); foreach (int sk in m.menu) { Console.Write($"{sk}"); } Console.WriteLine(); } } } Console.Write("\r\nSelect an option: "); switch (Console.ReadLine()) { case "1": MenuAdd.Add(menuData, stockData); // GenericTextProccesor.SaveToTextFile<MenuData>(menuData, "Menu.csv"); return(true); case "2": MenuDelete.Remove(menuData); // GenericTextProccesor.SaveToTextFile<MenuData>(menuData, "Menu.csv"); return(true); case "3": MenuUpdate.Update(menuData, stockData); // GenericTextProccesor.SaveToTextFile<MenuData>(menuData, "Menu.csv"); return(true); case "4": return(false); default: return(true); } }
public ActionResult Create([Bind(Include = "Id,Title,Text,Photo")] MenuUpdate menuUpdate, HttpPostedFileBase Photo) { if (ModelState.IsValid) { string fileName = DateTime.Now.ToString("yyyyMMddHHmmssff") + Photo.FileName; string path = Server.MapPath("~/Uploads/"); Photo.SaveAs(path + fileName); menuUpdate.Photo = fileName; db.MenuUpdate.Add(menuUpdate); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(menuUpdate)); }
void Start () { instance = this; x = transform.parent.position.x; y = transform.parent.position.y; z = transform.parent.position.z; text_enter = GameObject.Find ("Text_Enter"); useAnalytics = GameObject.Find ("GA_SystemTracker"); anim = GameObject.Find ("UpdatePopUp").GetComponent<Animator>(); if(LevelFinishedController.instance.getHomeVersion() == 1 && Application.loadedLevel == 0)//get version from server { WWW www = new WWW(url); StartCoroutine(WaitForRequest(www)); } else { transform.parent.position = new Vector3(x, -10, z); useAnalytics.SetActive(false); } }
public ActionResult Edit([Bind(Include = "Id,Title,Text,Photo")] MenuUpdate menuUpdate, HttpPostedFileBase Photo) { db.Entry(menuUpdate).State = EntityState.Modified; if (Photo == null) { db.Entry(menuUpdate).Property(a => a.Photo).IsModified = false; } else { string fileName = DateTime.Now.ToString("yyyyMMddHHmmssff") + Photo.FileName; string path = Server.MapPath("~/Uploads/"); Photo.SaveAs(path + fileName); menuUpdate.Photo = fileName; } if (ModelState.IsValid) { db.SaveChanges(); return(RedirectToAction("Index")); } return(View(menuUpdate)); }
protected virtual void OnMenuUpdate(MenuUpdate menu) { }
protected override void OnMenuUpdate(MenuUpdate menu) { base.OnMenuUpdate(menu); }
public static void Write(this MenuUpdate player, bool forceRefresh = false) { IntPtr menuStart = GetMenuStart(GetMapId()); if (menuStart == IntPtr.Zero) { return; } // Main select if (player.StartMenuSel != 0xFF) { HandleMenuChange(menuStart + STARTMENU_SEL_OFFSET, player.StartMenuSel); } // Save game select HandleMenuChange(menuStart + SAVEMENU_SEL_OFFSET, player.SaveMenuSel, true); // Difficulty select HandleMenuChange(menuStart + DIFFICULTYMENU_SEL_OFFSET, player.DifficultySel, true); // Planet select with custom refresh byte planetRefresh = PCSX2.Read <byte>(menuStart + PLANETMENU_SEL_REFRESH_OFFSET); if (HandleMenuChange(menuStart + PLANETMENU_SEL_OFFSET, player.PlanetMenuSel, true) || (planetRefresh == 0 && forceRefresh)) { PCSX2.Write(menuStart + PLANETMENU_SEL_REFRESH_OFFSET, 5); } // Planet challenge select HandleMenuChange(menuStart + PLANETMENU_CHALLENGE_SEL_OFFSET, player.PlanetChallengeMenuSel, true); // Weapon select byte weaponRefresh = PCSX2.Read <byte>(menuStart + WEAPONMENU_SUBMENU_REFRESH_OFFSET); if (HandleMenuChange(menuStart + WEAPONMENU_WEAPON_SEL_OFFSET, player.WeaponMenuWeaponSel) || (weaponRefresh == 0x80 && forceRefresh)) { PCSX2.Write(menuStart + WEAPONMENU_SUBMENU_REFRESH_OFFSET, 0x84); } // Mods if (HandleMenuChange(menuStart + WEAPONMENU_OMEGA_SEL_OFFSET, player.WeaponMenuOmegaSel)) { PCSX2.Write(menuStart + WEAPONMENU_SUBMENU_REFRESH_OFFSET, 0x88); } if (HandleMenuChange(menuStart + WEAPONMENU_ALPHA_SEL_OFFSET, player.WeaponMenuAlphaSel)) { PCSX2.Write(menuStart + WEAPONMENU_SUBMENU_REFRESH_OFFSET, 0x88); } // Weapon submenu select if (HandleMenuChange(menuStart + WEAPONMENU_SUBMENU_SEL_OFFSET, player.WeaponMenuSubmenuSel)) { PCSX2.Write(menuStart + WEAPONMENU_SUBMENU_REFRESH_OFFSET, 0x88); } // Submenu index if (player.WeaponMenuSubmenuIndex > 1 && player.WeaponMenuSubmenuIndex < 4) { HandleMenuChange(menuStart + WEAPONMENU_SUBMENU_INDEX_OFFSET, player.WeaponMenuSubmenuIndex); } // HandleMenuChange(menuStart + SKILLSMENU_SEL_OFFSET, player.SkillsMenuSel, true); HandleMenuChange(menuStart + CHALLENGEMENU_SEL_OFFSET, player.ChallengeMenuSel, true); // Dialog HandleMenuChange(menuStart + CHANGECHALLENGEDIALOG_SEL_OFFSET, player.ChangeChallengeDialogSel); HandleMenuChange(menuStart + CHANGEPLANETDIALOG_SEL_OFFSET, player.ChangePlanetDialogSel); }