public Widget(ContainerWidget parentNode, RectangleF positionAndSize) { this.Visible = true; this.Name = "New" + Widget.WidgetTypes[this.GetType()].ClassName.Substring(8) + GlobalSettings.GetUniqueInt(); this.TreeNode = new TreeNode(this.Name); if (this is ContainerWidget) { this.TreeNode.ImageIndex = 0; this.TreeNode.SelectedImageIndex = 0; } else { this.TreeNode.ImageIndex = 1; this.TreeNode.SelectedImageIndex = 1; } this.ParentNode = parentNode; this.TreeNode.Tag = this; if (parentNode != null) { parentNode.TreeNode.Nodes.Add(this.TreeNode); } this.PositionAndSize = positionAndSize; this.IsShown = false; this.Visible = true; this.TreeNode.Checked = true; this.ZPriority = 0f; this.Group = ""; this.ForceToHandleMouseEventsFlag = false; this.ForceToNeverBeFoundFlag = false; }
public Widget(XElement e, ContainerWidget parentNode) { this.Name = e.Element("Name").Value; this.TreeNode = new TreeNode(this.Name); if (this is ContainerWidget) { this.TreeNode.ImageIndex = 0; this.TreeNode.SelectedImageIndex = 0; } else { this.TreeNode.ImageIndex = 1; this.TreeNode.SelectedImageIndex = 1; } this.ParentNode = parentNode; this.TreeNode.Tag = this; if (parentNode != null) { parentNode.TreeNode.Nodes.Add(this.TreeNode); } XElement rectangle = e.Element("Rectangle"); this.PositionAndSize = XmlConverter.ToRectangleF(rectangle); this.IsShown = bool.Parse(e.Element("IsShown").Value); this.Visible = this.IsShown; this.TreeNode.Checked = this.IsShown; this.ZPriority = float.Parse(e.Element("ZPriority").Value); this.Group = e.Element("Group").Value; this.ForceToHandleMouseEventsFlag = bool.Parse(e.Element("ForceToHandleMouseEventsFlag").Value); this.ForceToNeverBeFoundFlag = bool.Parse(e.Element("ForceToNeverBeFoundFlag").Value); }
public ProgressBarWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { this.Background = new Texture(e.Element("BackgroundMaterial")); this.Update = new WidgetUpdate(e); this.ProgressBarValue = float.Parse(e.Element("ProgressBarValue").Value); this.ProgressBarLimit = float.Parse(e.Element("ProgressBarLimit").Value); }
public ProgressBarWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.Background = new Texture("", new RectangleF(0, 0, 1, 1), Color.White); this.Update = new WidgetUpdate("", true); this.ProgressBarValue = 50f; this.ProgressBarLimit = 100f; }
private void tsmiCreateWidget(object sender, EventArgs e) { ContainerWidget parentNode = treeViewWidgets.SelectedNode.Tag as ContainerWidget; Type widgetType = Widget.TypeFromString((sender as ToolStripMenuItem).Tag as string); ConstructorInfo info = widgetType.GetConstructor(new Type[] { typeof(ContainerWidget), typeof(RectangleF) }); Widget widget = (Widget)info.Invoke(new object[] { parentNode, new RectangleF(0, 0, 100, 100) }); parentNode.SubWidgets.Add(widget); }
public StaticTextWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { this.Background = new Texture(e.Element("BackgroundMaterial")); this.Text = new S5Writing(e.Element("StringHelper")); this.Update = new WidgetUpdate(e); this.FirstLineToPrint = int.Parse(e.Element("FirstLineToPrint").Value); this.NumberOfLinesToPrint = int.Parse(e.Element("NumberOfLinesToPrint").Value); this.LineDistanceFactor = float.Parse(e.Element("LineDistanceFactor").Value); }
public StaticTextWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.Background = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155)); this.Text = new S5Writing("data\\menu\\fonts\\standard12.met", new S5String("", "@center New Text"), 0f, Color.White); this.Update = new WidgetUpdate("", true); this.FirstLineToPrint = 0; this.NumberOfLinesToPrint = 0; this.LineDistanceFactor = 0f; }
public CustomWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { this.CustomClassName = e.Element("CustomClassName").Value; this.IntegerUserVariable0DefaultValue = int.Parse(e.Element("IntegerUserVariable0DefaultValue").Value); this.IntegerUserVariable1DefaultValue = int.Parse(e.Element("IntegerUserVariable1DefaultValue").Value); this.IntegerUserVariable2DefaultValue = int.Parse(e.Element("IntegerUserVariable2DefaultValue").Value); this.IntegerUserVariable3DefaultValue = int.Parse(e.Element("IntegerUserVariable3DefaultValue").Value); this.IntegerUserVariable4DefaultValue = int.Parse(e.Element("IntegerUserVariable4DefaultValue").Value); this.IntegerUserVariable5DefaultValue = int.Parse(e.Element("IntegerUserVariable5DefaultValue").Value); this.StringUserVariable0DefaultValue = e.Element("StringUserVariable0DefaultValue").Value; this.StringUserVariable1DefaultValue = e.Element("StringUserVariable1DefaultValue").Value; }
public CustomWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.CustomClassName = "EGUIX::CVideoPlaybackCustomWidget"; this.IntegerUserVariable0DefaultValue = 0; this.IntegerUserVariable1DefaultValue = 0; this.IntegerUserVariable2DefaultValue = 0; this.IntegerUserVariable3DefaultValue = 0; this.IntegerUserVariable4DefaultValue = 0; this.IntegerUserVariable5DefaultValue = 0; this.StringUserVariable0DefaultValue = ""; this.StringUserVariable1DefaultValue = ""; }
public ContainerWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { this.SubWidgets = new List <Widget>(); XElement subWidget = e.Element("SubWidgets").FirstNode as XElement; while (subWidget != null) { this.SubWidgets.Add(Widget.ParseWidget(subWidget, this)); subWidget = subWidget.NextNode as XElement; } }
private void tsmiPaste_Click(object sender, EventArgs e) { ContainerWidget toInsertInto = treeViewWidgets.SelectedNode.Tag as ContainerWidget; string toParse = (string)Clipboard.GetData(DataFormats.StringFormat); try { XDocument xd = XDocument.Parse(toParse); Widget toInsert = Widget.ParseWidget(xd.Element("WidgetList"), toInsertInto); toInsertInto.SubWidgets.Add(toInsert); } catch { MessageBox.Show("Not a widget! -______-"); } }
private void CreateNewGUI() { treeViewWidgets.Nodes.Clear(); RectangleF defaultPosAndSize = new RectangleF(0, 0, 1024, 768); baseWidget = new SpecialBonusBaseShitWidget(null, defaultPosAndSize); firstWidget = new ContainerWidget(baseWidget, defaultPosAndSize); baseWidget.SubWidgets.Add(firstWidget); baseWidget.Name = "GUIRoot"; firstWidget.Name = "Root"; firstWidget.TreeNode.Text = "Root"; treeViewWidgets.Nodes.Add(firstWidget.TreeNode); pBGameView.Invalidate(); }
public ButtonWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.Disabled = false; this.HighLighted = false; this.LuaCommand = ""; this.ShortCutString = new S5String("", "New Button"); this.ButtonNormal = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155)); this.ButtonHover = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155)); this.ButtonPressed = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155)); this.ButtonDisabled = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155)); this.ButtonHighlighted = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155)); this.ToolTipHelper = new Tooltip(false, new S5String("", "New Button"), "", false, ""); this.Update = new WidgetUpdate("", true); }
private void loadToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = GlobalSettings.DataPath; ofd.Filter = "S5 GUI File (*.xml)|*.xml"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { XDocument xd = XDocument.Load(ofd.FileName); XElement root = xd.Element("root"); treeViewWidgets.Nodes.Clear(); baseWidget = new SpecialBonusBaseShitWidget(root, null); firstWidget = baseWidget.SubWidgets[0] as ContainerWidget; treeViewWidgets.Nodes.Add(baseWidget.SubWidgets[0].TreeNode); pBGameView.Invalidate(); } }
public ButtonWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { XElement buttonHelper = e.Element("ButtonHelper"); this.Disabled = bool.Parse(buttonHelper.Element("DisabledFlag").Value); this.HighLighted = bool.Parse(buttonHelper.Element("HighLightedFlag").Value); this.LuaCommand = buttonHelper.Element("ActionFunction").Element("LuaCommand").Value; this.ShortCutString = new S5String(buttonHelper.Element("ShortCutString")); IEnumerable <XElement> buttons = e.Elements("Materials"); this.ButtonNormal = new Texture(buttons.ElementAt(0)); this.ButtonHover = new Texture(buttons.ElementAt(1)); this.ButtonPressed = new Texture(buttons.ElementAt(2)); this.ButtonDisabled = new Texture(buttons.ElementAt(3)); this.ButtonHighlighted = new Texture(buttons.ElementAt(4)); this.ToolTipHelper = new Tooltip(e.Element("ToolTipHelper")); this.Update = new WidgetUpdate(e); }
public static Widget ParseWidget(XElement e, ContainerWidget parentNode) { Widget widget; switch (e.FirstAttribute.Value) { case "EGUIX::CContainerWidget": widget = new ContainerWidget(e, parentNode); break; case "EGUIX::CStaticWidget": widget = new StaticWidget(e, parentNode); break; case "EGUIX::CGfxButtonWidget": widget = new GfxButtonWidget(e, parentNode); break; case "EGUIX::CTextButtonWidget": widget = new TextButtonWidget(e, parentNode); break; case "EGUIX::CStaticTextWidget": widget = new StaticTextWidget(e, parentNode); break; case "EGUIX::CCustomWidget": widget = new CustomWidget(e, parentNode); break; case "EGUIX::CProgressBarWidget": widget = new ProgressBarWidget(e, parentNode); break; case "EGUIX::CPureTooltipWidget": widget = new PureTooltipWidget(e, parentNode); break; default: throw new NotImplementedException(); } return(widget); }
private void treeView1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { if (e.Data.GetDataPresent("System.Windows.Forms.TreeNode", false) && this.NodeMap != null && this.NodeMap != "") { TreeNode MovingNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode"); string[] NodeIndexes = this.NodeMap.Split('|'); TreeNodeCollection InsertCollection = this.treeViewWidgets.Nodes; for (int i = 0; i < NodeIndexes.Length - 1; i++) { InsertCollection = InsertCollection[Int32.Parse(NodeIndexes[i])].Nodes; } if (InsertCollection != null && NodeIndexes.Length > 1) { treeViewWidgets.SuspendLayout(); Widget moveWidget = MovingNode.Tag as Widget; ContainerWidget wContainer = firstWidget; for (int i = 1; i < NodeIndexes.Length - 1; i++) { int idx = int.Parse(NodeIndexes[i]); wContainer = wContainer.SubWidgets[idx] as ContainerWidget; } wContainer.SubWidgets.Insert(int.Parse(NodeIndexes.Last()), null); ContainerWidget oldParent = moveWidget.ParentNode; moveWidget.ParentNode = wContainer; oldParent.SubWidgets.Remove(moveWidget); int repIdx = wContainer.SubWidgets.IndexOf(null); wContainer.SubWidgets[repIdx] = moveWidget; TreeNode newNode = (TreeNode)MovingNode.Clone(); RecursivelyCopyLinks(MovingNode, newNode); InsertCollection.Insert(Int32.Parse(NodeIndexes[NodeIndexes.Length - 1]), newNode); this.treeViewWidgets.SelectedNode = InsertCollection[Int32.Parse(NodeIndexes[NodeIndexes.Length - 1])]; MovingNode.Remove(); treeViewWidgets.ResumeLayout(true); pBGameView.Invalidate(); } } }
public PureTooltipWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.Tooltip = new Tooltip(false, new S5String("", "New Tooltip"), "", false, ""); }
public PureTooltipWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { this.Tooltip = new Tooltip(e.Element("ToolTipHelper")); }
public ContainerWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.SubWidgets = new List <Widget>(); }
public SpecialBonusBaseShitWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { }
public SpecialBonusBaseShitWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { }
public StaticWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { this.Background = new Texture(e.Element("BackgroundMaterial")); }
public TextButtonWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.ButtonText = new S5Writing("data\\menu\\fonts\\standard12.met", new S5String("", "@center New Button"), 0f, Color.White); }
public TextButtonWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { this.ButtonText = new S5Writing(e.Element("StringHelper")); }
public GfxButtonWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.IconMaterial = new Texture("", new RectangleF(0, 0, 1, 1), Color.FromArgb(100, 155, 155, 155)); }
} // use? public GfxButtonWidget(XElement e, ContainerWidget parentNode) : base(e, parentNode) { this.IconMaterial = new Texture(e.Element("IconMaterial")); }
public StaticWidget(ContainerWidget parentNode, RectangleF positionAndSize) : base(parentNode, positionAndSize) { this.Background = new Texture("", new RectangleF(0, 0, 1, 1), Color.Black); }