コード例 #1
0
        public async void UpdatePlayer(Player player, int rank, string status, string crewTag, PlayerIcon icon, HudColor rowColor, HudColor statusColor)
        {
            PlayerRow p = playerRows.Find(pr => { return(pr.Player.ServerId == player.ServerId); });

            p.Status      = status;
            p.PlayerRank  = rank;
            p.CrewTag     = crewTag;
            p.Icon        = icon;
            p.RowColor    = rowColor;
            p.StatusColor = statusColor;
            await UpdateList();
        }
コード例 #2
0
        public async void UpdatePlayer(int index, int rank, string status, string crewTag, PlayerIcon icon, HudColor rowColor, HudColor statusColor)
        {
            PlayerRow p = playerRows[index];

            p.Status      = status;
            p.PlayerRank  = rank;
            p.CrewTag     = crewTag;
            p.Icon        = icon;
            p.RowColor    = rowColor;
            p.StatusColor = statusColor;
            await UpdateList();
        }
コード例 #3
0
        private async Task UpdateList()
        {
            //for (var i = 0; i < 32; i++)
            //{
            //    PushScaleformMovieFunctionN("SET_DATA_SLOT_EMPTY");
            //    PushScaleformMovieFunctionParameterInt(3);
            //    PushScaleformMovieFunctionParameterInt(i);
            //    PopScaleformMovieFunctionVoid();
            //}
            //await BaseScript.Delay(0);
            if (playerRows.Count > 0)
            {
                for (var i = 0; i < playerRows.Count; i++)
                {
                    PlayerRow pr = playerRows[i];
                    if (pr.RowIndex != i)
                    {
                        pr.RowIndex   = i;
                        playerRows[i] = pr;
                    }

                    PushScaleformMovieFunctionN("SET_DATA_SLOT");                   // call scaleform function

                    PushScaleformMovieFunctionParameterInt(3);                      // frontend menu column
                    PushScaleformMovieFunctionParameterInt(i);                      // row index

                    PushScaleformMovieFunctionParameterInt(0);                      // menu ID
                    PushScaleformMovieFunctionParameterInt(0);                      // unique ID
                    PushScaleformMovieFunctionParameterInt(2);                      // type (2 = AS_ONLINE_IN_SESSION)

                    PushScaleformMovieFunctionParameterInt(pr.PlayerRank);          // rank value / (initialIndex 1337)
                    PushScaleformMovieFunctionParameterBool(false);                 // isSelectable

                    PushScaleformMovieFunctionParameterString(pr.Player.Name);      // playerName

                    PushScaleformMovieFunctionParameterInt((int)pr.RowColor);       // rowColor

                    PushScaleformMovieFunctionParameterBool(false);                 // reduceColors (if true: removes color from left bar & reduces color opacity on row itself.)

                    PushScaleformMovieFunctionParameterInt(0);                      // unused
                    PushScaleformMovieFunctionParameterInt((int)pr.Icon);           // right player icon.
                    PushScaleformMovieFunctionParameterInt(0);                      // unused

                    PushScaleformMovieFunctionParameterString($"..+{pr.CrewTag}");  // crew label text.

                    PushScaleformMovieFunctionParameterBool(false);                 // should be a thing to toggle blinking of (kick) icon, but doesn't seem to work.

                    PushScaleformMovieFunctionParameterString(pr.Status);           // badge/status tag text
                    PushScaleformMovieFunctionParameterInt((int)pr.StatusColor);    // badge/status tag background color

                    PopScaleformMovieFunctionVoid();                                // done
                }
            }
            else
            {
                await BaseScript.Delay(0);
            }
            //await BaseScript.Delay(500);

            //UpdateDetails();
            //PushScaleformMovieFunctionN("DISPLAY_DATA_SLOT");
            //PushScaleformMovieFunctionParameterInt(0);
            //PopScaleformMovieFunctionVoid();

            //UpdateSettings();
            //PushScaleformMovieFunctionN("DISPLAY_DATA_SLOT");
            //PushScaleformMovieFunctionParameterInt(1);
            //PopScaleformMovieFunctionVoid();

            //await UpdateList();
            PushScaleformMovieFunctionN("DISPLAY_DATA_SLOT");
            PushScaleformMovieFunctionParameterInt(3);
            PopScaleformMovieFunctionVoid();

            ///// ACTIVATE THE FIRST COLUMN (FOCUS).
            //PushScaleformMovieFunctionN("SET_COLUMN_FOCUS");
            //PushScaleformMovieFunctionParameterInt(0); // column index // _loc7_
            //PushScaleformMovieFunctionParameterInt(1); // highlightIndex // _loc6_
            //PushScaleformMovieFunctionParameterInt(1); // scriptSetUniqID // _loc4_
            //PushScaleformMovieFunctionParameterInt(0); // scriptSetMenuState // _loc5_
            //PopScaleformMovieFunctionVoid();
        }