Ejemplo n.º 1
0
		public override void Declare ()
		{
			label = "Button";
			hotspotLabel = "";
			hotspotLabelID = -1;
			isVisible = true;
			isClickable = true;
			textEffects = TextEffects.None;
			buttonClickType = AC_ButtonClickType.RunActionList;
			simulateInput = SimulateInputType.Button;
			simulateValue = 1f;
			numSlots = 1;
			anchor = TextAnchor.MiddleCenter;
			SetSize (new Vector2 (10f, 5f));
			doFade = false;
			switchMenuTitle = "";
			inventoryBoxTitle = "";
			shiftInventory = AC_ShiftInventory.ShiftLeft;
			loopJournal = false;
			actionList = null;
			inputAxis = "";
			clickTexture = null;
			clickAlpha = 0f;
			shiftAmount = 1;
			onlyShowWhenEffective = false;
			allowContinuousClick = false;

			base.Declare ();
		}
Ejemplo n.º 2
0
		public override void ShowGUI ()
		{
			EditorGUILayout.BeginVertical ("Button");
			textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects);
			craftingType = (CraftingElementType) EditorGUILayout.EnumPopup ("Crafting element type:", craftingType);

			if (craftingType == CraftingElementType.Ingredients)
			{
				numSlots = EditorGUILayout.IntSlider ("Number of slots:", numSlots, 1, 12);
				slotSpacing = EditorGUILayout.Slider ("Slot spacing:", slotSpacing, 0f, 20f);
				orientation = (ElementOrientation) EditorGUILayout.EnumPopup ("Slot orientation:", orientation);
				if (orientation == ElementOrientation.Grid)
				{
					gridWidth = EditorGUILayout.IntSlider ("Grid size:", gridWidth, 1, 10);
				}
			}
			else
			{
				categoryID = -1;
				numSlots = 1;
			}

			isClickable = true;
			EditorGUILayout.EndVertical ();
			
			PopulateList ();
			base.ShowGUI ();
		}
Ejemplo n.º 3
0
        public void CopyButton(MenuButton _element)
        {
            uiButton = _element.uiButton;
            uiText = _element.uiText;
            label = _element.label;
            hotspotLabel = _element.hotspotLabel;
            hotspotLabelID = _element.hotspotLabelID;
            anchor = _element.anchor;
            textEffects = _element.textEffects;
            buttonClickType = _element.buttonClickType;
            simulateInput = _element.simulateInput;
            simulateValue = _element.simulateValue;
            doFade = _element.doFade;
            switchMenuTitle = _element.switchMenuTitle;
            inventoryBoxTitle = _element.inventoryBoxTitle;
            shiftInventory = _element.shiftInventory;
            loopJournal = _element.loopJournal;
            actionList = _element.actionList;
            inputAxis = _element.inputAxis;
            clickTexture = _element.clickTexture;
            clickAlpha = _element.clickAlpha;
            shiftAmount = _element.shiftAmount;
            onlyShowWhenEffective = _element.onlyShowWhenEffective;
            allowContinuousClick = _element.allowContinuousClick;
            parameterID = _element.parameterID;
            parameterValue = _element.parameterValue;

            base.Copy (_element);
        }
Ejemplo n.º 4
0
		public void CopyInteraction (MenuInteraction _element)
		{
			displayType = _element.displayType;
			anchor = _element.anchor;
			textEffects = _element.textEffects;
			iconID = _element.iconID;
			
			base.Copy (_element);
		}
Ejemplo n.º 5
0
 protected override void ShowTextGUI(string apiPrefix)
 {
     anchor      = (TextAnchor)CustomGUILayout.EnumPopup("Text alignment:", anchor, apiPrefix + ".anchor", "The text alignment");
     textEffects = (TextEffects)CustomGUILayout.EnumPopup("Text effect:", textEffects, apiPrefix + ".textEffects", "The special FX applied to the text");
     if (textEffects != TextEffects.None)
     {
         outlineSize = CustomGUILayout.Slider("Effect size:", outlineSize, 1f, 5f, apiPrefix + ".outlineSize", "The outline thickness");
     }
 }
Ejemplo n.º 6
0
        public override void ShowGUI(Menu menu)
        {
            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");
            if (source == MenuSource.AdventureCreator)
            {
                textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);
                if (textEffects != TextEffects.None)
                {
                    outlineSize = EditorGUILayout.Slider("Effect size:", outlineSize, 1f, 5f);
                }
            }

            displayType  = (ConversationDisplayType)EditorGUILayout.EnumPopup("Display:", displayType);
            craftingType = (CraftingElementType)EditorGUILayout.EnumPopup("Crafting element type:", craftingType);

            if (craftingType == CraftingElementType.Ingredients)
            {
                numSlots = EditorGUILayout.IntSlider("Number of slots:", numSlots, 1, 12);
                if (source == MenuSource.AdventureCreator)
                {
                    slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f);
                    orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation);
                    if (orientation == ElementOrientation.Grid)
                    {
                        gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10);
                    }
                }
            }
            else
            {
                numSlots = 1;
            }

            if (source != MenuSource.AdventureCreator)
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
                uiHideStyle = (UIHideStyle)EditorGUILayout.EnumPopup("When invisible:", uiHideStyle);
                EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel);

                uiSlots = ResizeUISlots(uiSlots, numSlots);

                for (int i = 0; i < uiSlots.Length; i++)
                {
                    uiSlots[i].LinkedUiGUI(i, source);
                }
            }

            isClickable = true;
            EditorGUILayout.EndVertical();

            PopulateList(source);
            base.ShowGUI(menu);
        }
