예제 #1
0
파일: Utama.cs 프로젝트: fadholifh/retakan
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            PanelMain.Hide();
            WebMaps.Hide();
            PanelSearch.Show();
            PnlBg.Hide();
            BtnCari.Hide();
            DTPicker.Hide();
            TxtCari.Focus();
            PnlTxt.Show();
            DGView.Show();
            BtnBTempat.Image = global::Retakan.Properties.Resources.tempat_on;
            BtnBWaktu.Image  = global::Retakan.Properties.Resources.waktu_off;
            BtnTerkini.Image = global::Retakan.Properties.Resources.terkini_off;
            BtnMaps.Image    = global::Retakan.Properties.Resources.peta_off;
            BtnSearch.Image  = global::Retakan.Properties.Resources.cari_on;

            //insert
            koneksiObj.Open();
            SqlDataAdapter adapter = new SqlDataAdapter();
            string         sql     = null;

            sql = "insert into DataGempa (gempa,tempat,waktu,tsunami) values('" + C.mag + "','" + C.place + "','" + C.time.ToString("MM/dd/yyy hh:mm:ss") + "','" + C.tsunami + "')";
            try
            {
                adapter.InsertCommand = new SqlCommand(sql, koneksiObj);
                adapter.InsertCommand.ExecuteNonQuery();

                koneksiObj.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("ex" + ex);
            }
        }
예제 #2
0
파일: Utama.cs 프로젝트: fadholifh/retakan
        private void BtnTerkini_Click(object sender, EventArgs e)
        {
            PanelMain.Show();
            WebMaps.Hide();
            PanelSearch.Hide();
            BtnTerkini.Image = global::Retakan.Properties.Resources.terkini_on;
            BtnMaps.Image    = global::Retakan.Properties.Resources.peta_off;
            BtnSearch.Image  = global::Retakan.Properties.Resources.cari_off;

            rssData        = getRssData("https://rss.sciencedaily.com/earth_climate/earthquakes.xml");
            LblJudul1.Text = rssData[0, 0];
            LblJudul2.Text = rssData[1, 0];
            LblJudul3.Text = rssData[2, 0];
            LblIsi1.Text   = rssData[0, 1];
            LblIsi2.Text   = rssData[1, 1];
            LblIsi3.Text   = rssData[2, 1];

            A.AmbilDataBesar();
            D.AmbilDataMenengah();
            C.AmbilDataKecil();

            LblMag1.Text    = A.mag.ToString("0.0", System.Globalization.CultureInfo.InvariantCulture);
            LblLokasi1.Text = A.place;
            LblWaktu1.Text  = A.time.ToString();
            if (A.tsunami == "0")
            {
                LblPTsunami1.Text = "Tidak Berpotensi Tsunami";
            }
            else
            {
                LblPTsunami1.Text = "Berpotensi Tsunami";
            }
            Console.WriteLine(A.mag.ToString("0.0", System.Globalization.CultureInfo.InvariantCulture) + " Mag");

            LblMag2.Text    = D.mag.ToString("0.0", System.Globalization.CultureInfo.InvariantCulture);;
            LblLokasi2.Text = D.place;
            LblWaktu2.Text  = D.time.ToString();
            Console.WriteLine(D.mag.ToString("0.0", System.Globalization.CultureInfo.InvariantCulture) + " Mag");
            Console.WriteLine(D.tsunami);
            if (D.tsunami == "0")
            {
                LblPTsunami2.Text = "Tidak Berpotensi Tsunami";
            }
            else
            {
                LblPTsunami2.Text = "Berpotensi Tsunami";
            }
            LblMag3.Text    = C.mag.ToString("0.0", System.Globalization.CultureInfo.InvariantCulture);;
            LblLokasi3.Text = C.place;
            LblWaktu3.Text  = C.time.ToString();
            if (C.tsunami == "0")
            {
                LblPTsunami3.Text = "Tidak Berpotensi Tsunami";
            }
            else
            {
                LblPTsunami3.Text = "Berpotensi Tsunami";
            }
            Console.WriteLine(C.mag.ToString("0.0", System.Globalization.CultureInfo.InvariantCulture) + " Mag");
        }
예제 #3
0
    private static void DrawMiscTab()
    {
        GUI.BeginGroup(Groups[4], "");
        GroupBox("Misc", (int)Groups[4].width, (int)Groups[4].height + 10);
        for (int i = 23; i <= 30; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + ((i - 23) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
            if (i == 23)
            {
                GlobalVars.FloatTimers[2] = GUI.HorizontalSlider(new Rect(25 + Size.x, 22 + ((i - 23) * 20), 180 - Size.x, 12), GlobalVars.FloatTimers[2], GlobalVars.MinFloats[i - 19], GlobalVars.MaxFloats[i - 19]);
            }

            if (i == 30)
            {
                if (GUI.Button(new Rect(95, 18 + ((i - 23) * 20), 40, 16), "clear"))
                {
                    FengGameManagerMKII.instance.InternalIgnore.Clear();
                    object[] parameters = new object[] { "<color=#FFFFFF>[</color><b><color=#A5D2FF>sl0wm0d</color></b><color=#FFFFFF>]</color><b><color=#FFD2A5>Ignorelist has been cleared.</color></b>", string.Empty };
                    FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, parameters);
                }
            }
        }
        GUI.EndGroup();
    }
예제 #4
0
 public static void open()
 {
     if (m_inst == null)
     {
         m_inst = new PanelMain();
     }
 }
