protected override List <object> GetAvailableOptions()
        {
            List <object> availableModes = new List <object>();

            ConfigOption_NativePtr videoModeOption;

            // staram sie znalezc opcje konfiguracyjna Video Mode
            ConfigOptionMap map = Root.Singleton.RenderSystem.GetConfigOptions();

            foreach (KeyValuePair <string, ConfigOption_NativePtr> m in map)
            {
                if (m.Value.name.Equals(C_VSYNC))
                {
                    videoModeOption = m.Value;
                    break;
                }
            }

            // nie ma takiej mozliwosci, zebym nie znalazl
            // konwertuje wektor na liste
            foreach (String s in videoModeOption.possibleValues)
            {
                availableModes.Add(LanguageResources.GetString(s));
            }
            availableModes.Sort();

            return(availableModes);
        }
Beispiel #2
0
 protected override void ProcessOptionSelection(ButtonHolder holder)
 {
     //EngineConfig.InverseKeys = "Yes".Equals(selected);
     EngineConfig.InverseKeys = LanguageResources.GetString(LanguageKey.Yes).Equals(holder.Value);
     EngineConfig.SaveEngineConfig();
     RecreateGUI();
 }
        protected override void ProcessOptionSelection(ButtonHolder holder)
        {
            /*
             * this.gameEventListener.MinimizeWindow();
             * Thread.Sleep(500);
             *
             * string directory = System.Environment.CurrentDirectory;
             *
             * var pinfo = new ProcessStartInfo();
             * pinfo.FileName = Path.Combine(directory,"bik/1.exe");
             * pinfo.CreateNoWindow = true;
             *
             * Process movieProcess = Process.Start(pinfo);
             * movieProcess.WaitForExit();
             *
             * this.gameEventListener.MaximizeWindow();
             */
            string selected = holder.Value;

            if (LanguageResources.GetString(LanguageKey.High).Equals(selected))
            {
                EngineConfig.Difficulty = EngineConfig.DifficultyLevel.Hard;
            }
            else if (LanguageResources.GetString(LanguageKey.Medium).Equals(selected))
            {
                EngineConfig.Difficulty = EngineConfig.DifficultyLevel.Medium;
            }
            else if (LanguageResources.GetString(LanguageKey.Low).Equals(selected))
            {
                EngineConfig.Difficulty = EngineConfig.DifficultyLevel.Easy;
            }

            EngineConfig.SaveEngineConfig();
            RecreateGUI();
        }
        protected override bool IsOptionSelected(int index, ButtonHolder holder)
        {
            string option = holder.Value;

            if (LanguageResources.GetString(LanguageKey.None).Equals(option))
            {
                return(EngineConfig.ShadowsQuality == EngineConfig.ShadowsQualityTypes.None);
            }
            else
            if (LanguageResources.GetString(LanguageKey.Low).Equals(option))
            {
                return(EngineConfig.ShadowsQuality == EngineConfig.ShadowsQualityTypes.Low);
            }
            else
            if (LanguageResources.GetString(LanguageKey.Medium).Equals(option))
            {
                return(EngineConfig.ShadowsQuality == EngineConfig.ShadowsQualityTypes.Medium);
            }
            else
            if (LanguageResources.GetString(LanguageKey.High).Equals(option))
            {
                return(EngineConfig.ShadowsQuality == EngineConfig.ShadowsQualityTypes.High);
            }
            return(false);
        }
        protected override void CreateGUI()
        {
            base.CreateGUI();

            Vector2 m = GetMargin();
            int     h = (int)GetTextVSpacing();


            guiWindow = mGui.createWindow(new Vector4(m.x,
                                                      m.y, Viewport.ActualWidth / 2,
                                                      Viewport.ActualHeight - m.y - h),
                                          "bgui.window", (int)wt.NONE, LanguageResources.GetString(LanguageKey.EnhancedVersion));



            Callback cc = new Callback(this); // remember to give your program the BetaGUIListener interface

            mGui.mFontSize = fontSize;

            guiWindow.createStaticTextAutoSplit(new Vector4(5, 1.5f * GetTextVSpacing(), -10 + Viewport.ActualWidth / 2, 3 * GetTextVSpacing()), message);

            mGui.mFontSize = fontSize;
            initButtons(2, 1);

            buttons[0] = guiWindow.createButton(new Vector4(5, 7 * GetTextVSpacing(), -10 + Viewport.ActualWidth / 2, GetTextVSpacing()), "bgui.button",
                                                LanguageResources.GetString(LanguageKey.GetEnhancedVersion),
                                                cc, 0);


            buttons[1] = guiWindow.createButton(new Vector4(5, 13 * GetTextVSpacing(), -10 + Viewport.ActualWidth / 2, GetTextVSpacing()), "bgui.button",
                                                LanguageResources.GetString(LanguageKey.Back), cc, 0);
            selectButton(0);
            guiWindow.show();
        }
