Esempio n. 1
0
        static bool Prefix(ref string __result, ref int _quality, ref bool _useQualityColor)
        {
            Debug.Log("Patch 4");
            if (_quality != 0)
            {
                Debug.Log("Patching...");
                string text = string.Empty;
                _quality /= 10;
                switch (_quality)
                {
                case 0:
                    text = Localization.Get("lblQualityDamaged");
                    break;

                case 1:
                    text = Localization.Get("lblQualityPoor");
                    break;

                case 2:
                    text = Localization.Get("lblQualityAverage");
                    break;

                case 3:
                    text = Localization.Get("lblQualityGreat");
                    break;

                case 4:
                    text = Localization.Get("lblQualityFlawless");
                    break;

                case 5:
                    text = Localization.Get("lblQualityLegendary");
                    break;

                case 6:
                    text = Localization.Get("lblQualityLegendaryPlus");
                    break;

                case 7:
                    text = Localization.Get("lblQualityRelic");
                    break;

                case 8:
                    text = Localization.Get("lblQualityDemonic");
                    break;
                }
                if (_useQualityColor)
                {
                    text     = string.Format("[{0}]{1}[-]", QualityInfo.GetQualityColorHex(_quality), text);
                    __result = text;
                    Debug.Log("Patch done");
                }
            }
            else
            {
                __result = Localization.Get("lblQualityBroken");
            }
            return(false);
        }