예제 #5
0
    public static void DrawToolTip()
    {
        Vector2 TooltipLength = PanelMain.TextBounds(GlobalVars.ToolTip);

        GUI.DrawTexture(new Rect(UnityEngine.Input.mousePosition.x + 10, UnityEngine.Input.mousePosition.y - 5, TooltipLength.x + 6, TooltipLength.y + 4), ToolTipTex[0]);
        GUI.DrawTexture(new Rect(UnityEngine.Input.mousePosition.x + 11, UnityEngine.Input.mousePosition.y - 4, TooltipLength.x + 4, TooltipLength.y + 2), ToolTipTex[1]);
        GUI.Label(new Rect(UnityEngine.Input.mousePosition.x + 12, UnityEngine.Input.mousePosition.y - 3, TooltipLength.x, TooltipLength.y), GlobalVars.ToolTip /*, ModDrawGUI.FontStyle*/);
    }
예제 #6
0
파일: Utama.cs 프로젝트: fadholifh/retakan
 private void BtnMaps_Click(object sender, EventArgs e)
 {
     PanelMain.Hide();
     WebMaps.Show();
     PanelSearch.Hide();
     BtnTerkini.Image = global::Retakan.Properties.Resources.terkini_off;
     BtnMaps.Image    = global::Retakan.Properties.Resources.peta_on;
     BtnSearch.Image  = global::Retakan.Properties.Resources.cari_off;
 }
예제 #7
0
    public override void onEnter()
    {
        Tools.Log("enter SceneMain.");

        //addEventCallback(EventId.MSG_GAME_OVER, onGameOver);
        startProcMsg();

        PanelMain.open();
        //EventDispatcher.getInstance().dispatchEvent(EventId.UI_CLOSE_LOADING);
    }
예제 #8
0
    private static void GroupBox(string name, int xMax, int yMax)
    {
        Rendering.CustomCanvas.DrawLine(new Vector2(0, 12), new Vector2(10, 12), Color.white);
        Rendering.CustomCanvas.DrawLine(new Vector2(0, 12), new Vector2(0, yMax), Color.white);
        Rendering.CustomCanvas.DrawLine(new Vector2(xMax, 12), new Vector2(xMax, yMax), Color.white);
        Rendering.CustomCanvas.DrawLine(new Vector2(0, yMax), new Vector2(xMax, yMax), Color.white);
        Vector2 strBounds = PanelMain.TextBounds(name);

        Rendering.CustomCanvas.DrawLine(new Vector2(18 + strBounds.x, 12), new Vector2(xMax, 12), Color.white);
        GUI.Label(new Rect(14, 0, strBounds.x, strBounds.y), name, FontStyle);
    }
예제 #9
0
    public void OnClickBack()
    {
        m_progress.Save(m_RootPath);
        m_progress = null;

        SwitchToPanel(m_panelSetup);

        PanelMain panelMainScript = (PanelMain)m_panelMain.GetComponent(typeof(PanelMain));

        panelMainScript.ClearText();
    }
예제 #10
0
    public void OpenProgress(string id, List <string> books)
    {
        m_progress            = new Progress(m_RootPath);
        m_progress.ProgressID = id;
        foreach (string book in books)
        {
            m_progress.AddBook(book);
        }
        m_progress.Load(m_RootPath);

        PanelMain panelMainScript = (PanelMain)m_panelMain.GetComponent(typeof(PanelMain));

        panelMainScript.BookProgress = m_progress;
        panelMainScript.ResetState();
        SwitchToPanel(m_panelMain);
    }
        private void FadeInTimer_Tick(object sender, EventArgs e)
        {
            if (fadeIn)
            {
                FadeAlpha -= 1; // amount of opacity change for each timer tick
            }
            else
            {
                FadeAlpha += 1;
            }

            if (CurrentWrapperForm is object)
            {
                CurrentWrapperForm.Opacity = FadeAlpha / (double)100;
                PanelMain.Refresh();
            }

            if (FadeAlpha <= 0)
            {
                FadeInTimer.Enabled = false; // finished fade-in
                if (CurrentWrapperForm is object)
                {
                    if (PanelMain.Controls.Count > 0)
                    {
                        Control ctrl = null;
                        for (int i = PanelMain.Controls.Count - 1; i >= 0; i -= 1)
                        {
                            ctrl = PanelMain.Controls[i];
                            try
                            {
                                PanelMain.Controls.Remove(ctrl);
                            }
                            catch (Exception ex)
                            {
                                string statusMessage = "Error unloading form";
                            }
                        }
                    }
                }

                loadNextForm();
            }
            else if (FadeAlpha >= 100)
            {
                FadeInTimer.Enabled = false; // finished fade-in
            }
        }
예제 #12
0
 public static void SwitchToMainGrid()
 {
     App.Current.Dispatcher.Invoke(() =>
     {
         try
         {
             SLogger.Info(nameof(MainWindowBus), "Panel creating");
             var panel = new PanelMain();
             MainWindow.MainContentContainer.Content = panel;
             SLogger.Info(nameof(MainWindowBus), "Created panel instance");
         }
         catch (Exception e)
         {
             SLogger.Warn(nameof(MainWindowBus), "Could not create panel", e);
         }
     });
 }
예제 #13
0
        public Form1()
        {
            InitializeComponent();

            MainMenuStrip.BackColor = ThemeColors.WindowContentBackgroundDarkTheme;
            MainMenuStrip.ForeColor = ThemeColors.WindowContentForegroundDarkTheme;
            MainMenuStrip.Renderer  = new MenuStripCustomRenderer();

            mainPanel.DocumentStyle = DocumentStyle.DockingWindow;
            mainPanel.Theme         = new VS2015DarkTheme();
            mainPanel.Dock          = DockStyle.Fill;

            PanelMain.SuspendLayout();
            PanelMain.Controls.Add(mainPanel);
            PanelMain.ResumeLayout();

            DoubleBuffered = true;

            MenuItemNewHistoryChart.Click += MenuItemNewHistoryChart_Click;
        }