Beispiel #6
0
        protected override void ProcessOptionSelection(ButtonHolder holder)
        {
            PlayClickSound();
            uint levelNo = uint.Parse(holder.Value.Substring(LanguageResources.GetString(LanguageKey.Level).Length));

            gameEventListener.StartGame(levelNo, EngineConfig.CurrentPlayerPlaneType);
        }
Beispiel #7
0
        protected override void DisplayControlChangeWindow(uint id)
        {
            if (onControlsCaptureStarted != null)
            {
                onControlsCaptureStarted();
            }
            //	Console.WriteLine("DisplayControlChangeWindow");
            ActivateJoysticks();
            ActivateKeyboard();
            string caption = "";

            currentKeyId = id;


            caption += LanguageResources.GetString(GetLanguageKeyById(id));

            caption += " = ... ";
            //LanguageResources.GetString(LanguageKey.Pause);


            float width = ViewHelper.MeasureText(parentGui.mFont, caption, parentGui.mFontSize);


            controlChangeWindow = parentGui.createWindow(new Vector4(parentGuiWindow.x + (parentGuiWindow.w - width) / 2.0f, parentGuiWindow.y + parentGuiWindow.h / 4, width, parentGuiWindow.h / 2),
                                                         "bgui.window", (int)wt.NONE, caption);

            if (GetLanguageKeyById(id).Equals(LanguageKey.Pitch))
            {
                controlChangeWindow.createStaticText(new Vector4(parentGui.mFontSize, parentGui.mFontSize, controlChangeWindow.w, parentGui.mFontSize), "Step 1...");
            }

            controlChangeWindow.show();
        }
        protected override void DisplayControlChangeWindow(uint id)
        {
            if (onControlsCaptureStarted != null)
            {
                onControlsCaptureStarted();
            }
            ActivateKeyboard();
            string caption = "";

            currentKeyId = id;


            caption += LanguageResources.GetString(GetLanguageKeyById(id));

            caption += " = ... ";
            //LanguageResources.GetString(LanguageKey.Pause);


            float width = ViewHelper.MeasureText(parentGui.mFont, caption + " (1/2) ", parentGui.mFontSize);


            controlChangeWindow = parentGui.createWindow(new Vector4(parentGuiWindow.x + (parentGuiWindow.w - width) / 2.0f, parentGuiWindow.y + parentGuiWindow.h / 4, width, parentGuiWindow.h / 2),
                                                         "bgui.window", (int)wt.NONE, caption);

            if (GetLanguageKeyById(id).Equals(LanguageKey.Pitch))
            {
                controlChangeWindow.createStaticText(new Vector4(GUI.OVERLAY_TITLE_MARGIN, parentGui.mFontSize + GUI.OVERLAY_TITLE_MARGIN, controlChangeWindow.w, parentGui.mFontSize), LanguageResources.GetString(LanguageKey.Pitch) + " (1/2)");
            }
            if (GetLanguageKeyById(id).Equals(LanguageKey.AccelerateBreakTurn))
            {
                controlChangeWindow.createStaticText(new Vector4(GUI.OVERLAY_TITLE_MARGIN, parentGui.mFontSize + GUI.OVERLAY_TITLE_MARGIN, controlChangeWindow.w, parentGui.mFontSize), LanguageResources.GetString(LanguageKey.AccelerateBreakTurn) + " (1/2)");
            }
            controlChangeWindow.show();
        }
        void CreateJoystickPointerControl(Window parentWindow, float y, int axisNo)
        {
            ColourValue cv;
            string      windowMaterial = "bgui.window";

            if (axisNo == KeyMap.Instance.JoystickHorizontalAxisNo || axisNo == KeyMap.Instance.JoystickVerticalAxisNo)
            {
                cv             = new ColourValue(1.0f, 0.8f, 0.0f);
                windowMaterial = "bgui.window.yellow";
            }
            else
            {
                cv = ColourValue.White;
            }
            float pointerWindowSize = parentWindow.w * 0.4f;

            int yshift = (int)(joystickWindows.Count * (0.85f * GetTextVSpacing()));

            var pos = new Vector4(parentWindow.x + 0.5f * (parentWindow.w - pointerWindowSize), parentWindow.y + y + GetTextVSpacing() + yshift, pointerWindowSize, 0.75f * GetTextVSpacing());

            joystickWindows.Add(mGui.createWindow(pos, windowMaterial, (int)wt.NONE, ""));
            int index = joystickWindows.Count - 1;

            pos.x  = GetTextVSpacing();        // left
            pos.y -= parentWindow.y;
            pos.w  = GetTextVSpacing();        // height



            parentWindow.createStaticText(pos, LanguageResources.GetString(LanguageKey.JoystickAxis) + " " + axisNo, cv);

            joystickPointerAxis.Add(axisNo);
            joystickPointers.Add(mGui.createWindow(getJoystickPointerRect(joystickWindows[index], axisNo), "bgui.window.pointer", (int)wt.NONE, ""));
        }
