コード例 #1
0
        public void DisplayMessage(InstructionText text)
        {
            switch (text)
            {
            case InstructionText.AppDescription:
                nextInstruction = AppDescriptionMaterial;
                break;

            case InstructionText.Developers:
                nextInstruction = DevelopersMaterial;
                break;

            case InstructionText.Community:
                nextInstruction = CommunityMaterial;
                break;
            }

            if (isShown)
            {
                ChangeText();
            }
            else
            {
                slateRenderer.material = nextInstruction;
                nextInstruction        = null;
                Show();
            }
        }
コード例 #2
0
    public static string InstructionToString(InstructionText text)
    {
        switch (text)
        {
        // dialogue selection
        case InstructionText.AlreadyTalked:
            return(">> Already Talked Today <<");

        case InstructionText.TooHungry:
            return(">> Too Hungry, Need Food <<");

        case InstructionText.CanTalk:
            return("Click House to Talk!");

        // lamb placement
        case InstructionText.NotSuitableForLamb:
            return(">> Not Suitable for Lamb <<");

        case InstructionText.CanPlaceLamb:
            return("Click House to Place Lamb!");

        // food placement
        case InstructionText.GiveFood:
            return("Click House to Give Food!");
        }
        Debug.LogError($"Unknown instruction text! ({text})");
        return(text.ToString());
    }
コード例 #3
0
    public void DisplayMessage(InstructionText text)
    {
        switch (text)
        {
            case InstructionText.AppDescription:
                nextInstruction = AppDescriptionMaterial;
                break;
            case InstructionText.Developers:
                nextInstruction = DevelopersMaterial;
                break;
            case InstructionText.Community:
                nextInstruction = CommunityMaterial;
                break;
        }

        if (isShown)
        {
            ChangeText();
        }
        else
        {
            slateRenderer.material = nextInstruction;
            nextInstruction = null;
            Show();
        }
    }
コード例 #4
0
        public SearchResult FindMatch(SearchParameters options)
        {
            int index;

            bool isStartIndex = Index == options.SearchFromWordIndex;

            if ((!isStartIndex || options.SearchFromField <= FieldTypes.Value) && (options.SearchFields & FieldTypes.Value) == FieldTypes.Value)
            {
                index = LongValue.ToString().FindMatch(options, isStartIndex && options.SearchFromField == FieldTypes.Value ? options.SearchFromFieldIndex : 0);

                if (index >= 0)
                {
                    return new SearchResult {
                               Field = FieldTypes.Value, FieldIndex = index
                    }
                }
                ;
            }

            if ((!isStartIndex || options.SearchFromField <= FieldTypes.Chars) && (options.SearchFields & FieldTypes.Chars) == FieldTypes.Chars)
            {
                index = ToString(true).FindMatch(options, isStartIndex && options.SearchFromField == FieldTypes.Chars ? options.SearchFromFieldIndex : 0);

                if (index >= 0)
                {
                    return new SearchResult {
                               Field = FieldTypes.Chars, FieldIndex = index
                    }
                }
                ;
            }

            if ((!isStartIndex || options.SearchFromField <= FieldTypes.Instruction) && (options.SearchFields & FieldTypes.Instruction) == FieldTypes.Instruction)
            {
                var instruction = InstructionSet.Instance.GetInstruction(this[MixInstruction.OpcodeByte], new FieldSpec(this[MixInstruction.FieldSpecByte]));
                if (instruction == null)
                {
                    return(null);
                }

                var instance = instruction.CreateInstance(this);
                if (instance == null)
                {
                    return(null);
                }

                index = new InstructionText(instance).InstanceText.FindMatch(options, isStartIndex && options.SearchFromField == FieldTypes.Instruction ? options.SearchFromFieldIndex : 0);

                if (index >= 0)
                {
                    return new SearchResult {
                               Field = FieldTypes.Instruction, FieldIndex = index
                    }
                }
                ;
            }

            return(null);
        }
コード例 #5
0
ファイル: DecisionManager.cs プロジェクト: Landric/Guess-Data
    public void ShowStringPanel(string key)
    {
        selectedPanel = Panel.StringPanel;
        selectedData  = key;

        StringPanel.SetActive(true);
        NumberPanel.SetActive(false);
        TitlePanel.SetActive(false);

        AskButton.SetActive(true);
        InstructionText.SetActive(false);
    }
コード例 #6
0
ファイル: FormRules.cs プロジェクト: dimoniche/Service
        public override void LoadData()
        {
            foreach (object obj in Params.Objects.Where(obj => obj != null))
            {
                if (obj.GetType() == typeof(FormResultData))
                {
                    data = (FormResultData)obj;
                }
            }

            Globals.DesignConfiguration.Settings.LoadPictureBox(pBxMainMenu, Globals.DesignConfiguration.Settings.ButtonRetToMain);
            Globals.DesignConfiguration.Settings.LoadPictureBox(pBxStartService, Globals.DesignConfiguration.Settings.ButtonStartServices);

            InstructionText.LoadFile(Globals.HelpFileName);

            data.drivers.ReceivedResponse += reciveResponse;
        }
