Esempio n. 1
0
    private string OnNoteTooltip(float total_accumulation, string tooltip_text, ReportManager.ReportEntry.Order order, ReportManager.FormattingFn format_fn, Func <ReportManager.ReportEntry.Note, bool> is_note_applicable_cb, ReportManager.GroupFormattingFn group_format_fn = null)
    {
        notes.Clear();
        entry.IterateNotes(delegate(ReportManager.ReportEntry.Note note)
        {
            if (is_note_applicable_cb(note))
            {
                notes.Add(note);
            }
        });
        string text = string.Empty;
        float  num  = 0f;

        num = ((entry.contextEntries.Count <= 0) ? ((float)notes.Count) : ((float)entry.contextEntries.Count));
        num = Mathf.Max(num, 1f);
        foreach (ReportManager.ReportEntry.Note item in Sort(notes, reportGroup.posNoteOrder))
        {
            ReportManager.ReportEntry.Note current = item;
            string arg = format_fn(current.value);
            if (toggle.gameObject.activeInHierarchy && group_format_fn != null)
            {
                arg = group_format_fn(current.value, num);
            }
            text = string.Format(UI.ENDOFDAYREPORT.NOTES.NOTE_ENTRY_LINE_ITEM, text, current.note, arg);
        }
        string arg2 = format_fn(total_accumulation);

        if (group_format_fn != null && entry.context == null)
        {
            arg2 = group_format_fn(total_accumulation, num);
        }
        return(string.Format(tooltip_text + "\n" + text, arg2));
    }
        private static void OnNoteTooltip(ReportManager.ReportEntry entry, ReportManager.ReportGroup reportGroup, Dictionary <string, string> data, List <string> headers, Func <ReportManager.ReportEntry.Note, bool> is_note_applicable_cb)
        {
            //Debug.Log("OnNoteTooltip");
            List <ReportManager.ReportEntry.Note> notes = new List <ReportManager.ReportEntry.Note>();

            entry.IterateNotes(delegate(ReportManager.ReportEntry.Note note)
            {
                if (is_note_applicable_cb(note))
                {
                    notes.Add(note);
                }
            });

            foreach (ReportManager.ReportEntry.Note item in Sort(notes, reportGroup.posNoteOrder))
            {
                ReportManager.ReportEntry.Note current = item;

                string colName = CleanHeader(current.note);

                if (current.value > 0f)
                {
                    AddValue(colName + " (+)", current.value, data, headers);
                }
                else
                {
                    AddValue(colName + " (-)", current.value, data, headers);
                }
            }
        }
 private static bool IsNegativeNote(ReportManager.ReportEntry.Note note)
 {
     if (note.value < 0f)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 4
0
 private bool IsPositiveNote(ReportManager.ReportEntry.Note note)
 {
     if (note.value > 0f)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 5
0
    private void RefreshStress()
    {
        MinionIdentity identity = (!((UnityEngine.Object)selectedTarget != (UnityEngine.Object)null)) ? null : selectedTarget.GetComponent <MinionIdentity>();

        if ((UnityEngine.Object)identity == (UnityEngine.Object)null)
        {
            stressPanel.SetActive(false);
        }
        else
        {
            List <ReportManager.ReportEntry.Note> stressNotes = new List <ReportManager.ReportEntry.Note>();
            stressPanel.SetActive(true);
            stressPanel.GetComponent <CollapsibleDetailContentPanel>().HeaderLabel.text = UI.DETAILTABS.STATS.GROUPNAME_STRESS;
            ReportManager.ReportEntry reportEntry = ReportManager.Instance.TodaysReport.reportEntries.Find((ReportManager.ReportEntry entry) => entry.reportType == ReportManager.ReportType.StressDelta);
            stressDrawer.BeginDrawing();
            float num = 0f;
            stressNotes.Clear();
            int num2 = reportEntry.contextEntries.FindIndex((ReportManager.ReportEntry entry) => entry.context == identity.GetProperName());
            ReportManager.ReportEntry reportEntry2 = (num2 == -1) ? null : reportEntry.contextEntries[num2];
            if (reportEntry2 != null)
            {
                reportEntry2.IterateNotes(delegate(ReportManager.ReportEntry.Note note)
                {
                    stressNotes.Add(note);
                });
                stressNotes.Sort((ReportManager.ReportEntry.Note a, ReportManager.ReportEntry.Note b) => a.value.CompareTo(b.value));
                for (int i = 0; i < stressNotes.Count; i++)
                {
                    DetailsPanelDrawer             detailsPanelDrawer = stressDrawer;
                    string[]                       obj   = new string[6];
                    ReportManager.ReportEntry.Note note2 = stressNotes[i];
                    obj[0] = ((!(note2.value > 0f)) ? string.Empty : UIConstants.ColorPrefixRed);
                    ReportManager.ReportEntry.Note note3 = stressNotes[i];
                    obj[1] = note3.note;
                    obj[2] = ": ";
                    ReportManager.ReportEntry.Note note4 = stressNotes[i];
                    obj[3] = Util.FormatTwoDecimalPlace(note4.value);
                    obj[4] = "%";
                    ReportManager.ReportEntry.Note note5 = stressNotes[i];
                    obj[5] = ((!(note5.value > 0f)) ? string.Empty : UIConstants.ColorSuffix);
                    detailsPanelDrawer.NewLabel(string.Concat(obj));
                    float num3 = num;
                    ReportManager.ReportEntry.Note note6 = stressNotes[i];
                    num = num3 + note6.value;
                }
            }
            stressDrawer.NewLabel(((!(num > 0f)) ? string.Empty : UIConstants.ColorPrefixRed) + string.Format(UI.DETAILTABS.DETAILS.NET_STRESS, Util.FormatTwoDecimalPlace(num)) + ((!(num > 0f)) ? string.Empty : UIConstants.ColorSuffix));
            stressDrawer.EndDrawing();
        }
    }