Beispiel #1
0
 //Makes map always show quantity of 1 since it is unique
 static void Postfix(ui_mouseFrame_DragAndDrop __instance)
 {
     if (__instance.strHeldArchetypeOrID == "adventure_map")
     {
         __instance.iNumHeldItems = 1;
     }
 }
Beispiel #2
0
 //Clears the hotbar after using a map and before the map is actually consumed
 static void Prefix(ui_mouseFrame_DragAndDrop __instance)
 {
     for (int i = 0; i < dmUtilities.theGame.theUIFrames.hotbarArrayLength(); i++)
     {
         dmItem hotBarItem = dmUtilities.theGame.theUIFrames.GetHeldItemFromHotbar(i);
         if (hotBarItem != null && hotBarItem.ArchetypeName == "adventure_map" && hotBarItem.bRemove == true)
         {
             dmUtilities.theGame.theUIFrames.RemoveHeldItemFromHotbar(i);
             dmUtilities.theGame.theUIFrames.ClearHotbarSlot(i);
         }
     }
 }
Beispiel #3
0
        //On the function consumables don't set the containedItem, so here we set it so the map isn't consumed when clicked on the hotbar
        static bool Prefix(ui_mouseFrame_DragAndDrop __instance)
        {
            dmItem aux = Traverse.Create(__instance).Field("theInput").GetValue <dmInput>().mouseHeldItem;

            if (aux != null)
            {
                if (aux.ArchetypeName == "adventure_map")
                {
                    __instance.containedItem = aux;
                }
            }
            return(true);
        }