public ChildDialog(GraphicsControl sender, Rectangle rect, Dialog parent, DialogData data)
     : base(sender, rect, data)
 {
     ParentDialog = parent;
     //Parent = parent;
     ParentAttachPoint = Anchor.TopRight;
 }
Exemplo n.º 2
0
        public Button(GraphicsControl context, Dialog parent, DialogData data)
            : base(context, parent, "button", data)
        {
            ImageType = ImageType.EndCap;
            //Text = Name;
            TextStyles[(int)Race.Terran] =
                TextStyles[(int)Race.Protoss] =
                TextStyles[(int)Race.Zerg] = FontParser.Fonts["StandardButton"];
            Images[(int)Race.Terran] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normalpressed_terran.dds");
            Images[(int)Race.Protoss] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normalpressed_protoss.dds");
            Images[(int)Race.Zerg] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normalpressed_zerg.dds");
            HoverImages[(int)Race.Terran] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normaloverpressedover_terran.dds");
            HoverImages[(int)Race.Protoss] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normaloverpressedover_protoss.dds");
            HoverImages[(int)Race.Zerg] =
                new SingleTextureProperty("Assets\\Textures\\ui_button_generic_normaloverpressedover_zerg.dds");

            ImageType = ImageType.Border;
            Text = Name;
            IsHalfTexture = true;
        }
Exemplo n.º 3
0
 public Slider(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "slider", data)
 {
     Images[(int)Race.Terran] = new SingleTextureProperty("Assets\\Textures\\ui_glue_sliderframe_terran.dds");
     Images[(int)Race.Protoss] = new SingleTextureProperty("Assets\\Textures\\ui_battlenet_glue_sliderframe.dds");
     Images[(int)Race.Zerg] = new SingleTextureProperty("Assets\\Textures\\ui_glue_sliderframe_zerg.dds");
     ImageType = ImageType.Border;
 }
Exemplo n.º 4
0
        public Label(GraphicsControl context, Dialog parent, DialogData data)
            : base(context, parent, "label", data)
        {
            Text = Name;

            TextStyles[(int)Race.Terran] =
                TextStyles[(int)Race.Protoss] =
                TextStyles[(int)Race.Zerg] = FontParser.Fonts["StandardLabel"];
        }
 public DialogCreatorControl()
 {
     data = new DialogData();
     Dialog mainDialog = new Dialog(null, new Rectangle(0, 0, 500, 400), data);
     mainDialog.Anchor = Dialog_Creator.Enums.Anchor.Center;
     data.Dialogs.Add(mainDialog);
     InitializeComponent();
     graphicsControl1.Parent = this;
 }
 public DialogControl(GraphicsControl context, Dialog parent, string baseName, DialogData data)
     : base(context, parent, baseName, data)
 {
     RenderPriority = 512;
     Enabled = true;
     FullDialog = false;
     Visible = true;
     Text = "";
     TintColors[0] = TintColors[1] = TintColors[2] = Color.White;
     BlendMode = BlendMode.Alpha;
 }
Exemplo n.º 7
0
 public ListBox(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "listBox", data)
 {
     Images[(int)Race.Terran] = new SingleTextureProperty("Assets\\Textures\\ui_glue_listboxframe_terran.dds");
     Images[(int)Race.Protoss] = new SingleTextureProperty("Assets\\Textures\\ui_battlenet_glue_listboxframe.dds");
     Images[(int)Race.Zerg] = new SingleTextureProperty("Assets\\Textures\\ui_glue_listboxframe_zerg.dds");
     ImageType = ImageType.Border;
     TextStyles[(int) Race.Terran] =
         TextStyles[(int) Race.Protoss] =
         TextStyles[(int) Race.Zerg] = FontParser.Fonts["StandardListBox"];
 }
