Ejemplo n.º 1
0
        void RequirementField(Rect pos, Requirement req)
        {
            var selectionPos = new Rect(pos.x, pos.y + Data.statusPaddingY, pos.width, pos.height - Data.statusPaddingY * 2);

            GUI.color = selectedReq == req ? Data.selectedColor : Data.unselectedColor;
            if (GUI.Button(selectionPos, GUIContent.none, Data.selectionStyle))
            {
                selectedReq = req;
                UpdateSelectedTimestamp();
                Inspector.Repaint();
            }


            var statusPos = new Rect(pos.x, pos.y + Data.statusPaddingY, Data.statusWidth, pos.height - Data.statusPaddingY * 2);

            GUI.color = GetStatusColor(req);
            GUI.Box(statusPos, new GUIContent(GetStatusTex(req)), Data.statusStyle);

            var pathPos = new Rect(pos.x + Data.statusWidth + Data.reqNameWidth, pos.y + Data.statusPaddingY, pos.width - Data.responsiblePersonWidth - Data.reqNameWidth - Data.statusWidth, statusPos.height);

            GUI.Label(pathPos, new GUIContent(req.path), Data.pathBoxStyle);

            var namePos = new Rect(pos.x + Data.statusWidth, pos.y, Data.reqNameWidth, pos.height);

            GUI.color = GetPriorityColor(req);
            GUI.Label(namePos, new GUIContent(req.name), Data.nameBoxStyle);

            if (!LocalData.timestampDictionary.ContainsKey(req.path) || LocalData.timestampDictionary[req.path] < req.timestamp)
            {
                var notiPos = new Rect(namePos.x + namePos.width - Data.notificationPointPos.x, namePos.y + Data.notificationPointPos.y, Data.notificationPointPos.z, Data.notificationPointPos.z);
                GUI.color = Data.notificationPointColor;
                GUI.Box(notiPos, GUIContent.none, Data.notificationPointStyle);
            }

            var personPos = new Rect(pos.x + pos.width - Data.responsiblePersonWidth, pos.y, Data.responsiblePersonWidth, pos.height);

            GUI.color = Color.white;
            GUI.Label(personPos, string.IsNullOrWhiteSpace(req.responsiblePerson) ? new GUIContent(Data.responsiblePersonTex) : new GUIContent(req.responsiblePerson), Data.responsiblePersonStyle);

            GUI.color = Color.white;
        }