Пример #1
0
        /**
         * <summary>A Constructor that sets all its values by copying another InvItem.</summary>
         * <param name = "assetItem">The InvItem to copy</param>
         */
        public InvItem(InvItem assetItem)
        {
            count       = assetItem.count;
            tex         = assetItem.tex;
            activeTex   = assetItem.activeTex;
            selectedTex = assetItem.selectedTex;

            //cursorIcon = assetItem.cursorIcon;
            cursorIcon = new CursorIcon();
            cursorIcon.Copy(assetItem.cursorIcon, true);

            carryOnStart           = assetItem.carryOnStart;
            carryOnStartNotDefault = assetItem.carryOnStartNotDefault;
            carryOnStartID         = assetItem.carryOnStartID;
            canCarryMultiple       = assetItem.canCarryMultiple;
            label     = assetItem.label;
            altLabel  = assetItem.altLabel;
            id        = assetItem.id;
            lineID    = assetItem.lineID;
            useIconID = assetItem.useIconID;

            binID = assetItem.binID;
            if (binID == -1 && KickStarter.inventoryManager != null && KickStarter.inventoryManager.bins != null && KickStarter.inventoryManager.bins.Count > 0)
            {
                // Place item in first available cateogry if undefined
                binID = KickStarter.inventoryManager.bins[0].id;
            }

            useSeparateSlots = assetItem.useSeparateSlots;
            selectSingle     = assetItem.selectSingle;
            recipeSlot       = -1;

            overrideUseSyntax = assetItem.overrideUseSyntax;
            hotspotPrefix1    = assetItem.hotspotPrefix1;
            hotspotPrefix2    = assetItem.hotspotPrefix2;

            useActionList              = assetItem.useActionList;
            lookActionList             = assetItem.lookActionList;
            interactions               = assetItem.interactions;
            combineActionList          = assetItem.combineActionList;
            unhandledActionList        = assetItem.unhandledActionList;
            unhandledCombineActionList = assetItem.unhandledCombineActionList;
            combineID    = assetItem.combineID;
            linkedPrefab = assetItem.linkedPrefab;

            canBeAnimated = DetermineCanBeAnimated();

            vars = assetItem.vars;
            if (Application.isPlaying)
            {
                for (int i = 0; i < vars.Count; i++)
                {
                    if (vars[i].type == VariableType.PopUp)
                    {
                        // Transfer ID of PopUps translation from global property to per-item
                        vars[i].popUpsLineID = KickStarter.inventoryManager.invVars[i].popUpsLineID;
                    }
                }
            }
        }
Пример #2
0
        /**
         * <summary>A Constructor in which the id is explicitly set.</summary>
         * <param name = "_id">The ID number to assign</param>
         */
        public InvItem(int _id)
        {
            count                  = 0;
            tex                    = null;
            activeTex              = null;
            selectedTex            = null;
            cursorIcon             = new CursorIcon();
            id                     = _id;
            binID                  = -1;
            carryOnStartNotDefault = false;
            vars                   = new List <InvVar>();
            canBeAnimated          = false;
            linkedPrefab           = null;
            maxCount               = 999;
            canBeLowerCase         = false;

            itemStackingMode = ItemStackingMode.All;
            interactions     = new List <InvInteraction>();

            combineActionList = new List <ActionListAsset>();
            combineID         = new List <int>();

            overrideUseSyntax = false;
            hotspotPrefix1    = new HotspotPrefix("Use");
            hotspotPrefix2    = new HotspotPrefix("on");

            label    = "Inventory item " + (id + 1).ToString();
            altLabel = "";
        }
Пример #3
0
        public InvItem(int[] idArray)
        {
            count = 0;
            tex = null;
            activeTex = null;
            id = 0;
            binID = -1;
            recipeSlot = -1;
            useSeparateSlots = false;
            carryOnStartNotDefault = false;

            interactions = new List<InvInteraction>();

            combineActionList = new List<ActionListAsset>();
            combineID = new List<int>();

            overrideUseSyntax = false;
            hotspotPrefix1 = new HotspotPrefix ("Use");
            hotspotPrefix2 = new HotspotPrefix ("on");

            // Update id based on array
            foreach (int _id in idArray)
            {
                if (id == _id)
                    id ++;
            }

            label = "Inventory item " + (id + 1).ToString ();
            altLabel = "";
        }