예제 #14
0
    private static void DrawPlayerTab()
    {
        GUI.BeginGroup(Groups[4], "");
        GroupBox("Player", (int)Groups[4].width, (int)Groups[4].height);
        for (int i = 13; i <= 16; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i]       = GUI.Toggle(new Rect(5, 15 + ((i - 13) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
            GlobalVars.Floats[i - 13] = GUI.HorizontalSlider(new Rect(25 + Size.x, 22 + ((i - 13) * 20), 180 - Size.x, 12), GlobalVars.Floats[i - 13], GlobalVars.MinFloats[i - 13], GlobalVars.MaxFloats[i - 13]);
        }
        GUI.EndGroup();

        GUI.BeginGroup(Groups[5], "");
        GroupBox("Autosmite", (int)Groups[5].width, (int)Groups[5].height);
        for (int i = 17; i <= 20; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + ((i - 17) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
        }
        GUI.EndGroup();
    }
예제 #15
0
        public void Init()
        {
            // 设置点击事件
            //var dateText = ReflectionMethod.GetValue<PanelMain, TextMeshProUGUI>(PanelMain_Awake_Patch.panelMain, "DateText");
            //var btn = dateText.transform.parent.parent.gameObject.AddComponent<Button>();
            if (!isInit)
            {
                panelMain = SingletonMonoBehaviour <PanelMain> .Instance;

                //btn.targetGraphic = dateText;
                try
                {
                    Button btn = panelMain.gameObject.AddComponent <Button>();
                    btn.interactable = true;
                    btn.onClick.AddListener(ToggleWindow);
                }
                catch (Exception)
                {
                    // 未初始化完毕时,类型不一样防止报错(NullReferenceException: object reference not set to an instance of an object)
                    //FormationMod.logger.Log("FormationMod Init End");
                }
                isInit = true;
            }
        }
예제 #16
0
    private static void DrawVisualsTab()
    {
        Texture2D ColorOpt = new Texture2D(1, 1);

        GUI.BeginGroup(Groups[0], "");
        GroupBox("Titans/PT", (int)Groups[0].width, (int)Groups[0].height);
        for (int i = 0; i <= 3; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + (i * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
            if (GUI.Button(new Rect(80, 18 + (i * 20), 20, 15), ""))
            {
                GlobalVars.Colors[i] = new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2]);
            }
            ColorOpt.SetPixel(1, 1, new Color(GlobalVars.Colors[i][0], GlobalVars.Colors[i][1], GlobalVars.Colors[i][2], 1.0f));
            ColorOpt.Apply();

            GUI.DrawTexture(new Rect(80, 18 + (i * 20), 20, 15), ColorOpt);
        }
        GUI.EndGroup();


        GUI.BeginGroup(Groups[1], "");
        GroupBox("Player", (int)Groups[1].width, (int)Groups[1].height);
        for (int i = 4; i <= 7; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + ((i - 4) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
            if (GUI.Button(new Rect(80, 18 + ((i - 4) * 20), 20, 15), ""))
            {
                GlobalVars.Colors[i] = new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2]);
            }
            ColorOpt.SetPixel(1, 1, new Color(GlobalVars.Colors[i][0], GlobalVars.Colors[i][1], GlobalVars.Colors[i][2], 1.0f));
            ColorOpt.Apply();

            GUI.DrawTexture(new Rect(80, 18 + ((i - 4) * 20), 20, 15), ColorOpt);
        }
        GUI.EndGroup();

        GUI.BeginGroup(Groups[2], "");
        GroupBox("Misc", (int)Groups[2].width, (int)Groups[2].height);
        for (int i = 8; i <= 12; i++)
        {
            Vector2 Size = PanelMain.TextBounds(GlobalVars.GUIContents[i].text);
            if (i >= 11)
            {
                GlobalVars.Bools[i] = GUI.Toggle(new Rect(126, 15 + ((i - 11) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
                if (GUI.Button(new Rect(201, 18 + ((i - 11) * 20), 20, 15), ""))
                {
                    GlobalVars.Colors[i] = new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2]);
                }
                ColorOpt.SetPixel(1, 1, new Color(GlobalVars.Colors[i][0], GlobalVars.Colors[i][1], GlobalVars.Colors[i][2], 1.0f));
                ColorOpt.Apply();
                GUI.DrawTexture(new Rect(201, 18 + ((i - 11) * 20), 20, 15), ColorOpt);
            }
            else
            {
                GlobalVars.Bools[i] = GUI.Toggle(new Rect(5, 15 + ((i - 8) * 20), Size.x + 16, Size.y + 2), GlobalVars.Bools[i], GlobalVars.GUIContents[i]);
                if (GUI.Button(new Rect(80, 18 + ((i - 8) * 20), 20, 15), ""))
                {
                    GlobalVars.Colors[i] = new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2]);
                }
                ColorOpt.SetPixel(1, 1, new Color(GlobalVars.Colors[i][0], GlobalVars.Colors[i][1], GlobalVars.Colors[i][2], 1.0f));
                ColorOpt.Apply();

                GUI.DrawTexture(new Rect(80, 18 + ((i - 8) * 20), 20, 15), ColorOpt);
            }
        }
        GUI.EndGroup();

        GUI.BeginGroup(Groups[3], "");
        GroupBox("Colors", (int)Groups[3].width, (int)Groups[3].height);
        GUI.DrawTexture(new Rect(10, 20, 100, 30), ColorTexture);
        Vector2 PreviewSize = PanelMain.TextBounds("Preview");

        GUI.Label(new Rect(60 - (PreviewSize.x / 2), 32, PreviewSize.x, PreviewSize.y), "Preview", FontStyle);
        ColorFloats[0] = GUI.VerticalSlider(new Rect(20, 60, 12, 150), ColorFloats[0], 1.0f, 0.0f);
        ColorFloats[1] = GUI.VerticalSlider(new Rect(50, 60, 12, 150), ColorFloats[1], 1.0f, 0.0f);
        ColorFloats[2] = GUI.VerticalSlider(new Rect(80, 60, 12, 150), ColorFloats[2], 1.0f, 0.0f);
        ColorTexture.SetPixel(1, 1, new Color(ColorFloats[0], ColorFloats[1], ColorFloats[2], 1.0f));
        ColorTexture.Apply();

        GUI.EndGroup();
    }
