Example #1
0
        protected void UseSkillsToPickUpItem( )
        {
            if (UsingSkillList)
            {
                return;
            }

            //add the option list we'll use to select the skill
            SpawnOptionsList optionsList = gameObject.GetOrAdd <SpawnOptionsList> ();

            optionsList.Message                 = "Use a skill";
            optionsList.MessageType             = "Pick up item";
            optionsList.FunctionName            = "OnSelectRemoveSkill";
            optionsList.RequireManualEnable     = false;
            optionsList.OverrideBaseAvailabilty = true;
            optionsList.FunctionTarget          = gameObject;
            optionsList.ScreenTarget            = transform;
            optionsList.ScreenTargetCamera      = GameManager.Get.GameCamera.GetComponent <Camera>();
            mRemoveSkillList.Clear();
            mRemoveSkillList.AddRange(Skills.Get.SkillsByName(mRemoveItemSkillNames));
            foreach (Skill removeItemSkill in mRemoveSkillList)
            {
                optionsList.AddOption(removeItemSkill.GetListOption(mSkillUseTarget.worlditem));
            }
            optionsList.AddOption(new WIListOption("Cancel"));
            optionsList.ShowDoppleganger = false;
            GUIOptionListDialog dialog = null;

            if (optionsList.TryToSpawn(true, out dialog, null))
            {
                UsingSkillList = true;
            }
        }
Example #2
0
 public bool ItemInteract(double timeStamp)
 {
     if (usingMenu || mWaitingForRename)
     {
         //we're already busy
         return(true);
     }
     //if a critter is in player focus
     //and it HASN'T been named yet
     //spawn a pop up menu that allows them to name the critter
     if (player.Surroundings.IsCritterInPlayerFocus && !player.Surroundings.CritterFocus.UseName)
     {
         //if they haven't learned the beast master skill don't do anything
         //TODO tie this to butterfly namer reward
         lastCritterInFocus = player.Surroundings.CritterFocus;
         if (lastCritterInFocus == null)
         {
             Debug.Log("Last critter in focus was null!");
             return(true);
         }
         if (Skills.Get.HasLearnedSkill("AnimalNamer"))
         {
             //we won't use the actual skill in this case - it's enough that the player has the skill
             //add the option list we'll use to select the skill
             SpawnOptionsList optionsList = gameObject.GetOrAdd <SpawnOptionsList> ();
             optionsList.MessageType             = string.Empty;        //"Take " + mSkillUseTarget.DisplayName;
             optionsList.Message                 = "Rename Critter";
             optionsList.FunctionName            = "OnRenameCritter";
             optionsList.RequireManualEnable     = false;
             optionsList.OverrideBaseAvailabilty = true;
             optionsList.FunctionTarget          = gameObject;
             optionsList.AddOption(new WIListOption("Give Name", "GiveNameToCritter"));
             optionsList.AddOption(new WIListOption("Cancel", "CancelGiveNameToCritter"));
             optionsList.ShowDoppleganger = false;
             GUIOptionListDialog dialog = null;
             if (optionsList.TryToSpawn(true, out dialog, null))
             {
                 optionsList.FunctionTarget = gameObject;
                 optionsList.PauseWhileOpen = true;
                 usingMenu = true;
                 Debug.Log("Spawned menu!");
             }
         }
     }
     return(true);
 }