Ejemplo n.º 7
0
        public override void ShowGUI(MenuSource source)
        {
            EditorGUILayout.BeginVertical("Button");

            if (source == MenuSource.AdventureCreator)
            {
                label             = EditorGUILayout.TextField("Label text:", label);
                anchor            = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor);
                textEffects       = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);
                useFullWidth      = EditorGUILayout.Toggle("Use full width?", useFullWidth);
                sliderDisplayType = (SliderDisplayType)EditorGUILayout.EnumPopup("Display type:", sliderDisplayType);

                EditorGUILayout.BeginHorizontal();
                if (sliderDisplayType == SliderDisplayType.FillBar)
                {
                    EditorGUILayout.LabelField("Fill-bar texture:", GUILayout.Width(145f));
                }
                else if (sliderDisplayType == SliderDisplayType.MoveableBlock)
                {
                    EditorGUILayout.LabelField("Movable block texture:", GUILayout.Width(145f));
                }
                sliderTexture = (Texture2D)EditorGUILayout.ObjectField(sliderTexture, typeof(Texture2D), false, GUILayout.Width(70f), GUILayout.Height(30f));
                EditorGUILayout.EndHorizontal();

                if (sliderDisplayType == SliderDisplayType.MoveableBlock)
                {
                    blockSize = EditorGUILayout.Vector2Field("Block size:", blockSize);
                }
            }
            else
            {
                uiSlider = LinkedUiGUI <Slider> (uiSlider, "Linked Slider:", source);
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
            }

            sliderType = (AC_SliderType)EditorGUILayout.EnumPopup("Slider affects:", sliderType);
            if (sliderType == AC_SliderType.CustomScript)
            {
                amount = EditorGUILayout.Slider("Default value:", amount, 0f, 1f);
                ShowClipHelp();
            }
            else if (sliderType == AC_SliderType.FloatVariable)
            {
                varID = EditorGUILayout.IntField("Global Variable ID:", varID);
            }

            if (source == MenuSource.AdventureCreator)
            {
                numberOfSteps = EditorGUILayout.IntField("Number of steps:", numberOfSteps);
            }
            isClickable = EditorGUILayout.Toggle("User can change value?", isClickable);
            EditorGUILayout.EndVertical();

            base.ShowGUI(source);
        }
Ejemplo n.º 8
0
        public override void ShowGUI(MenuSource source)
        {
            EditorGUILayout.BeginVertical("Button");

            if (source != MenuSource.AdventureCreator)
            {
                uiToggle = LinkedUiGUI <Toggle> (uiToggle, "Linked Toggle:", source);
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
            }

            label       = EditorGUILayout.TextField("Label text:", label);
            appendState = EditorGUILayout.Toggle("Append state to label?", appendState);

            if (source == MenuSource.AdventureCreator)
            {
                anchor      = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor);
                textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("'On' texture:", GUILayout.Width(145f));
                onTexture = (Texture2D)EditorGUILayout.ObjectField(onTexture, typeof(Texture2D), false, GUILayout.Width(70f), GUILayout.Height(30f));
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("'Off' texture:", GUILayout.Width(145f));
                offTexture = (Texture2D)EditorGUILayout.ObjectField(offTexture, typeof(Texture2D), false, GUILayout.Width(70f), GUILayout.Height(30f));
                EditorGUILayout.EndHorizontal();
            }

            toggleType = (AC_ToggleType)EditorGUILayout.EnumPopup("Toggle type:", toggleType);
            if (toggleType == AC_ToggleType.CustomScript)
            {
                isOn = EditorGUILayout.Toggle("On by default?", isOn);
                ShowClipHelp();
            }
            else if (toggleType == AC_ToggleType.Variable)
            {
                varID = AdvGame.GlobalVariableGUI("Boolean variable:", varID);
                if (varID >= 0 && AdvGame.GetReferences() && AdvGame.GetReferences().variablesManager)
                {
                    GVar _var = AdvGame.GetReferences().variablesManager.GetVariable(varID);
                    if (_var != null && _var.type != VariableType.Boolean)
                    {
                        EditorGUILayout.HelpBox("The chosen Variable must be a Boolean.", MessageType.Warning);
                    }
                }
            }
            if (toggleType != AC_ToggleType.Subtitles)
            {
                actionListOnClick = (ActionListAsset)EditorGUILayout.ObjectField("ActionList on click:", actionListOnClick, typeof(ActionListAsset), false);
            }
            EditorGUILayout.EndVertical();

            base.ShowGUI(source);
        }
