示例#1
0
        private void DrawModItemContent(MonitoredModViewModel mod, float indent)
        {
            indent += Appearance.LargeMargin;

            mod.IsReflectionListExpanded = DrawTools.DrawExpander(
                () => DrawItemHeader(Strings.ReflectionQueries, mod.QueriesDescription),
                enabled: mod.AnyQueries,
                expanded: mod.IsReflectionListExpanded,
                i => DrawStringList(mod.QueriedMembers, i),
                indent);

            string conflictsCaption = mod.AnyConflicts
                ? Strings.PossibleModConflicts
                : Strings.PossibleModConflicts + ": " + Strings.None;

            GUILayout.BeginHorizontal();
            GUILayout.Space(indent);
            GUI.contentColor = Colors.Text;
            GUILayout.Label(conflictsCaption);
            GUILayout.EndHorizontal();

            GUILayout.Space(Appearance.SmallMargin);

            if (mod.AnyConflicts)
            {
                DrawConflictedMods(mod.Conflicts, indent);
            }
        }
示例#2
0
 /// <summary>
 /// Draws the content of the specified <see cref="MonitoredModViewModel"/> instance
 /// in the current area.
 /// </summary>
 /// <param name="mod">A <see cref="MonitoredModViewModel"/> instance to display.</param>
 public void DrawModView(MonitoredModViewModel mod)
 => mod.IsExpanded = DrawTools.DrawExpander(
     () => DrawItemHeader(mod.ModName, mod.Description),
     enabled: true,
     expanded: mod.IsExpanded,
     _ => DrawModItemContent(mod, Appearance.LargeMargin),
     indent: 0f);
示例#3
0
 private void DrawConflictedMods(IEnumerable <ConflictInfoViewModel> conflicts, float indent)
 {
     foreach (var conflict in conflicts)
     {
         conflict.IsExpanded = DrawTools.DrawExpander(
             () => DrawItemHeader(conflict.ModName, conflict.Description),
             enabled: conflict.AnyMembers,
             expanded: conflict.IsExpanded,
             i => DrawStringList(conflict.MemberNames, i),
             indent);
     }
 }