public void InitializeInterfaceMainMenu(out Interfaces.MainMenu o_InterfaceMainMenu) { // Initialize the Main menu o_InterfaceMainMenu = new Interfaces.MainMenu("--- Interface Main Menu ---", eMainMenuType.FirstMenu); // Initialize the Date/Time menu Interfaces.MainMenu dateTimeInterfaceMenu = new Interfaces.MainMenu("Show Date/Time", eMainMenuType.SecondaryMenu); Interfaces.ExecutableItem showTimeExe = new ExecutableItem("Show Time"); Interfaces.ExecutableItem showDateExe = new ExecutableItem("Show Date"); // Add showTimeExe and showDateExe as a listeners - it mean that when the user click on them the ShowTime and ShowDate method will start. showTimeExe.AttachListener(new ShowTime()); showDateExe.AttachListener(new ShowDate()); // Add dateTimeInterfaceMenu to the menu dateTimeInterfaceMenu.AddItemToMenu(showTimeExe); dateTimeInterfaceMenu.AddItemToMenu(showDateExe); o_InterfaceMainMenu.AddItemToMenu(dateTimeInterfaceMenu); // Initialize the versionAndCountDigits menu Interfaces.MainMenu versionAndCountDigits = new Interfaces.MainMenu("Version and Count Digits", eMainMenuType.SecondaryMenu); Interfaces.ExecutableItem countDigitsExe = new ExecutableItem("Count Digits"); Interfaces.ExecutableItem showVersionExe = new ExecutableItem("Show Version"); // Add countDigitsExe and showVersionExe as a listeners - it mean that when the user click on them the ShowTime and ShowDate method will start. countDigitsExe.AttachListener(new CountDigits()); showVersionExe.AttachListener(new ShowVersion()); // Add versionAndCountDigits to the menu versionAndCountDigits.AddItemToMenu(countDigitsExe); versionAndCountDigits.AddItemToMenu(showVersionExe); o_InterfaceMainMenu.AddItemToMenu(versionAndCountDigits); }
public void Init(ExecutableItem executableItem,bool WithButtons) { base.Init(executableItem,true, WithButtons); switch (executableItem.ExecutableType) { case ExecutableType.craft: var craft = executableItem as ExecCraftItem; if (craft != null) { NameLabel.text = craft.Name; mainIcon.sprite = craft.IconSprite; descField.text = "Use this for craft weapons and armor"; } break; case ExecutableType.enchant: var enchant = executableItem as ExecEnchantItem; if (enchant != null) { NameLabel.text = enchant.Name; mainIcon.sprite = enchant.IconSprite; descField.text = "Use for enchant items to upgrade power"; } break; case ExecutableType.catalys: var catalys = executableItem as ExecCatalysItem; if (catalys != null) { NameLabel.text = catalys.Name; mainIcon.sprite = catalys.IconSprite; descField.text = "Use for craft weapon to add special abilities"; } break; } }
public static void WrapBulbAction(this ExecutableItem exec) { var originalAction = (Action)ExecutableItemActionField.GetValue(exec); var actionProxy = new LoggingActionProxy(originalAction); var newAction = (Action)(wrapper.Execute); ExecutableItemActionField.SetValue(exec, newAction); }
private void OnChangeCount(ExecutableItem obj,int delta) { var element = PlayerItemElements.FirstOrDefault(x => x.PlayerItem == obj); if (element != null) { element.Refresh(); } if (delta > 0) ItemWindow.Init(obj); }