示例#1
0
        private DarkNetTrader InitTrader(DarkNetTraderDef def)
        {
            DarkNetTrader newTrder = (DarkNetTrader)Activator.CreateInstance(def.workerClass);

            newTrder.def = def;
            newTrder.FirstInit();

            return(newTrder);
        }
示例#2
0
        public void InitDarkNet()
        {
            Traders = new List <DarkNetTrader>();

            foreach (var trader in DefDatabase <DarkNetTraderDef> .AllDefs)
            {
                DarkNetTrader newTrader = InitTrader(trader);

                Traders.Add(newTrader);
            }
        }
示例#3
0
        public Dialog_DarkNetTraderCard(DarkNetTrader trader)
        {
            doCloseX    = true;
            this.trader = trader;

            if (trader.def.OverridePortraitWidth == 0)
            {
                width = 400;
            }
            else
            {
                width = trader.def.OverridePortraitWidth;
            }
        }
示例#4
0
        private void DrawTraderInfo(DarkNetTrader trader)
        {
            Text.Font = GameFont.Medium;
            Vector2 textSize  = Text.CalcSize(currentTrader.Name);
            Rect    labelRect = new Rect(130, 0, textSize.x, 35);

            Widgets.Label(labelRect, currentTrader.Name);
            Rect rect = new Rect(labelRect.x + textSize.x + 5, 0, 24, 24);

            if (Widgets.ButtonImage(rect, Info, GUI.color))
            {
                Find.WindowStack.Add(new Dialog_DarkNetTraderCard(trader));
            }
            TooltipHandler.TipRegion(rect, "DefTraderInfoTip".Translate());

            GUIUtils.DrawLineHorizontal(112, 32, 360, Color.gray);

            Text.Font = GameFont.Small;
        }
示例#5
0
        private void DrawTraderIcon(Rect rect, DarkNetTrader trader)
        {
            bool status = trader.Online || trader.OnlineEveryTime;

            if (Widgets.ButtonImage(rect, status ? trader.IconMenu : trader.IconOfflineMenu))
            {
                currentTrader = trader;
            }
            Widgets.DrawHighlightIfMouseover(rect);

            if (!status)
            {
                GUI.color = Color.black;
                GUI.DrawTexture(rect, StorytellerHighlightTex);
                GUI.color = Color.white;
            }

            if (currentTrader == trader)
            {
                GUI.DrawTexture(rect, StorytellerHighlightTex);
            }
        }