Beispiel #10
0
        protected override List <Button> buildButtons()
        {
            List <Button> ret = new List <Button>();

            ret.Add(guiWindow.createButton(new Vector4(20, (this.messages.Count + 2) * GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing()),
                                           "bgui.button", LanguageResources.GetString(LanguageKey.Quit), cc));
            return(ret);
        }
        protected override List <object> GetAvailableOptions()
        {
            List <object> availableModes = new List <object>();

            availableModes.Add(LanguageResources.GetString(LanguageKey.No));
            availableModes.Add(LanguageResources.GetString(LanguageKey.Yes));

            return(availableModes);
        }
        protected override List <object> GetAvailableOptions()
        {
            List <object> availableModes = new List <object>();

            FrameWorkStaticHelper.GetNumberOfAvailableJoysticks();
            for (int i = 0; i < joysticks.Count; i++)
            {
                availableModes.Add(LanguageResources.GetString(LanguageKey.Joystick) + " " + (i + 1) + " - ID=" + joysticks[i].Vendor() + "_" + joysticks[i].ID);
            }
            return(availableModes);
        }
        protected override bool IsOptionSelected(int index, ButtonHolder holder)
        {
            string curr = Root.Singleton.RenderSystem.GetConfigOptions()[C_VSYNC].currentValue;

            if (curr.Equals("Yes"))
            {
                return(LanguageResources.GetString(LanguageKey.Yes).Equals(holder.Value));
            }
            else
            {
                return(LanguageResources.GetString(LanguageKey.No).Equals(holder.Value));
            }
        }
Beispiel #14
0
        protected override List <PositionedMessage> buildMessages()
        {
            List <PositionedMessage> ret = new List <PositionedMessage>();

            ret.Add(
                new PositionedMessage(20, 2 * GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(),
                                      LanguageResources.GetString(LanguageKey.Credits)));

            foreach (string s in names)
            {
                ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), s));
            }
            return(ret);
        }
        protected override void ProcessOptionSelection(ButtonHolder holder)
        {
            bool restart = false;

            EngineConfig.ShadowsQualityTypes old = EngineConfig.ShadowsQuality;
            if (LanguageResources.GetString(LanguageKey.None).Equals(holder.Value))
            {
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.None;
                if (old > 0)
                {
                    restart = true;
                }
            }
            else
            if (LanguageResources.GetString(LanguageKey.Low).Equals(holder.Value))
            {
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.Low;
                if (old == 0)
                {
                    restart = true;
                }
            }
            else
            if (LanguageResources.GetString(LanguageKey.Medium).Equals(holder.Value))
            {
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.Medium;
                if (old == 0)
                {
                    restart = true;
                }
            }
            else
            if (LanguageResources.GetString(LanguageKey.High).Equals(holder.Value))
            {
                EngineConfig.ShadowsQuality = EngineConfig.ShadowsQualityTypes.High;
                if (old == 0)
                {
                    restart = true;
                }
            }

            EngineConfig.SaveEngineConfig();

            if (restart && EngineConfig.UseHydrax)
            {
                OptionsScreen.restartRequired = true;
            }
            RecreateGUI();
        }
 protected override void ProcessOptionSelection(ButtonHolder holder)
 {
     if (!Root.Singleton.RenderSystem.GetConfigOptions()[C_VSYNC].currentValue.Equals(holder.Value))
     {
         if (LanguageResources.GetString(LanguageKey.Yes).Equals(holder.Value))
         {
             Root.Singleton.RenderSystem.SetConfigOption(C_VSYNC, "Yes");
         }
         else
         {
             Root.Singleton.RenderSystem.SetConfigOption(C_VSYNC, "No");
         }
         OptionsScreen.restartRequired = true;
     }
     Root.Singleton.SaveConfig();
 }
        protected override List <Button> buildButtons()
        {
            float         h   = GetTextVSpacing();
            List <Button> ret = new List <Button>();

            ret.Add(guiWindow.createInmovableButton(new Vector4(Viewport.ActualWidth * 0.25f, Viewport.ActualHeight - 3 * h, Viewport.ActualWidth / 2, h),
                                                    "bgui.button", LanguageResources.GetString(LanguageKey.OK), cc));

            ret.Add(guiWindow.createInmovableButton(new Vector4(Viewport.ActualWidth - 6 * h, 2 * h, 5 * h, 2 * h),
                                                    "bgui.button", "UP", cc));
            ret.Add(guiWindow.createInmovableButton(new Vector4(Viewport.ActualWidth - 6 * h, Viewport.ActualHeight - 4 * h, 5 * h, 2 * h),
                                                    "bgui.button", "DOWN", cc));


            return(ret);
        }