Ejemplo n.º 9
0
		public void CopyCrafting (MenuCrafting _element)
		{
			isClickable = _element.isClickable;
			textEffects = _element.textEffects;
			numSlots = _element.numSlots;
			craftingType = _element.craftingType;
			PopulateList ();
			
			base.Copy (_element);
		}
Ejemplo n.º 10
0
		public override void Declare ()
		{
			isVisible = true;
			isClickable = true;
			numSlots = 4;
			SetSize (new Vector2 (6f, 10f));
			textEffects = TextEffects.None;
			craftingType = CraftingElementType.Ingredients;
			items = new List<InvItem>();
		}
Ejemplo n.º 11
0
        private void CopyDrag(MenuDrag _element)
        {
            label       = _element.label;
            anchor      = _element.anchor;
            textEffects = _element.textEffects;
            dragRect    = _element.dragRect;
            dragType    = _element.dragType;
            elementName = _element.elementName;

            base.Copy(_element);
        }
Ejemplo n.º 12
0
		public override void ShowGUI ()
		{
			EditorGUILayout.BeginVertical ("Button");
			label = EditorGUILayout.TextField ("Label text:", label);
			anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor);
			textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects);
			cycleType = (AC_CycleType) EditorGUILayout.EnumPopup ("Cycle type:", cycleType);
			if (cycleType == AC_CycleType.CustomScript || cycleType == AC_CycleType.Variable)
			{
				int numOptions = optionsArray.Count;
				numOptions = EditorGUILayout.IntField ("Number of choices:", optionsArray.Count);
				if (numOptions < 0)
				{
					numOptions = 0;
				}
				
				if (numOptions < optionsArray.Count)
				{
					optionsArray.RemoveRange (numOptions, optionsArray.Count - numOptions);
				}
				else if (numOptions > optionsArray.Count)
				{
					if(numOptions > optionsArray.Capacity)
					{
						optionsArray.Capacity = numOptions;
					}
					for (int i=optionsArray.Count; i<numOptions; i++)
					{
						optionsArray.Add ("");
					}
				}
				
				for (int i=0; i<optionsArray.Count; i++)
				{
					optionsArray [i] = EditorGUILayout.TextField ("Choice #" + i.ToString () + ":", optionsArray [i]);
				}
				
				if (cycleType == AC_CycleType.CustomScript)
				{
					if (optionsArray.Count > 0)
					{
						selected = EditorGUILayout.IntField ("Default option #:", selected);
					}
					ShowClipHelp ();
				}
				else if (cycleType == AC_CycleType.Variable)
				{
					varID = EditorGUILayout.IntField ("Global Variable ID:", varID);
				}
			}
			EditorGUILayout.EndVertical ();
			
			base.ShowGUI ();
		}
Ejemplo n.º 13
0
 //static TextManager()
 //{
 //    _textEffects = GameObject.Find("Level").GetComponent<TextEffects>();
 //}
 public static void Show(
     string text, 
     TextEffects.Size size = TextEffects.Size.Medium, 
     TextEffects.Effect effect = TextEffects.Effect.Normal,
     Vector2 position = new Vector2())
 {
     var o = new GameObject("Flashing_Text");
     o.transform.position = position;
     o.AddComponent<TextEffects>().Add(text, size, effect);
     Object.Destroy(o, 5);
 }
Ejemplo n.º 14
0
        public void CopyInteraction(MenuInteraction _element)
        {
            uiButton    = _element.uiButton;
            uiText      = null;
            displayType = _element.displayType;
            anchor      = _element.anchor;
            textEffects = _element.textEffects;
            iconID      = _element.iconID;

            base.Copy(_element);
        }
Ejemplo n.º 15
0
        public void CopyDrag(MenuDrag _element)
        {
            label = _element.label;
            anchor = _element.anchor;
            textEffects = _element.textEffects;
            dragRect = _element.dragRect;
            dragType = _element.dragType;
            elementName = _element.elementName;

            base.Copy (_element);
        }
Ejemplo n.º 16
0
        public void CopyInteraction(MenuInteraction _element)
        {
            uiButton = _element.uiButton;
            uiText = null;
            displayType = _element.displayType;
            anchor = _element.anchor;
            textEffects = _element.textEffects;
            iconID = _element.iconID;

            base.Copy (_element);
        }
Ejemplo n.º 17
0
 protected override void ShowTextGUI(string apiPrefix)
 {
     if (displayType != ConversationDisplayType.IconOnly)
     {
         anchor      = (TextAnchor)CustomGUILayout.EnumPopup("Text alignment:", anchor, apiPrefix + ".anchor");
         textEffects = (TextEffects)CustomGUILayout.EnumPopup("Text effect:", textEffects, apiPrefix + ".textEffects");
         if (textEffects != TextEffects.None)
         {
             outlineSize = CustomGUILayout.Slider("Effect size:", outlineSize, 1f, 5f, apiPrefix + ".outlineSize");
         }
     }
 }
