Esempio n. 1
0
        public void Handle(Input.ConfirmT Action)
        {
            Save();

            int nSngIdx = SngIdxCheck();
            int nDblIdx = DblIdxCheck();

            Hata = "";

            if (nSngIdx == SngMacSay && nDblIdx == DblMacSay)
            {
                CET cet = Db.FromId <CET>((ulong)CEToNo);
                Db.TransactAsync(() =>
                {
                    if (H_G == "H")
                    {
                        cet.IsHOS = true;
                    }
                    else
                    {
                        cet.IsGOS = true;
                    }
                });
                Read();
            }
            else
            {
                Hata = "Sng/Dbl Sıralama Hatası. ONAYLANMADI";
            }
        }
    void OnEnable()
    {
        MyTarget = (AchievementManager)target;
        MyTarget.LoadAchievementState();

        for (int i = 0; i < MyTarget.AchievementList.Count; i++)
        {
            Hidden.Add(false);
        }

        #region Editor Styles
        ManageBackground.normal.background = CET.MakeEditorBackgroundColor(new Color(0.805f, 0.805f, 0.813f));
        ManageBackground.padding           = new RectOffset(5, 5, 5, 5);

        ManageInsideBackground.normal.background = CET.MakeEditorBackgroundColor(new Color(0.629f, 0.633f, 0.649f));
        ManageInsideBackground.padding           = new RectOffset(0, 0, 5, 5);

        RowButton.padding     = new RectOffset();
        RowButton.fixedHeight = 20;
        RowButton.fixedWidth  = 20;
        RowButton.margin      = new RectOffset(0, 5, 0, 0);

        ProgressBar.normal.background = CET.MakeEditorBackgroundColor(Color.blue);
        ProgressBar.margin            = new RectOffset(0, 5, 0, 0);

        Border.normal.background = CET.MakeEditorBackgroundColor(new Color(0.2f, 0.2f, 0.2f));
        Border.padding           = new RectOffset(3, 3, 3, 3);
        Border.margin            = new RectOffset(0, 0, 0, 10);
        #endregion
    }
    public void DrawAchievementList()
    {
        if (GUILayout.Button(HideAll ? "Show All" : "Hide All", GUILayout.Width(70)))
        {
            for (int i = 0; i < Hidden.Count; i++)
            {
                Hidden[i] = HideAll;
            }
            HideAll = !HideAll;
        }

        for (int i = 0; i < MyTarget.AchievementList.Count; i++)
        {
            DrawAchievement(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i), i);
        }
        GUILayout.Space(10);


        if (GUILayout.Button("Add"))
        {
            MyTarget.AchievementList.Add(new AchievementInfromation());
            MyTarget.States.Add(new AchievementState());
            MyTarget.SaveAchievementState();
            Hidden.Add(false);
        }

        CET.HorizontalLine();
        EditorGUILayout.PropertyField(serializedObject.FindProperty("UseFinalAchievement"));
        GUILayout.Label("Define an achievement which will be unlocked once all other have been completed");
        if (MyTarget.UseFinalAchievement)
        {
            EditorGUILayout.PropertyField(serializedObject.FindProperty("FinalAchievementKey"));
        }
        CET.HorizontalLine();
    }
        void Save(bool ok)
        {
            MAC MAC = null;

            Db.TransactAsync(() =>
            {
                foreach (var mac in MACs)
                {
                    MAC = Db.FromId <MAC>((ulong)mac.MACoNo);
                    if (mac.Drm == "OK")  // Single MacDrm OK degilse yapma cunki Idx 88 lerin oynamasi yasak, Rnk belli degil
                    {
                        MAC.H1W = H.IntParse(mac.H1W);
                        MAC.H2W = H.IntParse(mac.H2W);
                        MAC.H3W = H.IntParse(mac.H3W);
                        MAC.H4W = H.IntParse(mac.H4W);
                        MAC.H5W = H.IntParse(mac.H5W);
                        MAC.G1W = H.IntParse(mac.G1W);
                        MAC.G2W = H.IntParse(mac.G2W);
                        MAC.G3W = H.IntParse(mac.G3W);
                        MAC.G4W = H.IntParse(mac.G4W);
                        MAC.G5W = H.IntParse(mac.G5W);
                    }
                    if (mac.Drm == "hX")    // Home Diskalifiye
                    {
                        MAC.G1W = 11;
                        MAC.G2W = 11;
                        MAC.G3W = 11;
                    }
                    if (mac.Drm == "gX")    // Guest Diskalifiye
                    {
                        MAC.H1W = 11;
                        MAC.H2W = 11;
                        MAC.H3W = 11;
                    }
                    // mac.Drm == "X" ise yani ikiside Diskalifiye ise zaten sonuclari yazmiyacak ve sifir kalacak
                    H.MAC_RefreshSonuc(MAC);
                }
                if (ok)
                {
                    CET cet = Db.FromId <CET>((ulong)CEToNo);
                    cet.Drm = "OK";
                    IsEdit  = false;
                }
            });
            if (ok)
            {
                H.MAC_RefreshSonuc(H.DnmRun);
                H.CET_RefreshSonuc(H.DnmRun);
                H.CT_RefreshSonuc(H.DnmRun);
                H.CTP_RefreshSonuc(H.DnmRun);
                H.DD_RefreshSonuc(H.DnmRun);
                H.PPRD_RefreshSonuc(H.DnmRun);
                H.PPRD_RefreshCurRuns(H.DnmRun);
            }
        }
