Inheritance: MonoBehaviour
Beispiel #1
0
        private void richEditControl1_MouseClick(object sender, MouseEventArgs e)
        {
            PageLayoutPosition pageLayoutPosition = richEditControl1.ActiveView.GetDocumentLayoutPosition(e.Location);

            if (pageLayoutPosition == null)
            {
                return;
            }
            int                   pageIndex  = pageLayoutPosition.PageIndex;
            Point                 point      = pageLayoutPosition.Position;
            LayoutPage            layoutPage = richEditControl1.DocumentLayout.GetPage(pageIndex);
            HitTestManager        hitTest    = new HitTestManager(richEditControl1.DocumentLayout);
            RichEditHitTestResult result     = hitTest.HitTest(layoutPage, point);

            if (result.LayoutElement is CharacterBox && richEditControl1.Document.Selection.Length == 0)
            {
                CharacterBox     character     = (CharacterBox)result.LayoutElement;
                DocumentPosition caretPosition = richEditControl1.Document.CaretPosition;
                SubDocument      document      = caretPosition.BeginUpdateDocument();
                if (document.GetSubDocumentType() == GetLocation(character.Parent))
                {
                    DocumentRange characterRange = document.CreateRange(character.Range.Start, 1);
                    UpdateCheckState(document, characterRange, character.Text);
                }
                caretPosition.EndUpdateDocument(document);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Displays an introduction to the Game.
        /// </summary>
        internal static void DisplayGameIntroduction()
        {
            CharacterBox theProgramBanner = new CharacterBox('*', Resource.ProgramBanner);

            theProgramBanner.Display();
            Console.WriteLine();
            Console.WriteLine(Resource.GameIntroduction);
            Console.WriteLine();
        }
        public CharacterEditor(IEnumerable <string> characters)
        {
            InitializeComponent();

            CharacterBox.Text = "";
            foreach (string character in characters)
            {
                CharacterBox.Text += character + "\r\n";
            }
            CharacterBox.Select(CharacterBox.Text.Length, 0);

            Canceled = true; // if they X out, this is the default
        }
Beispiel #4
0
        private static void UpdateCharacterBoxGraphics(CharacterBox targetCharacterBox)
        {
            if (!targetCharacterBox.gameObject.activeInHierarchy)
            {
                return;
            }

            targetCharacterBox.IsUnlocked = CheckUnlocked(targetCharacterBox.CharacterNumber);

            if (targetCharacterBox.IsBuyable)
            {
                if (!targetCharacterBox.IsUnlocked)
                {
                    targetCharacterBox.CherryCost = GetCharacterCost(targetCharacterBox.CharacterNumber);
                }
            }

            targetCharacterBox.IsSelected = targetCharacterBox.CharacterNumber == PlayerSettings.CurrentCharacterId;
        }
Beispiel #5
0
 void Awake()
 {
     characterBox = GetComponentInParent <CharacterBox>();
 }