"Subinventory" (= jumpsuit pockets etc) bugfixes, quest message fix

This commit is contained in:
Regalis
2015-11-19 18:01:54 +02:00
parent f42cc78af3
commit a46f724f1f
4 changed files with 40 additions and 18 deletions

View File

@@ -103,7 +103,9 @@
<sprite texture="engigear.png" limb="LeftLeg" sourcerect="33,0,20,51" origin="0.5,0.5" depth="0.15" hidelimb="true"/>
</Wearable>
<ItemContainer containable="smallitem" capacity="5"/>
<ItemContainer capacity="5">
<Containable name="smallitem"/>
</ItemContainer>
</Item>
<Item
@@ -127,7 +129,9 @@
<sprite texture="engigear.png" limb="LeftLeg" sourcerect="33,77,20,51" origin="0.5,0.5" depth="0.15" hidelimb="true"/>
</Wearable>
<ItemContainer containable="smallitem" capacity="5"/>
<ItemContainer capacity="5">
<Containable name="smallitem"/>
</ItemContainer>
</Item>
</Items>

View File

@@ -9,7 +9,7 @@
failuremessage="Retrieving the artifact failed"
successmessage="The artifact has been succesfully retrieved"
itemname="Skyholder Artifact">
<message header="Artifact collected" message="The artifact is now on board. Navigate the submarine out of the cavern to claim the reward."/>
<message header="Artifact collected" text="The artifact is now on board. Navigate the submarine out of the cavern to claim the reward."/>
</SalvageQuest>
<SalvageQuest
@@ -21,7 +21,7 @@
failuremessage="Retrieving the artifact failed"
successmessage="The artifact has been succesfully retrieved"
itemname="Thermal Artifact">
<message header="Artifact collected" message="The artifact is now on board. Navigate the submarine out of the cavern to claim the reward."/>
<message header="Artifact collected" text="The artifact is now on board. Navigate the submarine out of the cavern to claim the reward."/>
</SalvageQuest>
<MonsterQuest
@@ -32,7 +32,7 @@
radarlabel="Moloch"
successmessage="The Moloch has been killed."
monsterfile="Content/Characters/Moloch/moloch.xml">
<message header="Target terminated" message="The moloch is dead. Navigate the submarine out of the cavern to claim the reward."/>
<message header="Target terminated" text="The moloch is dead. Navigate the submarine out of the cavern to claim the reward."/>
</MonsterQuest>
<MonsterQuest
@@ -43,7 +43,7 @@
radarlabel="Tiger Thresher"
successmessage="The Tiger Thresher has been killed."
monsterfile="Content/Characters/TigerThresher/tigerthresher.xml">
<message header="Target terminated" message="The thresher is dead. Navigate the submarine out of the cavern to claim the reward."/>
<message header="Target terminated" text="The thresher is dead. Navigate the submarine out of the cavern to claim the reward."/>
</MonsterQuest>
<MonsterQuest

View File

@@ -208,8 +208,6 @@ namespace Barotrauma
{
bool mouseOn = rect.Contains(PlayerInput.MousePosition);
DrawSlot(spriteBatch, rect, (draggingItem == item && !mouseOn) ? null : item, mouseOn, isSubSlot, drawItem);
if (mouseOn)
{
if (draggingItem == null)
@@ -226,18 +224,27 @@ namespace Barotrauma
doubleClickedItem = item;
}
selectedSlot = slotIndex;
//selectedSlot = slotIndex;
TryPutItem(draggingItem, slotIndex);
draggingItem = null;
}
if (!isSubSlot) selectedSlot = slotIndex;
if (!isSubSlot && selectedSlot == -1)
{
System.Diagnostics.Debug.WriteLine("DSFG");
selectedSlot = slotIndex;
}
}
if (selectedSlot == slotIndex)
if (selectedSlot == slotIndex && !isSubSlot)
{
System.Diagnostics.Debug.WriteLine("sdfg: "+selectedSlot+" - "+slotIndex);
selectedSlot = -1;
if (item == null) return;
int itemCapacity = item.Capacity;
if (itemCapacity == 0) return;
@@ -247,25 +254,36 @@ namespace Barotrauma
if (slotIndex<0 || slotIndex>=items.Length) return;
#endif
Rectangle containerRect = new Rectangle(rect.X - 5, rect.Y - (40 + 10) * itemCapacity - 5,
rect.Width + 10, rect.Height + (40 + 10) * itemCapacity + 10);
Rectangle subRect = rect;
subRect.Height = 40;
Rectangle containerRect = new Rectangle(rect.X - 5, rect.Y - (rect.Height + 10) * itemCapacity - 5,
rect.Width + 10, rect.Height + (rect.Height + 10) * itemCapacity + 10);
selectedSlot = containerRect.Contains(PlayerInput.MousePosition) ? slotIndex : -1;
System.Diagnostics.Debug.WriteLine(selectedSlot);
GUI.DrawRectangle(spriteBatch, containerRect, Color.Black*0.8f, true);
GUI.DrawRectangle(spriteBatch, containerRect, Color.White);
Item[] containedItems = null;
if (items[slotIndex] != null) containedItems = items[slotIndex].ContainedItems;
if (containedItems == null || !containedItems.Any()) return;
for (int i = 0; i < itemCapacity; i++)
if (containedItems != null)
{
rect.Y = rect.Y - rect.Height - 10;
UpdateSlot(spriteBatch, rect, selectedSlot, i < containedItems.Count() ? containedItems[i] : null, true);
for (int i = 0; i < itemCapacity; i++)
{
subRect.Y = subRect.Y - subRect.Height - 10;
UpdateSlot(spriteBatch, subRect, selectedSlot, i < containedItems.Count() ? containedItems[i] : null, true);
}
}
}
DrawSlot(spriteBatch, rect, (draggingItem == item && !mouseOn) ? null : item, mouseOn, isSubSlot, drawItem);
}
protected void DrawSlot(SpriteBatch spriteBatch, Rectangle rect, Item item, bool isHighLighted, bool isSubSlot, bool drawItem=true)

Binary file not shown.