Ejemplo n.º 18
0
		public void CopyInput (MenuInput _element)
		{
			label = _element.label;
			anchor = _element.anchor;
			textEffects = _element.textEffects;
			inputType = _element.inputType;
			characterLimit = _element.characterLimit;
			linkedButton = _element.linkedButton;
			allowSpaces = _element.allowSpaces;

			base.Copy (_element);
		}
Ejemplo n.º 19
0
 public override void Declare()
 {
     uiSlots     = null;
     isVisible   = true;
     isClickable = true;
     numSlots    = 4;
     SetSize(new Vector2(6f, 10f));
     textEffects  = TextEffects.None;
     craftingType = CraftingElementType.Ingredients;
     displayType  = ConversationDisplayType.IconOnly;
     items        = new List <InvItem>();
 }
Ejemplo n.º 20
0
        public void CopyProfilesList(MenuProfilesList _element)
        {
            uiSlots = _element.uiSlots;

            textEffects       = _element.textEffects;
            anchor            = _element.anchor;
            maxSlots          = _element.maxSlots;
            actionListOnClick = _element.actionListOnClick;
            showActive        = _element.showActive;

            base.Copy(_element);
        }
Ejemplo n.º 21
0
        public SizeF GetTextSize(string text, TextEffects effects)
        {
            float width  = 0;
            float height = effects.font.Size.Height;

            foreach (char c in text)
            {
                StrokeChar ch = new StrokeChar(newstroke_font[(int)c - 32]);
                width += ch.Width * effects.font.Size.Width;
            }
            return(new SizeF(width, height));
        }
Ejemplo n.º 22
0
		public void CopyCycle (MenuCycle _element)
		{
			label = _element.label;
			textEffects = _element.textEffects;
			anchor = _element.anchor;
			selected = _element.selected;
			optionsArray = _element.optionsArray;
			cycleType = _element.cycleType;
			varID = _element.varID;
			
			base.Copy (_element);
		}
Ejemplo n.º 23
0
        public void CopyProfilesList(MenuProfilesList _element)
        {
            uiSlots = _element.uiSlots;

            textEffects = _element.textEffects;
            anchor = _element.anchor;
            maxSlots = _element.maxSlots;
            actionListOnClick = _element.actionListOnClick;
            showActive = _element.showActive;

            base.Copy (_element);
        }
Ejemplo n.º 24
0
 /**
  * Initialises the element when it is created within MenuManager.
  */
 public override void Declare()
 {
     uiSlots = null;
     isVisible = true;
     isClickable = true;
     numSlots = 4;
     SetSize (new Vector2 (6f, 10f));
     textEffects = TextEffects.None;
     craftingType = CraftingElementType.Ingredients;
     displayType = ConversationDisplayType.IconOnly;
     items = new List<InvItem>();
 }
Ejemplo n.º 25
0
		public override void Declare ()
		{
			isVisible = true;
			isClickable = true;
			numSlots = 1;
			anchor = TextAnchor.MiddleCenter;
			SetSize (new Vector2 (5f, 5f));
			iconID = -1;
			textEffects = TextEffects.None;
			
			base.Declare ();
		}
Ejemplo n.º 26
0
        public fp_text(string value, PointF at, string layer, SizeF font_size, float thickness, bool visible)
        {
            this.Type     = "user";
            this.Value    = value;
            this.position = new Position(at);
            this.layer    = layer;
            this.visible  = visible;

            this.effects                = new TextEffects();
            this.effects.font           = new FontAttributes();
            this.effects.font.Size      = font_size;
            this.effects.font.thickness = thickness;
        }
Ejemplo n.º 27
0
        public void CopyCrafting(MenuCrafting _element)
        {
            uiSlots      = _element.uiSlots;
            isClickable  = _element.isClickable;
            textEffects  = _element.textEffects;
            numSlots     = _element.numSlots;
            craftingType = _element.craftingType;
            displayType  = _element.displayType;

            PopulateList(MenuSource.AdventureCreator);

            base.Copy(_element);
        }
Ejemplo n.º 28
0
        private void CopyInput(MenuInput _element)
        {
            uiInput        = _element.uiInput;
            label          = _element.label;
            anchor         = _element.anchor;
            textEffects    = _element.textEffects;
            inputType      = _element.inputType;
            characterLimit = _element.characterLimit;
            linkedButton   = _element.linkedButton;
            allowSpaces    = _element.allowSpaces;

            base.Copy(_element);
        }
Ejemplo n.º 29
0
        private void CopyInteraction(MenuInteraction _element)
        {
            uiButton        = _element.uiButton;
            uiText          = null;
            displayType     = _element.displayType;
            anchor          = _element.anchor;
            textEffects     = _element.textEffects;
            iconID          = _element.iconID;
            overrideTexture = _element.overrideTexture;
            activeTexture   = _element.activeTexture;

            base.Copy(_element);
        }
