Esempio n. 1
0
        public override void Initialize()
        {
            ShouldBeScaled = false;
            Layer          = 990;

            bback = new Elements.EncyclopediaBrowserButton(20, 440, 80, 30, "Back");
            (bback as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bback.foreground = Color.White;
            //bback.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bback.onClicked += new Elements.Button.ClickedEventHandler(backClick);
            controls.Add(bback);

            bref = new Elements.EncyclopediaBrowserButton(500, 440, 80, 30, "Refresh");
            (bref as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bref.foreground = Color.White;
            //bref.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bref.onClicked += new Elements.Button.ClickedEventHandler(refClick);
            controls.Add(bref);

            bdelete = new Elements.EncyclopediaBrowserButton(600, 440, 80, 30, "Delete");
            (bdelete as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bdelete.foreground = Color.White;
            //bdelete.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick);
            controls.Add(bdelete);

            bsave = new Elements.EncyclopediaBrowserButton(700, 440, 80, 30, "Save");
            (bsave as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bsave.foreground = Color.White;
            //bsave.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bsave.onClicked += new Elements.Button.ClickedEventHandler(saveClick);
            controls.Add(bsave);

            saves = new Elements.ListBox(10, 20, 780, 370);
            saves.onDoubleClicked        += new Elements.ListBox.DoubleClickedEventHandler(saves_onDoubleClicked);
            saves.onSelectedIndexChanged += new Elements.ListBox.SelectedIndexChangedEventHandler(saves_onSelectedIndexChanged);
            controls.Add(saves);

            tb = new Elements.TextBox(10, 400, 780, 30, "");
            tb.onTextChanged  += new Elements.TextBox.TextChangedEventHandler(tb_onTextChanged);
            tb.BackgroundColor = Color.Black;
            tb.ForegroundColor = Color.White;
            tb.CursorColor     = Color.White;
            tb.Multiline       = false;
            controls.Add(tb);

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }
Esempio n. 2
0
        public new void Initialize()
        {
            //ShouldBeScaled = true;
            CanOffset = true;
            Layer = 50;

            tbCode = new Elements.TextBox(0, 0, 500, 250);
            //tbCode.Font = ResourceManager.Load<SpriteFont>("Fonts/CodeEditor");
            size = tbCode.size;
            tbCode.ForegroundColor = new Color(0.1f, 0.6f, 0.1f);
            tbCode.CursorColor = new Color(0.1f, 0.6f, 0.1f);
            tbCode.BackgroundColor = new Color(0f, 0f, 0f) * 0.85f;
            tbCode.SelectionColor = new Color(0.8f,0.8f,0.8f);
            //tbCode.ShouldBeScaled = true;
            tbCode.ShouldOffset = true;
            controls.Add(tbCode);
        }
Esempio n. 3
0
        public new void Initialize()
        {
            //ShouldBeScaled = true;
            CanOffset = true;
            Layer     = 50;

            tbCode = new Elements.TextBox(0, 0, 500, 250);
            //tbCode.Font = ResourceManager.Load<SpriteFont>("Fonts/CodeEditor");
            size = tbCode.size;
            tbCode.ForegroundColor = new Color(0.1f, 0.6f, 0.1f);
            tbCode.CursorColor     = new Color(0.1f, 0.6f, 0.1f);
            tbCode.BackgroundColor = new Color(0f, 0f, 0f) * 0.85f;
            tbCode.SelectionColor  = new Color(0.8f, 0.8f, 0.8f);
            //tbCode.ShouldBeScaled = true;
            tbCode.ShouldOffset = true;
            controls.Add(tbCode);
        }
Esempio n. 4
0
        public new void Initialize()
        {
            vm = new ScripterNet.ScripterVM();
            vm.RegisterFunction("print", GetType().GetMethod("writeln"));
            vm.RegisterFunction("graph", GetType().GetMethod("debuggraph"));

            ShouldBeScaled = false;
            Layer = 90000;

            tbLog = new Elements.TextBox(0, 0, 800, 20 * 20);
            tbLog.Editable = false;
            tbLog.ShouldOffset = false;
            tbLog.Font = ResourceManager.Load<SpriteFont>("Fonts/CourierNew_14");
            tbLog.BackgroundColor = tbLog.BackgroundColor * 0.7f;
            controls.Add(tbLog);

            tbinput = new Elements.TextBox(0, OutputEngine.LOG_LENGTH * 20, 800, 30);
            tbinput.Font = ResourceManager.Load<SpriteFont>("Fonts/CourierNew_14");
            tbinput.BackgroundColor = tbinput.BackgroundColor * 0.7f;
            tbinput.Multiline = true;
            controls.Add(tbinput);

            logoffset = 1000;
            CheckLogRange();

            base.Initialize();

            if (File.Exists("console.txt"))
            {
                string s = File.ReadAllText("console.txt");
                try
                {
                    DoCommand(s);
                }
                catch (Exception e) { }
            }
        }
Esempio n. 5
0
        public override void Initialize()
        {
            ButtonsCount   = FrameButtonsCount.Two;
            ShouldBeScaled = false;

            saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35);
            saves.onElementSelected      += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected);
            saves.onSelectedIndexChanged += new Elements.SavesLoadsList.SelectionEvent(saves_onSelectedIndexChanged);
            controls.Add(saves);

            lTitle            = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Save");
            lTitle.foreground = Color.White;
            controls.Add(lTitle);

            bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23,
                                              120, 23, "Delete");
            bdelete.Font       = ButtonFont;
            bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick);
            controls.Add(bdelete);

            bsave = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23,
                                            120, 23, "Save");
            bsave.Font       = ButtonFont;
            bsave.onClicked += new Elements.Button.ClickedEventHandler(saveClick);
            controls.Add(bsave);

            tb = new Elements.TextBox((int)saves.position.X, (int)bsave.position.Y, (int)saves.size.X, 23, "");
            tb.onTextChanged  += new Elements.TextBox.TextChangedEventHandler(tb_onTextChanged);
            tb.BackgroundColor = Color.White * 0.2f;
            tb.ForegroundColor = Color.White;
            tb.CursorColor     = Color.White;
            tb.Multiline       = false;
            tb.BGAsColor       = true;
            controls.Add(tb);

            base.Initialize();
        }