예제 #17
0
 void Awake()
 {
     instance = this;
 }
예제 #18
0
 private void btnClickMe_Click(object sender, RoutedEventArgs e)
 {
     LbResult.Items.Add(PanelMain.FindResource("StrPanel").ToString());
     LbResult.Items.Add(this.FindResource("StrWindow").ToString());
     LbResult.Items.Add(Application.Current.FindResource("StrApp").ToString());
 }
예제 #19
0
    public static void DrawSkinGUI(int WindowID)
    {
        int  Reapply     = GUI.skin.button.fontSize;
        Font ReapplyFont = GUI.skin.button.font;

        GUI.skin.button.font     = GlobalVars.Segoe;
        GUI.skin.button.fontSize = 12;

        GUI.skin.toggle.font     = GlobalVars.Segoe;
        GUI.skin.toggle.fontSize = 12;

        int Additions = 0;

        GUI.DrawTexture(new Rect(0, 0, 400, 300), GlobalVars.sl0wTextures[1]);
        IEnumerator zEnum = GameObject.Find("MultiplayerManager").GetComponent <FengGameManagerMKII>().getPlayers().GetEnumerator();

        DebugScrollPos            = GUI.BeginScrollView(new Rect(9, 45, 218, 235), DebugScrollPos, new Rect(0, 0, 170, (20 * 18) + 4)); // add real number via a loop later  //218 248
        GUI.skin.button.alignment = TextAnchor.MiddleLeft;
        GUI.skin.label.alignment  = TextAnchor.MiddleLeft;
        while (zEnum.MoveNext())
        {
            HERO aHERO = zEnum.Current as HERO;
            if (!aHERO ||
                !aHERO.photonView)
            {
                continue;
            }

            if (!aHERO.photonView.owner.isLocal)
            {
                if (aHERO.bHasSkin && aHERO.skinURL != string.Empty)
                {
                    string Playername = ModDrawOverlay.RemoveTags((string)aHERO.photonView.owner.customProperties[PhotonPlayerProperty.name]);
                    if (GUI.Button(new Rect(4, 25 * (Additions) + 4, 130, 20), Playername))
                    {
                        SelectedHero = aHERO;
                    }
                    Additions++;
                }
            }
        }
        GUI.skin.button.alignment = TextAnchor.MiddleCenter;
        GUI.skin.label.alignment  = TextAnchor.UpperLeft;
        GUI.EndScrollView();

        if (SelectedHero) // 240 90
        {
            string PlayerName = ModDrawOverlay.RemoveTags((string)SelectedHero.photonView.owner.customProperties[PhotonPlayerProperty.name]);

            if (PlayerName.Length > 25)
            {
                PlayerName = PlayerName.Remove(25);
            }

            string  Label       = string.Format("{0}'s Setup", PlayerName);
            Vector2 LabelBounds = PanelMain.TextBounds(Label);
            GUI.Label(new Rect(240, 90, LabelBounds.x, LabelBounds.y), Label, FontStyle);
            GUI.Label(new Rect(250, 105, 100, 20), string.Format("SEX: {0}", (SelectedHero.setup.myCostume.sex == SEX.MALE ? "MALE" : "FEMALE")), FontStyle);
            GUI.Label(new Rect(250, 117, 100, 20), string.Format("EYES: {0}", SelectedHero.setup.myCostume.eye_texture_id), FontStyle);
            GUI.Label(new Rect(250, 129, 100, 20), string.Format("MOUTH: {0}", SelectedHero.setup.myCostume.beard_texture_id), FontStyle);
            GUI.Label(new Rect(250, 141, 100, 20), string.Format("GLASSES: {0}", SelectedHero.setup.myCostume.glass_texture_id), FontStyle);
            GUI.Label(new Rect(250, 153, 100, 20), string.Format("HAIR: {0}", SelectedHero.setup.myCostume.hairInfo.hair), FontStyle);
            GUI.Label(new Rect(250, 165, 100, 20), string.Format("CAPE: {0}", (SelectedHero.setup.myCostume.cape ? "YES" : "NO")), FontStyle);
            GUI.Label(new Rect(250, 177, 100, 20), string.Format("COSTUME: {0}", SelectedHero.setup.myCostume.costumeId), FontStyle);

            if (GUI.Button(new Rect(330, 275, 65, 22), "Dumpskin", PanelMain.changelogstyle))
            {
                string[] Urls     = SelectedHero.skinURL.Split(new char[] { ',' });
                string   FullText = string.Format("Username: {0}\n\n", PlayerName);

                for (int i = 0; i < URLAddons.Length; i++)
                {
                    FullText = string.Format("{0}{1}{2}\n", FullText, URLAddons[i], Urls[i]);
                }


                string folderDir = RemoveSpecialCharacters(PlayerName);
                if (folderDir == string.Empty)
                {
                    folderDir = "DefaultFallback";
                }

                folderDir = string.Format(".\\{0}", folderDir);
                if (!System.IO.Directory.Exists(folderDir))
                {
                    System.IO.Directory.CreateDirectory(folderDir);
                    System.IO.File.WriteAllText(string.Format("{0}\\{1}.txt", folderDir, 1), FullText);
                }
                else
                {
                    int ExistingNum = 1;
                    while (System.IO.File.Exists(string.Format("{0}\\{1}.txt", folderDir, ExistingNum)))
                    {
                        ExistingNum++;
                    }
                    System.IO.File.WriteAllText(string.Format("{0}\\{1}.txt", folderDir, ExistingNum), FullText);
                }
            }

            if (GUI.Button(new Rect(255, 275, 65, 22), "Clone", PanelMain.changelogstyle))
            {
            }


//               if(Event.current.type == EventType.Repaint)
//               {
//                   guiCamera.Render();
//               }

            //GUI.DrawTexture(new Rect(228, 42, 170, 100), renderTexture);
        }
        GUI.skin.toggle.font     = ReapplyFont;
        GUI.skin.toggle.fontSize = Reapply;
        GUI.skin.button.font     = ReapplyFont;
        GUI.skin.button.fontSize = Reapply;

        GUI.DragWindow(new Rect(0, 0, 300, 35));
    }
