示例#1
0
    void Start()
    {
        notFoundPanel.IsVisible = false;
        dfScrollPanel leaderPanel = GetComponent <dfScrollPanel> ();

        //categoryPanel.Anchor = dfAnchorStyle.All;
        HTTP.Client.Instance.Configure(new HTTP.Settings(TriviaService.GetHostAddress()).Protocol(HTTP.Protocol.HTTP));

        new HTTP.Request(TriviaService.GetHttpFolderPath() + "get_game_leaderboard.php?prize_id=" + CategoryConstant.PrizeId)
        .OnReply((reply) => {
            LeaderBoardReply leaderReply = JsonConvert.DeserializeObject <LeaderBoardReply>(reply.DataAsString);
            if (leaderReply.success == 1)
            {
                foreach (LeaderBoardData data in leaderReply.data)
                {
                    LeaderBoard instance = leaderPanel.AddPrefab(Prefab.gameObject).GetComponent <LeaderBoard>();
                    //instance.GetComponent<dfPanel>().Anchor = dfAnchorStyle.All;

                    instance.Data = data;
                    instance.start();
                }
                loaderPanel.IsVisible = false;
            }
            else
            {
                notFoundPanel.IsVisible = true;
                loaderPanel.IsVisible   = false;
            }
        })
        .Send();
    }
    // Use this for initialization
    void Start()
    {
        //topTitle.Text = categoryConstant.MainCategoryName;
        notFoundPanel.IsVisible = false;
        dfScrollPanel categoryPanel = GetComponent <dfScrollPanel> ();

        HTTP.Client.Instance.Configure(new HTTP.Settings(TriviaService.GetHostAddress()).Protocol(HTTP.Protocol.HTTP));

        new HTTP.Request(TriviaService.GetHttpFolderPath() + "second_categories.php?parent_id=" + CategoryConstant.MainCategoryId)
        .OnReply((reply) => {
            SubCatagoryReply catReply = JsonConvert.DeserializeObject <SubCatagoryReply>(reply.DataAsString);
            if (catReply.success == 1)
            {
                foreach (SubCatagoryData data in catReply.data)
                {
                    SubCatagory instance = categoryPanel.AddPrefab(Prefab.gameObject).GetComponent <SubCatagory>();

                    //MainCatagory instance = Instantiate(Prefab) as MainCatagory;
                    instance.Data = data;
                    instance.start();
                }
                loaderPanel.IsVisible = false;
            }
            else
            {
                //	notFoundPanel.IsVisible = true;
                //	loaderPanel.IsVisible = false;

                CategoryConstant.SubCategoryId   = 0;
                CategoryConstant.GrandCategoryId = 0;
                SceneManager.LoadScene("TriviaGameSponsor");
            }
        })
        .Send();
    }
示例#3
0
    void Start()
    {
        HTTP.Client.Instance.Configure(new HTTP.Settings(TriviaService.GetHostAddress()).Protocol(HTTP.Protocol.HTTP));

        notFoundPanel.IsVisible = false;
        dfScrollPanel historyPanel = GetComponent <dfScrollPanel> ();

        //categoryPanel.Anchor = dfAnchorStyle.All;

        new HTTP.Request(TriviaService.GetHttpFolderPath() + "get_user_game_history.php?game_user_id=" + GameConstant.UserId + "&game_user_type=" + GameConstant.UserType)
        .OnReply((reply) => {
            HistoryReply hReply = JsonConvert.DeserializeObject <HistoryReply>(reply.DataAsString);
            if (hReply.success == 1)
            {
                foreach (HistoryData data in hReply.data)
                {
                    History instance = historyPanel.AddPrefab(Prefab.gameObject).GetComponent <History>();

                    instance.Data = data;
                    instance.start();
                }
                loaderPanel.IsVisible = false;
            }
            else
            {
                notFoundPanel.IsVisible = true;
                loaderPanel.IsVisible   = false;
            }
        })
        .Send();
    }
示例#4
0
    void Start()
    {
        HTTP.Client.Instance.Configure(new HTTP.Settings(TriviaService.GetHostAddress()).Protocol(HTTP.Protocol.HTTP));

        notFoundPanel.IsVisible = false;
        dfScrollPanel winnerPanel = GetComponent <dfScrollPanel> ();

        //categoryPanel.Anchor = dfAnchorStyle.All;

        new HTTP.Request(TriviaService.GetHttpFolderPath() + "get_game_winners.php")
        .OnReply(reply =>
        {
            WinnerReply winReply = JsonConvert.DeserializeObject <WinnerReply>(reply.DataAsString);
            if (winReply.success == 1)
            {
                foreach (WinnerData data in winReply.data)
                {
                    Winner instance = winnerPanel.AddPrefab(Prefab.gameObject).GetComponent <Winner>();
                    //instance.GetComponent<dfPanel>().Anchor = dfAnchorStyle.All;

                    instance.Data = data;
                    instance.start();
                }
                loaderPanel.IsVisible = false;
            }
            else
            {
                notFoundPanel.IsVisible = true;
                loaderPanel.IsVisible   = false;
            }
        })
        .Send();
    }
 void Start()
 {
     if (Panel == null)
     {
         Panel = GetComponent <dfScrollPanel>();
     }
 }