Esempio n. 6
0
        public new void Initialize()
        {
            vm = new ScripterNet.ScripterVM();
            vm.RegisterFunction("print", GetType().GetMethod("writeln"));
            vm.RegisterFunction("graph", GetType().GetMethod("debuggraph"));

            ShouldBeScaled = false;
            Layer          = 90000;

            tbLog                 = new Elements.TextBox(0, 0, 800, 20 * 20);
            tbLog.Editable        = false;
            tbLog.ShouldOffset    = false;
            tbLog.Font            = ResourceManager.Load <SpriteFont>("Fonts/CourierNew_14");
            tbLog.BackgroundColor = tbLog.BackgroundColor * 0.7f;
            controls.Add(tbLog);

            tbinput                 = new Elements.TextBox(0, OutputEngine.LOG_LENGTH * 20, 800, 30);
            tbinput.Font            = ResourceManager.Load <SpriteFont>("Fonts/CourierNew_14");
            tbinput.BackgroundColor = tbinput.BackgroundColor * 0.7f;
            tbinput.Multiline       = true;
            controls.Add(tbinput);

            logoffset = 1000;
            CheckLogRange();

            base.Initialize();

            if (File.Exists("console.txt"))
            {
                string s = File.ReadAllText("console.txt");
                try
                {
                    DoCommand(s);
                }
                catch (Exception e) { }
            }
        }
Esempio n. 7
0
        public new void Initialize()
        {
            ShouldBeScaled = false;
            CanOffset = false;
            Layer = 700;

            button = new Elements.NewStyleButton(Main.WindowWidth - 28, (Main.WindowHeight - 100) / 2, 156, 34, "S\r\nr\r\ni\r\np\r\nt");
            button.LoadImages("GUI/HUD/ScriptButton");
            button.onClicked+=new Elements.Button.ClickedEventHandler(button_onClicked);
            controls.Add(button);

            tbCode = new Elements.TextBox(50, 50, Main.WindowWidth - 100, Main.WindowHeight - 100);
            tbCode.Font = ResourceManager.Load<SpriteFont>("Fonts/CourierNew_14");
            tbCode.ForegroundColor = new Color(0.1f, 0.6f, 0.1f);
            tbCode.CursorColor = new Color(0.1f, 0.6f, 0.1f);
            tbCode.BackgroundColor = new Color(0f, 0f, 0f);
            tbCode.SelectionColor = new Color(0.8f,0.8f,0.8f);
            tbCode.isVisible = false;
            controls.Add(tbCode);

            Reset();

            base.Initialize();
        }