예제 #20
0
파일: Utama.cs 프로젝트: fadholifh/retakan
        private void InitializePosition()
        {
            // Set Extend Attribute
            this.ClientSize     = new System.Drawing.Size(800, 600);
            PanelMain.BackColor = Color.FromArgb(20, 0, 0, 0);
            //PanelMain.ClientSize = new System.Drawing.Size(697, 522);
            PanelA1.BackColor      = Color.FromArgb(180, 158, 33, 36);
            PanelA2.BackColor      = Color.FromArgb(150, 158, 33, 36);
            PanelB1.BackColor      = Color.FromArgb(180, 156, 77, 35);
            PanelB2.BackColor      = Color.FromArgb(150, 156, 77, 35);
            PanelC1.BackColor      = Color.FromArgb(180, 17, 147, 36);
            PanelC2.BackColor      = Color.FromArgb(150, 17, 147, 36);
            PanelAtas.BackColor    = Color.FromArgb(70, 0, 0, 0);
            PanelKiri.BackColor    = Color.FromArgb(50, 0, 0, 0);
            PanelSearch.BackColor  = Color.FromArgb(0, 255, 255, 255);
            PnlTxt.BackColor       = Color.FromArgb(0, 255, 255, 255);
            PnlBg.BackColor        = Color.FromArgb(80, 255, 255, 255);
            DGView.BackgroundColor = Color.Lavender;
            panel1.BackColor       = Color.Transparent;

            LblJudul1.BackColor = Color.Transparent;
            LblJudul2.BackColor = Color.Transparent;
            LblJudul3.BackColor = Color.Transparent;
            LblIsi1.BackColor   = Color.Transparent;
            LblIsi2.BackColor   = Color.Transparent;
            LblIsi3.BackColor   = Color.Transparent;

            LblSkala1.BackColor    = Color.Transparent;
            LblSkala2.BackColor    = Color.Transparent;
            LblSkala3.BackColor    = Color.Transparent;
            LblMag1.BackColor      = Color.Transparent;
            LblMag2.BackColor      = Color.Transparent;
            LblMag3.BackColor      = Color.Transparent;
            LblSR1.BackColor       = Color.Transparent;
            LblSR2.BackColor       = Color.Transparent;
            LblSR3.BackColor       = Color.Transparent;
            LblLokasi1.BackColor   = Color.Transparent;
            LblLokasi2.BackColor   = Color.Transparent;
            LblLokasi3.BackColor   = Color.Transparent;
            LblWaktu1.BackColor    = Color.Transparent;
            LblWaktu2.BackColor    = Color.Transparent;
            LblWaktu3.BackColor    = Color.Transparent;
            LblPTsunami1.BackColor = Color.Transparent;
            LblPTsunami2.BackColor = Color.Transparent;
            LblPTsunami3.BackColor = Color.Transparent;

            LblSkala1.Font    = new Font("Segoe UI", 14, FontStyle.Bold);
            LblMag1.Font      = new Font("Myraid Pro", 72, FontStyle.Bold);
            LblSR1.Font       = new Font("Segoe UI", 14, FontStyle.Bold);
            LblLokasi1.Font   = new Font("Segoe UI", 10, FontStyle.Bold);
            LblWaktu1.Font    = new Font("Segoe UI", 8, FontStyle.Bold);
            LblPTsunami1.Font = new Font("Segoe UI", 8, FontStyle.Bold);
            LblSkala2.Font    = new Font("Segoe UI", 14, FontStyle.Bold);
            LblMag2.Font      = new Font("Myraid Pro", 72, FontStyle.Bold);
            LblSR2.Font       = new Font("Segoe UI", 14, FontStyle.Bold);
            LblLokasi2.Font   = new Font("Segoe UI", 10, FontStyle.Bold);
            LblWaktu2.Font    = new Font("Segoe UI", 8, FontStyle.Bold);
            LblPTsunami2.Font = new Font("Segoe UI", 8, FontStyle.Bold);
            LblSkala3.Font    = new Font("Segoe UI", 14, FontStyle.Bold);
            LblMag3.Font      = new Font("Myraid Pro", 72, FontStyle.Bold);
            LblSR3.Font       = new Font("Segoe UI", 14, FontStyle.Bold);
            LblLokasi3.Font   = new Font("Segoe UI", 10, FontStyle.Bold);
            LblWaktu3.Font    = new Font("Segoe UI", 8, FontStyle.Bold);
            LblPTsunami3.Font = new Font("Segoe UI", 8, FontStyle.Bold);

            BtnMinimize.Text      = "";
            BtnMinimize.BackColor = Color.Transparent;
            BtnMinimize.FlatAppearance.BorderSize = 0;
            BtnMinimize.FlatStyle = FlatStyle.Flat;
            BtnMinimize.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnMinimize.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnClose.Text      = "";
            BtnClose.BackColor = Color.Transparent;
            BtnClose.FlatAppearance.BorderSize = 0;
            BtnClose.FlatStyle = FlatStyle.Flat;
            BtnClose.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnClose.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnTerkini.Text      = "";
            BtnTerkini.BackColor = Color.Transparent;
            BtnTerkini.FlatAppearance.BorderSize = 0;
            BtnTerkini.FlatStyle = FlatStyle.Flat;
            BtnTerkini.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnTerkini.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnMaps.Text      = "";
            BtnMaps.BackColor = Color.Transparent;
            BtnMaps.FlatAppearance.BorderSize = 0;
            BtnMaps.FlatStyle = FlatStyle.Flat;
            BtnMaps.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnMaps.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnSearch.Text      = "";
            BtnSearch.BackColor = Color.Transparent;
            BtnSearch.FlatAppearance.BorderSize = 0;
            BtnSearch.FlatStyle = FlatStyle.Flat;
            BtnSearch.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnSearch.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnCari.Text      = "";
            BtnCari.BackColor = Color.Transparent;
            BtnCari.FlatAppearance.BorderSize = 0;
            BtnCari.FlatStyle = FlatStyle.Flat;
            BtnCari.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnCari.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnBTempat.Text      = "";
            BtnBTempat.BackColor = Color.Transparent;
            BtnBTempat.FlatAppearance.BorderSize = 0;
            BtnBTempat.FlatStyle = FlatStyle.Flat;
            BtnBTempat.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnBTempat.FlatAppearance.MouseOverBackColor = Color.Transparent;

            BtnBWaktu.Text      = "";
            BtnBWaktu.BackColor = Color.Transparent;
            BtnBWaktu.FlatAppearance.BorderSize = 0;
            BtnBWaktu.FlatStyle = FlatStyle.Flat;
            BtnBWaktu.FlatAppearance.MouseDownBackColor = Color.Transparent;
            BtnBWaktu.FlatAppearance.MouseOverBackColor = Color.Transparent;


            //bound
            PanelAtas.SetBounds(0, 0, 800, 90);
            PanelKiri.SetBounds(0, 90, 80, 510);
            PanelMain.SetBounds(80, 90, 720, 510);
            PanelA1.SetBounds(0, 0, 240, 171);
            PanelA2.SetBounds(240, 0, 480, 171);
            PanelB1.SetBounds(0, 171, 240, 171);
            PanelB2.SetBounds(240, 171, 480, 171);
            PanelC1.SetBounds(0, 342, 240, 172);
            PanelC2.SetBounds(240, 342, 480, 171);
            PanelSearch.SetBounds(80, 90, 720, 510);
            PnlTxt.SetBounds(230, 70, 249, 24);
            DGView.SetBounds(230, 70, 249, 24);
            BtnBTempat.SetBounds(200, 20, 150, 25);
            BtnBWaktu.SetBounds(360, 20, 150, 25);
            BtnCari.SetBounds(430, 69, 39, 25);
            TxtCari.SetBounds(10, 1, 230, 25);
            WebMaps.SetBounds(80, 90, 720, 510);
            BtnMinimize.SetBounds(702, 0, 49, 21);
            BtnClose.SetBounds(751, 0, 49, 21);
            BtnTerkini.SetBounds(3, 20, 73, 73);
            BtnMaps.SetBounds(3, 104, 73, 73);
            BtnSearch.SetBounds(3, 188, 73, 73);
            DGView.SetBounds(35, 110, 650, 375);
            PnlBg.SetBounds(35, 110, 650, 375);
            DTPicker.SetBounds(230, 72, 200, 28);

            LblJudul1.SetBounds(5, 15, 230, 20);
            LblJudul2.SetBounds(5, 15, 230, 20);
            LblJudul3.SetBounds(5, 15, 230, 20);
            LblIsi1.SetBounds(5, 55, 230, 100);
            LblIsi2.SetBounds(5, 55, 230, 100);
            LblIsi3.SetBounds(5, 55, 230, 100);

            LblSkala1.SetBounds(5, 5, 73, 73);
            LblMag1.SetBounds(150, 30, 73, 73);
            LblSR1.SetBounds(300, 45, 73, 73);
            LblLokasi1.SetBounds(5, 145, 73, 73);
            LblWaktu1.SetBounds(350, 5, 73, 73);
            LblPTsunami1.SetBounds(335, 150, 73, 73);
            LblSkala2.SetBounds(5, 5, 73, 73);
            LblMag2.SetBounds(150, 30, 73, 73);
            LblSR2.SetBounds(300, 45, 73, 73);
            LblLokasi2.SetBounds(5, 145, 73, 73);
            LblWaktu2.SetBounds(350, 5, 73, 73);
            LblPTsunami2.SetBounds(335, 150, 73, 73);
            LblSkala3.SetBounds(5, 5, 73, 73);
            LblMag3.SetBounds(150, 30, 73, 73);
            LblSR3.SetBounds(300, 45, 73, 73);
            LblLokasi3.SetBounds(5, 145, 73, 73);
            LblWaktu3.SetBounds(350, 5, 73, 73);
            LblPTsunami3.SetBounds(335, 150, 73, 73);

            label44.SetBounds(10, 20, 31, 30);
            label43.SetBounds(50, 20, 295, 30);
            label42.SetBounds(350, 20, 186, 30);
            label41.SetBounds(540, 20, 100, 30);

            label1.SetBounds(10, 65, 31, 23);
            label2.SetBounds(50, 65, 295, 23);
            label3.SetBounds(350, 65, 186, 23);
            label4.SetBounds(540, 65, 100, 23);
            label5.SetBounds(10, 95, 31, 23);
            label6.SetBounds(50, 95, 295, 23);
            label7.SetBounds(350, 95, 186, 23);
            label8.SetBounds(540, 95, 100, 23);
            label12.SetBounds(10, 125, 31, 23);
            label11.SetBounds(50, 125, 295, 23);
            label10.SetBounds(350, 125, 186, 23);
            label9.SetBounds(540, 125, 100, 23);
            label16.SetBounds(10, 155, 31, 23);
            label15.SetBounds(50, 155, 295, 23);
            label14.SetBounds(350, 155, 186, 23);
            label13.SetBounds(540, 155, 100, 23);
            label20.SetBounds(10, 185, 31, 23);
            label19.SetBounds(50, 185, 295, 23);
            label18.SetBounds(350, 185, 186, 23);
            label17.SetBounds(540, 185, 100, 23);
            label24.SetBounds(10, 215, 31, 23);
            label23.SetBounds(50, 215, 295, 23);
            label22.SetBounds(350, 215, 186, 23);
            label21.SetBounds(540, 215, 100, 23);
            label28.SetBounds(10, 245, 31, 23);
            label27.SetBounds(50, 245, 295, 23);
            label26.SetBounds(350, 245, 186, 23);
            label25.SetBounds(540, 245, 100, 23);
            label32.SetBounds(10, 275, 31, 23);
            label31.SetBounds(50, 275, 295, 23);
            label30.SetBounds(350, 275, 186, 23);
            label29.SetBounds(540, 275, 100, 23);
            label36.SetBounds(10, 305, 31, 23);
            label35.SetBounds(50, 305, 295, 23);
            label34.SetBounds(350, 305, 186, 23);
            label33.SetBounds(540, 305, 100, 23);
            label40.SetBounds(10, 335, 31, 23);
            label39.SetBounds(50, 335, 295, 23);
            label38.SetBounds(350, 335, 186, 23);
            label37.SetBounds(540, 335, 100, 23);
            panel1.SetBounds(10, 5, 183, 74);



            this.BackgroundImage = global::Retakan.Properties.Resources.bg2;
            //PanelKiri.BackgroundImage = global::Retakan.Properties.Resources.kiri;
            //PanelAtas.BackgroundImage = global::Retakan.Properties.Resources.header;
            BtnClose.Image          = global::Retakan.Properties.Resources.close;
            BtnMinimize.Image       = global::Retakan.Properties.Resources.minim;
            BtnTerkini.Image        = global::Retakan.Properties.Resources.terkini_off;
            PanelA2.BackgroundImage = global::Retakan.Properties.Resources.merah_;
            PanelB2.BackgroundImage = global::Retakan.Properties.Resources.orange_;
            PanelC2.BackgroundImage = global::Retakan.Properties.Resources.hijau_;
            BtnMaps.Image           = global::Retakan.Properties.Resources.peta_off;
            BtnSearch.Image         = global::Retakan.Properties.Resources.cari_off;
            PnlTxt.BackgroundImage  = global::Retakan.Properties.Resources.caritxt;
            BtnCari.Image           = global::Retakan.Properties.Resources.btncari_off;
            BtnBTempat.Image        = global::Retakan.Properties.Resources.tempat_on;
            BtnBWaktu.Image         = global::Retakan.Properties.Resources.waktu_off;
            panel1.BackgroundImage  = global::Retakan.Properties.Resources.unnamed;
        }