Esempio n. 5
0
        public override Task <CETProxy> CETUpdate(CETProxy request, ServerCallContext context)
        {
            Scheduling.RunTask(() =>
            {
                // RowSte: Added, Modified, Deletede, Unchanged
                Db.Transact(() =>
                {
                    if (request.RowSte == "A")
                    {
                        CET row = CRUDsHelper.FromProxy <CETProxy, CET>(request);
                        request = CRUDsHelper.ToProxy <CETProxy, CET>(row);
                    }
                    else if (request.RowSte == "M")
                    {
                        CET row = CRUDsHelper.FromProxy <CETProxy, CET>(request);
                        H.CET_RefreshSonuc(row);
                        request = CRUDsHelper.ToProxy <CETProxy, CET>(row);

                        H.CT_RefreshSonuc(row.CC);
                    }
                    else if (request.RowSte == "D")
                    {
                        var row = (CET)Db.FromId(request.RowKey);
                        if (row == null)
                        {
                            request.RowErr = "CET Rec not found";
                        }
                        else
                        {
                            var mac = Db.SQL <MAC>("select r from MAC r where r.CEB = ?", row).FirstOrDefault();
                            if (mac != null)
                            {
                                request.RowErr = $"Maçları var, Silemezsiniz";
                            }
                            else
                            {
                                row.Delete();
                            }
                        }
                    }
                });
            }).Wait();

            Session.RunTaskForAll((s, id) =>
            {
                s.CalculatePatchAndPushOnWebSocket();
            });

            return(Task.FromResult(request));
        }
        protected override void OnData()
        {
            base.OnData();

            CET cet = Db.FromId <CET>((ulong)CEToNo);

            HCTAd = cet.HCTAd;
            GCTAd = cet.GCTAd;

            if (string.IsNullOrEmpty(cet.Drm))
            {
                var session = Session.Ensure();
                var mp      = session.Store[nameof(MasterPage)] as MasterPage;
                if (!string.IsNullOrEmpty(cet.CC.Pwd) && mp.Pwd == cet.CC.Pwd)
                {
                    IsEdit = true;
                }
            }
            Read();
        }
Esempio n. 7
0
        protected override void OnData()
        {
            base.OnData();

            IsOS = true;
            IsML = true;

            CET cet     = Db.FromId <CET>((ulong)CEToNo);
            var session = Session.Ensure();
            var mp      = session.Store[nameof(MasterPage)] as MasterPage;

            IsYetkili = false;
            if (!string.IsNullOrEmpty(cet.CC.Pwd) && mp.Pwd == cet.CC.Pwd)
            {
                IsYetkili = true;
            }

            //IsYetkili = true;   // DENEME
            SortFld = "Idx";

            //Read();
        }
