private void buildIntervalNode(int id, progressInterval p, int size, ref Rect r) { GUILayout.BeginHorizontal(); GUILayout.Space(20); if (popup) GUILayout.Label(p.Descriptor, contractSkins.progressBodyTitleBehind, GUILayout.MaxWidth(160 + size * 30)); else { if (GUILayout.Button(p.Descriptor, contractSkins.progressBodyTitle, GUILayout.MaxWidth(160 + size * 30))) { p.ShowRecords = !p.ShowRecords; } } GUILayout.EndHorizontal(); if (p.ShowRecords) { for (int i = 1; i < p.Interval; i++) { GUILayout.Label(p.Descriptor + " Record " + i.ToString() + ": " + p.getRecord(i).ToString(), contractSkins.progressNodeTitle, GUILayout.MaxWidth(165 + size * 30)); r = GUILayoutUtility.GetLastRect(); //Only draw the rewards if they are visible in the window if (r.yMin >= (scroll.y - 20) && r.yMax <= (scroll.y + WindowRect.height - (20 + size * 6))) { Rect rewardsRect = r; rewardsRect.x = 180 + (size * 30); rewardsRect.y += (2 + (size * 2)); scaledContent(ref rewardsRect, p.getFundsString(i), "", Currency.Funds, size, true, false); scaledContent(ref rewardsRect, p.getScienceString(i), "", Currency.Science, size, true, false); scaledContent(ref rewardsRect, p.getRepString(i), "", Currency.Reputation, size, true, false); } } } }
private void drawIntervalRecords(progressInterval p, int index) { GUILayout.Label(string.Format(p.Descriptor + " Record {0}: {1}", index, p.getRecord(index)), CapComSkins.parameterText); GUILayout.Label("Rewards: ", CapComSkins.headerText, GUILayout.Width(80)); sizedContent(p.getFundsString(index), p.getScienceString(index), p.getRepString(index), TransactionReasons.ContractReward); }