Ejemplo n.º 30
0
		public void CopyDialogList (MenuDialogList _element)
		{
			textEffects = _element.textEffects;
			displayType = _element.displayType;
			testIcon = _element.testIcon;
			anchor = _element.anchor;
			labels = _element.labels;
			fixedOption = _element.fixedOption;
			optionToShow = _element.optionToShow;
			maxSlots = _element.maxSlots;
			
			base.Copy (_element);
		}
Ejemplo n.º 31
0
        public void CopyCrafting(MenuCrafting _element)
        {
            uiSlots = _element.uiSlots;
            isClickable = _element.isClickable;
            textEffects = _element.textEffects;
            numSlots = _element.numSlots;
            craftingType = _element.craftingType;
            displayType = _element.displayType;

            PopulateList (MenuSource.AdventureCreator);

            base.Copy (_element);
        }
Ejemplo n.º 32
0
        public override void Declare()
        {
            uiButton    = null;
            uiText      = null;
            isVisible   = true;
            isClickable = true;
            numSlots    = 1;
            anchor      = TextAnchor.MiddleCenter;
            SetSize(new Vector2(5f, 5f));
            iconID      = -1;
            textEffects = TextEffects.None;

            base.Declare();
        }
Ejemplo n.º 33
0
        public static fp_text Parse(SNodeBase node)
        {
            fp_text result = new fp_text();

            if ((node is SExpression) && ((node as SExpression).Name == "fp_text"))
            {
                SExpression expr = node as SExpression;

                result.Type  = (expr.Items[0] as SNodeAtom).Value;
                result.Value = (expr.Items[1] as SNodeAtom).Value;

                int index = 2;

                while (index < expr.Items.Count)
                {
                    if (expr.Items[index] is SExpression)
                    {
                        SExpression sub = expr.Items[index] as SExpression;
                        if (sub.Name == "at")
                        {
                            result.position = Position.Parse(sub);
                        }
                        else if (sub.Name == "effects")
                        {
                            result.effects = TextEffects.Parse(sub);
                        }
                        else if (sub.Name == "layer")
                        {
                            result.layer = Layer.ParseLayer(sub);
                        }
                    }
                    else
                    {
                        SNodeAtom atom = expr.Items[index] as SNodeAtom;

                        if (atom.Value == "hide")
                        {
                            result.visible = false;
                        }
                    }

                    index++;
                }
                return(result);
            }
            else
            {
                return(null);  // error
            }
        }
Ejemplo n.º 34
0
		public void CopyToggle (MenuToggle _element)
		{
			label = _element.label;
			isOn = _element.isOn;
			textEffects = _element.textEffects;
			anchor = _element.anchor;
			toggleType = _element.toggleType;
			varID = _element.varID;
			appendState = _element.appendState;
			onTexture = _element.onTexture;
			offTexture = _element.offTexture;
			
			base.Copy (_element);
		}
Ejemplo n.º 35
0
        private void CopyProfilesList(MenuProfilesList _element)
        {
            uiSlots = _element.uiSlots;

            textEffects       = _element.textEffects;
            outlineSize       = _element.outlineSize;
            anchor            = _element.anchor;
            maxSlots          = _element.maxSlots;
            actionListOnClick = _element.actionListOnClick;
            showActive        = _element.showActive;
            uiHideStyle       = _element.uiHideStyle;

            base.Copy(_element);
        }
Ejemplo n.º 36
0
        public static TextEffects GetTextEffects(bool bold, bool italic)
        {
            TextEffects effects = TextEffects.None;

            if (bold)
            {
                effects |= TextEffects.Bold;
            }
            if (italic)
            {
                effects |= TextEffects.Italic;
            }
            return(effects);
        }
Ejemplo n.º 37
0
		public void CopyLabel (MenuLabel _element)
		{
			label = _element.label;
			anchor = _element.anchor;
			textEffects = _element.textEffects;
			labelType = _element.labelType;
			variableID = _element.variableID;
			variableNumber = _element.variableNumber;
			useCharacterColour = _element.useCharacterColour;
			autoAdjustHeight = _element.autoAdjustHeight;
			newLabel = "";

			base.Copy (_element);
		}
Ejemplo n.º 38
0
        public override void ShowGUI(Menu menu)
        {
            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");

            showActive = EditorGUILayout.Toggle("Include active?", showActive);
            maxSlots   = EditorGUILayout.IntField("Max no. of slots:", maxSlots);
            if (source == MenuSource.AdventureCreator)
            {
                numSlots    = EditorGUILayout.IntSlider("Test slots:", numSlots, 1, maxSlots);
                slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f);
                orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation);
                if (orientation == ElementOrientation.Grid)
                {
                    gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10);
                }
            }

            if (source == MenuSource.AdventureCreator)
            {
                anchor      = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor);
                textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);
                if (textEffects != TextEffects.None)
                {
                    outlineSize = EditorGUILayout.Slider("Effect size:", outlineSize, 1f, 5f);
                }
            }

            actionListOnClick = ActionListAssetMenu.AssetGUI("ActionList after selecting:", actionListOnClick, "", menu.title + "_" + title + "_After_Selecting");

            if (source != MenuSource.AdventureCreator)
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
                uiHideStyle = (UIHideStyle)EditorGUILayout.EnumPopup("When invisible:", uiHideStyle);
                EditorGUILayout.LabelField("Linked button objects", EditorStyles.boldLabel);

                uiSlots = ResizeUISlots(uiSlots, maxSlots);
                for (int i = 0; i < uiSlots.Length; i++)
                {
                    uiSlots[i].LinkedUiGUI(i, source);
                }
            }

            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
