private static string GetFormPercentStr(int percent, bool isExtra)
 {
     if (isExtra)
     {
         return(string.Format(valForm2, CUICommonSystem.GetValuePercent(percent)));
     }
     return(CUICommonSystem.GetValuePercent(percent));
 }
Example #2
0
        public static void RefreshPropPanel(GameObject propPanel, ref int[] propArr, ref int[] propPctArr)
        {
            int num    = 0x24;
            int amount = 0;

            for (int i = 0; i < num; i++)
            {
                if ((propArr[i] > 0) || (propPctArr[i] > 0))
                {
                    amount++;
                }
            }
            CUIListScript component = propPanel.GetComponent <CUIListScript>();

            component.SetElementAmount(amount);
            amount = 0;
            for (int j = 0; j < num; j++)
            {
                if ((propArr[j] > 0) || (propPctArr[j] > 0))
                {
                    CUIListElementScript elemenet = component.GetElemenet(amount);
                    DebugHelper.Assert(elemenet != null);
                    if (elemenet != null)
                    {
                        Text text  = elemenet.gameObject.transform.Find("titleText").GetComponent <Text>();
                        Text text2 = elemenet.gameObject.transform.Find("valueText").GetComponent <Text>();
                        DebugHelper.Assert(text != null);
                        if (text != null)
                        {
                            text.text = CUICommonSystem.s_attNameList[j];
                        }
                        DebugHelper.Assert(text2 != null);
                        if (text2 != null)
                        {
                            if (propArr[j] > 0)
                            {
                                if (CUICommonSystem.s_pctFuncEftList.IndexOf((uint)j) != -1)
                                {
                                    text2.text = string.Format("+{0}", CUICommonSystem.GetValuePercent(propArr[j] / 100));
                                }
                                else
                                {
                                    text2.text = string.Format("+{0}", ((float)propArr[j]) / 100f);
                                }
                            }
                            else if (propPctArr[j] > 0)
                            {
                                text2.text = string.Format("+{0}", CUICommonSystem.GetValuePercent(propPctArr[j]));
                            }
                        }
                    }
                    amount++;
                }
            }
        }
Example #3
0
        public static void RefreshPropPanel(GameObject propPanel, ref int[] propArr, ref int[] propPctArr)
        {
            int num  = 37;
            int num2 = 0;

            for (int i = 0; i < num; i++)
            {
                if (propArr[i] > 0 || propPctArr[i] > 0)
                {
                    num2++;
                }
            }
            CUIListScript component = propPanel.GetComponent <CUIListScript>();

            component.SetElementAmount(num2);
            num2 = 0;
            for (int j = 0; j < num; j++)
            {
                if (propArr[j] > 0 || propPctArr[j] > 0)
                {
                    CUIListElementScript elemenet = component.GetElemenet(num2);
                    DebugHelper.Assert(elemenet != null);
                    if (elemenet != null)
                    {
                        Text component2 = elemenet.gameObject.transform.Find("titleText").GetComponent <Text>();
                        Text component3 = elemenet.gameObject.transform.Find("valueText").GetComponent <Text>();
                        DebugHelper.Assert(component2 != null);
                        if (component2 != null)
                        {
                            component2.set_text(CUICommonSystem.s_attNameList[j]);
                        }
                        DebugHelper.Assert(component3 != null);
                        if (component3 != null)
                        {
                            if (propArr[j] > 0)
                            {
                                if (CUICommonSystem.s_pctFuncEftList.IndexOf((uint)j) != -1)
                                {
                                    component3.set_text(string.Format("+{0}", CUICommonSystem.GetValuePercent(propArr[j] / 100)));
                                }
                                else
                                {
                                    component3.set_text(string.Format("+{0}", (float)propArr[j] / 100f));
                                }
                            }
                            else if (propPctArr[j] > 0)
                            {
                                component3.set_text(string.Format("+{0}", CUICommonSystem.GetValuePercent(propPctArr[j])));
                            }
                        }
                    }
                    num2++;
                }
            }
        }