Пример #4
0
        public InvItem(InvItem assetItem)
        {
            count                  = assetItem.count;
            tex                    = assetItem.tex;
            activeTex              = assetItem.activeTex;
            carryOnStart           = assetItem.carryOnStart;
            carryOnStartNotDefault = assetItem.carryOnStartNotDefault;
            carryOnStartID         = assetItem.carryOnStartID;
            canCarryMultiple       = assetItem.canCarryMultiple;
            label                  = assetItem.label;
            altLabel               = assetItem.altLabel;
            id               = assetItem.id;
            lineID           = assetItem.lineID;
            useIconID        = assetItem.useIconID;
            binID            = assetItem.binID;
            useSeparateSlots = assetItem.useSeparateSlots;
            isEditing        = false;
            recipeSlot       = -1;

            overrideUseSyntax = assetItem.overrideUseSyntax;
            hotspotPrefix1    = assetItem.hotspotPrefix1;
            hotspotPrefix2    = assetItem.hotspotPrefix2;

            useActionList              = assetItem.useActionList;
            lookActionList             = assetItem.lookActionList;
            interactions               = assetItem.interactions;
            combineActionList          = assetItem.combineActionList;
            unhandledActionList        = assetItem.unhandledActionList;
            unhandledCombineActionList = assetItem.unhandledCombineActionList;
            combineID = assetItem.combineID;
        }
Пример #5
0
        public InvItem(int[] idArray)
        {
            count                  = 0;
            tex                    = null;
            activeTex              = null;
            id                     = 0;
            binID                  = -1;
            recipeSlot             = -1;
            useSeparateSlots       = false;
            carryOnStartNotDefault = false;

            interactions = new List <InvInteraction>();

            combineActionList = new List <ActionListAsset>();
            combineID         = new List <int>();

            overrideUseSyntax = false;
            hotspotPrefix1    = new HotspotPrefix("Use");
            hotspotPrefix2    = new HotspotPrefix("on");

            // Update id based on array
            foreach (int _id in idArray)
            {
                if (id == _id)
                {
                    id++;
                }
            }

            label    = "Inventory item " + (id + 1).ToString();
            altLabel = "";
        }
Пример #6
0
        /**
         * <summary>A Constructor that sets all its values by copying another InvItem.</summary>
         * <param name = "assetItem">The InvItem to copy</param>
         */
        public InvItem(InvItem assetItem)
        {
            count       = assetItem.count;
            tex         = assetItem.tex;
            activeTex   = assetItem.activeTex;
            selectedTex = assetItem.selectedTex;

            //cursorIcon = assetItem.cursorIcon;
            cursorIcon = new CursorIcon();
            cursorIcon.Copy(assetItem.cursorIcon);

            carryOnStart           = assetItem.carryOnStart;
            carryOnStartNotDefault = assetItem.carryOnStartNotDefault;
            carryOnStartID         = assetItem.carryOnStartID;
            canCarryMultiple       = assetItem.canCarryMultiple;
            label     = assetItem.label;
            altLabel  = assetItem.altLabel;
            id        = assetItem.id;
            lineID    = assetItem.lineID;
            useIconID = assetItem.useIconID;

            binID = assetItem.binID;
            if (binID == -1 && KickStarter.inventoryManager != null && KickStarter.inventoryManager.bins != null && KickStarter.inventoryManager.bins.Count > 0)
            {
                // Place item in first available cateogry if undefined
                binID = KickStarter.inventoryManager.bins[0].id;
            }

            useSeparateSlots = assetItem.useSeparateSlots;
            selectSingle     = assetItem.selectSingle;
            isEditing        = false;
            recipeSlot       = -1;

            overrideUseSyntax = assetItem.overrideUseSyntax;
            hotspotPrefix1    = assetItem.hotspotPrefix1;
            hotspotPrefix2    = assetItem.hotspotPrefix2;

            useActionList              = assetItem.useActionList;
            lookActionList             = assetItem.lookActionList;
            interactions               = assetItem.interactions;
            combineActionList          = assetItem.combineActionList;
            unhandledActionList        = assetItem.unhandledActionList;
            unhandledCombineActionList = assetItem.unhandledCombineActionList;
            combineID    = assetItem.combineID;
            vars         = assetItem.vars;
            linkedPrefab = assetItem.linkedPrefab;

            canBeAnimated = DetermineCanBeAnimated();
        }
