public RubberduckMenu(VBE vbe, AddIn addIn, IConfigurationService configService, IRubberduckParser parser, IInspector inspector) : base(vbe, addIn) { _configService = configService; var testExplorer = new TestExplorerWindow(); var testEngine = new TestEngine(); var testPresenter = new TestExplorerDockablePresenter(vbe, addIn, testExplorer, testEngine); _testMenu = new TestMenu(vbe, addIn, testExplorer, testPresenter); var codeExplorer = new CodeExplorerWindow(); var codePresenter = new CodeExplorerDockablePresenter(parser, vbe, addIn, codeExplorer); codePresenter.RunAllTests += codePresenter_RunAllTests; codePresenter.RunInspections += codePresenter_RunInspections; codePresenter.Rename += codePresenter_Rename; codePresenter.FindAllReferences += codePresenter_FindAllReferences; _codeExplorerMenu = new CodeExplorerMenu(vbe, addIn, codeExplorer, codePresenter); var todoSettings = configService.LoadConfiguration().UserSettings.ToDoListSettings; var todoExplorer = new ToDoExplorerWindow(); var todoPresenter = new ToDoExplorerDockablePresenter(parser, todoSettings.ToDoMarkers, vbe, addIn, todoExplorer); _todoItemsMenu = new ToDoItemsMenu(vbe, addIn, todoExplorer, todoPresenter); var inspectionExplorer = new CodeInspectionsWindow(); var inspectionPresenter = new CodeInspectionsDockablePresenter(inspector, vbe, addIn, inspectionExplorer); _codeInspectionsMenu = new CodeInspectionsMenu(vbe, addIn, inspectionExplorer, inspectionPresenter); _refactorMenu = new RefactorMenu(IDE, AddIn, parser); }
public void createNew() { Debug.Log("Creating new..."); TestMenu menu = new TestMenu(); menu.Show(); }
// Update is called once per frame void Update() { this.global = GameObject.FindObjectOfType <TestMenu> (); string weapon = "None"; string defense = "None"; string utility = "None"; if (this.global.activeWeapon.IsOwned()) { weapon = this.global.activeWeapon.GetItem(); } if (this.global.activeDefense.IsOwned()) { defense = this.global.activeDefense.GetItem(); } if (this.global.activeUtility.IsOwned()) { utility = this.global.activeUtility.GetItem(); } string t = "Current Weapon: \n" + weapon + "\n\n"; t += "Current Defense: \n" + defense + "\n\n"; t += "Current Utility: \n" + utility + "\n"; this.txt.text = t; }
public static void TopMainMenu() { Console.Clear(); Console.WriteLine("Ameex Technologies Admin"); Console.WriteLine(); Console.WriteLine("Select an option: "); Console.WriteLine("1. Students"); Console.WriteLine("2. Tests"); Console.WriteLine("3. Schedule"); Console.WriteLine("4. Enroll"); Console.WriteLine("5. Grade"); switch (Console.ReadLine().Trim()) { case "1": Console.Clear(); Console.WriteLine("Student Entry not implemented. Resetting..."); Thread.Sleep(4000); TopMainMenu(); break; case "2": TestMenu.MainMenu(); break; case "3": ScheduleMenu.MainMenu(); break; case "4": EnrollMenu.MainMenu(); break; case "5": GradeMenu.MainMenu(); break; default: Console.Clear(); Console.WriteLine("Invalid Input. Resetting..."); Thread.Sleep(3000); TopMainMenu(); break; } Console.WriteLine("Press any key to close"); Console.ReadKey(); }
// Use this for initialization void Start() { GameObject persistentData = GameObject.FindGameObjectWithTag("Global"); if (persistentData != null) { this.data = persistentData.GetComponent <TestMenu> (); } }
public void InitializeCharacter() { TestMenu global = GameObject.FindGameObjectWithTag("Global").gameObject.GetComponent <TestMenu>(); string[] weaponData; double[] armorData; float health; if (global == null) { weaponData = new string[] { "Projectile", "Lazer", "BurstJump", "SpeedBurst" }; armorData = new double[] { 1.0, 1.0, 1.0, 1.0 }; health = 100f; } else { weaponData = global.weaponData; armorData = global.armorData; health = global.health; } /*IAbility ab; * for (int i = 0; i < weaponData.Length; i++) { * switch (weaponData [i]) { * case "Projectile": * ab = new BasicAttack ("Projectile", 10f, 10f, 10f, 10f, 0.5f); * break; * case "Lazer": * ab = new BasicAttack ("Lazer", 10f, 10f, 10f, 10f, 0.5f); * break; * case "BurstJump": * ab = new BurstJump (500f, 5f); * break; * case "Rush": * ab = new Rush (4000f, 3f); * break; * case "SpeedBurst": * ab = new SpeedBurst(-2f,5f); * break; * case "GrenadeToss": * ab = new GrenadeToss(30f,30f,30f,30f,6f); * break; * case "DeathLazer": * ab = new DeathLazer(5f,5f,5f,5f,5f); * break; * default: * ab = new BasicAttack ("Projectile", 0f, 0f, 0f, 0f, 0.5f); * break; * } * this.playerAbility.SetAbility (ab, i); * }*/ this.playerDefense.SetResistance(armorData [0], armorData [1], armorData [2], armorData [3]); this.playerDefense.ResetHealth(health); this.currentSpeed = speed; this.gcd = Time.time; }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Player")) { GameObject persistentData = GameObject.FindGameObjectWithTag("Global"); persistentData.name = "returnPersistentData"; TestMenu menuData = persistentData.GetComponent <TestMenu>(); menuData.nextLevel = this.nextLevel; Application.LoadLevel(2); } }
// Update is called once per frame void Update() { this.global = GameObject.FindObjectOfType <TestMenu> (); if (!this.global.library.GetItem(this.item).IsOwned()) { this.button.image.color = Color.grey; } else { this.button.image.color = Color.white; } }
/// ------------------------------------------------------------------- /// <summary> /// This will test that the menu and it's menu names are as defined in the Xml tree /// </summary> /// ------------------------------------------------------------------- private void TS_VerifyXmlToTree(XmlNode xmlNode, TestMenu menu) { // If they are both null, we are at the end...just return then if (xmlNode == null && menu == null) { return; } // Make sure both are either null, or something if ((xmlNode == null && menu != null) || (xmlNode != null && menu == null)) { ThrowMe(CheckType.Verification, "Mismatch1!"); } string curName = menu.AutomationElement.GetCurrentPropertyValue(AutomationElement.NameProperty) as string; string expName = new StringBuilder(xmlNode.Name).Replace("_", " ").ToString(); // Verify that the NameProperty returned something valid if (String.IsNullOrEmpty(curName)) { ThrowMe(CheckType.Verification, "AutomationElement.NameProperty is empty or null"); } // Everything looks good, so tell the user what we are doing Comment("Comparing expected name(" + expName + ") with actual name(" + curName + ")"); if (expName != curName) { ThrowMe(CheckType.Verification, "Expected element with name of " + expName + ", yet it was " + curName); } // MenuItems need to be expanded to get to the children. Menu's don't since they are only containers that are // already opened. if (menu.Expandable) { menu.Expand(); } // Recurse the children and siblings if (xmlNode.FirstChild != null) { TS_VerifyXmlToTree(xmlNode.FirstChild, menu.GetFirstSubMenu()); } if (xmlNode.NextSibling != null) { TS_VerifyXmlToTree(xmlNode.NextSibling, menu.GetNextSiblingMenu()); } }
public RubberduckMenu(VBE vbe, AddIn addIn, IConfigurationService configService, Parser parser, IEnumerable <IInspection> inspections) { _vbe = vbe; _configService = configService; _testMenu = new TestMenu(_vbe, addIn); _codeExplorerMenu = new CodeExplorerMenu(_vbe, addIn, parser); var todoSettings = configService.LoadConfiguration().UserSettings.ToDoListSettings; _todoItemsMenu = new ToDoItemsMenu(_vbe, addIn, todoSettings, parser); _codeInspectionsMenu = new CodeInspectionsMenu(_vbe, addIn, parser, inspections); //_refactorMenu = new RefactorMenu(_vbe, addIn); }
private void Load() { TextureManager.LoadTexture("block", "block"); TextureManager.LoadTexture("suprise", "suprise"); TextureManager.LoadTexture("dude", "player"); TextureManager.LoadTexture("animNumbers", "animatie0", 4, 2); TextureManager.LoadTexture("animLetters", "animatie1", 5, 2); TextureManager.LoadTexture("tiletest", "block", 0, 0); AudioManager.LoadEffect("bleep", "blocklock"); AudioManager.LoadTrack("music", "beethoven"); TestMenu testMenu = new TestMenu(); TestGame testGame = new TestGame(); game.states.AddState("menu", testMenu); game.states.AddState("game", testGame); game.states.SetStartingState("menu"); }
public void TestMenuStructureAndNames(TestCaseAttribute testCase, object[] arguments) { XmlDocument doc = new XmlDocument(); if (arguments == null) { throw new ArgumentException(); } string xml = (string)arguments[0]; //"Step: Load the argument into an XmlDocument", TS_LoadMenuDefinition(xml, ref doc, CheckType.Verification); //"Verify: That the menu tree matches the XmlDocument tree structure by name" TestMenu menuBar = _appCommands.GetIWUIMenuCommands().GetMenuBar().GetFirstSubMenu(); TS_VerifyXmlToTree(doc.DocumentElement.FirstChild, menuBar); }
// Use this for initialization void Start() { this.canClimb = false; this.isStun = false; rb2d = gameObject.GetComponent <Rigidbody2D> (); anim = gameObject.GetComponent <Animator> (); this.playerAbility = gameObject.GetComponentInChildren <CharacterAbility> (); this.playerDefense = gameObject.GetComponentInChildren <CharacterDefense> (); this.fit = gameObject.GetComponentInChildren <FittingMenu> (); TestMenu global = GameObject.FindObjectOfType <TestMenu> (); this.fit.Equip(global.activeWeapon); this.fit.Equip(global.activeDefense); this.fit.Equip(global.activeUtility); this.fit.SetAbility(); InitializeCharacter(); }
public RubberduckMenu(VBE vbe, AddIn addIn, IGeneralConfigService configService, IRubberduckParser parser, IActiveCodePaneEditor editor, IInspector inspector) : base(vbe, addIn) { _addIn = addIn; _parser = parser; _configService = configService; var testExplorer = new TestExplorerWindow(); var testEngine = new TestEngine(); var testGridViewSort = new GridViewSort <TestExplorerItem>(RubberduckUI.Result, false); var testPresenter = new TestExplorerDockablePresenter(vbe, addIn, testExplorer, testEngine, testGridViewSort); _testMenu = new TestMenu(vbe, addIn, testExplorer, testPresenter); var codeExplorer = new CodeExplorerWindow(); var codePresenter = new CodeExplorerDockablePresenter(parser, vbe, addIn, codeExplorer); codePresenter.RunAllTests += CodePresenterRunAllAllTests; codePresenter.RunInspections += codePresenter_RunInspections; codePresenter.Rename += codePresenter_Rename; codePresenter.FindAllReferences += codePresenter_FindAllReferences; codePresenter.FindAllImplementations += codePresenter_FindAllImplementations; _codeExplorerMenu = new CodeExplorerMenu(vbe, addIn, codeExplorer, codePresenter); var todoSettings = configService.LoadConfiguration().UserSettings.ToDoListSettings; var todoExplorer = new ToDoExplorerWindow(); var todoGridViewSort = new GridViewSort <ToDoItem>(RubberduckUI.Priority, false); var todoPresenter = new ToDoExplorerDockablePresenter(parser, todoSettings.ToDoMarkers, vbe, addIn, todoExplorer, todoGridViewSort); _todoItemsMenu = new ToDoItemsMenu(vbe, addIn, todoExplorer, todoPresenter); var inspectionExplorer = new CodeInspectionsWindow(); var inspectionGridViewSort = new GridViewSort <CodeInspectionResultGridViewItem>(RubberduckUI.Component, false); var inspectionPresenter = new CodeInspectionsDockablePresenter(inspector, vbe, addIn, inspectionExplorer, inspectionGridViewSort); _codeInspectionsMenu = new CodeInspectionsMenu(vbe, addIn, inspectionExplorer, inspectionPresenter); _refactorMenu = new RefactorMenu(IDE, AddIn, parser, editor); }
// Use this for initialization void Start() { this.nextLevel = 3; money = 0; this.activeWeapon = new NonItem(); this.activeDefense = new NonItem(); this.activeUtility = new NonItem(); this.library = new ItemLibrary(); this.activeWeapon = this.library.GetItem("GrenadeLauncher"); this.health = 100f; GameObject oldData = GameObject.Find("oldPersistentData"); if (oldData != null) { this.money += oldData.GetComponent <TestMenu>().money; Destroy(oldData); } GameObject returnData = GameObject.Find("returnPersistentData"); if (returnData != null) { TestMenu data = returnData.GetComponent <TestMenu>(); this.money += data.money; this.nextLevel = data.nextLevel; this.activeWeapon = data.activeWeapon; this.activeUtility = data.activeUtility; this.activeDefense = data.activeDefense; this.health = data.health; this.library = data.library; Destroy(returnData); } DontDestroyOnLoad(transform.gameObject); availableWeapons = new string[] { "Projectile", "Lazer", "BurstJump", "Rush", "SpeedBurst", "GrenadeToss", "DeathLazer" }; weaponData = new string[] { availableWeapons [0], availableWeapons [0], availableWeapons [0], availableWeapons [0] }; buttonTracker = new int[] { 0, 0, 0, 0 }; armorData = new double[] { 1.0, 1.0, 1.0, 1.0 }; }
private void loginEvent() { try { user = function.Login(textBoxUserID.Text, textBoxPassword.Text); } catch (Exception e) { MessageBox.Show(e.Message, e.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); throw; } if (user == null) { MessageBox.Show("Null value, tolong cek koneksi, apakah database sudah dihidupkan apa tidak", "Unknown Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { switch ((int)user.Status) { case 0: MessageBox.Show("Tidak dapat menemukan User, Tolong periksa Username and Password", "Tidak dapat menemukan user", MessageBoxButtons.OK, MessageBoxIcon.Error); textBoxPassword.Text = null; break; case 1: GlobalVar.GlobalVarUserID = user.UserID; GlobalVar.GlobalVarPassword = user.Password; GlobalVar.GlobalVarProfileID = user.ProfileID; GlobalVar.GlobalVarUsername = user.Username; textBoxUserID.Text = ""; textBoxPassword.Text = ""; textBoxUserID.Focus(); this.Hide(); TestMenu mainMenuForm = new TestMenu(); mainMenuForm.ShowDialog(); this.Close(); break; case 2: MessageBox.Show("User dalam keadaan Frozen, tolong hubungi admin", "User dalam keadaan frozen", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case 3: MessageBox.Show("User sudah di delete, Tolong pakai user yang lain", "User sudah di delete", MessageBoxButtons.OK, MessageBoxIcon.Error); break; default: MessageBox.Show("Tolong hubungi Admin", "Unknown error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } } }
// Use this for initialization void Start() { this.button = GetComponent <Button> (); this.item = this.button.name; this.global = GameObject.FindObjectOfType <TestMenu> (); }
// Use this for initialization void Start() { this.global = GameObject.FindObjectOfType <TestMenu> (); this.txt = GetComponent <Text> (); }
// Update is called once per frame void Update() { this.global = GameObject.FindObjectOfType <TestMenu> (); }
// Use this for initialization void Start() { this.wasTouched = false; anim = gameObject.GetComponent <Animator> (); this.testMenu = GameObject.FindObjectOfType <TestMenu> (); }
static void Main(string[] args) { var testMenu = new TestMenu(); testMenu.Display(); }
// Update is called once per frame void Update() { this.global = GameObject.FindObjectOfType <TestMenu> (); txt.text = "Available Gold\n" + this.global.money; }