예제 #21
0
    public void SetView(ViewMode view, bool first)
    {
        var viewPanels = new Dictionary <ViewMode, ViewConnector>
        {
            {
                ViewMode.ChapterVerses,
                new ViewConnector
                {
                    MenuItem = ActionViewVerses,
                    Panel    = PanelViewVerses,
                    Focused  = PanelViewVerses
                }
            },
            {
                ViewMode.VerseFiltered,
                new ViewConnector
                {
                    MenuItem = ActionViewVerseFiltered,
                    Panel    = PanelViewVerseFiltered,
                    Focused  = PanelViewVerseFiltered
                }
            },
            {
                ViewMode.ChapterTranslation,
                new ViewConnector
                {
                    MenuItem = ActionViewTranslations,
                    Panel    = PanelViewTranslations,
                    Focused  = TextBoxTranslations
                }
            },
            {
                ViewMode.ChapterOriginal,
                new ViewConnector
                {
                    MenuItem = ActionViewRawText,
                    Panel    = PanelViewOriginalText,
                    Focused  = EditChapterOriginal
                }
            },
            {
                ViewMode.BookELS50,
                new ViewConnector
                {
                    MenuItem = ActionViewELS50,
                    Panel    = PanelViewELS50,
                    Focused  = EditChapterELS50
                }
            },
            {
                ViewMode.Search,
                new ViewConnector
                {
                    MenuItem = ActionViewSearch,
                    Panel    = PanelViewSearch,
                    Focused  = SelectSearchType
                }
            }
        };

        if (Settings.CurrentView == view && !first)
        {
            if (Settings.CurrentView == ViewMode.Search)
            {
                RotateSearchTab();
            }
            return;
        }
        checkFirst();
        viewPanels[Settings.CurrentView].MenuItem.Checked = false;
        viewPanels[Settings.CurrentView].Panel.Parent     = null;
        viewPanels[view].MenuItem.Checked = true;
        viewPanels[view].Panel.Parent     = PanelMainCenter;
        if (view != ViewMode.Search)
        {
            viewPanels[view].Focused?.Focus();
        }
        Settings.CurrentView = view;
        updateControls();
        switch (view)
        {
        case ViewMode.ChapterVerses:
        case ViewMode.ChapterOriginal:
        case ViewMode.ChapterTranslation:
        case ViewMode.BookELS50:
            SetTanakItemFocus();
            break;

        case ViewMode.Search:
            SelectSearchType_Selected(null, null);
            break;

        case ViewMode.VerseFiltered:
            VerseControl.ResetMetricsRequired = true;
            WordControl.ResetMetricsRequired  = true;
            RenderVerseFiltered();
            break;
        }
        //
        void checkFirst()
        {
            if (first)
            {
                UpdateFilters(null, null);
                SelectSearchType.SelectedIndex = Settings.CurrentSearchTypeTab;
                setRadio(SelectSearchTypeTranslation, Settings.SearchTranslationRadioButtonIndex);
                setRadio(SelectSearchTypeVerses, Settings.SearchVerseRadioButtonIndex);
                void setRadio(TabPage page, int index)
                {
                    var radio = page.Controls.OfType <RadioButton>().FirstOrDefault(c => c.TabIndex == index);

                    if (radio is not null)
                    {
                        radio.Checked = true;
                    }
                }
            }
            else
            {
                ActionSave.PerformClick();
                if (!Settings.RenderAllChapterVersesKeep && Settings.RenderAllChapterVerses)
                {
                    if (view == ViewMode.VerseFiltered || view == ViewMode.Search)
                    {
                        Settings.RenderAllChapterVerses = false;
                    }
                }
            }
        }

        //
        void updateControls()
        {
            LabelTitle.Text = AppTranslations.ViewPanelTitle.GetLang(view).ToUpper();
            LabelTitle.Refresh();
            //
            PanelNavigation.Visible = view != ViewMode.VerseFiltered && view != ViewMode.Search;
            PanelMain.Refresh();
            //
            ActionCopyToClipboard.Enabled = view == ViewMode.ChapterTranslation || view == ViewMode.ChapterOriginal || view == ViewMode.BookELS50;
            SelectRenderAllVerses.Enabled = view == ViewMode.ChapterVerses;
            ActionExportBook.Enabled      = PanelNavigation.Visible;
            ActionExportChapter.Enabled   = PanelNavigation.Visible;
            //
            SelectBook.Enabled          = PanelNavigation.Visible;
            SelectBookNavigator.Enabled = SelectBook.Enabled;
            LabelSelectBook.Enabled     = SelectBook.Enabled;
            EditBookTranslation.Enabled = SelectBook.Enabled;
            ActionEditBookMemo.Enabled  = SelectBook.Enabled;
            //
            SelectChapter.Enabled          = PanelNavigation.Visible;
            SelectChapterNavigator.Enabled = SelectChapter.Enabled;
            LabelSelectChapter.Enabled     = SelectChapter.Enabled;
            EditChapterTitle.Enabled       = SelectChapter.Enabled;
            EditChapterMemo.Enabled        = SelectChapter.Enabled;
            //
            SelectVerse.Enabled          = PanelNavigation.Visible && view != ViewMode.BookELS50;
            SelectVerseNavigator.Enabled = SelectVerse.Enabled;
            LabelSelectVerse.Enabled     = SelectVerse.Enabled;
            ActionSearchVerse.Enabled    = SelectVerse.Enabled;
            //
            UpdateHistoryButtons();
        }
    }