示例#6
0
 void Start()
 {
     if( Panel == null )
     {
         Panel = GetComponent<dfScrollPanel>();
     }
 }
 void Awake()
 {
     mMyPlayerInfoPrefab = (GameObject)Resources.Load("Lobby/Prefabs/MyPlayerInfoBox");
     mPlayerInfoPrefab   = (GameObject)Resources.Load("Lobby/Prefabs/PlayerInfoBox");
     mPlayersList        = (dfScrollPanel)GameObject.FindObjectOfType(typeof(dfScrollPanel));
     mChat           = (dfRichTextLabel)GameObject.FindObjectOfType(typeof(dfRichTextLabel));
     mLoadingPanel   = (LoadingPanel)GameObject.FindObjectOfType(typeof(LoadingPanel));
     mNetworkManager = (NetworkManager)GameObject.FindObjectOfType(typeof(NetworkManager));
 }
 public void Start()
 {
     // If not already assigned, grab a reference to the
     // Scroll Panel that will contain the dynamically-
     // created controls.
     if( target == null )
     {
         this.target = GetComponent<dfScrollPanel>();
     }
 }
 public void Start()
 {
     // If not already assigned, grab a reference to the
     // Scroll Panel that will contain the dynamically-
     // created controls.
     if (target == null)
     {
         this.target = GetComponent <dfScrollPanel>();
     }
 }
 void Awake()
 {
     mScreenPanel = (dfPanel)GameObject.FindGameObjectWithTag("Screen").GetComponent(typeof(dfPanel));
     mSprite = GetComponent<dfTextureSprite>();
     if (mSprite == null) {
         mSprite = GetComponent<dfSlicedSprite>();
     }
     mProps = (dfScrollPanel)FindObjectOfType(typeof(dfScrollPanel));
     mRecordingProp = (RecordingProp)GetComponent (typeof(RecordingProp));
 }
    bool hasDroppedFirst = false;     // This tracks if this is our first drag - if so we can do something special on first drop

    void Awake()
    {
        mScreenPanel = (dfPanel)GameObject.FindGameObjectWithTag("Screen").GetComponent(typeof(dfPanel));
        mSprite      = GetComponent <dfTextureSprite>();
        if (mSprite == null)
        {
            mSprite = GetComponent <dfSlicedSprite>();
        }
        mProps         = (dfScrollPanel)FindObjectOfType(typeof(dfScrollPanel));
        mRecordingProp = (RecordingProp)GetComponent(typeof(RecordingProp));
    }
示例#12
0
 protected internal override void OnMouseMove(dfMouseEventArgs args)
 {
     if ((args is dfTouchEventArgs || this.isMouseDown) && !args.Used && (args.Position - this.touchStartPosition).magnitude > 5f)
     {
         Vector2       vector2        = args.MoveDelta.Scale(-1f, 1f);
         dfScrollPanel scrollPosition = this;
         scrollPosition.ScrollPosition = scrollPosition.ScrollPosition + vector2;
         this.scrollMomentum           = (this.scrollMomentum + vector2) * 0.5f;
         args.Use();
     }
     base.OnMouseMove(args);
 }
示例#13
0
    void Awake()
    {
        mNetworkManager         = FindObjectOfType <NetworkManager>();
        mGame                   = FindObjectOfType <Game>();
        mFinalPlayerScores      = GameObject.Find("FinalPlayerScores").GetComponent <dfScrollPanel>();
        mFinalPlayerScorePrefab = (GameObject)Resources.Load("EndOfGame/Prefabs/FinalPlayerScore");
        GameObject container = GameObject.Find("Container");

        dfTweenVector3[] tweens = container.GetComponents <dfTweenVector3>();
        mOverallDetailTween = tweens[0];
        mDetailOverallTween = tweens[1];
    }
示例#14
0
    public void Init(ref ServerBrowser.Server s)
    {
        this.server           = s;
        this.textLabel.Text   = this.server.name;
        this.textPlayers.Text = this.server.currentplayers.ToString() + " / " + this.server.maxplayers.ToString();
        this.textPing.Text    = this.server.ping.ToString();
        dfScrollPanel component = base.transform.parent.GetComponent <dfScrollPanel>();

        if (component != null)
        {
            base.GetComponent <dfControl>().Width = component.Width;
            base.GetComponent <dfControl>().ResetLayout(true, false);
        }
        this.UpdateColours();
    }
