Beispiel #1
0
        protected override bool DoShow(MenuScreen <PauseMenu> previous)
        {
            GuiContentData guiContentData = new GuiContentData();

            guiContentData.SetValue("itemList", this.MakeItemList(base.Owner.currEnt, base.Owner._itemInfoData));
            guiContentData.SetValue("hasItem", false);
            guiContentData.SetValue("playerSuit", base.Owner.currEnt.GetStateVariable("outfit"));
            guiContentData.SetValue("hasCards", base.Owner._cards.ShouldShow());
            base.Root.ApplyContent(guiContentData, true);
            return(true);
        }
Beispiel #2
0
        protected override bool DoShow(MenuScreen <PauseMenu> previous)
        {
            GuiContentData guiContentData = new GuiContentData();

            guiContentData.SetValue("infoStr", this.GetHintString());
            int stateVariable = base.Owner.currEnt.GetStateVariable("outfit");

            guiContentData.SetValue("playerSuit", stateVariable);
            base.Root.ApplyContent(guiContentData, true);
            return(true);
        }
Beispiel #3
0
    public void OutputText(string info)
    {
        GuiContentData guiContentData = new GuiContentData();

        guiContentData.SetValue("currentInfo", info);
        this.menuRoot.ApplyContent(guiContentData, true);
    }
Beispiel #4
0
    void UpdateValue(bool withCaret)
    {
        GuiContentData guiContentData = new GuiContentData();

        this.hasCaret = false;
        if (withCaret)
        {
            guiContentData.SetValue("currentValue", this.currentText + "|");
            this.hasCaret = true;
        }
        else
        {
            guiContentData.SetValue("currentValue", this.currentText);
        }
        this.menuRoot.ApplyContent(guiContentData, true);
        this.blinkTimer = this._blinkTime;
    }
Beispiel #5
0
        List <GuiContentData> MakeItemList(IExprContext ctx, VariableInfoData info)
        {
            List <GuiContentData> list = new List <GuiContentData>();
            List <VariableInfoData.RealValueData> allData = info.GetAllData(ctx);

            GuiNode.OnVoidFunc f = new GuiNode.OnVoidFunc(this.ClickedItem);
            for (int i = 0; i < allData.Count; i++)
            {
                GuiContentData guiContentData = new GuiContentData();
                VariableInfoData.RealValueData realValueData = allData[i];
                if (realValueData != null && realValueData.icon != null)
                {
                    guiContentData.SetValue("itemPic", realValueData.icon);
                    guiContentData.SetValue("hasCount", realValueData.hasCount);
                    guiContentData.SetValue("itemCount", realValueData.count);
                }
                else
                {
                    guiContentData.SetValue("itemPic", false);
                    realValueData = null;
                }
                guiContentData.SetValue("itemTag", realValueData);
                guiContentData.SetValue("itemEvent", new GuiNode.VoidBinding(f, realValueData));
                guiContentData.SetValue("itemEnabled", realValueData != null && realValueData.icon != null);
                list.Add(guiContentData);
            }
            return(list);
        }
Beispiel #6
0
        protected override bool DoShow(MenuScreen <PauseMenu> previous)
        {
            GuiContentData guiContentData = new GuiContentData();

            guiContentData.SetValue("showMap", base.Owner._mapWindow.CanShow(base.Owner.currEnt));
            bool flag = !PlayerRespawner.RespawnInhibited() && PlayerRespawner.GetActiveInstance() != null;

            guiContentData.SetValue("canWarp", flag);
            if (flag)
            {
                IDataSaver saver = base.Owner._saver.GetSaver("/local/start", true);
                if (saver != null)
                {
                    guiContentData.SetValue("hasWarpTgt", true);
                    guiContentData.SetValue("warpTgt", saver.LoadData("level"));
                }
                else
                {
                    guiContentData.SetValue("hasWarpTgt", false);
                }
            }
            base.Root.ApplyContent(guiContentData, true);
            return(true);
        }
Beispiel #7
0
    void Setup()
    {
        GuiBindInData inData      = new GuiBindInData(null, null);
        GuiBindData   guiBindData = GuiNode.Connect(this._layout, inData);

        this.menuRoot = guiBindData.GetTracker <GuiWindow>("debugRoot");
        guiBindData.GetTrackerEvent <IGuiOnclick>("debug.done").onclick = new GuiNode.OnVoidFunc(this.ClickedDone);
        guiBindData.GetTrackerEvent <IGuiOnclick>("debug.back").onclick = new GuiNode.OnVoidFunc(this.ClickedCancel);
        GuiContentData guiContentData = new GuiContentData();

        guiContentData.SetValue("version", this._version.GetVersion());
        this.menuRoot.ApplyContent(guiContentData, true);

        // Modify the HUD to make it better
        ModifyUI();
    }
Beispiel #8
0
        void ClickedItem(object ctx)
        {
            GuiContentData guiContentData = new GuiContentData();

            VariableInfoData.RealValueData realValueData = ctx as VariableInfoData.RealValueData;
            if (realValueData != null)
            {
                guiContentData.SetValue("currItemPic", realValueData.icon);
                guiContentData.SetValue("currItemName", realValueData.name);
                guiContentData.SetValue("currItemDesc", realValueData.desc);
                guiContentData.SetValue("hasItem", true);
                guiContentData.SetValue("currItemHasCount", realValueData.hasCount);
                guiContentData.SetValue("currItemCount", realValueData.count);
            }
            else
            {
                guiContentData.SetValue("hasItem", false);
            }
            base.Root.ApplyContent(guiContentData, true);
        }