private void CreateMenu() { try { bool newMenu = false; LeagueSharp.Common.Menu menu; if (Menu.GetMenu("SAssembliesRoot") == null) { menu = new LeagueSharp.Common.Menu("SAssemblies", "SAssembliesRoot", true); newMenu = true; } else { menu = Menu.GetMenu("SAssembliesRoot"); } MainMenu.Timer = Timer.SetupMenu(menu); mainMenu.UpdateDirEntry(ref MainMenu.HealthRelic, HealthRelic.SetupMenu(MainMenu.Timer.Menu)); var globalMenu = Menu.GetSubMenu(menu, "SAwarenessGlobalSettings"); if (globalMenu == null) { Menu.GlobalSettings.Menu = menu.AddSubMenu(new LeagueSharp.Common.Menu("Global Settings", "SAwarenessGlobalSettings")); Menu.GlobalSettings.Menu.AddItem( new MenuItem("SAssembliesGlobalSettingsServerChatPingActive", "Server Chat/Ping").SetValue(false)); Menu.GlobalSettings.Menu.AddItem( new MenuItem("SAssembliesGlobalSettingsVoiceVolume", "Voice Volume").SetValue(new Slider(100, 0, 100))); } else { Menu.GlobalSettings.Menu = globalMenu; } if (newMenu) { menu.AddItem(new MenuItem("By Screeder", "By Screeder V" + Assembly.GetExecutingAssembly().GetName().Version)); menu.AddToMainMenu(); } } catch (Exception ex) { Console.WriteLine("SAssemblies: {0}", ex); throw; } }
public static int CreateRelics(string table) { int responseCode; string jsonGetData = string.Empty; // ######################################################################################### // Create the Attack Relic BaseRelic AtkRelic = new AttackRelic(); responseCode = JTAzureTableRESTCommands.GetAllEntities(storageName, sAS, table + "(PartitionKey='" + AtkRelic.PartitionKey + "',RowKey='" + AtkRelic.RowKey + "')", out jsonGetData); if (responseCode == 7) { responseCode = JTAzureTableRESTCommands.ChangeEntity("POST", storageName, sAS, table, JsonConvert.SerializeObject(AtkRelic), string.Empty, string.Empty); } else { responseCode = 201; } // ######################################################################################### // ######################################################################################### // Create the Health Relic BaseRelic HPRelic = new HealthRelic(); responseCode = JTAzureTableRESTCommands.GetAllEntities(storageName, sAS, table + "(PartitionKey='" + HPRelic.PartitionKey + "',RowKey='" + HPRelic.RowKey + "')", out jsonGetData); if (responseCode == 7) { responseCode = JTAzureTableRESTCommands.ChangeEntity("POST", storageName, sAS, table, JsonConvert.SerializeObject(HPRelic), string.Empty, string.Empty); } else { responseCode = 201; } // ######################################################################################### // ######################################################################################### // Create the Speed Relic BaseRelic SPRelic = new SpeedRelic(); responseCode = JTAzureTableRESTCommands.GetAllEntities(storageName, sAS, table + "(PartitionKey='" + SPRelic.PartitionKey + "',RowKey='" + SPRelic.RowKey + "')", out jsonGetData); if (responseCode == 7) { responseCode = JTAzureTableRESTCommands.ChangeEntity("POST", storageName, sAS, table, JsonConvert.SerializeObject(SPRelic), string.Empty, string.Empty); } else { responseCode = 201; } // ######################################################################################### // ######################################################################################### // Create the Accuracy Relic BaseRelic AccRelic = new AccuracyRelic(); responseCode = JTAzureTableRESTCommands.GetAllEntities(storageName, sAS, table + "(PartitionKey='" + AccRelic.PartitionKey + "',RowKey='" + AccRelic.RowKey + "')", out jsonGetData); if (responseCode == 7) { responseCode = JTAzureTableRESTCommands.ChangeEntity("POST", storageName, sAS, table, JsonConvert.SerializeObject(AccRelic), string.Empty, string.Empty); } else { responseCode = 201; } // ######################################################################################### return(responseCode); }