static void Postfix(ScoreboardSlot __instance, string ìåäòäóëäêèæ, int óîèòèðîðçîì, string ñíçæóñðæéòó, int çïîèïçïñêïæ, int äïóïåòòéðåç, int ìëäòìèçñçìí, int óíïòðíäóïçç, int íîóìóíèíñìå, bool ðèæòðìêóëïð, bool äåîéíèñèììñ, bool æíèòîîìðçóî, int ïîñíñóóåîîñ, int æìíñèéçñîíí, bool òêóçíïåæíîë, bool æåèòðéóçêçó, bool èëçòëæêäêîå, bool ëååííåïäæîè, bool ñîäèñæïîóçó)
 {
     try
     {
         Texture2D newBadgeTexture;
         //æìíñèéçñîíí = prestige
         //ïîñíñóóåîîñ = level
         if (æìíñèéçñîíí >= 10)
         {
             int index = ~levels.BinarySearch(ïîñíñóóåîîñ);
             if (customBadges.TryGetValue(levels[index - 1], out newBadgeTexture))
             {
                 if (newBadgeTexture.name != "NOTFOUND")
                 {
                     __instance.éòëèïòëóæèó.texture = newBadgeTexture;
                 }
             }
             return;
         }
     }
     catch (Exception e)
     {
         if (e.Message.Contains("Object reference not set to an instance of an object"))
         {
             //Go do one
         }
         else
         {
             log("Failed to assign custom badge to a player:");
             log(e.Message);
         }
     }
 }
    public static void SortData(int Level)
    {
        bool Sorted = false;

        while (!Sorted)
        {
            Sorted = true;
            for (int i = Gd.Scoreboards[Level - 1].Slots.Length - 1; i > 0; i--)
            {
                if (Gd.Scoreboards[Level - 1].Slots[i].Score > Gd.Scoreboards[Level - 1].Slots[i - 1].Score)
                {
                    Sorted = false;
                    ScoreboardSlot temp = Gd.Scoreboards[Level - 1].Slots[i];
                    Gd.Scoreboards[Level - 1].Slots[i]     = Gd.Scoreboards[Level - 1].Slots[i - 1];
                    Gd.Scoreboards[Level - 1].Slots[i - 1] = temp;
                }
            }
        }
    }
Exemple #3
0
        public ReadResults Read(out ScoreboardSlot result)
        {
            result = default;
            ReadResults readResults = StringReader.ReadUnquotedString(out string slot);

            if (!readResults.Successful)
            {
                return(readResults);
            }

            string[] values = slot.Split('.');
            if (Resources.ScoreboardSlots.TryGetSlot(values[0], out Collections.ScoreboardSlot contents))
            {
                if (contents.Read(slot.Substring(values[0].Length), Resources))
                {
                    result = new ScoreboardSlot(slot);
                    return(ReadResults.Success());
                }
            }
            return(ReadResults.Failure(CommandError.UnknownDisplaySlot(slot)));
        }