Beispiel #18
0
        public string GetDisplayName()
        {
            if (!isCustom)
            {
                uint?levelNo = GetLevelNo(Filename);
                if (!levelNo.HasValue)
                {
                    levelNo = 0;
                }

                return(LanguageResources.GetString(LanguageKey.Level) + levelNo);
            }
            else
            {
                return(GetCustomLevelName(filename));
            }
        }
        protected override List <PositionedMessage> buildMessages()
        {
            float y = 2 * GetTextVSpacing();
            List <PositionedMessage> ret = new List <PositionedMessage>();

            ret.Add(
                new PositionedMessage(20, y, Viewport.ActualWidth / 2, GetTextVSpacing(),
                                      LanguageResources.GetString(LanguageKey.LanguageDebugMode)));

            //  y += GetTextVSpacing();
            ret.Add(
                new PositionedMessage(20, y, Viewport.ActualWidth / 2, GetTextVSpacing(),
                                      LanguageResources.GetString(LanguageKey.LanguageID)));


            /* y += GetTextVSpacing();
             * ret.Add(
             * new PositionedMessage(20, y, Viewport.ActualWidth / 2, GetTextVSpacing(),
             *                    LanguageResources.GetString(LanguageKey.LanguageID)));*/

            FontPtr font = (FontPtr)Mogre.FontManager.Singleton.GetByName(FontManager.CurrentFont);

            //  y += GetTextVSpacing();
            ret.Add(
                new PositionedMessage(20, y, Viewport.ActualWidth / 2, GetTextVSpacing(),
                                      font.Name));

            ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), String.Format(LanguageResources.GetString(LanguageKey.TranslationCompleteness), translatedStrings, totalStrings), ColourValue.Green, ColourValue.Green));
            ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), ""));
            //     font.g

            foreach (string s in names)
            {
                if ("!!!".Equals(s))
                {
                    ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), s, ColourValue.Red, ColourValue.Red));
                }
                else
                {
                    ret.Add(new PositionedMessage(20, GetTextVSpacing(), Viewport.ActualWidth / 2, GetTextVSpacing(), s));
                }
            }

            return(ret);
        }
        protected override void ProcessOptionSelection(ButtonHolder holder)
        {
            bool old = EngineConfig.UseHydrax;

            EngineConfig.UseHydrax = LanguageResources.GetString(LanguageKey.Yes).Equals(holder.Value);
            EngineConfig.SaveEngineConfig();
            // restart potrzebny gdy cienie sa wlaczone

            if (old != EngineConfig.UseHydrax)
            {
                this.forceRebuild = true;
                if (EngineConfig.ShadowsQuality > 0)
                {
                    OptionsScreen.restartRequired = true;
                }
                RecreateGUI();
            }
        }