Esempio n. 8
0
        public new void Initialize()
        {
            ShouldBeScaled = false;
            CanOffset      = false;
            Layer          = 700;

            button = new Elements.NewStyleButton(Main.WindowWidth - 28, (Main.WindowHeight - 100) / 2, 156, 34, "S\r\nr\r\ni\r\np\r\nt");
            button.LoadImages("GUI/HUD/ScriptButton");
            button.onClicked += new Elements.Button.ClickedEventHandler(button_onClicked);
            controls.Add(button);

            tbCode                 = new Elements.TextBox(50, 50, Main.WindowWidth - 100, Main.WindowHeight - 100);
            tbCode.Font            = ResourceManager.Load <SpriteFont>("Fonts/CourierNew_14");
            tbCode.ForegroundColor = new Color(0.1f, 0.6f, 0.1f);
            tbCode.CursorColor     = new Color(0.1f, 0.6f, 0.1f);
            tbCode.BackgroundColor = new Color(0f, 0f, 0f);
            tbCode.SelectionColor  = new Color(0.8f, 0.8f, 0.8f);
            tbCode.isVisible       = false;
            controls.Add(tbCode);

            Reset();

            base.Initialize();
        }
Esempio n. 9
0
        public override void Initialize()
        {
            ShouldBeScaled = false;
            Layer = 990;

            bback = new Elements.EncyclopediaBrowserButton(20, 440, 80, 30, "Back");
            (bback as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bback.foreground = Color.White;
            //bback.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bback.onClicked += new Elements.Button.ClickedEventHandler(backClick);
            controls.Add(bback);

            bref = new Elements.EncyclopediaBrowserButton(500, 440, 80, 30, "Refresh");
            (bref as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bref.foreground = Color.White;
            //bref.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bref.onClicked += new Elements.Button.ClickedEventHandler(refClick);
            controls.Add(bref);

            bdelete = new Elements.EncyclopediaBrowserButton(600, 440, 80, 30, "Delete");
            (bdelete as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bdelete.foreground = Color.White;
            //bdelete.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick);
            controls.Add(bdelete);

            bsave = new Elements.EncyclopediaBrowserButton(700, 440, 80, 30, "Save");
            (bsave as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            bsave.foreground = Color.White;
            //bsave.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont");
            bsave.onClicked += new Elements.Button.ClickedEventHandler(saveClick);
            controls.Add(bsave);

            saves = new Elements.ListBox(10, 20, 780, 370);
            saves.onDoubleClicked += new Elements.ListBox.DoubleClickedEventHandler(saves_onDoubleClicked);
            saves.onSelectedIndexChanged += new Elements.ListBox.SelectedIndexChangedEventHandler(saves_onSelectedIndexChanged);
            controls.Add(saves);

            tb = new Elements.TextBox(10, 400, 780, 30, "");
            tb.onTextChanged += new Elements.TextBox.TextChangedEventHandler(tb_onTextChanged);
            tb.BackgroundColor = Color.Black;
            tb.ForegroundColor = Color.White;
            tb.CursorColor = Color.White;
            tb.Multiline = false;
            controls.Add(tb);

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }
Esempio n. 10
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.Two;
            ShouldBeScaled = false;

            saves = new Elements.SavesLoadsList((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y - 35);
            saves.onElementSelected += new Elements.SavesLoadsList.SaveLoadEvent(saves_onElementSelected);
            saves.onSelectedIndexChanged += new Elements.SavesLoadsList.SelectionEvent(saves_onSelectedIndexChanged);
            controls.Add(saves);

            lTitle = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "Save");
            lTitle.foreground = Color.White;
            controls.Add(lTitle);

            bdelete = new Elements.MenuButton((int)(Position.X + Size.X) - 240, (int)(Position.Y + Size.Y) - 23,
                120, 23, "Delete");
            bdelete.Font = ButtonFont;
            bdelete.onClicked += new Elements.Button.ClickedEventHandler(deleteClick);
            controls.Add(bdelete);

            bsave = new Elements.MenuButton((int)(Position.X + Size.X) - 120, (int)(Position.Y + Size.Y) - 23,
                120, 23, "Save");
            bsave.Font = ButtonFont;
            bsave.onClicked += new Elements.Button.ClickedEventHandler(saveClick);
            controls.Add(bsave);

            tb = new Elements.TextBox((int)saves.position.X, (int)bsave.position.Y, (int)saves.size.X, 23, "");
            tb.onTextChanged += new Elements.TextBox.TextChangedEventHandler(tb_onTextChanged);
            tb.BackgroundColor = Color.White * 0.2f;
            tb.ForegroundColor = Color.White;
            tb.CursorColor = Color.White;
            tb.Multiline = false;
            tb.BGAsColor = true;
            controls.Add(tb);

            base.Initialize();
        }