public override void Update(Vector2 OFFSET) { try { text.txt = (Globals.curDir == "") ? Globals.currentNode.path : "processing: " + Globals.curDir; } catch { text.txt = "Select Folder"; } if (Globals.GetBoxOverlap((pos - dim / 2) + OFFSET, dim, Globals.mouse.newMousePos, Vector2.Zero) && Globals.curDir == "") { color = new Color(50, 50, 50, 50); if (Globals.mouse.LeftClick()) { using (var dialog = new FolderBrowserDialog()) { if (DialogResult.OK == dialog.ShowDialog()) { Globals.currentNode = new DirectoryNode(null, dialog.SelectedPath, false); main.SwitchDirectory(Globals.currentNode); } } } } else { color = new Color(50, 50, 50, 80); } pos = new Vector2(Globals.screenWidth / 2 - 40, 20); dim = new Vector2(Globals.screenWidth - 100, 30); //60 text.Update(OFFSET); cdbtn.pos = new Vector2(Globals.screenWidth - 88 + cdbtn.dim.X / 2, pos.Y); cdbtn.dim = new Vector2(40, 30); if (Globals.curDir == "") { cdbtn.Update(OFFSET); } try { cdbtn.node = Globals.currentNode.parent; } catch { } base.Update(OFFSET); }
public override void Update(Vector2 OFFSET) { if (node.locked) { color = new Color(60, 10, 10, 80); } else { if (Globals.GetBoxOverlap((pos - dim / 2) + OFFSET, dim, Globals.mouse.newMousePos, Vector2.Zero)) { color = new Color(50, 50, 50, 50); if (Globals.mouse.LeftClick()) { //main.SwitchDirectory(node); if (unfolded) { main.CloseDirectory(node); unfolded = false; } else { main.OpenDirectory(node); unfolded = true; } } } else { color = new Color(50, 50, 50, 80); } } cdbtn.pos = new Vector2(Globals.screenWidth - 88 + cdbtn.dim.X / 2, pos.Y); cdbtn.dim = new Vector2(40, 30); cdbtn.Update(OFFSET); base.Update(OFFSET); }