Beispiel #1
0
 private void GermanToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _lang.ChangeLanguage(LangID.German);
     germanToolStripMenuItem.Checked  = true;
     englishToolStripMenuItem.Checked = false;
     MessageBox.Show(Lang.GetText("control_form1_languagechanged_message"));
 }
Beispiel #2
0
 public static void DrawButton(int state, Rect r, string text, Texture2D icon)
 {
     BottomBar.mpos = new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
     if (BottomBar.click2time[state] + 0.05f > Time.time)
     {
         GUI.DrawTexture(r, BottomBar.tWhite);
         GUI.color = Color.black;
         GUI.DrawTexture(new Rect(r.x + (r.width - r.height) / 2f, r.y, r.height, r.height), icon);
         GUI.color = Color.white;
         GUI.DrawTexture(new Rect(r.x, r.y - GUIM.YRES(14f), r.width, GUIM.YRES(16f)), BottomBar.tWhite);
         GUIM.DrawText(new Rect(r.x, r.y - GUIM.YRES(14f), r.width, GUIM.YRES(16f)), text, TextAnchor.MiddleCenter, BaseColor.Black, 0, 10, false);
     }
     else if (r.Contains(BottomBar.mpos))
     {
         BottomBar.button2time[state] = Time.time;
         GUI.DrawTexture(new Rect(r.x + (r.width - r.height) / 2f, r.y, r.height, r.height), icon);
         GUI.DrawTexture(new Rect(r.x, r.y - GUIM.YRES(14f), r.width, GUIM.YRES(16f)), BottomBar.tWhite);
         GUIM.DrawText(new Rect(r.x, r.y - GUIM.YRES(14f), r.width, GUIM.YRES(16f)), text, TextAnchor.MiddleCenter, BaseColor.Black, 0, 10, false);
         if (Input.GetMouseButton(0))
         {
             BottomBar.click2time[state] = Time.time;
         }
     }
     else
     {
         float num  = Time.time - BottomBar.button2time[state];
         float num2 = 16f - num * 100f;
         if (num2 < 2f)
         {
             num2 = 2f;
         }
         GUI.DrawTexture(new Rect(r.x + (r.width - r.height) / 2f, r.y, r.height, r.height), icon);
         GUI.DrawTexture(new Rect(r.x, r.y + GUIM.YRES(2f - num2), r.width, GUIM.YRES(num2)), BottomBar.tWhite);
     }
     if (GUIM.HideButton(r))
     {
         if (state == 0)
         {
             Lang.ChangeLanguage();
         }
         if (state == 1)
         {
             if (Options.menuvol != 0f)
             {
                 Options.menuvol = 0f;
             }
             else
             {
                 Options.menuvol = 0.25f;
             }
             PlayerPrefs.SetFloat("menuvol", Options.menuvol);
             GameObject gameObject = GameObject.Find("Camera");
             if (gameObject && gameObject.GetComponent <AudioSource>())
             {
                 gameObject.GetComponent <AudioSource>().volume = Options.menuvol;
             }
         }
         if (state == 2)
         {
             Options.ToggleFullScreen();
         }
     }
 }