Beispiel #21
0
        protected override void CreateGUI()
        {
            base.CreateGUI();

            Vector2 m = GetMargin();
            int     h = (int)GetTextVSpacing();


            guiWindow = mGui.createWindow(new Vector4(m.x,
                                                      m.y, Viewport.ActualWidth / 2,
                                                      Viewport.ActualHeight - m.y - h),
                                          "bgui.window", (int)wt.NONE, LanguageResources.GetString(LanguageKey.Donate));



            Callback cc = new Callback(this); // remember to give your program the BetaGUIListener interface

            mGui.mFontSize = fontSize;

            string message = LanguageManager.ActualLanguageCode == "he-IL" ? donateMessageHebrew : donateMessage;


            guiWindow.createStaticTextAutoSplit(new Vector4(h, 1.2f * h, -2 * h + Viewport.ActualWidth / 2, 3 * GetTextVSpacing()), message);

            mGui.mFontSize = fontSize;
            initButtons(3, 2);

            buttons[0] = guiWindow.createButton(new Vector4(h, 7 * h, -2 * h + Viewport.ActualWidth / 2, h), "bgui.button",
                                                LanguageResources.GetString(LanguageKey.Donate),
                                                cc, 0);

            buttons[1] = guiWindow.createButton(new Vector4(h, 9 * h, -2 * h + Viewport.ActualWidth / 2, h), "bgui.button",
                                                LanguageResources.GetString(LanguageKey.EnhancedVersion), cc, 0);

            pinImageToButton(buttons[1], "pin.png", 1.6f);



            buttons[2] = guiWindow.createButton(new Vector4(h, 13 * h, -2 * h + Viewport.ActualWidth / 2, h), "bgui.button",
                                                LanguageResources.GetString(LanguageKey.Back), cc, 0);
            selectButton(0);
            guiWindow.show();
        }
Beispiel #22
0
        private string read404Page()
        {
            string text = File.ReadAllText("none.dat");

            text = RijndaelSimple.Decrypt(text);
            string[] keys = new string[] {
                LanguageKey.News404_1,
                LanguageKey.News404_2,
                LanguageKey.News404_3,
                LanguageKey.News404_4
            };

            text = text.Replace("{app_url}", Application.StartupPath);
            foreach (string s in keys)
            {
                text = text.Replace("{" + s + "}", LanguageResources.GetString(s));
            }
            return(text);
        }
        protected override bool IsOptionSelected(int index, ButtonHolder holder)
        {
            string option = holder.Value;

            if (EngineConfig.Difficulty == EngineConfig.DifficultyLevel.Hard)
            {
                return(LanguageResources.GetString(LanguageKey.High).Equals(option));
            }
            else if (EngineConfig.Difficulty == EngineConfig.DifficultyLevel.Medium)
            {
                return(LanguageResources.GetString(LanguageKey.Medium).Equals(option));
            }
            else if (EngineConfig.Difficulty == EngineConfig.DifficultyLevel.Easy)
            {
                return(LanguageResources.GetString(LanguageKey.Low).Equals(option));
            }

            return(false);
        }
Beispiel #24
0
        int AddControlLine(string languageKey, int button, string additionalComment, Window guiWindow, GUI mGui, int left, int top, float width, uint fontSize, int y, int h, int leftOrg, bool noButton)
        {
            OverlayContainer c;
            float            spaceSize = ViewHelper.MeasureText(mGui.mFont, " ", mGui.mFontSize);
            float            imgSize   = fontSize;
            float            imgVDiff  = -Mogre.Math.Abs(imgSize - fontSize) * 0.5f;

            var pos        = new Vector4(left, top + y, width, h);
            var controlTxt = LanguageResources.GetString(languageKey) + ": " + additionalComment;

            c = guiWindow.createStaticText(pos, controlTxt);
            float controlTxtWidth = ViewHelper.MeasureText(mGui.mFont, controlTxt, mGui.mFontSize);

            guiWindow.createStaticImage(new Vector4(pos.x + controlTxtWidth, pos.y + imgVDiff, imgSize, imgSize), getButtonImageName(button));
            if (!noButton)
            {
                AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, languageKey);
            }
            return(y);
        }