Ejemplo n.º 39
0
        public override void Declare()
        {
            label = "Button";
            isVisible = true;
            isClickable = true;
            textEffects = TextEffects.None;
            numSlots = 1;
            anchor = TextAnchor.MiddleCenter;
            SetSize (new Vector2 (10f, 5f));
            dragRect = new Rect (0,0,0,0);
            dragType = DragElementType.EntireMenu;
            elementName = "";

            base.Declare ();
        }
Ejemplo n.º 40
0
        public void CopyDialogList(MenuDialogList _element)
        {
            uiSlots = _element.uiSlots;

            textEffects  = _element.textEffects;
            displayType  = _element.displayType;
            testIcon     = _element.testIcon;
            anchor       = _element.anchor;
            labels       = _element.labels;
            fixedOption  = _element.fixedOption;
            optionToShow = _element.optionToShow;
            maxSlots     = _element.maxSlots;

            base.Copy(_element);
        }
Ejemplo n.º 41
0
        private void CopyInput(MenuInput _element)
        {
            uiInput               = _element.uiInput;
            label                 = _element.label;
            anchor                = _element.anchor;
            textEffects           = _element.textEffects;
            outlineSize           = _element.outlineSize;
            inputType             = _element.inputType;
            characterLimit        = _element.characterLimit;
            linkedButton          = _element.linkedButton;
            allowSpaces           = _element.allowSpaces;
            uiSelectableHideStyle = _element.uiSelectableHideStyle;

            base.Copy(_element);
        }
Ejemplo n.º 42
0
		public override void ShowGUI ()
		{
			EditorGUILayout.BeginVertical ("Button");
				displayType = (AC_DisplayType) EditorGUILayout.EnumPopup ("Display type:", displayType);
				GetCursorGUI ();
			
				if (displayType != AC_DisplayType.IconOnly)
				{
					anchor = (TextAnchor) EditorGUILayout.EnumPopup ("Text alignment:", anchor);
					textEffects = (TextEffects) EditorGUILayout.EnumPopup ("Text effect:", textEffects);
				}
			EditorGUILayout.EndVertical ();

			base.ShowGUI ();
		}
Ejemplo n.º 43
0
        private void CopyCrafting(MenuCrafting _element)
        {
            uiSlots      = _element.uiSlots;
            isClickable  = _element.isClickable;
            textEffects  = _element.textEffects;
            outlineSize  = _element.outlineSize;
            numSlots     = _element.numSlots;
            craftingType = _element.craftingType;
            displayType  = _element.displayType;
            uiHideStyle  = _element.uiHideStyle;

            PopulateList(MenuSource.AdventureCreator);

            base.Copy(_element);
        }
Ejemplo n.º 44
0
        /**
         * Initialises the element when it is created within MenuManager.
         */
        public override void Declare()
        {
            label       = "Button";
            isVisible   = true;
            isClickable = true;
            textEffects = TextEffects.None;
            numSlots    = 1;
            anchor      = TextAnchor.MiddleCenter;
            SetSize(new Vector2(10f, 5f));
            dragRect    = new Rect(0, 0, 0, 0);
            dragType    = DragElementType.EntireMenu;
            elementName = "";

            base.Declare();
        }
Ejemplo n.º 45
0
		public void CopySavesList (MenuSavesList _element)
		{
			newSaveText = _element.newSaveText;
			textEffects = _element.textEffects;
			anchor = _element.anchor;
			saveListType = _element.saveListType;
			maxSaves = _element.maxSaves;
			actionListOnSave = _element.actionListOnSave;
			displayType = _element.displayType;
			blankSlotTexture = _element.blankSlotTexture;
			fixedOption = _element.fixedOption;
			optionToShow = _element.optionToShow;
			
			base.Copy (_element);
		}
Ejemplo n.º 46
0
        public fp_text(string Name, string value, PointF at, string layer, SizeF font_size, float thickness, float rotation, bool visible, bool italic)
        {
            this.Type              = Name;
            this.Value             = value;
            this.position          = new Position(at);
            this.layer             = layer;
            this.visible           = visible;
            this.position.Rotation = rotation;

            this.effects                = new TextEffects();
            this.effects.font           = new FontAttributes();
            this.effects.font.Size      = font_size;
            this.effects.font.thickness = thickness;
            this.effects.font.italic    = italic;
        }