Пример #7
0
        /**
         * <summary>A Constructor that sets all its values by copying another InvItem.</summary>
         * <param name = "assetItem">The InvItem to copy</param>
         */
        public InvItem(InvItem assetItem)
        {
            count       = assetItem.count;
            tex         = assetItem.tex;
            activeTex   = assetItem.activeTex;
            selectedTex = assetItem.selectedTex;

            //cursorIcon = assetItem.cursorIcon;
            cursorIcon = new CursorIcon();
            cursorIcon.Copy(assetItem.cursorIcon);

            carryOnStart           = assetItem.carryOnStart;
            carryOnStartNotDefault = assetItem.carryOnStartNotDefault;
            carryOnStartID         = assetItem.carryOnStartID;
            canCarryMultiple       = assetItem.canCarryMultiple;
            label            = assetItem.label;
            altLabel         = assetItem.altLabel;
            id               = assetItem.id;
            lineID           = assetItem.lineID;
            useIconID        = assetItem.useIconID;
            binID            = assetItem.binID;
            useSeparateSlots = assetItem.useSeparateSlots;
            selectSingle     = assetItem.selectSingle;
            isEditing        = false;
            recipeSlot       = -1;

            overrideUseSyntax = assetItem.overrideUseSyntax;
            hotspotPrefix1    = assetItem.hotspotPrefix1;
            hotspotPrefix2    = assetItem.hotspotPrefix2;

            useActionList              = assetItem.useActionList;
            lookActionList             = assetItem.lookActionList;
            interactions               = assetItem.interactions;
            combineActionList          = assetItem.combineActionList;
            unhandledActionList        = assetItem.unhandledActionList;
            unhandledCombineActionList = assetItem.unhandledCombineActionList;
            combineID    = assetItem.combineID;
            vars         = assetItem.vars;
            linkedPrefab = assetItem.linkedPrefab;

            canBeAnimated = DetermineCanBeAnimated();
        }
Пример #8
0
        public InvItem(InvItem assetItem)
        {
            count = assetItem.count;
            tex = assetItem.tex;
            activeTex = assetItem.activeTex;
            carryOnStart = assetItem.carryOnStart;
            carryOnStartNotDefault = assetItem.carryOnStartNotDefault;
            carryOnStartID = assetItem.carryOnStartID;
            canCarryMultiple = assetItem.canCarryMultiple;
            label = assetItem.label;
            altLabel = assetItem.altLabel;
            id = assetItem.id;
            lineID = assetItem.lineID;
            useIconID = assetItem.useIconID;
            binID = assetItem.binID;
            useSeparateSlots = assetItem.useSeparateSlots;
            isEditing = false;
            recipeSlot = -1;

            overrideUseSyntax = assetItem.overrideUseSyntax;
            hotspotPrefix1 = assetItem.hotspotPrefix1;
            hotspotPrefix2 = assetItem.hotspotPrefix2;

            useActionList = assetItem.useActionList;
            lookActionList = assetItem.lookActionList;
            interactions = assetItem.interactions;
            combineActionList = assetItem.combineActionList;
            unhandledActionList = assetItem.unhandledActionList;
            unhandledCombineActionList = assetItem.unhandledCombineActionList;
            combineID = assetItem.combineID;
        }
