public override void Unload() { CommandLogic.instance = null; orgCoatSlots = new int[0]; HidePartyUI(); HideCommandUI(); HideDialogUI(); HideLevelUpUI(); PartySelectHotkey = null; GuardHotKey = null; MusicUpKey = null; MusicLeftKey = null; MusicDownKey = null; MusicRightKey = null; if (partyUI != null && commandUI != null && dialogUI != null) { partyUI.Destroy(); commandUI.Destroy(); dialogUI.Destroy(); } partyUI = null; commandUI = null; dialogUI = null; instance = null; }
private CommandMenu GetManageMenu(Vector2 optionLocation, int index = 0) { // Command Window Vector2 manage_loc = optionLocation + new Vector2(48, 8); var manageCommandWindow = new Window_Command(manage_loc, 72, new List <string> { "Organize", "Items", "Support" }); manageCommandWindow.text_offset = new Vector2(8, 0); manageCommandWindow.glow = true; manageCommandWindow.bar_offset = new Vector2(-8, 0); manageCommandWindow.stereoscopic = Config.PREPMAIN_WINDOW_DEPTH; manageCommandWindow.index = index; var manageCommandMenu = new CommandMenu(manageCommandWindow); manageCommandMenu.CreateCancelButton( Config.WINDOW_WIDTH - 128, Config.PREPMAIN_INFO_DEPTH); manageCommandMenu.Selected += manageCommandMenu_Selected; manageCommandMenu.Canceled += menu_Closed; return(manageCommandMenu); }
/// <summary> /// Constructor /// </summary> public CommandListener(ICommandLayer command) { CommandMenu cmd = new CommandMenu(command, this, OnPrompt); _IO = command; cmd.Add(new string[] { "banner" }, cmdBanner, Lang.Get("Man_Banner")); cmd.Add(new string[] { "version" }, cmdVersion, Lang.Get("Man_Version")); cmd.Add(new string[] { "clear", "cls" }, cmdClear, Lang.Get("Man_Clear")); cmd.Add(new string[] { "cd", "cd..", "cd\\", "cd/", "back" }, cmdCD, Lang.Get("Man_Cd")); // Modules command cmd.Add(new string[] { "use" }, cmdUse, Lang.Get("Man_Use")); cmd.Add(new string[] { "show" }, cmdShow, Lang.Get("Man_Show")); cmd.Add(new string[] { "set" }, cmdSet, Lang.Get("Man_Set")); cmd.Add(new string[] { "gset" }, cmdSetG, Lang.Get("Man_Set_Global")); cmd.Add(new string[] { "check" }, cmdCheck, Lang.Get("Man_Check")); cmd.Add(new string[] { "exploit", "run" }, cmdRun, Lang.Get("Man_Run")); cmd.Add(new string[] { "reload" }, cmdReload, Lang.Get("Man_Reload")); cmd.Add(new string[] { "resource" }, cmdResource, Lang.Get("Man_Resource")); cmd.Add(new string[] { "kill" }, cmdKill, Lang.Get("Man_Kill")); cmd.Add(new string[] { "jobs" }, cmdJobs, Lang.Get("Man_Jobs")); cmd.Add(new string[] { "load" }, cmdLoad, Lang.Get("Man_Load")); cmd.Add(new string[] { "rerun", "rexploit" }, cmdReRun, Lang.Get("Man_ReRun")); cmd.Add(new string[] { "rcheck" }, cmdRCheck, Lang.Get("Man_RCheck")); cmd.Add(new string[] { "info" }, cmdInfo, Lang.Get("Man_Info")); cmd.Add(new string[] { "search" }, cmdSearch, Lang.Get("Man_Search")); cmd.Add(new string[] { "ifcheckrun" }, cmdIfCheckRun, Lang.Get("Man_IfCheckRun")); _Command = cmd; }
public GameObject GetCommandButton(CommandMenu menu) { switch (menu) { case CommandMenu.Attack: return(Attack); case CommandMenu.Defend: return(Defend); case CommandMenu.Ability1: return(Skill1); case CommandMenu.Ability2: return(Skill2); case CommandMenu.Item: return(Item); case CommandMenu.Change: return(Change); default: return(Attack); } }
// Selected an item in the reinforcements menu void reinforcementsMenu_Selected(object sender, EventArgs e) { var reinforcementsMenu = sender as ReinforcementsMenu; List <string> commands = new List <string> { "Edit", "Add", "Paste", "Delete" }; var reinforcementsOptionsWindow = new Window_Command( reinforcementsMenu.WindowLoc + new Vector2(WindowCommandReinforcements.WIDTH + 8, 0), 80, commands); if (ReinforcementData.Count == 0) { reinforcementsOptionsWindow.set_text_color(0, "Grey"); reinforcementsOptionsWindow.set_text_color(3, "Grey"); } var reinforcementsOptionsMenu = new CommandMenu(reinforcementsOptionsWindow); reinforcementsOptionsMenu.Selected += reinforcementsOptionsMenu_Selected; reinforcementsOptionsMenu.Canceled += reinforcementsOptionsMenu_Canceled; AddMenu(reinforcementsOptionsMenu); }
public void Initialise(int newIndex, CommandMenu menu, Item newItem) { index = newIndex; characterName = newItem.name; text.text = characterName; commandMenu = menu; item = newItem; }
public void Initialise(int newIndex, string newName, CommandMenu menu, bool newTargetAllies) { index = newIndex; characterName = newName; text.text = characterName; commandMenu = menu; targetAllies = newTargetAllies; }
public static ContextMenuStrip BuildContextMenu(CommandMenu menu, CommandRegistry registry) { ContextMenuStrip strip = new ContextMenuStrip(); if (menu.Groups == null) return strip; PopulateItems(strip.Items, menu.Groups, registry); return strip; }
public void Initialise(int newIndex, CommandMenu menu, Spell newSpell, bool canAfford) { index = newIndex; characterName = newSpell.name; text.text = characterName; commandMenu = menu; spell = newSpell; button.interactable = canAfford; }
public static ToolStripMenuItem BuildToolStripMenu(CommandMenu menu, CommandRegistry registry) { ToolStripMenuItem strip = new ToolStripMenuItem(menu.Name); if (menu.Groups == null) return strip; PopulateItems(strip.DropDownItems, menu.Groups, registry); return strip; }
public CommandMenuHelp(CommandMenu menu) : base(new string[] { "help", "man" }) { if (menu == null) throw new ArgumentNullException("menu"); _Menu = menu; HelpText = Lang.Get("Man_Help"); }
/// <summary> /// Called when the aim of the Heal magic is released. /// </summary> /// <param name="actionMenu">The menu that requested the mover.</param> /// <param name="target">The unit targeted by the aim. Null if the aim is over anything.</param> /// <param name="position">The last valid position of the aim.</param> private void Aim_Aimed(ActionMenu actionMenu, Unit target, Vector2 position) { this.Reset(); // Execute the command. CommandMenu commandMenu = actionMenu as CommandMenu; commandMenu.Command.Execute(target, position); }
private void Run(string[] args) { CommandMenu menu = new CommandMenu(); CommandResult result = CommandResult.NoOp; while (result != CommandResult.CriticalError && result != CommandResult.Exit) { result = menu.ReadEvalPrint(args); } }
public override void Awake() { base.Awake(); ddol = GameObject.FindObjectOfType <DDOL>(); levelManager = GameObject.FindObjectOfType <LevelManager>(); gameManager = GameObject.FindObjectOfType <GameManager>(); commandMenu = GameObject.FindObjectOfType <CommandMenu>(); itemMenu = GameObject.FindObjectOfType <ItemMenu>(); spriteRenderer = GetComponent <SpriteRenderer>(); }
public static ToolStripMenuItem BuildToolStripMenu(CommandMenu menu, CommandRegistry registry) { ToolStripMenuItem strip = new ToolStripMenuItem(menu.Name); if (menu.Groups == null) { return(strip); } PopulateItems(strip.DropDownItems, menu.Groups, registry); return(strip); }
public CommandMenuHelp(CommandMenu menu) : base(new string[] { "help", "man" }) { if (menu == null) { throw new ArgumentNullException("menu"); } _Menu = menu; HelpText = Lang.Get("Man_Help"); }
public static ContextMenuStrip BuildContextMenu(CommandMenu menu, CommandRegistry registry) { ContextMenuStrip strip = new ContextMenuStrip(); if (menu.Groups == null) { return(strip); } PopulateItems(strip.Items, menu.Groups, registry); return(strip); }
// Open item use menu private void ItemsMenu_Use(object sender, EventArgs e) { var itemsMenu = (sender as Window_Prep_Items); CommandMenu itemCommandMenu = null; if (Menus.Peek() is CommandMenu) { itemCommandMenu = Menus.Peek() as CommandMenu; RemoveTopMenu(); } AddUseMenu(itemsMenu, itemCommandMenu); }
private void AddUseMenu(Window_Prep_Items itemsMenu, CommandMenu itemCommandMenu = null) { itemsMenu.StartUse(); var useMenu = itemsMenu.GetUseMenu(); if (itemCommandMenu != null) { useMenu.SetCursorLoc(itemCommandMenu.CurrentCursorLoc); } useMenu.Selected += UseMenu_Selected; useMenu.Canceled += UseMenu_Canceled; AddMenu(useMenu); }
IEnumerator CommandManager() { CommandMenu cm = commandMenu.GetComponent <CommandMenu>(); while (true) { GameObject currentOrder = cm.getCurrentOrder(); if (currentOrder != null) { giveOrder(currentOrder); yield return(new WaitUntil(() => currentOrder == null)); } yield return(new WaitForFixedUpdate()); } }
private void ActivateObjectMenu(PointerEventInfo info) { CommandMenu menu = new CommandMenu("", new List <CommandMenuGroup>() { new CommandMenuGroup() { CommandKey.Cut, CommandKey.Copy, CommandKey.Paste, CommandKey.Delete, }, new CommandMenuGroup() { CommandKey.ObjectProperties, }, }); LayerContext.ActivateContextMenu(menu, new Point((int)info.X, (int)info.Y)); }
public static void Main() { // var items = new List<Item>(); // var test = new Test(); //test.AddTestObjects(items); //var users = new List<User>(); //var testUsers = new TestUsers(); //testUsers.AddTestObjects(users); //Register.Serialize(users); var file = FileClass.Deserialize(); var usersFile = Login.Deserialize(); var itemFactory = new ItemFactory(); var commandMenu = new CommandMenu(); commandMenu.Menu(file, itemFactory, usersFile); }
/// <summary> /// Handle the Execute event for attack commands. /// </summary> /// <param name="actionMenu">The menu that dispatched the event.</param> private void Attack_Execute(ActionMenu actionMenu) { CommandMenu commandMenu = actionMenu as CommandMenu; switch ((commandMenu.Command as Attack).Type) { case Attack.AttackType.Long: this.Aim.Activate(actionMenu, this.Unit.Attributes.LongAttackRange); break; case Attack.AttackType.Short: this.Aim.Activate(actionMenu, this.Unit.Attributes.ShortAttackRange); break; } }
/// <summary> /// Handle the Execute event for item commands. /// </summary> /// <param name="actionMenu">The menu that dispatched the event.</param> private void Item_Execute(ActionMenu actionMenu) { CommandMenu commandMenu = actionMenu as CommandMenu; switch ((commandMenu.Command as Item).Type) { case Item.ItemType.Self: commandMenu.Command.Execute(this.Unit, this.Unit.Position); this.Reset(); break; case Item.ItemType.Target: this.Aim.Activate(actionMenu, this.Unit.Attributes.SkillRange); break; } }
/// <summary> /// Construct the menu. /// </summary> private void Construct() { // Create the actions. ActionMenu moveAction = new ActionMenu(this.Unit, "Move", ActionMenu.ActionMenuType.Move); ActionMenu attackAction = new ActionMenu(this.Unit, "Attack", ActionMenu.ActionMenuType.Attack); ActionMenu skillsAction = new ActionMenu(this.Unit, "Skills", ActionMenu.ActionMenuType.Skills); ActionMenu itemsAction = new ActionMenu(this.Unit, "Items", ActionMenu.ActionMenuType.Items); // Handle the Execute events. moveAction.Execute += new ActionMenu.ExecuteEventHandler(Action_Execute); attackAction.Execute += new ActionMenu.ExecuteEventHandler(Action_Execute); skillsAction.Execute += new ActionMenu.ExecuteEventHandler(Action_Execute); itemsAction.Execute += new ActionMenu.ExecuteEventHandler(Action_Execute); // Add the attacks. foreach (Attack attack in this.Unit.Attacks) { CommandMenu menu = new CommandMenu(attack, ActionMenu.ActionMenuType.Attack); menu.Execute += new ActionMenu.ExecuteEventHandler(Attack_Execute); attackAction.Commands.Add(menu); } // Add the skills. foreach (Skill skill in this.Unit.Skills) { CommandMenu menu = new CommandMenu(skill, ActionMenu.ActionMenuType.Skills); menu.Execute += new ActionMenu.ExecuteEventHandler(Skill_Execute); skillsAction.Commands.Add(menu); } // Add the items. foreach (Item item in this.Unit.Items) { CommandMenu menu = new CommandMenu(item, ActionMenu.ActionMenuType.Items); menu.Execute += new ActionMenu.ExecuteEventHandler(Item_Execute); itemsAction.Commands.Add(menu); } // Add the actions. this.Actions.Add(moveAction); this.Actions.Add(attackAction); this.Actions.Add(skillsAction); this.Actions.Add(itemsAction); }
static void Main(string[] args) { // Context = new InstanceContext(new CallbackHandler()); // Server client = new Server(Context); // // Cards = client.GetCards().ToList(); // Cards.ForEach(card => // { // Console.Write(card.Id); // Console.Write("{"); // card.Symbols.ForEach(symbol => Console.Write(symbol + ",")); // Console.Write("}\n"); // }); InitClient(); CommandMenu <Server> menu = new CommandMenu <Server>(Program.server); var commands = new Dictionary <int, Command <Server> >(); commands.Add(1, new JoinCommand(server, "Dołącz do lobby")); commands.Add(2, new DeclareReadinessCommand(server, "Zaznacz gotowość.")); commands.Add(3, new PickCardCommand(server, "Wybierz kartę")); commands.Add(4, new ChangeSettingsCommand(server, "Zmień ustawienia")); commands.Add(5, new LeaveCommand(server, "Wyjdź z lobby")); commands.Add(9, new ExitCommand(server, "Wyjdź")); menu.AddCommands(commands); Console.WriteLine("---------------------"); Console.WriteLine("Testowy klient Dobble"); while (true) { try { menu.displayMenu(); var cmd = int.Parse(Console.ReadLine() ?? string.Empty); menu.execute(cmd); Thread.Sleep(500); } catch (Exception e) { Console.WriteLine(e.ToString()); } } }
private void PromotionChoiceMenu_Selected(object sender, EventArgs e) { Global.game_system.play_se(System_Sounds.Open); var promotionChoiceMenu = (sender as PromotionChoiceMenu); var promotionConfirmWindow = new Window_Command( promotionChoiceMenu.WindowLoc + new Vector2(64, 24), 48, new List <string> { "Change", "Cancel" }); promotionConfirmWindow.help_stereoscopic = Config.MAPCOMMAND_HELP_DEPTH; promotionConfirmWindow.small_window = true; var promotionConfirmMenu = new CommandMenu(promotionConfirmWindow, promotionChoiceMenu); promotionConfirmMenu.Selected += PromotionConfirmMenu_Selected; promotionConfirmMenu.Canceled += menu_Closed; AddMenu(promotionConfirmMenu); }
private static BattleCommandId GetCommandFromCommandIndex(CommandMenu commandIndex, Int32 playerIndex) { BattleUnit player = FF9StateSystem.Battle.FF9Battle.GetUnit(playerIndex); CharacterPresetId presetId = FF9StateSystem.Common.FF9.party.GetCharacter(player.Position).PresetId; switch (commandIndex) { case CommandMenu.Attack: return(BattleCommandId.Attack); case CommandMenu.Defend: return(BattleCommandId.Defend); case CommandMenu.Ability1: { CharacterCommandSet commandSet = CharacterCommands.CommandSets[presetId]; Boolean underTrance = player.IsUnderStatus(BattleStatus.Trance); return(commandSet.Get(underTrance, 0)); } case CommandMenu.Ability2: { CharacterCommandSet commandSet = CharacterCommands.CommandSets[presetId]; Boolean underTrance = player.IsUnderStatus(BattleStatus.Trance); return(commandSet.Get(underTrance, 1)); } case CommandMenu.Item: return(BattleCommandId.Item); case CommandMenu.Change: return(BattleCommandId.Change); default: return(BattleCommandId.None); } }
public CommandMenuQuit(CommandMenu menu) : base(new string[] { "quit", "exit" }) { _Menu = menu; HelpText = Lang.Get("Man_Exit"); }
// Use this for initialization void Start() { GameObject menuObject = GameObject.FindGameObjectWithTag("CommandMenu"); menu = menuObject.GetComponent <CommandMenu> (); }
private void ActivateObjectMenu(PointerEventInfo info) { CommandMenu menu = new CommandMenu("", new List<CommandMenuGroup>() { new CommandMenuGroup() { CommandKey.Cut, CommandKey.Copy, CommandKey.Paste, CommandKey.Delete, }, new CommandMenuGroup() { CommandKey.ObjectProperties, }, }); LayerContext.ActivateContextMenu(menu, new Point((int)info.X, (int)info.Y)); }
public ContextMenuEventArgs(CommandMenu menu, Point location) { Menu = menu; Location = location; }
public void ActivateContextMenu(CommandMenu menu, Point location) { OnContextMenuActivated(new ContextMenuEventArgs(menu, location)); }
public override void Load() { PartySelectHotkey = KeybindLoader.RegisterKeybind(this, "Party menu", "F"); GuardHotKey = KeybindLoader.RegisterKeybind(this, "Guard", "Q"); MusicUpKey = KeybindLoader.RegisterKeybind(this, "MusicalUp", "Z"); MusicLeftKey = KeybindLoader.RegisterKeybind(this, "MusicalLeft", "X"); MusicDownKey = KeybindLoader.RegisterKeybind(this, "MusicalDown", "N"); MusicRightKey = KeybindLoader.RegisterKeybind(this, "MusicalRight", "M"); instance = this; CommandLogic.Initialize(); CommandLogic.instance.ChangeCommand(0); Logger.InfoFormat("{0} Sora logging", Name); if (!Main.dedServ) { orgCoatSlots = new int[3]; orgCoatSlots[0] = AddEquipTexture(new Items.Armor.orgCoat(), EquipType.Body, "KingdomTerrahearts/Items/Armor/orgCoat_Body"); orgCoatSlots[1] = AddEquipTexture(new Items.Armor.orgCoat(), EquipType.Legs, "KingdomTerrahearts/Items/Armor/orgCoat_Legs"); orgCoatSlots[2] = AddEquipTexture(new Items.Armor.orgCoat(), EquipType.Head, "KingdomTerrahearts/Items/Armor/orgCoat_Head"); MusicLoader.AddMusicBox(this, MusicLoader.GetMusicSlot(this, "Sounds/Music/Lazy Afternoons"), ModContent.ItemType <Items.Placeable.LazyAfternoons_Item>(), ModContent.TileType <Tiles.MusicBoxes.LazyAfternoons_MusicBox>()); MusicLoader.AddMusicBox(this, MusicLoader.GetMusicSlot(this, "Sounds/Music/Vector to the Heaven"), ModContent.ItemType <Items.Placeable.VectorToHeaven_Item>(), ModContent.TileType <Tiles.MusicBoxes.VectorToHeaven_MusicBox>()); } if (Main.netMode != NetmodeID.Server) { // First, you load in your shader file. // You'll have to do this regardless of what kind of shader it is, // and you'll have to do it for every shader file. // This example assumes you have both armour and screen shaders. Ref <Effect> dyeRef = new Ref <Effect>(ModContent.Request <Effect>("KingdomTerrahearts/Effects/lastWorldShader").Value); // To add a dye, simply add this for every dye you want to add. // "PassName" should correspond to the name of your pass within the *technique*, // so if you get an error here, make sure you've spelled it right across your effect file. GameShaders.Armor.BindShader(ModContent.ItemType <Items.lastWorldDye>(), new ArmorShaderData(dyeRef, "ArmorMyShader")); Ref <Effect> screenRef = new Ref <Effect>(ModContent.Request <Effect>("KingdomTerrahearts/Effects/Shockwave").Value); // The path to the compiled shader file. Filters.Scene["Shockwave"] = new Filter(new ScreenShaderData(screenRef, "Shockwave"), EffectPriority.VeryHigh); Filters.Scene["Shockwave"].Load(); } if (!Main.dedServ) { partyInterface = new UserInterface(); partyUI = new PartyUI(); partyUI.Activate(); commandInterface = new UserInterface(); commandUI = new CommandMenu(); commandUI.Activate(); dialogInterface = new UserInterface(); dialogUI = new DialogDisplay(); dialogUI.Activate(); levelUpInterface = new UserInterface(); levelUpUI = new KeybladeLeveling(); levelUpUI.Activate(); } //Collision extra On.Terraria.Player.Update_NPCCollision += CollisionDetour; }
public static ContextMenuStrip BuildContextMenu(CommandMenu menu) { return BuildContextMenu(menu, CommandRegistry.Default); }
public static ContextMenuStrip BuildContextMenu(CommandMenu menu) { return(BuildContextMenu(menu, CommandRegistry.Default)); }
public void ActivateContextMenu(CommandMenu menu, Point location) { }
public static ToolStripMenuItem BuildToolStripMenu(CommandMenu menu) { return BuildToolStripMenu(menu, CommandRegistry.Default); }
public void ActivateContextMenu(CommandMenu menu, Treefrog.Framework.Imaging.Point location) { }