Exemplo n.º 8
0
 public Pulldown(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "pulldown", data)
 {
     Images[(int)Race.Terran] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_terran.dds");
     Images[(int)Race.Protoss] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_protoss.dds");
     Images[(int)Race.Zerg] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normalpressed_zerg.dds");
     HoverImages[(int)Race.Terran] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_terran.dds");
     HoverImages[(int)Race.Protoss] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_protoss.dds");
     HoverImages[(int)Race.Zerg] = new SingleTextureProperty(@"Assets\Textures\ui_glue_dropdownbutton_normaloverpressedover_zerg.dds");
     ImageType = ImageType.EndCap;
     IsHalfTexture = true;
 }
 public ProgressBar(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "progressBar", data)
 {
     Images[(int) Race.Terran] =
         Images[(int) Race.Protoss] =
         Images[(int) Race.Zerg] =
         new SingleTextureProperty(@"Assets\Textures\progress-queue.dds");
     TintColors[(int)Race.Terran] = new Color(40, 125, 75);
     TintColors[(int)Race.Protoss] = new Color(35, 125, 254);
     TintColors[(int)Race.Zerg] = new Color(229, 95, 5);
     ImageType = ImageType.Normal;
     MaxValue = 1f;
     IsHalfTexture = true;
 }
        private void StyleBrowserDialog_Load(object sender, EventArgs e)
        {
            Dialog mainDialog = new Dialog(graphicsControl1, new Rectangle(0, 0, 200, 200), null);
            mainDialog.Fullscreen = true;
            mainDialog.ImageType = ImageType.None;
            graphicsControl1.AddDialog(mainDialog);

            label = new Label(graphicsControl1, mainDialog, null);
            label.Text = TBTestText.Text;
            label.TextStyle = SelectedFont;
            label.Size = new Size(graphicsControl1.DrawWidth, graphicsControl1.DrawHeight);
            label.Offset = new Point(0, 0);
            label.RenderPriority = 513;
            mainDialog.AddControl(label);
            graphicsControl1.Invalidate();
        }
Exemplo n.º 11
0
 public CheckBox(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "checkBox", data)
 {
     Images[(int)Race.Terran] =
         new SingleTextureProperty("Assets\\Textures\\ui_glue_checkbox_normalpressed_terran.dds");
     Images[(int)Race.Protoss] =
         new SingleTextureProperty("Assets\\Textures\\ui_battlenet_glue_checkbox_normalpressed.dds");
     Images[(int)Race.Zerg] =
         new SingleTextureProperty("Assets\\Textures\\ui_glue_checkbox_normalpressed_zerg.dds");
     HoverImages[(int)Race.Terran] =
         new SingleTextureProperty("Assets\\Textures\\ui_glue_checkbox_normaloverpressedover_terran.dds");
     HoverImages[(int)Race.Protoss] =
         new SingleTextureProperty("Assets\\Textures\\ui_battlenet_glue_checkbox_normaloverpressedover.dds");
     HoverImages[(int)Race.Zerg] =
         new SingleTextureProperty("Assets\\Textures\\ui_glue_checkbox_normaloverpressedover_zerg.dds");
     ImageType = ImageType.Normal;
     IsHalfTexture = true;
 }
 public void AddDialog(Dialog item)
 {
     items.Add(item);
     SelectedItems.Clear();
     SelectedItems.Add(item);
     MainSelectedItem = item;
 }