示例#15
0
    public override void Update()
    {
        base.Update();
        if (this.useScrollMomentum && !this.isMouseDown && this.scrollMomentum.sqrMagnitude > 1.401298E-45f)
        {
            dfScrollPanel scrollPosition = this;
            scrollPosition.ScrollPosition = scrollPosition.ScrollPosition + this.scrollMomentum;
        }
        if (this.isControlInvalidated && this.autoLayout && base.IsVisible)
        {
            this.AutoArrange();
            this.updateScrollbars();
        }
        dfScrollPanel _dfScrollPanel = this;

        _dfScrollPanel.scrollMomentum = _dfScrollPanel.scrollMomentum * (0.95f - Time.deltaTime);
    }
示例#16
0
    void Start()
    {
        //  Grab user current daily game
        HTTP.Client.Instance.Configure(new HTTP.Settings(TriviaService.GetHostAddress()).Protocol(HTTP.Protocol.HTTP));
        new HTTP.Request(TriviaService.GetHttpFolderPath() + "get_player_game.php?game_user_id=" + GameConstant.UserId + "&game_user_type=" + GameConstant.UserType)
        .OnReply((reply2) => {
            DailyGameReply dailyReply = JsonConvert.DeserializeObject <DailyGameReply>(reply2.DataAsString);
            if (dailyReply.daily_game == 0)
            {
                SceneManager.LoadScene("TriviaInAppPurchase");
            }
        }).Send();


        notFoundPanel.IsVisible = false;
        dfScrollPanel categoryPanel = GetComponent <dfScrollPanel> ();

        //categoryPanel.Anchor = dfAnchorStyle.All;

        new HTTP.Request(TriviaService.GetHttpFolderPath() + "first_categories.php")
        .OnReply((reply) => {
            MainCatagoryReply catReply = JsonConvert.DeserializeObject <MainCatagoryReply>(reply.DataAsString);
            if (catReply.success == 1)
            {
                foreach (MainCatagoryData data in catReply.data)
                {
                    MainCatagory instance = categoryPanel.AddPrefab(Prefab.gameObject).GetComponent <MainCatagory>();
                    //instance.GetComponent<dfPanel>().Anchor = dfAnchorStyle.All;

                    instance.Data = data;
                    instance.start();
                }
                loaderPanel.IsVisible = false;
            }
            else
            {
                notFoundPanel.IsVisible = true;
                loaderPanel.IsVisible   = false;
            }
        })
        .Send();
    }
示例#17
0
    protected internal override void OnKeyDown(dfKeyEventArgs args)
    {
        if (!this.scrollWithArrowKeys || args.Used)
        {
            base.OnKeyDown(args);
            return;
        }
        float single  = (this.horzScroll == null ? 1f : this.horzScroll.IncrementAmount);
        float single1 = (this.vertScroll == null ? 1f : this.vertScroll.IncrementAmount);

        if (args.KeyCode == KeyCode.LeftArrow)
        {
            dfScrollPanel scrollPosition = this;
            scrollPosition.ScrollPosition = scrollPosition.ScrollPosition + new Vector2(-single, 0f);
            args.Use();
        }
        else if (args.KeyCode == KeyCode.RightArrow)
        {
            dfScrollPanel _dfScrollPanel = this;
            _dfScrollPanel.ScrollPosition = _dfScrollPanel.ScrollPosition + new Vector2(single, 0f);
            args.Use();
        }
        else if (args.KeyCode == KeyCode.UpArrow)
        {
            dfScrollPanel scrollPosition1 = this;
            scrollPosition1.ScrollPosition = scrollPosition1.ScrollPosition + new Vector2(0f, -single1);
            args.Use();
        }
        else if (args.KeyCode == KeyCode.DownArrow)
        {
            dfScrollPanel _dfScrollPanel1 = this;
            _dfScrollPanel1.ScrollPosition = _dfScrollPanel1.ScrollPosition + new Vector2(0f, single1);
            args.Use();
        }
        base.OnKeyDown(args);
    }
示例#18
0
 void Awake()
 {
     mMyPropsList = (dfScrollPanel)FindObjectOfType(typeof(dfScrollPanel));
     mAfternoonPropPrefab = (GameObject)Resources.Load ("Afternoon/Prefabs/AfternoonProp");
     mNetworkManager = (NetworkManager)FindObjectOfType (typeof(NetworkManager));
 }
示例#19
0
 void Awake()
 {
     mMyPropsList = (dfScrollPanel)FindObjectOfType(typeof(dfScrollPanel));
     mPropSelectionPurchasedPropPrefab = (GameObject)Resources.Load("PropSelection/Prefabs/PropSelectionPurchasedProp");
 }
示例#20
0
 void Awake()
 {
     panel = this.GetComponent<dfScrollPanel>();
 }
