コード例 #1
0
        private void DoContents(Rect rect)
        {
            var l = new Listing_StandardPlus();

            l.Begin(rect);
            l.Gap();
            l.Label(Lang.Get("ContentDirectory").Bold());
            l.Label(_pack.SourceDirectory.FullName.Italic());
            l.GapLine();
            l.End();

            var filterList     = new Listing_StandardPlus();
            var filterRect     = new Rect(rect.x, rect.y + l.CurHeight, rect.width, rect.height - l.CurHeight);
            var filterViewRect = new Rect(0f, 0f, rect.width - ScrollBarWidth, _pack.AllContent.Count() * (Text.LineHeight + filterList.verticalSpacing));

            Widgets.BeginScrollView(filterRect, ref _scroll, filterViewRect);
            filterList.Begin(filterViewRect);

            foreach (var item in _pack.AllContent)
            {
                var path        = _pack.GetRelativePath(item);
                var isDirectory = item is DirectoryInfo;

                var isIncluded = _pack.IsIncluded(item);
                var include    = filterList.CheckboxLabeled(isDirectory ? path.Bold() + "\\" : path, isIncluded, item.FullName, isIncluded ? (Color?)null : Color.red);
                if (include != isIncluded)
                {
                    _pack.SetIncluded(item, include);
                }
            }

            filterList.End();
            Widgets.EndScrollView();
        }
コード例 #2
0
        private void DoFinalize(Rect rect)
        {
            var l = new Listing_StandardPlus();

            l.Begin(rect);
            l.Gap();
            l.Label(Lang.Get("FinalInformation", _pack.Title.Bold(), _pack.Id.Bold()));
            l.End();
        }
コード例 #3
0
        private void DoDetails(Rect rect)
        {
            var listing = new Listing_StandardPlus();

            listing.Begin(rect);
            listing.Gap();

            listing.Label(Lang.Get("FileId").Bold());
            listing.Label(_pack.Id.Italic());
            listing.GapLine();

            listing.Label(Lang.Get("Title").Bold());
            _pack.Title = listing.TextEntry(_pack.Title);
            const string experimentalMode = "*#exp#"; // Experimental Mode: Can load tags in xml

            if (_pack.Title.EndsWith(experimentalMode))
            {
                _pack.Title          = _pack.Title.Substring(0, _pack.Title.Length - experimentalMode.Length);
                Mod.ExperimentalMode = true;
                Mod.Warning("Experimental Mode activated");
            }
            listing.GapLine();

            listing.Label(Lang.Get("Description").Bold() + (_pack.IsNewCreation ? null : Lang.Get("DescriptionLocked")));
            var description = listing.TextEntry(_pack.Description, 6);

            if (_pack.IsNewCreation)
            {
                _pack.Description = description;
            }
            listing.GapLine();

            listing.Label(Lang.Get("Tags").Bold());
            listing.Label(_pack.Tags.ToCommaList().Italic());
            listing.GapLine();

            listing.Label(Lang.Get("PreviewFile").Bold() + (_pack.PreviewExists ? null : Lang.Get("PreviewNotFound").Italic()));
            _pack.Preview = listing.TextEntry(_pack.Preview);

            listing.End();
        }