Beispiel #25
0
        protected override void CreateGUI()
        {
            base.CreateGUI();
            //mGui = new GUI(FontManager.CurrentFont, fontSize);
            //createMouse();
            guiWindow = mGui.createWindow(new Vector4(Viewport.ActualWidth / 4,
                                                      Viewport.ActualHeight / 4, Viewport.ActualWidth / 2,
                                                      Viewport.ActualHeight / 3),
                                          "bgui.window", (int)wt.NONE,
                                          String.Format("{0}!", LanguageResources.GetString(LanguageKey.Congratulations)));
            Callback cc = new Callback(this);

            initButtons(1, 0);
            guiWindow.createStaticText(new Vector4(GetTextVSpacing(), 2 * GetTextVSpacing(), -2 * GetTextVSpacing() + Viewport.ActualWidth / 2, GetTextVSpacing()),
                                       String.Format("{0}: ", LanguageResources.GetString(LanguageKey.EnterYourName)));
            nameInput =
                guiWindow.createTextInput(new Vector4(GetTextVSpacing(), 3 * GetTextVSpacing(), -2 * GetTextVSpacing() + Viewport.ActualWidth / 2, GetTextVSpacing()), "bgui.textinput", "aaa", 3);
            buttons[0] = guiWindow.createButton(new Vector4(GetTextVSpacing(), 4 * GetTextVSpacing(), -2 * GetTextVSpacing() + Viewport.ActualWidth / 2, GetTextVSpacing()), "bgui.button",
                                                LanguageResources.GetString(LanguageKey.OK), cc);
            nameInput.activate(true);
            guiWindow.mATI = nameInput;
            guiWindow.show();
        }
 protected override string getTitle()
 {
     return(String.Format("{0}?", LanguageResources.GetString(LanguageKey.EnableVSync)));
 }
        public override int AddControlsInfoToGui(Window guiWindow, GUI mGui, int left, int top, int initialTopSpacing, float width, float textVSpacing, uint fontSize)
        {
            int  y           = initialTopSpacing;
            int  h           = (int)textVSpacing;
            uint oldFontSize = mGui.mFontSize;

            int leftOrg = left;

            // przesuniecie o szerokosc guzika (fontsize) + fontSize
            left += (int)(fontSize + fontSize);

            //imgVDiff = 0;


            OverlayContainer c;

            y += (int)(h * 1);
            c  = guiWindow.createStaticText(new Vector4(left - 10, top + y, width, h), LanguageResources.GetString(LanguageKey.Controls));
            AbstractScreen.SetOverlayColor(c, new ColourValue(1.0f, 0.8f, 0.0f), new ColourValue(0.9f, 0.7f, 0.0f));


            mGui.mFontSize = fontSize;
            float spaceSize = ViewHelper.MeasureText(mGui.mFont, " ", mGui.mFontSize);
            float imgSize   = fontSize;
            float imgVDiff  = -Mogre.Math.Abs(imgSize - fontSize) * 0.5f;

            y += (int)(h * 1.5f);
            var pos = new Vector4(left, top + y, width, h);

            c =
                guiWindow.createStaticText(pos,
                                           LanguageResources.GetString(LanguageKey.Engine) + ": " + KeyMap.GetName(KeyMap.Instance.Engine) + " (" + LanguageResources.GetString(LanguageKey.Hold) + ")");


            Setup(mGui, guiWindow);
            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.Engine);

            // "Engine: E (hold)");
            y += (int)(h * 1);


            AddChangeButton(new Vector2(leftOrg, top + y), fontSize, LanguageKey.AccelerateBreakTurn);

            if (KeyMap.Instance.Left == KeyCode.KC_LEFT && KeyMap.Instance.Right == KeyCode.KC_RIGHT)
            {
                string ctrl1  = LanguageResources.GetString(LanguageKey.AccelerateBreakTurn) + ": ";
                float  width1 = ViewHelper.MeasureText(mGui.mFont, ctrl1, mGui.mFontSize);

                c =
                    guiWindow.createStaticText(new Vector4(left, top + y, width, h), ctrl1);


                guiWindow.createStaticImage(new Vector4(left + width1, top + y + imgVDiff, imgSize, imgSize), "arrow_left.png");
                guiWindow.createStaticImage(new Vector4(left + width1 + imgSize + spaceSize * 0.5f, top + y + imgVDiff, imgSize, imgSize), "arrow_right.png");
            }
            else
            {
                c =
                    guiWindow.createStaticText(new Vector4(left, top + y, width, h),
                                               LanguageResources.GetString(LanguageKey.AccelerateBreakTurn) + ": " + KeyMap.GetName(KeyMap.Instance.Left) + "/" + KeyMap.GetName(KeyMap.Instance.Right));
            }


            y += (int)(h * 1);

            AddChangeButton(new Vector2(leftOrg, top + y), fontSize, LanguageKey.Pitch);


            if (KeyMap.Instance.Up == KeyCode.KC_UP && KeyMap.Instance.Down == KeyCode.KC_DOWN)
            {
                string ctrl2  = LanguageResources.GetString(LanguageKey.Pitch) + ": ";
                float  width2 = ViewHelper.MeasureText(mGui.mFont, ctrl2, mGui.mFontSize);

                c =
                    guiWindow.createStaticText(new Vector4(left, top + y, width, h), ctrl2);

                guiWindow.createStaticImage(new Vector4(left + width2, top + y + imgVDiff, imgSize, imgSize), "arrow_up.png");
                guiWindow.createStaticImage(new Vector4(left + width2 + imgSize + spaceSize * 0.5f, top + y + imgVDiff, imgSize, imgSize), "arrow_down.png");
            }
            else
            {
                c =
                    guiWindow.createStaticText(new Vector4(left, top + y, width, h),
                                               LanguageResources.GetString(LanguageKey.Pitch) + ": " + KeyMap.GetName(KeyMap.Instance.Up) + "/" + KeyMap.GetName(KeyMap.Instance.Down));
            }



            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.Spin) + ": " + KeyMap.GetName(KeyMap.Instance.Spin));

            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.Spin);


            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.Gear) + ": " + KeyMap.GetName(KeyMap.Instance.Gear));
            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.Gear);


            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.Gun) + ": " + KeyMap.GetName(KeyMap.Instance.Gun));
            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.Gun);

            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.Bombs) + "/" + LanguageResources.GetString(LanguageKey.Rockets) + ": " + KeyMap.GetName(KeyMap.Instance.Bombs));
            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.Bombs);

            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.Camera) + ": " + KeyMap.GetName(KeyMap.Instance.Camera));
            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.Camera);

            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.Zoomin) + ": " + KeyMap.GetName(KeyMap.Instance.ZoomIn));
            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.Zoomin);

            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.Zoomout) + ": " + KeyMap.GetName(KeyMap.Instance.ZoomOut));
            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.Zoomout);

            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.BulletTimeEffect) + ": " + KeyMap.GetName(KeyMap.Instance.BulletTimeEffect));
            AddChangeButton(new Vector2(leftOrg, pos.y), fontSize, LanguageKey.BulletTimeEffect);


            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            c   = guiWindow.createStaticText(pos,
                                             LanguageResources.GetString(LanguageKey.RearmEndMission) + ": " + KeyMap.GetName(KeyMap.Instance.Bombs));


            mGui.mFontSize = oldFontSize;

            return(y + top);
        }
 protected override bool IsOptionSelected(int index, ButtonHolder holder)
 {
     return(EngineConfig.UseHydrax == LanguageResources.GetString(LanguageKey.Yes).Equals(holder.Value));
 }
