private static void ModelsDialogCreate(Player player) { var action = new EventHandler <DialogResponseEventArgs>((o, args) => { if (args.DialogButton == DialogButton.Left) { player.SendClientMessage($"Stworzyłeś obiekt o modelu {args.InputText}."); player.ObjectEditor.CreateObjectMode(new MruDynamicObject(Int32.Parse(args.InputText), player.Position)); } else { ModelsDialogCreate(player); } }); var categoriesDialog = new ListDialog("Kategorie modeli", "Wyjdź", "Wybierz"); categoriesDialog.AddItems(Objects.Objects.ObjectModelsCategory.Keys); categoriesDialog.Response += (sender, args) => { var tablistDialog = new TablistDialog($"Modele - Kategoria {args.InputText}", new[] { "Model", "Nazwa", "Rozmiar", "Tagi" }, "Stwórz", "Wróć"); foreach (var objectModel in Objects.Objects.ObjectModelsCategory[args.InputText]) { var o = objectModel.Value; tablistDialog.Add(o.Model.ToString(), o.Name, o.Size.ToString(CultureInfo.CurrentCulture), String.Join(", ", o.Tags)); } tablistDialog.Response += action; tablistDialog.Show(player); }; categoriesDialog.Show(player); }
public static void TopTen(Player player) { var dialogTop = new ListDialog("Top Ten", "Seleccionar", "Cerrar"); var topten = new Top() { Sender = player, DialogMain = dialogTop }; dialogTop.AddItems(new[] { "Total Kills", "Total Deaths", "Killing Sprees", "Headshots", "Dropped Flags" }); dialogTop.Response += (sender, e) => { if (e.DialogButton == DialogButton.Left) { switch (e.ListItem) { case 0: topten.ShowTopTen("totalKills", "Total Kills"); break; case 1: topten.ShowTopTen("totalDeaths", "Total Deaths"); break; case 2: topten.ShowTopTen("killingSprees", "Killing Sprees"); break; case 3: topten.ShowTopTen("headshots", "Headshots"); break; case 4: topten.ShowTopTen("droppedFlags", "Dropped Flags"); break; } } }; dialogTop.Show(player); }
private static void Weather(Player player) { if (player.IsVipLevel(1)) { return; } var dweather = new ListDialog("Climas", "Aceptar", "Cerrar"); dweather.AddItems(new[] { "Restaurar día y sol", "Noche", "Madrugada", "Mañana", "Día", "Tarde", "Lluvia", "Soleado", "Niebla", "Tormenta de Arena", "Cielo Gris", "Cielo Rojo", "Cielo Purpura" }); dweather.Show(player); dweather.Response += (sender, e) => { if (e.DialogButton == DialogButton.Left) { switch (e.ListItem) { case 0: player.SetWeather(1); player.SetTime(12, 0); player.SendClientMessage(Color.Yellow, "* Día Restaurado."); break; case 1: player.SetTime(3, 0); player.SendClientMessage(Color.Yellow, "* Clima cambiado a la noche."); break; case 2: player.SetTime(22, 0); player.SendClientMessage(Color.Yellow, "* Clima cambiado a la madrugada."); break; case 3: player.SetTime(8, 0); player.SendClientMessage(Color.Yellow, "* Clima cambiado a la mañana."); break; case 4: player.SetTime(12, 0); player.SendClientMessage(Color.Yellow, "* Clima cambiado al día."); break; case 5: player.SetTime(16, 0); player.SendClientMessage(Color.Yellow, "* Clima cambiado a la tarde."); break; case 6: player.SetWeather(8); player.SendClientMessage(Color.Yellow, "* Has hecho llover."); break; case 7: player.SetWeather(1); player.SendClientMessage(Color.Yellow, "* Has hecho salir el sol."); break; case 8: player.SetWeather(9); player.SendClientMessage(Color.Yellow, "* Nieve activada."); break; case 9: player.SetWeather(19); player.SendClientMessage(Color.Yellow, "* Tormenta de arena seleccionada."); break; case 10: player.SetWeather(21); player.SendClientMessage(Color.Yellow, "* Cielo gris seleccionado."); break; case 11: player.SetWeather(382); player.SendClientMessage(Color.Yellow, "* Cielo rojo seleccionado."); break; case 12: player.SetWeather(953); player.SendClientMessage(Color.Yellow, "* Cielo color purpura seleccionado."); break; } } }; }
public static void ListCommands(Player player) { var dialog = new ListDialog("Menu", "Seleccionar", "Cerrar"); dialog.AddItems(new[] { "General", "Armas", "Mensajes Privados", "AFK", "Estadísticas", "Atajos", "Signos", "Otros comandos" }); var category = new CategoryCommand() { DialogMain = dialog }; dialog.Response += (sender, e) => { if (e.DialogButton == DialogButton.Left) { category.DialogCategory.Message = ""; category.DialogCategory.Caption = dialog.Items[e.ListItem]; switch (e.ListItem) { case 0: category.ShowGeneral(); break; case 1: category.ShowWeapons(); break; case 2: category.ShowPM(); break; case 3: category.ShowAFK(); break; case 4: category.ShowStats(); break; case 5: category.ShowShortcurts(); break; case 6: category.ShowSigns(); break; case 7: category.ShowOthers(); break; } category.DialogCategory.Show(player); } }; dialog.Show(player); }