示例#21
0
 void Awake()
 {
     mMyPropsList         = (dfScrollPanel)FindObjectOfType(typeof(dfScrollPanel));
     mAfternoonPropPrefab = (GameObject)Resources.Load("Afternoon/Prefabs/AfternoonProp");
     mNetworkManager      = (NetworkManager)FindObjectOfType(typeof(NetworkManager));
 }
示例#22
0
 public void ToggleToPanel(dfScrollPanel targetPanel, bool doFocus = false)
 {
     TabModTheGungeon.IsVisible = (targetPanel == TabModTheGungeon);
     orig_ToggleToPanel(targetPanel, doFocus);
 }
示例#23
0
 void Awake()
 {
     mMyPropsList = (dfScrollPanel)FindObjectOfType(typeof(dfScrollPanel));
     mPropSelectionPurchasedPropPrefab = (GameObject)Resources.Load ("PropSelection/Prefabs/PropSelectionPurchasedProp");
 }
示例#24
0
    // Use this for initialization
    void Start()
    {
        this._panel = GetComponent <dfScrollPanel>();
        //   _dialog = GameObject.Find("Dialog").GetComponent<DialogShow>();

        //   _panel.transform.Find("NewBrainButton").GetComponent<dfButton>().Click += button_Click;

        var q = new ParseQuery <Brain>().WhereEqualTo("userId", ParseUser.CurrentUser.ObjectId).WhereDoesNotExist("originalBrain").OrderBy("createdAt");

        q.FindAsync().ContinueWith(t =>
        {
            // print("Joe");
            rootBrains = new List <Brain>();
            IEnumerable <Brain> result = t.Result;
            //     Dictionary<string, Brain> allBrains = new Dictionary<string, Brain>();

            foreach (Brain brain in result)
            {
                // print("Brain");
                if (brain.Population != null)
                {
                    // print("FILE: " + brain.Population.Name + ", URL: " + brain.Population.Url);

                    //  StartCoroutine(WaitForRequest(brain));
                }
                if (brain.ParentId != null)
                {
                    result.Where(b => b.ObjectId == brain.ParentId).First().Children.Add(brain);
                }
                else
                {
                    rootBrains.Add(brain);
                }
            }
            allBrains           = result;
            Settings.RootBrains = rootBrains;
            DataLoaded          = true;
        });

        //   GameObject.Find("Back Button").GetComponent<dfButton>().Click += AddBrainButtons_Click;

        slot1      = GameObject.Find("Slot 1").GetComponent <dfPanel>();
        slot1Color = slot1.BackgroundColor;
        slot2      = GameObject.Find("Slot 2").GetComponent <dfPanel>();
        slot2Color = slot2.BackgroundColor;
        slot3      = GameObject.Find("Slot 3").GetComponent <dfPanel>();
        slot3Color = slot3.BackgroundColor;
        slot4      = GameObject.Find("Slot 4").GetComponent <dfPanel>();
        slot4Color = slot4.BackgroundColor;


        slot1.DragDrop  += slot1_DragDrop;
        slot1.DragEnter += slot1_DragEnter;
        slot1.DragLeave += slot1_DragLeave;

        slot2.DragDrop  += slot1_DragDrop;
        slot2.DragEnter += slot1_DragEnter;
        slot2.DragLeave += slot1_DragLeave;

        slot3.DragDrop  += slot1_DragDrop;
        slot3.DragEnter += slot1_DragEnter;
        slot3.DragLeave += slot1_DragLeave;

        slot4.DragDrop  += slot1_DragDrop;
        slot4.DragEnter += slot1_DragEnter;
        slot4.DragLeave += slot1_DragLeave;

        BlankBrainButton.Click += new MouseEventHandler(BlankBrainButton_Click);

        if (Settings.RootBrains != null)
        {
            rootBrains = Settings.RootBrains;
            StartCoroutine(DoLayout());
        }
    }
 public void ToggleToPanel(dfScrollPanel targetPanel, bool doFocus = false)
 {
     TabETGMod.IsVisible = (targetPanel == TabETGMod);
     orig_ToggleToPanel(targetPanel, doFocus);
 }
 private void Awake()
 {
     orig_Awake();
     TabETGMod = Instantiate(TabControls);
 }
示例#27
0
 // Called by Unity just before any of the Update methods is called the first time.
 public void Start()
 {
     // Obtain a reference to the dfScrollPanel instance attached to this object
     this._scrollPanel = GetComponent <dfScrollPanel>();
 }
示例#28
0
 private void Awake()
 {
     orig_Awake();
     TabModTheGungeon = Instantiate(TabControls);
 }
示例#29
0
 // Use this for initialization
 void Start()
 {
     this._scrollPanel = GetComponent <dfScrollPanel>();
 }
示例#30
0
 public extern void orig_ToggleToPanel(dfScrollPanel targetPanel, bool doFocus = false);