Exemplo n.º 13
0
        private void MakeNewDialog()
        {
            if (openProjectDir == null)
            {
            //Open an unsaved file

            }
            else
            {
            //Make file, and open it
                //Find it's position in the gui tree
                TreeNode folderNode = projectView.SelectedNode ??
                                        ProjectProperties.CurrentProjectPropperties.SrcFolder.GUINode;

                DirItem markedChild = (DirItem) folderNode.Tag;
                FolderItem parentFolder = (FolderItem) (markedChild.Parent ?? markedChild);
                if (markedChild is FolderItem)
                    parentFolder = (FolderItem) markedChild;

                //Find a default unique name
                string name = "New dialog.Dialog";
                int i = 1;
                while (parentFolder.Children.Any(child => child.Text == name))
                {
                    i++;
                    name = "New dialog" + i + ".Dialog";
                }
                DialogItem item = new DialogItem(parentFolder);
                item.Name = name;

                //Create the file
                DialogData dialogData = new DialogData();
                Dialog mainDialog = new Dialog(null, new Rectangle(0, 0, 500, 400), dialogData);
                mainDialog.Anchor = Dialog_Creator.Enums.Anchor.TopLeft;
                dialogData.Dialogs.Add(mainDialog);
                dialogData.Save(item.FullName);

                //Todo: Add to compiler

                item.GUINode = new TreeNode(name);
                item.GUINode.SelectedImageIndex = item.GUINode.ImageIndex = 5;
                item.GUINode.Tag = item;
                //Image index

                //Insert into tree
                int insertAt = parentFolder.Children.IndexOf(markedChild) + 1;
                if (insertAt == 0 || insertAt == parentFolder.Children.Count)
                {
                    parentFolder.Children.Add(item);
                    parentFolder.GUINode.Nodes.Add(item.GUINode);
                }
                else
                {
                    parentFolder.Children.Insert(insertAt, item);
                    parentFolder.GUINode.Nodes.Insert(insertAt, item.GUINode);
                }

                item.CodeGUINode = new TreeNode(name.Substring(0, name.LastIndexOf(".Dialog")) + ".galaxy++");
                item.CodeGUINode.SelectedImageIndex = item.CodeGUINode.ImageIndex = 2;
                item.CodeGUINode.Tag = item;
                item.GUINode.Nodes.Add(item.CodeGUINode);

                item.DesignerGUINode =
                    new TreeNode(name.Substring(0, name.LastIndexOf(".Dialog")) + ".Designer.galaxy++");
                item.DesignerGUINode.SelectedImageIndex = item.DesignerGUINode.ImageIndex = 2;
                item.DesignerGUINode.Tag = item;
                item.GUINode.Nodes.Add(item.DesignerGUINode);

                compiler.AddDialogFile(item);

                ProjectProperties.CurrentProjectPropperties.Save();
                UploadedChangesToMap = false;
                UploadToMap();

                projectView.SelectedNode = item.GUINode;
                item.GUINode.EnsureVisible();
                BeginRename(item.GUINode);
            }
        }
Exemplo n.º 14
0
        public override void PrintInitialization(StringBuilder builder)
        {
            //myDialog = DialogCreate(width, height, anchor, x, y, modal)
            builder.Append("\t\t");
            builder.Append(Name);
            builder.Append(" = DialogCreate(");
            builder.Append(Size.Width);
            builder.Append(", ");
            builder.Append(Size.Height);
            builder.Append(", ");
            builder.Append(Anchor.ToSCIIString());
            builder.Append(", ");
            builder.Append(Offset.X);
            builder.Append(", ");
            builder.Append(Offset.Y);
            builder.Append(", ");
            builder.Append(Modal.ToString().ToLower());
            builder.AppendLine(");");

            Dialog defaultDialog = new Dialog(null, new Rectangle(0, 0, 100, 100), Data);
            defaultDialog.ContextChanged(Context);

            if (Image != defaultDialog.Image && (defaultDialog.Image == null || Image.Path != defaultDialog.Image.Path))
            {
                //Set texture
                //DialogSetImage(myDialog, "my texture");
                builder.Append("\t\tDialogSetImage(");
                builder.Append(Name);
                builder.Append(", \"");
                builder.Append(Image.Path.Replace("\\", "\\\\"));
                builder.AppendLine("\");");
            }

            if (Title != defaultDialog.Title)
            {
                //DialogSetTitle(myDialog, "my title");
                builder.Append("\t\tDialogSetTitle(");
                builder.Append(Name);
                builder.Append(", \"");
                builder.Append(Title);
                builder.AppendLine("\");");
            }

            if (Offscreen != defaultDialog.Offscreen)
            {
                //DialogSetOffscreen(myDialog, true);
                builder.Append("\t\tDialogSetOffscreen(");
                builder.Append(Name);
                builder.Append(", \"");
                builder.Append(Offscreen);
                builder.AppendLine("\");");
            }

            if (Fullscreen != defaultDialog.Fullscreen)
            {
                //DialogSetOffscreen(myDialog, true);
                builder.Append("\t\tDialogSetFullscreen(");
                builder.Append(Name);
                builder.Append(", ");
                builder.Append(Fullscreen.ToString().ToLower());
                builder.AppendLine(");");
            }

            if (BackgroundVisible != defaultDialog.BackgroundVisible)
            {
                //DialogSetOffscreen(myDialog, true);
                builder.Append("\t\tDialogSetImageVisible(");
                builder.Append(Name);
                builder.Append(", ");
                builder.Append(BackgroundVisible.ToString().ToLower());
                builder.AppendLine(");");
            }

            if (Transparency != defaultDialog.Transparency)
            {
                //DialogSetOffscreen(myDialog, true);
                builder.Append("\t\tDialogSetTransparency(");
                builder.Append(Name);
                builder.Append(", \"");
                builder.Append(Transparency);
                builder.AppendLine("\");");
            }

            if (Visible != defaultDialog.Visible)
            {
                //this->SetVisible(PlayerGroupAll(), true);
                builder.Append("\t\tthis->SetVisible(PlayerGroupAll(), ");
                builder.Append(Visible.ToString().ToLower());
                builder.AppendLine(");");
            }
        }