Ejemplo n.º 47
0
        public void CopyCycle(MenuCycle _element)
        {
            uiButton     = _element.uiButton;
            uiText       = null;
            label        = _element.label;
            textEffects  = _element.textEffects;
            anchor       = _element.anchor;
            selected     = _element.selected;
            optionsArray = _element.optionsArray;
            cycleType    = _element.cycleType;
            varID        = _element.varID;
            cycleText    = "";

            base.Copy(_element);
        }
Ejemplo n.º 48
0
        public override void ShowGUI(MenuSource source)
        {
            EditorGUILayout.BeginVertical("Button");
            if (source == MenuSource.AdventureCreator)
            {
                textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);
            }
            displayType  = (ConversationDisplayType)EditorGUILayout.EnumPopup("Display:", displayType);
            craftingType = (CraftingElementType)EditorGUILayout.EnumPopup("Crafting element type:", craftingType);

            if (craftingType == CraftingElementType.Ingredients)
            {
                numSlots = EditorGUILayout.IntSlider("Number of slots:", numSlots, 1, 12);
                if (source == MenuSource.AdventureCreator)
                {
                    slotSpacing = EditorGUILayout.Slider("Slot spacing:", slotSpacing, 0f, 20f);
                    orientation = (ElementOrientation)EditorGUILayout.EnumPopup("Slot orientation:", orientation);
                    if (orientation == ElementOrientation.Grid)
                    {
                        gridWidth = EditorGUILayout.IntSlider("Grid size:", gridWidth, 1, 10);
                    }
                }
            }
            else
            {
                categoryID = -1;
                numSlots   = 1;
            }

            if (source != MenuSource.AdventureCreator)
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");

                uiSlots = ResizeUISlots(uiSlots, numSlots);

                for (int i = 0; i < uiSlots.Length; i++)
                {
                    uiSlots[i].LinkedUiGUI(i, source);
                }
            }

            isClickable = true;
            EditorGUILayout.EndVertical();

            PopulateList(source);
            base.ShowGUI(source);
        }
Ejemplo n.º 49
0
        public override void ShowGUI(Menu menu)
        {
            MenuSource source = menu.menuSource;

            EditorGUILayout.BeginVertical("Button");

            if (source == MenuSource.AdventureCreator)
            {
                displayType = (AC_DisplayType)EditorGUILayout.EnumPopup("Display type:", displayType);
                GetCursorGUI();

                if (displayType != AC_DisplayType.IconOnly)
                {
                    anchor      = (TextAnchor)EditorGUILayout.EnumPopup("Text alignment:", anchor);
                    textEffects = (TextEffects)EditorGUILayout.EnumPopup("Text effect:", textEffects);
                    if (textEffects != TextEffects.None)
                    {
                        outlineSize = EditorGUILayout.Slider("Effect size:", outlineSize, 1f, 5f);
                    }
                }

                if (displayType != AC_DisplayType.TextOnly)
                {
                    overrideTexture = EditorGUILayout.Toggle("Override icon texture?", overrideTexture);
                    if (overrideTexture)
                    {
                        EditorGUILayout.BeginHorizontal();
                        EditorGUILayout.LabelField("Active texture:", GUILayout.Width(145f));
                        activeTexture = (Texture2D)EditorGUILayout.ObjectField(activeTexture, typeof(Texture2D), false, GUILayout.Width(70f), GUILayout.Height(30f));
                        EditorGUILayout.EndHorizontal();
                    }
                }
            }
            else
            {
                uiButton = LinkedUiGUI <UnityEngine.UI.Button> (uiButton, "Linked Button:", source);
                uiSelectableHideStyle = (UISelectableHideStyle)EditorGUILayout.EnumPopup("When invisible:", uiSelectableHideStyle);
                uiPointerState        = (UIPointerState)EditorGUILayout.EnumPopup("Responds to:", uiPointerState);
                EditorGUILayout.EndVertical();
                EditorGUILayout.BeginVertical("Button");
                displayType = (AC_DisplayType)EditorGUILayout.EnumPopup("Display type:", displayType);
                GetCursorGUI();
            }
            alternativeInputButton = EditorGUILayout.TextField("Alternative input button:", alternativeInputButton);
            EditorGUILayout.EndVertical();

            base.ShowGUI(menu);
        }
Ejemplo n.º 50
0
 /**
  * Initialises the element when it is created within MenuManager.
  */
 public override void Declare()
 {
     uiSlots     = null;
     isVisible   = true;
     isClickable = true;
     numSlots    = 4;
     SetSize(new Vector2(6f, 10f));
     textEffects  = TextEffects.None;
     outlineSize  = 2f;
     craftingType = CraftingElementType.Ingredients;
     displayType  = ConversationDisplayType.IconOnly;
     uiHideStyle  = UIHideStyle.DisableObject;
     actionListOnWrongIngredients = null;
     linkUIGraphic = LinkUIGraphic.ImageComponent;
     items         = new List <InvItem>();
 }