Пример #9
0
        private void ExtractPrefix(HotspotPrefix prefix, bool onlySeekNew)
        {
            if (onlySeekNew && prefix.lineID == -1)
            {
                // Assign a new ID on creation
                SpeechLine newLine;
                newLine = new SpeechLine (GetIDArray(), "", prefix.label, languages.Count - 1, AC_TextType.HotspotPrefix);
                prefix.lineID = newLine.lineID;
                lines.Add (newLine);
            }
            else if (!onlySeekNew && prefix.lineID > -1)
            {
                // Already has an ID, so don't replace
                SpeechLine existingLine = new SpeechLine (prefix.lineID, "", prefix.label, languages.Count - 1, AC_TextType.HotspotPrefix);

                int lineID = SmartAddLine (existingLine);
                if (lineID >= 0) prefix.lineID = lineID;
            }
        }
Пример #10
0
        /**
         * <summary>A Constructor that sets all its values by copying another InvItem.</summary>
         * <param name = "assetItem">The InvItem to copy</param>
         */
        public InvItem(InvItem assetItem)
        {
            count       = assetItem.count;
            tex         = assetItem.tex;
            activeTex   = assetItem.activeTex;
            selectedTex = assetItem.selectedTex;

            //cursorIcon = assetItem.cursorIcon;
            cursorIcon = new CursorIcon();
            cursorIcon.Copy(assetItem.cursorIcon, true);

            carryOnStart           = assetItem.carryOnStart;
            carryOnStartNotDefault = assetItem.carryOnStartNotDefault;
            carryOnStartID         = assetItem.carryOnStartID;
            carryOnStartIDs.Clear();
            foreach (int _id in assetItem.carryOnStartIDs)
            {
                carryOnStartIDs.Add(_id);
            }
            Upgrade();
            canCarryMultiple = assetItem.canCarryMultiple;
            label            = assetItem.label;
            altLabel         = assetItem.altLabel;
            id        = assetItem.id;
            lineID    = assetItem.lineID;
            useIconID = assetItem.useIconID;

            canBeLowerCase = assetItem.canBeLowerCase;

            binID = assetItem.binID;
            if (binID == -1 && KickStarter.inventoryManager && KickStarter.inventoryManager.bins != null && KickStarter.inventoryManager.bins.Count > 0)
            {
                // Place item in first available cateogry if undefined
                binID = KickStarter.inventoryManager.bins[0].id;
            }

            maxCount         = assetItem.maxCount;
            itemStackingMode = assetItem.itemStackingMode;

            overrideUseSyntax = assetItem.overrideUseSyntax;
            hotspotPrefix1    = assetItem.hotspotPrefix1;
            hotspotPrefix2    = assetItem.hotspotPrefix2;

            useActionList              = assetItem.useActionList;
            lookActionList             = assetItem.lookActionList;
            interactions               = assetItem.interactions;
            combineActionList          = assetItem.combineActionList;
            unhandledActionList        = assetItem.unhandledActionList;
            unhandledCombineActionList = assetItem.unhandledCombineActionList;
            combineID    = assetItem.combineID;
            linkedPrefab = assetItem.linkedPrefab;

            vars.Clear();
            foreach (InvVar invVar in assetItem.vars)
            {
                vars.Add(new InvVar(invVar));
            }

            if (Application.isPlaying)
            {
                for (int i = 0; i < vars.Count; i++)
                {
                    if (vars[i].type == VariableType.PopUp)
                    {
                        // Transfer ID of PopUps translation from global property to per-item
                        vars[i].popUpsLineID = KickStarter.inventoryManager.invVars[i].popUpsLineID;
                    }
                }
            }
        }
Пример #11
0
		private void ExtractPrefix (HotspotPrefix prefix, bool onlySeekNew)
		{
			if (onlySeekNew && prefix.lineID == -1)
			{
				// Assign a new ID on creation
				SpeechLine newLine;
				newLine = new SpeechLine (GetIDArray(), EditorApplication.currentScene, prefix.label, languages.Count - 1, AC_TextType.HotspotPrefix);
				prefix.lineID = newLine.lineID;
				lines.Add (newLine);
			}
			
			else if (!onlySeekNew && prefix.lineID > -1)
			{
				// Already has an ID, so don't replace
				lines.Add (new SpeechLine (prefix.lineID, EditorApplication.currentScene, prefix.label, languages.Count - 1, AC_TextType.HotspotPrefix));
			}
		}