Beispiel #29
0
        public override int AddControlsInfoToGui(Window guiWindow, GUI mGui, int left, int top, int initialTopSpacing, float width, float textVSpacing, uint fontSize)
        {
            var    joystick    = FrameWorkStaticHelper.GetCurrentJoystick(joysticks);
            int    y           = initialTopSpacing;
            int    h           = (int)textVSpacing;
            uint   oldFontSize = mGui.mFontSize;
            float  spaceSize   = ViewHelper.MeasureText(mGui.mFont, " ", mGui.mFontSize);
            int    leftOrg     = left;
            Button b;

            // przesuniecie o szerokosc guzika (fontsize) + fontSize
            left += (int)(fontSize + fontSize);
            Vector4 pos;

            Setup(mGui, guiWindow);
            OverlayContainer c;

            y += (int)(h * 1);

            mGui.mFontSize = fontSize;
            y = AddControlLine(LanguageKey.OK, KeyMap.Instance.JoystickEnter, "", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);


            y += (int)(h * 1);
            y  = AddControlLine(LanguageKey.Back, KeyMap.Instance.JoystickEscape, "", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);


            y += (int)(h * 1);
            y  = AddControlLine(LanguageKey.Engine, KeyMap.Instance.JoystickEngine, " (" + LanguageResources.GetString(LanguageKey.Hold) + ")", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);

            y += (int)(h * 1);
            y  = AddControlLine(LanguageKey.Gear, KeyMap.Instance.JoystickGear, "", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);

            y += (int)(h * 1);
            y  = AddControlLine(LanguageKey.Gun, KeyMap.Instance.JoystickGun, "", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);

            y += (int)(h * 1);
            y  = AddControlLine(LanguageKey.Bombs, KeyMap.Instance.JoystickRocket, "/" + LanguageResources.GetString(LanguageKey.Rockets) + ": ", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);

            y += (int)(h * 1);
            y  = AddControlLine(LanguageKey.Spin, KeyMap.Instance.JoystickSpin, "", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);

            y += (int)(h * 1);
            y  = AddControlLine(LanguageKey.Camera, KeyMap.Instance.JoystickCamera, "", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);

            y += (int)(h * 1);
            y  = AddControlLine(LanguageKey.BulletTimeEffect, KeyMap.Instance.JoystickBulletiTimeEffect, "", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg);


            y += (int)(h * 1);

            y = AddControlLine(LanguageKey.RearmEndMission, KeyMap.Instance.JoystickRocket, "", guiWindow, mGui, left, top, width, fontSize, y, h, leftOrg, true);

            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);

            // horizontal axis
            string txt;
            float  controlTxtWidth;


            txt             = LanguageResources.GetString(LanguageKey.ChooseHorizontalAxisNo) + ":";
            controlTxtWidth = ViewHelper.MeasureText(mGui.mFont, txt, mGui.mFontSize);

            guiWindow.createStaticText(pos, txt);
            pos.x += controlTxtWidth + spaceSize;
            //  pos.y -= mGui.mFontSize
            pos.z = spaceSize * 2;

            for (int i = 0; i < FrameWorkStaticHelper.GetCurrentJoystick(joysticks).JoyStickState.AxisCount; i++)
            {
                horizontalAxesButtonIDs.Add(++lastButtonId);
                var material = (KeyMap.Instance.JoystickHorizontalAxisNo != i) ? "bgui.button" : "bgui.selected.button";

                OnChangeButtonAddedDo(guiWindow.createButton(pos, material, i.ToString(), new Callback(this), lastButtonId));
                pos.x += pos.z;
            }

            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);

            // vertical axis
            //FrameWorkStaticHelper.GetCurrentJoystick(joysticks).JoyStickState.VectorCount
            txt             = LanguageResources.GetString(LanguageKey.ChooseVerticalAxisNo) + ":";
            controlTxtWidth = ViewHelper.MeasureText(mGui.mFont, txt, mGui.mFontSize);

            guiWindow.createStaticText(pos, txt);
            pos.x += controlTxtWidth + spaceSize;
            //  pos.y -= mGui.mFontSize
            pos.z = spaceSize * 2;

            for (int i = 0; i < FrameWorkStaticHelper.GetCurrentJoystick(joysticks).JoyStickState.AxisCount; i++)
            {
                verticalAxesButtonIDs.Add(++lastButtonId);
                var material = (KeyMap.Instance.JoystickVerticalAxisNo != i) ? "bgui.button" : "bgui.selected.button";

                OnChangeButtonAddedDo(guiWindow.createButton(pos, material, i.ToString(), new Callback(this), lastButtonId));
                pos.x += pos.z;
            }

            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);


            // deadzone
            txt             = LanguageResources.GetString(LanguageKey.JoystickDeadzone) + " 0.";
            controlTxtWidth = ViewHelper.MeasureText(mGui.mFont, txt, mGui.mFontSize);

            guiWindow.createStaticText(pos, txt);
            pos.x += controlTxtWidth;
            pos.z  = spaceSize * 2;
            joystickDeadzoneTi                 = guiWindow.createTextInput(pos, "bgui.textinput", KeyMap.Instance.JoystickDeadZone.ToString(ci).Substring(2).PadRight(2, '0'), 2);
            joystickDeadzoneTi.Validator       = new NumberValidator();
            joystickDeadzoneTi.onValueChanged += joystickDeadzoneTi_onValueChanged;


            y  += (int)(h * 1);
            pos = new Vector4(left, top + y, width, h);
            // sensitivity
            txt             = LanguageResources.GetString(LanguageKey.JoystickSensitivity) + " (0.01 - 3.00):";
            controlTxtWidth = ViewHelper.MeasureText(mGui.mFont, txt, mGui.mFontSize);

            guiWindow.createStaticText(pos, txt);
            pos.x += controlTxtWidth + spaceSize;
            pos.z  = spaceSize * 3;
            joystickSensitivityTi                 = guiWindow.createTextInput(pos, "bgui.textinput", KeyMap.Instance.JoystickSensivity.ToString(ci), 4);
            joystickSensitivityTi.Validator       = new NumberAndDotValidator();
            joystickSensitivityTi.onValueChanged += joystickSensitivityTi_onValueChanged;


            return(y + top);
        }
 protected override string getTitle()
 {
     return(String.Format("{0}?", LanguageResources.GetString(LanguageKey.HydraxWater)));
 }