public static void DrawGroup(Group group) { //CellObject.SetObject(Cell.current, group); if (UI.current.layout) { UI.current.cellObjs.ForceAdd(group, Cell.current, "Group"); } Texture2D tex = UI.current.textures.GetColorizedTexture("MapMagic/Group", group.color); GUIStyle style = UI.current.textures.GetElementStyle(tex); Draw.Element(style); Cell.EmptyRowPx(5); using (Cell.Row) { Cell.EmptyLinePx(5); using (Cell.LinePx(24)) Draw.EditableLabelRight(ref group.name, style: UI.current.styles.bigLabel); //using (Cell.LineStd) Draw.EditableLabelRight(ref group.comment); Cell.EmptyLinePx(3); using (Cell.LineStd) { using (Cell.RowPx(0)) { using (Cell.RowPx(20)) Draw.Icon(UI.current.textures.GetTexture("DPUI/Chevrons/Down")); using (Cell.RowPx(35)) Draw.Label("Color"); if (Draw.Button("", visible: false)) { GroupRightClick.DrawGroupColorSelector(group); } } } } }
public static void DrawGroup(Group group, bool isMini = false) { float miniFactor = !isMini ? 1 : 0.5f / GraphWindow.miniZoom; //group controls are slightly smaller than in fullscreen //CellObject.SetObject(Cell.current, group); if (UI.current.layout) { UI.current.cellObjs.ForceAdd(group, Cell.current, "Group"); } Texture2D tex = UI.current.textures.GetColorizedTexture("MapMagic/Group", group.color); GUIStyle style = UI.current.textures.GetElementStyle(tex); Draw.Element(style); Cell.EmptyRowPx(5 * miniFactor); using (Cell.Row) { if (isMini && miniNameStyle == null) { miniNameStyle = new GUIStyle(UI.current.styles.bigLabel); miniNameStyle.fontSize = (int)(miniNameStyle.fontSize / GraphWindow.miniZoom * 0.6f); } Cell.EmptyLinePx(5 * miniFactor); GUIStyle labelStyle = !isMini ? UI.current.styles.bigLabel : miniNameStyle; using (Cell.LinePx(24 * miniFactor)) Draw.EditableLabelRight(ref group.name, style: labelStyle); //using (Cell.LineStd) Draw.EditableLabelRight(ref group.comment); Cell.EmptyLinePx(3 * miniFactor); using (Cell.LineStd) { using (Cell.RowPx(0)) { if (!isMini) { using (Cell.RowPx(20)) Draw.Icon(UI.current.textures.GetTexture("DPUI/Chevrons/Down"), scale: 0.5f * miniFactor); using (Cell.RowPx(35)) Draw.Label("Color"); } if (Draw.Button("", visible: false)) { GroupRightClick.DrawGroupColorSelector(group); } } } } }