コード例 #7
0
ファイル: DecisionManager.cs プロジェクト: Landric/Guess-Data
    public void OpenPanel()
    {
        //If the only child is "Title", make sure to instantiate the data fields
        if (DecisionCard.transform.childCount <= 1)
        {
            InitDecisionPanel(FindObjectOfType <GameManager>().ChosenCards[0]);
        }

        StringPanel.SetActive(false);
        NumberPanel.SetActive(false);
        TitlePanel.SetActive(false);

        AskButton.SetActive(false);
        InstructionText.SetActive(true);

        DecisionPanel.SetActive(true);
        DecisionResponse.SetActive(false);
    }
コード例 #8
0
    public void UpdateDisplay(Character character, InstructionText instruction = InstructionText.CanTalk)
    {
        if (last == character && lastInstruction == instruction)
        {
            return;
        }

        lastInstruction = instruction;
        last            = character;

        instructionText.text = InstructionToString(instruction);

        if (character)
        {
            this.gameObject.SetActive(true);
            nameText.text = character.name;
        }
        else
        {
            this.gameObject.SetActive(false);
        }
    }
コード例 #9
0
ファイル: FormRules.cs プロジェクト: dimoniche/Service
        private void timer1_Tick(object sender, EventArgs e)
        {
            Timeout++;

            if (!fileLoaded)
            {
                InstructionText.LoadFile(Globals.HelpFileName);
                fileLoaded      = true;
                timer1.Interval = 1000;
            }

            if (Globals.ClientConfiguration.Settings.timeout == 0)
            {
                Timeout = 0;
                return;
            }

            if (Timeout > Globals.ClientConfiguration.Settings.timeout * 60)
            {
                data.stage = WorkerStateStage.TimeOut;
                this.Close();
            }
        }
コード例 #10
0
        public new void Update()
        {
            var    memoryFullWord = mInstructionWord as IMemoryFullWord;
            string sourceLine     = memoryFullWord?.SourceLine;

            if (mEditMode || (mLastRenderedMagnitude == mInstructionWord.MagnitudeLongValue &&
                              mLastRenderedSign == mInstructionWord.Sign &&
                              mLastRenderedSourceLine == sourceLine))
            {
                return;
            }

            mUpdating = true;
            mEditMode = false;

            mCaption = null;
            mToolTip?.SetToolTip(this, null);

            mLastRenderedSourceLine = sourceLine;
            BackColor = mLastRenderedSourceLine != null ? mLoadedInstructionBackgroundColor : mEditorBackgroundColor;

            string sourceCaption = mLastRenderedSourceLine != null ? "Original source:   " + mLastRenderedSourceLine : null;

            mLastRenderedMagnitude = mInstructionWord.MagnitudeLongValue;
            mLastRenderedSign      = mInstructionWord.Sign;
            var instruction = InstructionSet.Instance.GetInstruction(mInstructionWord[MixInstruction.OpcodeByte], new FieldSpec(mInstructionWord[MixInstruction.FieldSpecByte]));

            if (instruction == null)
            {
                HandleNoInstruction(sourceCaption);
                return;
            }

            var instance = instruction.CreateInstance(mInstructionWord);
            var errors   = instance.Validate();
            var text     = new InstructionText(instance);

            SuspendLayout();
            base.Text = "";

            ForeColor = mLastRenderedSourceLine != null ? mLoadedInstructionTextColor : mRenderedTextColor;
            AddTextElement(text.Mnemonic + " ", false);
            AddTextElement(text.Address, ItemInErrors(errors, InstanceValidationError.Sources.Address));
            AddTextElement(text.Index, ItemInErrors(errors, InstanceValidationError.Sources.Index));
            AddTextElement(text.Field, ItemInErrors(errors, InstanceValidationError.Sources.FieldSpec));

            if (TextLength > 0)
            {
                Select(TextLength, 0);
            }

            var caption = GetAddressErrorsCaption(errors);

            if (sourceCaption != null)
            {
                caption = caption == null ? sourceCaption : string.Concat(sourceCaption, Environment.NewLine, caption);
            }

            mCaption = caption;
            mToolTip?.SetToolTip(this, caption);

            var address = GetAddress();

            mShowAddressMenuItem.Enabled        = address >= MemoryMinIndex && address <= MemoryMaxIndex;
            mShowIndexedAddressMenuItem.Enabled = IndexedAddressCalculatorCallback?.Invoke(address, mInstructionWord[MixInstruction.IndexByte]) != int.MinValue;
            ContextMenu = mContextMenu;

            base.Update();
            ResumeLayout();

            mNoInstructionRendered = false;
            mUpdating = false;
        }