Ejemplo n.º 51
0
		public override void Declare ()
		{
			label = "Cycle";
			selected = 0;
			isVisible = true;
			isClickable = true;
			numSlots = 1;
			textEffects = TextEffects.None;
			SetSize (new Vector2 (15f, 5f));
			anchor = TextAnchor.MiddleLeft;
			cycleType = AC_CycleType.CustomScript;
			varID = 0;
			optionsArray = new List<string>();
			
			base.Declare ();
		}
Ejemplo n.º 52
0
		public override void Declare ()
		{
			isVisible = true;
			isClickable = true;
			fixedOption = false;
			displayType = ConversationDisplayType.TextOnly;
			testIcon = null;
			optionToShow = 1;
			numSlots = 0;
			SetSize (new Vector2 (20f, 5f));
			maxSlots = 10;
			anchor = TextAnchor.MiddleLeft;
			textEffects = TextEffects.None;

			base.Declare ();
		}
Ejemplo n.º 53
0
        public void CopyCycle(MenuCycle _element)
        {
            uiButton = _element.uiButton;
            uiText = null;
            label = _element.label;
            textEffects = _element.textEffects;
            anchor = _element.anchor;
            selected = _element.selected;
            optionsArray = _element.optionsArray;
            cycleType = _element.cycleType;
            varID = _element.varID;
            cycleText = "";
            actionListOnClick = _element.actionListOnClick;

            base.Copy (_element);
        }
Ejemplo n.º 54
0
		public override void Declare ()
		{
			label = "Input";
			isVisible = true;
			isClickable = true;
			numSlots = 1;
			anchor = TextAnchor.MiddleCenter;
			SetSize (new Vector2 (10f, 5f));
			inputType = AC_InputType.AlphaNumeric;
			characterLimit = 10;
			linkedButton = "";
			textEffects = TextEffects.None;
			allowSpaces = false;

			base.Declare ();
		}
Ejemplo n.º 55
0
        public void CopyLabel(MenuLabel _element)
        {
            uiText             = _element.uiText;
            label              = _element.label;
            anchor             = _element.anchor;
            textEffects        = _element.textEffects;
            labelType          = _element.labelType;
            variableID         = _element.variableID;
            variableNumber     = _element.variableNumber;
            useCharacterColour = _element.useCharacterColour;
            autoAdjustHeight   = _element.autoAdjustHeight;
            updateIfEmpty      = _element.updateIfEmpty;
            newLabel           = "";

            base.Copy(_element);
        }
Ejemplo n.º 56
0
        /**
         * Initialises the element when it is created within MenuManager.
         */
        public override void Declare()
        {
            uiButton = null;
            uiText = null;
            isVisible = true;
            isClickable = true;
            numSlots = 1;
            anchor = TextAnchor.MiddleCenter;
            SetSize (new Vector2 (5f, 5f));
            iconID = -1;
            textEffects = TextEffects.None;
            overrideTexture = false;
            activeTexture = null;

            base.Declare ();
        }
Ejemplo n.º 57
0
        public void CopyToggle(MenuToggle _element)
        {
            uiToggle    = _element.uiToggle;
            uiText      = null;
            label       = _element.label;
            isOn        = _element.isOn;
            textEffects = _element.textEffects;
            anchor      = _element.anchor;
            toggleType  = _element.toggleType;
            varID       = _element.varID;
            appendState = _element.appendState;
            onTexture   = _element.onTexture;
            offTexture  = _element.offTexture;

            base.Copy(_element);
        }
Ejemplo n.º 58
0
        public void CopyJournal(MenuJournal _element)
        {
            uiText = _element.uiText;
            pages = new List<JournalPage>();
            foreach (JournalPage page in _element.pages)
            {
                pages.Add (page);
            }

            numPages = _element.numPages;
            showPage = 1;
            anchor = _element.anchor;
            textEffects = _element.textEffects;
            fullText = "";

            base.Copy (_element);
        }
Ejemplo n.º 59
0
        public void CopyToggle(MenuToggle _element)
        {
            uiToggle = _element.uiToggle;
            uiText = null;
            label = _element.label;
            isOn = _element.isOn;
            textEffects = _element.textEffects;
            anchor = _element.anchor;
            toggleType = _element.toggleType;
            varID = _element.varID;
            appendState = _element.appendState;
            onTexture = _element.onTexture;
            offTexture = _element.offTexture;
            actionListOnClick = _element.actionListOnClick;

            base.Copy (_element);
        }
Ejemplo n.º 60
0
		public override void Declare ()
		{
			label = "Label";
			isVisible = true;
			isClickable = false;
			numSlots = 1;
			anchor = TextAnchor.MiddleCenter;
			SetSize (new Vector2 (10f, 5f));
			labelType = AC_LabelType.Normal;
			variableID = 0;
			variableNumber = 0;
			useCharacterColour = false;
			autoAdjustHeight = true;
			textEffects = TextEffects.None;
			newLabel = "";

			base.Declare ();
		}