예제 #22
0
 void OnDestroy()
 {
     instance = null;
 }
예제 #23
0
    public static void DrawMiscOverlay()
    {
        MiscStyle          = new GUIStyle(GUI.skin.label);
        MiscStyle.font     = GlobalVars.Segoe;
        MiscStyle.fontSize = 12;

        // Only reason atm im not just forlooping a single func is beyond me... i think the layering math that way would hurt my hed tho XDDDD
        if (GlobalVars.Bools[8])
        {
            MiscStyle.normal.textColor = GlobalVars.Colors[8];
            string  LocalTime = DateTime.Now.ToString();
            Vector2 TxtBounds = PanelMain.TextBounds(LocalTime);
            GUI.Label(new Rect(Screen.width - 4 - TxtBounds.x, Screen.height - 4 - TxtBounds.y, TxtBounds.x, TxtBounds.y), LocalTime, MiscStyle);
        }

        if (GlobalVars.Bools[9])
        {
            MiscStyle.normal.textColor = GlobalVars.Colors[9];
            string  ResolutionString = String.Format("({0}x{1})", Screen.width, Screen.height);
            Vector2 TxtBounds        = PanelMain.TextBounds(ResolutionString);
            GUI.Label(new Rect(Screen.width - 4 - TxtBounds.x, Screen.height - 4 - TxtBounds.y -
                               (GlobalVars.Bools[8] ? 18 : 0), TxtBounds.x, TxtBounds.y), ResolutionString, MiscStyle);
        }

        if (GlobalVars.Bools[11])
        {
            MiscStyle.normal.textColor = GlobalVars.Colors[11];
            string  PingString = String.Format("Ping: {0}", PhotonNetwork.GetPing());
            Vector2 TxtBounds  = PanelMain.TextBounds(PingString);
            GUI.Label(new Rect(Screen.width - 4 - TxtBounds.x, Screen.height - 4 - TxtBounds.y -
                               (GlobalVars.Bools[8] ? GlobalVars.Bools[9] ? 36 : 18 : GlobalVars.Bools[9] ? 18 : 0),
                               TxtBounds.x, TxtBounds.y), PingString, MiscStyle);
        }

        if (GlobalVars.Bools[10])
        {
            if (sFPS != string.Empty)
            {
                MiscStyle.normal.textColor = GlobalVars.Colors[10];
                Vector2 TxtBounds = PanelMain.TextBounds(sFPS);
                GUI.Label(new Rect(Screen.width - 4 - TxtBounds.x, Screen.height - 4 - TxtBounds.y -
                                   (GlobalVars.Bools[8]
                    ?
                                    GlobalVars.Bools[9]
                        ?
                                    GlobalVars.Bools[11]
                            ?
                                    54
                            :
                                    36
                       :
                                    GlobalVars.Bools[11]
                        ?
                                    36
                        :
                                    18
                    :
                                    GlobalVars.Bools[9]
                    ?
                                    GlobalVars.Bools[11]
                        ?
                                    36
                        :
                                    18
                    :
                                    GlobalVars.Bools[11]
                        ?
                                    18
                        :
                                    0
                                   ),
                                   TxtBounds.x, TxtBounds.y), sFPS, MiscStyle);
            }
        }
    }
예제 #24
0
 public override void dispose()
 {
     base.dispose();
     m_inst = null;
 }
예제 #25
0
 private void ActionScreenshot_Click(object sender, EventArgs e)
 {
     Clipboard.SetImage(PanelMain.GetBitmap());
     DisplayManager.ShowSuccessOrSound(SysTranslations.ScreenshotDone.GetLang(), Globals.ScreenshotSoundFilePath);
 }