Esempio n. 8
0
        public void Register()
        {
            Handle.GET("/bodved/partials/aboutpage", () =>
            {
                var page = new AboutPage();
                return(page);
            });

            Handle.GET("/bodved/partials/PPs", () =>
            {
                var page = new PPsPage();
                //page.PPs.Data = Db.SQL<PP>("SELECT r FROM PP r order by r.RnkIdx");

                //var top = Db.SQL<long>("select COUNT(r) from PP r").FirstOrDefault();
                //var aktif = Db.SQL<long>("select count(r) from PP r where r.IsRun = ?", true).FirstOrDefault();
                //page.PPs.Data = Db.SQL<PP>("SELECT r FROM PP r order by r.Ad");

                page.Data = null;
                return(page);
            });

            Handle.GET("/bodved/partials/DDs", () =>
            {
                var page = new DDsPage();
                //page.DDs.Data = Db.SQL<DD>("SELECT r FROM DD r order by r.Dnm DESC");
                page.Data = null;
                return(page);
            });

            Handle.GET("/bodved/partials/PPRDs/{?}", (int dnm) =>
            {
                var page        = new PPRDsPage();
                page.Dnm        = dnm;
                DD DD           = Db.SQL <DD>("select r from DD r where r.Dnm = ?", dnm).FirstOrDefault();
                page.Hdr        = $"{DD.Ad} ► Oyuncular";
                page.PPRDs.Data = Db.SQL <PPRD>("SELECT r FROM PPRD r where r.Dnm = ? order by r.RnkIdx", dnm);

                //page.Data = null;
                return(page);
            });


            Handle.GET("/bodved/partials/CCs/{?}", (int dnm) =>
            {
                var page      = new CCsPage();
                page.CCs.Data = Db.SQL <CC>("SELECT r FROM CC r where r.Dnm = ? order by r.Idx", dnm);
                //page.Data = null;
                return(page);
            });

            Handle.GET("/bodved/partials/CTs/{?}", (ulong cc) =>
            {
                var page      = new CTsPage();
                CC CC         = Db.FromId <CC>(cc);
                page.CCoNo    = (long)CC.CCoNo;
                page.Hdr      = $"{CC.Ad} ► Takım Puanları";
                page.CTs.Data = Db.SQL <CT>("SELECT r FROM CT r WHERE r.CC = ? order by r.Idx", CC);
                return(page);
            });

            Handle.GET("/bodved/partials/CFs/{?}", (ulong cc) =>
            {
                var page   = new CFsPage();
                page.CCoNo = (long)cc;
                page.Data  = null;
                return(page);
            });

            Handle.GET("/bodved/partials/CTPs/{?}", (ulong ct) =>
            {
                var page = new CTPsPage();

                //CT CT = Db.FromId<CT>(ct);
                //page.Hdr = $"{CT.CC.Ad} ► {CT.Ad} ► Takım Oyuncuları";
                //page.CTPs.Data = Db.SQL<CTP>("SELECT r FROM CTP r WHERE r.CT = ? order by r.RnkBas DESC, r.PP.Ad", CT);

                page.CToNo = (long)ct;
                page.Data  = null;
                return(page);
            });

            Handle.GET("/bodved/partials/CurEvents", () =>
            {
                var page  = new CurEventsPage();
                page.Data = null;
                return(page);
            });


            Handle.GET("/bodved/partials/CC2CETs/{?}", (ulong cc) =>
            {
                var page   = new CC2CETsPage();
                page.CCoNo = (long)cc;
                page.Data  = null;
                return(page);
            });

            // CC2CETs kullaniliyor
            Handle.GET("/bodved/partials/CETs/{?}", (ulong cc) =>
            {
                var page       = new CETsPage();
                CC CC          = Db.FromId <CC>(cc);
                page.Hdr       = $"{CC.Ad} ► Takım Fikstür";
                page.CETs.Data = Db.SQL <CET>("SELECT r FROM CET r WHERE r.CC = ? order by r.Trh", CC);
                return(page);
            });

            Handle.GET("/bodved/partials/CEFs/{?}", (ulong cc) =>
            {
                var page       = new CEFsPage();
                CC CC          = Db.FromId <CC>(cc);
                page.Hdr       = $"{CC.Ad} ► Ferdi Fikstür";
                page.CEFs.Data = Db.SQL <CEF>("SELECT r FROM CEF r WHERE r.CC = ? order by r.Trh, r.HPP.Ad, r.GPP.Ad", CC);
                return(page);
            });

            Handle.GET("/bodved/partials/CF2CEFs/{?}/{?}", (ulong cc, ulong pp) =>
            {
                var page       = new CF2CEFsPage();
                page.CCoNo     = (long)cc;
                page.PPoNo     = (long)pp;
                CC CC          = Db.FromId <CC>(cc);
                PP PP          = Db.FromId <PP>(pp);
                page.Hdr       = $"{CC.Ad} ► {PP.Ad} ► Fikstür";
                page.CEFs.Data = Db.SQL <CEF>("SELECT r FROM CEF r WHERE r.CC = ? and (r.HPP = ? or r.GPP = ?) order by r.Trh, r.HPP.Ad, r.GPP.Ad", CC, PP, PP);
                return(page);
            });

            Handle.GET("/bodved/partials/CET2CETXs/{?}/{?}", (ulong cetono, ulong ctono) =>
            {
                var page = new CET2CETXsPage();

                CET cet     = Db.FromId <CET>(cetono);
                page.Hdr    = $"{cet.CC.Ad} ► {cet.Trh:dd.MM.yy} ► Sıralama";
                page.CEToNo = (long)cetono;
                page.Data   = null;

                /*
                 * CET cet = Db.FromId<CET>(cetono);
                 * CT ct = Db.FromId<CT>(ctono);
                 *
                 * page.Hdr = $"{cet.CC.Ad} ► {ct.Ad} {cet.Trh:dd.MM.yy} ► Sıralama";
                 * page.CEToNo = (long)cetono;
                 * page.CToNo = (long)ctono;
                 * page.Data = null;
                 *
                 * page.CET.Data = cet;
                 */
                //page.CETXs.Data = Db.SQL<CETX>("SELECT r FROM CETX r WHERE r.CET = ? and r.CT = ? order by r.Idx", cet, ct);

                return(page);
            });

            Handle.GET("/bodved/partials/CET2MACs/{?}", (ulong cet) =>
            {
                var page = new CET2MACsPage();
                CET CET  = Db.FromId <CET>(cet);

                page.Hdr = $"{CET.CC.Ad} ► Takım Maçları ► {CET.Trh:dd.MM.yy}";

                page.CET.Data   = CET;
                page.Sngls.Data = Db.SQL <MAC>("SELECT r FROM MAC r WHERE r.CEB = ? and r.SoD = ? order by r.Idx", CET, "S");
                page.Dbls.Data  = Db.SQL <MAC>("SELECT r FROM MAC r WHERE r.CEB = ? and r.SoD = ? order by r.Idx", CET, "D");
                return(page);
            });

            Handle.GET("/bodved/partials/CET2MACsInp/{?}", (ulong cet) =>
            {
                var page = new CET2MACsInpPage();
                CET CET  = Db.FromId <CET>(cet);

                page.CEToNo = (long)cet;
                page.Hdr    = $"{CET.CC.Ad} ► Takım Maçları ► {CET.Trh:dd.MM.yy}";
                page.Data   = null;
                //page.CET.Data = CET;
                //page.Sngls.Data = Db.SQL<MAC>("SELECT r FROM MAC r WHERE r.CEB = ? and r.SoD = ? order by r.Idx", CET, "S");
                //page.Dbls.Data = Db.SQL<MAC>("SELECT r FROM MAC r WHERE r.CEB = ? and r.SoD = ? order by r.Idx", CET, "D");
                return(page);
            });

            Handle.GET("/bodved/partials/CEF2MACs/{?}", (ulong cef) =>
            {
                var page = new CEF2MACsPage();
                CEF CEF  = Db.FromId <CEF>(cef);

                page.Hdr = $"{CEF.CC.Ad} ► Ferdi Maçları ► {CEF.Trh:dd.MM.yy}";

                page.CEF.Data   = CEF;
                page.Sngls.Data = Db.SQL <MAC>("SELECT r FROM MAC r WHERE r.CEB = ? order by r.Idx", CEF);
                return(page);
            });

            Handle.GET("/bodved/partials/PP2MACs/{?}", (ulong pp) =>
            {
                var page   = new PP2MACsPage();
                page.PPoNo = (long)pp;
                page.Data  = null;
                return(page);
            });

            Handle.GET("/bodved/partials/PP2PPRDs/{?}", (ulong pp) =>
            {
                var page        = new PP2PPRDsPage();
                PP PP           = Db.FromId <PP>(pp);
                page.Hdr        = $"{PP.Ad} ► Dönem Bilgileri";
                page.PPRDs.Data = Db.SQL <PPRD>("select r from PPRD r where r.PP = ? order by r.Dnm DESC", PP);
                return(page);
            });

            Handle.GET("/bodved/partials/CT2CETs/{?}", (long ct) =>
            {
                var page   = new CT2CETsPage();
                page.CToNo = ct;
                page.Data  = null;
                return(page);
            });
        }
    public void DrawAchievementList()
    {
        if (GUILayout.Button(HideAll ? "Hide All" : "Open All", GUILayout.Width(70)))
        {
            for (int i = 0; i < Hidden.Count; i++)
            {
                Hidden[i] = HideAll;
            }
            HideAll = !HideAll;
        }

        for (int i = 0; i < MyTarget.AchievementList.Count; i++)
        {
            GUILayout.BeginVertical(Border);
            GUILayout.BeginVertical(ManageBackground);
            GUILayout.BeginHorizontal(ManageInsideBackground);

            if (GUILayout.Button(CET.LoadImageFromFile("Assets/AchievementSystem/Resources/" + (Hidden[i] ? "Plus.png" : "Minus.png")), RowButton))
            {
                Hidden[i] = !Hidden[i];
            }

            GUILayout.Label("(" + i + ") " + MyTarget.AchievementList[i].DisplayName);

            if (i > 0 && GUILayout.Button(CET.LoadImageFromFile("Assets/AchievementSystem/Resources/Up.png"), RowButton))
            {
                AchievementInfromation temp = MyTarget.AchievementList[i];
                MyTarget.AchievementList[i]     = MyTarget.AchievementList[i - 1];
                MyTarget.AchievementList[i - 1] = temp;

                AchievementState temp2 = MyTarget.States[i];
                MyTarget.States[i]     = MyTarget.States[i - 1];
                MyTarget.States[i - 1] = temp2;
                MyTarget.SaveAchievementState();
            }
            if (i < MyTarget.AchievementList.Count - 1 && GUILayout.Button(CET.LoadImageFromFile("Assets/AchievementSystem/Resources/Down.png"), RowButton))
            {
                AchievementInfromation temp = MyTarget.AchievementList[i];
                MyTarget.AchievementList[i]     = MyTarget.AchievementList[i + 1];
                MyTarget.AchievementList[i + 1] = temp;

                AchievementState temp2 = MyTarget.States[i];
                MyTarget.States[i]     = MyTarget.States[i + 1];
                MyTarget.States[i + 1] = temp2;
                MyTarget.SaveAchievementState();
            }
            if (GUILayout.Button(CET.LoadImageFromFile("Assets/AchievementSystem/Resources/Cross.png"), RowButton))
            {
                MyTarget.AchievementList.RemoveAt(i);
                Hidden.RemoveAt(i);
                MyTarget.States.RemoveAt(i);
                MyTarget.SaveAchievementState();
                Repaint();
                return;
            }

            GUILayout.EndHorizontal();

            if (!Hidden[i])
            {
                GUILayout.Space(10);
                EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("Key"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("DisplayName"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("Description"));

                GUILayout.Space(10);
                EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("LockedIcon"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("LockOverlay"));
                GUILayout.Space(5);
                EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("AchievedIcon"));
                GUILayout.Space(10);

                EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("Spoiler"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("Progression"));

                if (MyTarget.AchievementList[i].Progression == true)
                {
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("ProgressGoal"));
                    EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievementList").GetArrayElementAtIndex(i).FindPropertyRelative("NotificationFrequency"));
                }
            }
            GUILayout.EndVertical();
            GUILayout.EndVertical();
        }

        GUILayout.Space(20);

        if (GUILayout.Button("Add"))
        {
            MyTarget.AchievementList.Add(new AchievementInfromation());
            MyTarget.States.Add(new AchievementState());
            MyTarget.SaveAchievementState();
            Hidden.Add(false);
        }
    }
    public void DrawSettings()
    {
        EditorGUILayout.PropertyField(serializedObject.FindProperty("DisplayTime"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("NumberOnScreen"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("DisplayAchievements"));
        if (MyTarget.DisplayAchievements)
        {
            EditorGUILayout.PropertyField(serializedObject.FindProperty("StackLocation"));
        }
        EditorGUILayout.PropertyField(serializedObject.FindProperty("ShowExactProgress"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("AutoSave"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("AutoLoad"));

        CET.HorizontalLine();

        GUILayout.BeginVertical(ManageBackground);
        for (int i = 0; i < MyTarget.AchievementList.Count; i++)
        {
            Rect ProgressBarRect;
            Rect r = EditorGUILayout.BeginHorizontal(ManageInsideBackground);

            GUILayout.Label("[" + i + "] " + MyTarget.AchievementList[i].DisplayName + " (" + MyTarget.AchievementList[i].Key + ")", GUILayout.Width(250));

            if (MyTarget.AchievementList[i].Progression)
            {
                float Progress = MyTarget.States[i].Progress / MyTarget.AchievementList[i].ProgressGoal;
                ProgressBarRect = EditorGUILayout.BeginHorizontal(ProgressBar, GUILayout.ExpandWidth(true));
                GUILayout.Label("");
                EditorGUILayout.EndHorizontal();
                EditorGUI.ProgressBar(ProgressBarRect, Progress, "" + MyTarget.States[i].Progress + " / " + MyTarget.AchievementList[i].ProgressGoal + " (" + (Progress * 100) + "%)");
            }
            else
            {
                GUILayout.Label(MyTarget.States[i].Achieved ? "True" : "False");
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(2);
        }
        GUILayout.EndVertical();
        CET.HorizontalLine();

        GUILayout.BeginHorizontal();

        if (GUILayout.Button("Save States"))
        {
            MyTarget.SaveAchievementState();
        }
        if (GUILayout.Button("Reset States"))
        {
            MyTarget.ResetAchievementState();
        }
        if (!MyTarget.AutoLoad && GUILayout.Button("Load States"))
        {
            MyTarget.LoadAchievementState();
        }
        GUILayout.EndHorizontal();
        CET.HorizontalLine();
        GUILayout.Space(20);
        EditorGUILayout.PropertyField(serializedObject.FindProperty("Stack"));
    }
    public void DrawSettings()
    {
        EditorGUILayout.PropertyField(serializedObject.FindProperty("DisplayTime"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("NumberOnScreen"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("DisplayAchievements"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("SpoilerAchievementMessage"));
        if (MyTarget.DisplayAchievements)
        {
            EditorGUILayout.PropertyField(serializedObject.FindProperty("StackLocation"));
        }
        EditorGUILayout.PropertyField(serializedObject.FindProperty("ShowExactProgress"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("AutoSave"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("ProgressMadeSound"));
        EditorGUILayout.PropertyField(serializedObject.FindProperty("AchievedSound"));
        CET.HorizontalLine();

        GUILayout.BeginVertical(ManageBackground);
        for (int i = 0; i < MyTarget.AchievementList.Count; i++)
        {
            Rect ProgressBarRect;
            Rect r = EditorGUILayout.BeginHorizontal(ManageInsideBackground);

            GUILayout.Label("[" + i + "] " + MyTarget.AchievementList[i].DisplayName + " (" + MyTarget.AchievementList[i].Key + ")", GUILayout.Width(250));

            if (MyTarget.AchievementList[i].Progression)
            {
                float Progress = MyTarget.States[i].Progress / MyTarget.AchievementList[i].ProgressGoal;
                ProgressBarRect = EditorGUILayout.BeginHorizontal(ProgressBar, GUILayout.ExpandWidth(true));
                GUILayout.Label("");
                EditorGUILayout.EndHorizontal();
                EditorGUI.ProgressBar(ProgressBarRect, Progress, "" + MyTarget.States[i].Progress + " / " + MyTarget.AchievementList[i].ProgressGoal + " (" + (Progress * 100) + "%)");
            }
            else
            {
                GUILayout.Label(MyTarget.States[i].Achieved ? "True" : "False");
            }
            if (MyTarget.UseFinalAchievement && MyTarget.FinalAchievementKey.Equals(MyTarget.AchievementList[i].Key))
            {
                GUILayout.Box(Resources.Load <Texture2D>("CompleteAllIcon"), RowButton);
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(2);
        }
        GUILayout.EndVertical();
        CET.HorizontalLine();

        GUILayout.BeginHorizontal();

        if (GUILayout.Button("Manual Save"))
        {
            MyTarget.SaveAchievementState();
        }
        if (GUILayout.Button("Reset All States"))
        {
            if (EditorUtility.DisplayDialog("Reset Confirmation", "Are you sure you want to reset all achevement states?", "Reset", "Cancel"))
            {
                MyTarget.ResetAchievementState();
            }
        }
        GUILayout.EndHorizontal();
        CET.HorizontalLine();
    }
Esempio n. 12
0
        void Read()
        {
            CET cet  = Db.FromId <CET>((ulong)CEToNo);
            var macs = Db.SQL <MAC>("SELECT r FROM MAC r WHERE r.CEB = ? order by r.SoD DESC, r.Idx", cet);

            string[] ad1, ad2;

            MACs.Clear();
            string SoD = "S";

            foreach (var mac in macs)
            {
                MACsElementJson abc = new MACsElementJson
                {
                    MACoNo = (long)mac.MACoNo,
                    Drm    = mac.Drm,
                    Idx    = mac.Idx,
                    SoD    = mac.SoD,

                    HPPAd = mac.HPP1Ad,
                    GPPAd = mac.GPP1Ad,

                    HSW = mac.HSW,
                    GSW = mac.GSW,
                    HWL = mac.HWL,
                    GWL = mac.GWL,

                    H1W = mac.H1W.ToString("#"),
                    G1W = mac.G1W.ToString("#"),
                    H2W = mac.H2W.ToString("#"),
                    G2W = mac.G2W.ToString("#"),
                    H3W = mac.H3W.ToString("#"),
                    G3W = mac.G3W.ToString("#"),
                    H4W = mac.H4W.ToString("#"),
                    G4W = mac.G4W.ToString("#"),
                    H5W = mac.H5W.ToString("#"),
                    G5W = mac.G5W.ToString("#"),
                    H6W = mac.H6W.ToString("#"),
                    G6W = mac.G6W.ToString("#"),
                    H7W = mac.H7W.ToString("#"),
                    G7W = mac.G7W.ToString("#"),
                };
                if (mac.SoD == "D")
                {
                    ad1 = mac.HPP1Ad.Split(' ');
                    ad2 = mac.HPP2Ad.Split(' ');

                    abc.HPPAd = $"{ad1[0]}{(ad1.Length == 1 ? "" : ad1[1].Substring(0, 1))} + {ad2[0]}{(ad2.Length == 1 ? "" : ad2[1].Substring(0, 1))}";
                    ad1       = mac.GPP1Ad.Split(' ');
                    ad2       = mac.GPP2Ad.Split(' ');
                    abc.GPPAd = $"{ad1[0]}{(ad1.Length == 1 ? "" : ad1[1].Substring(0, 1))} + {ad2[0]}{(ad2.Length == 1 ? "" : ad2[1].Substring(0, 1))}";
                    //abc.GPPAd = $"{ad1[0]}{ad1[1].Substring(0, 1)} + {ad2[0]}{ad2[1].Substring(0, 1)}";
                }
                if (abc.SoD != SoD)
                {
                    abc.Break = true;
                    SoD       = abc.SoD;
                }

                MACs.Add(abc);
            }
        }
Esempio n. 13
0
        private void Read()
        {
            // Okusun ama islem yapamasin
            //if (!IsYetkili)
            //    return;

            CET cet = Db.FromId <CET>((ulong)CEToNo);

            if (H_G == "H")
            {
                CToNo = (long)cet.HCToNo;
                IsOS  = cet.IsHOS;
            }
            else if (H_G == "G")
            {
                CToNo = (long)cet.GCToNo;
                IsOS  = cet.IsGOS;
            }
            else
            {
                return;
            }

            //IsML = cet.IsHOS && cet.IsGOS && !cet.IsMLY;
            IsML = true;
            if (cet.IsHOS && cet.IsGOS)
            {
                IsML = cet.IsMLY;
            }

            CT ct = Db.FromId <CT>((ulong)CToNo);

            // Lig Takim Event/Musabaka Sng/Dbl Mac sayilari
            SngMacSay = cet.CC.TNSM;
            DblMacSay = cet.CC.TNDM;

            //var cetxs = Db.SQL<CETX>("SELECT r FROM CETX r WHERE r.CET = ? and r.CT = ? order by r.SngIdx, r.Idx", cet, ct)

            IOrderedEnumerable <CETX> cetxs = null;

            if (SortFld == "Ad")
            {
                cetxs = Db.SQL <CETX>("SELECT r FROM CETX r WHERE r.CET = ? and r.CT = ?", cet, ct)
                        .OrderBy(x => { if (x.PPoNo == H.dskPPoNo)
                                        {
                                            return("zzzz");
                                        }
                                        return(x.PPAd); });
            }
            else if (SortFld == "Idx")
            {
                cetxs = Db.SQL <CETX>("SELECT r FROM CETX r WHERE r.CET = ? and r.CT = ?", cet, ct)
                        .OrderBy(x => { int i = x.Idx; if (i == 0)
                                        {
                                            i = 99;
                                        }
                                        return(i); });
            }
            else if (SortFld == "Idx2")
            {
                cetxs = Db.SQL <CETX>("SELECT r FROM CETX r WHERE r.CET = ? and r.CT = ?", cet, ct)
                        .OrderBy(x => { int i = x.Idx2; if (i == 0)
                                        {
                                            i = 99;
                                        }
                                        return(i); });
            }
            else if (SortFld == "SngIdx")
            {
                cetxs = Db.SQL <CETX>("SELECT r FROM CETX r WHERE r.CET = ? and r.CT = ?", cet, ct)
                        .OrderBy(x => { int i = x.SngIdx; if (i == 0)
                                        {
                                            i = 99;
                                        }
                                        return(i); });
            }
            else if (SortFld == "DblIdx")
            {
                cetxs = Db.SQL <CETX>("SELECT r FROM CETX r WHERE r.CET = ? and r.CT = ?", cet, ct)
                        .OrderBy(x => { int i = x.DblIdx; if (i == 0)
                                        {
                                            i = 99;
                                        }
                                        return(i); });
            }


            CETXs.Clear();
            foreach (var cetx in cetxs)
            {
                CETXsElementJson abc = new CETXsElementJson
                {
                    CETXoNo = (long)cetx.CETXoNo,
                    CToNo   = (long)cetx.CToNo,
                    Idx     = cetx.Idx,
                    Idx2    = cetx.Idx2,
                    SH      = "H",
                    PPoNo   = (long)cetx.PPoNo,
                    PPAd    = cetx.PPAd,
                    SngIdx  = cetx.SngIdx,
                    DblIdx  = cetx.DblIdx,
                    SngIdxS = cetx.SngIdx.ToString("#"),
                    DblIdxS = cetx.DblIdx.ToString("#"),
                };
                if (abc.SngIdx != 0)
                {
                    if ((abc.Idx2 - 2) > abc.SngIdx || (abc.Idx2 + 2) < abc.SngIdx)
                    {
                        abc.SH = "E";   // SiralamaHatasi bildirim
                    }
                }
                CETXs.Add(abc);
            }
        }