Exemplo n.º 15
0
 public virtual void SetParent(Dialog dialog)
 {
     Parent = dialog;
 }
Exemplo n.º 16
0
        public override void PrintInitialization(StringBuilder builder)
        {
            //myDialog = DialogCreate(width, height, anchor, x, y, modal)
            builder.Append("\t\t");
            builder.Append(Name);
            builder.Append(" = DialogCreate(");
            builder.Append(Size.Width);
            builder.Append(", ");
            builder.Append(Size.Height);
            builder.Append(", ");
            builder.Append(Anchor.ToSCIIString());
            builder.Append(", ");
            builder.Append(Offset.X);
            builder.Append(", ");
            builder.Append(Offset.Y);
            builder.Append(", ");
            builder.Append(Modal.ToString().ToLower());
            builder.AppendLine(");");

            Dialog defaultDialog = new Dialog(null, new Rectangle(0, 0, 100, 100), Data);

            defaultDialog.ContextChanged(Context);

            if (Image != defaultDialog.Image && (defaultDialog.Image == null || Image.Path != defaultDialog.Image.Path))
            {
                //Set texture
                //DialogSetImage(myDialog, "my texture");
                builder.Append("\t\tDialogSetImage(");
                builder.Append(Name);
                builder.Append(", \"");
                builder.Append(_imagePath2ScriptPath(Image.Path.Replace("\\", "\\\\")));
                builder.AppendLine("\");");
            }

            if (Title != defaultDialog.Title)
            {
                //DialogSetTitle(myDialog, "my title");
                builder.Append("\t\tDialogSetTitle(");
                builder.Append(Name);
                builder.Append(", \"");
                builder.Append(Title);
                builder.AppendLine("\");");
            }

            if (Offscreen != defaultDialog.Offscreen)
            {
                //DialogSetOffscreen(myDialog, true);
                builder.Append("\t\tDialogSetOffscreen(");
                builder.Append(Name);
                builder.Append(", \"");
                builder.Append(Offscreen);
                builder.AppendLine("\");");
            }


            if (Fullscreen != defaultDialog.Fullscreen)
            {
                //DialogSetOffscreen(myDialog, true);
                builder.Append("\t\tDialogSetFullscreen(");
                builder.Append(Name);
                builder.Append(", ");
                builder.Append(Fullscreen.ToString().ToLower());
                builder.AppendLine(");");
            }

            if (BackgroundVisible != defaultDialog.BackgroundVisible)
            {
                //DialogSetOffscreen(myDialog, true);
                builder.Append("\t\tDialogSetImageVisible(");
                builder.Append(Name);
                builder.Append(", ");
                builder.Append(BackgroundVisible.ToString().ToLower());
                builder.AppendLine(");");
            }

            if (Transparency != defaultDialog.Transparency)
            {
                //DialogSetOffscreen(myDialog, true);
                builder.Append("\t\tDialogSetTransparency(");
                builder.Append(Name);
                builder.Append(", \"");
                builder.Append(Transparency);
                builder.AppendLine("\");");
            }

            if (Visible != defaultDialog.Visible)
            {
                //this->SetVisible(PlayerGroupAll(), true);
                builder.Append("\t\tthis->SetVisible(PlayerGroupAll(), ");
                builder.Append(Visible.ToString().ToLower());
                builder.AppendLine(");");
            }
        }
Exemplo n.º 17
0
 public ImageControl(GraphicsControl context, Dialog parent, DialogData data)
     : base(context, parent, "image", data)
 {
     ImageType = ImageType.Normal;
     Images[0] = Images[1] = Images[2] = new SingleTextureProperty("Assets\\Textures\\white32.dds");
 }
Exemplo n.º 18
0
 public virtual void SetParent(Dialog dialog)
 {
     ParentDialog = Parent = dialog;
 }