"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
+6 -2
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"/> <sprite texture="engigear.png" limb="LeftLeg" sourcerect="33,0,20,51" origin="0.5,0.5" depth="0.15" hidelimb="true"/>
</Wearable> </Wearable>
<ItemContainer containable="smallitem" capacity="5"/> <ItemContainer capacity="5">
<Containable name="smallitem"/>
</ItemContainer>
</Item> </Item>
<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"/> <sprite texture="engigear.png" limb="LeftLeg" sourcerect="33,77,20,51" origin="0.5,0.5" depth="0.15" hidelimb="true"/>
</Wearable> </Wearable>
<ItemContainer containable="smallitem" capacity="5"/> <ItemContainer capacity="5">
<Containable name="smallitem"/>
</ItemContainer>
</Item> </Item>
</Items> </Items>
+4 -4
View File
@@ -9,7 +9,7 @@
failuremessage="Retrieving the artifact failed" failuremessage="Retrieving the artifact failed"
successmessage="The artifact has been succesfully retrieved" successmessage="The artifact has been succesfully retrieved"
itemname="Skyholder Artifact"> 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>
<SalvageQuest <SalvageQuest
@@ -21,7 +21,7 @@
failuremessage="Retrieving the artifact failed" failuremessage="Retrieving the artifact failed"
successmessage="The artifact has been succesfully retrieved" successmessage="The artifact has been succesfully retrieved"
itemname="Thermal Artifact"> 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> </SalvageQuest>
<MonsterQuest <MonsterQuest
@@ -32,7 +32,7 @@
radarlabel="Moloch" radarlabel="Moloch"
successmessage="The Moloch has been killed." successmessage="The Moloch has been killed."
monsterfile="Content/Characters/Moloch/moloch.xml"> 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>
<MonsterQuest <MonsterQuest
@@ -43,7 +43,7 @@
radarlabel="Tiger Thresher" radarlabel="Tiger Thresher"
successmessage="The Tiger Thresher has been killed." successmessage="The Tiger Thresher has been killed."
monsterfile="Content/Characters/TigerThresher/tigerthresher.xml"> 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>
<MonsterQuest <MonsterQuest
+30 -12
View File
@@ -208,8 +208,6 @@ namespace Barotrauma
{ {
bool mouseOn = rect.Contains(PlayerInput.MousePosition); bool mouseOn = rect.Contains(PlayerInput.MousePosition);
DrawSlot(spriteBatch, rect, (draggingItem == item && !mouseOn) ? null : item, mouseOn, isSubSlot, drawItem);
if (mouseOn) if (mouseOn)
{ {
if (draggingItem == null) if (draggingItem == null)
@@ -226,18 +224,27 @@ namespace Barotrauma
doubleClickedItem = item; doubleClickedItem = item;
} }
selectedSlot = slotIndex; //selectedSlot = slotIndex;
TryPutItem(draggingItem, slotIndex); TryPutItem(draggingItem, slotIndex);
draggingItem = null; 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; if (item == null) return;
int itemCapacity = item.Capacity; int itemCapacity = item.Capacity;
if (itemCapacity == 0) return; if (itemCapacity == 0) return;
@@ -247,25 +254,36 @@ namespace Barotrauma
if (slotIndex<0 || slotIndex>=items.Length) return; if (slotIndex<0 || slotIndex>=items.Length) return;
#endif #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; 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); GUI.DrawRectangle(spriteBatch, containerRect, Color.White);
Item[] containedItems = null; Item[] containedItems = null;
if (items[slotIndex] != null) containedItems = items[slotIndex].ContainedItems; if (items[slotIndex] != null) containedItems = items[slotIndex].ContainedItems;
if (containedItems == null || !containedItems.Any()) return; if (containedItems != null)
for (int i = 0; i < itemCapacity; i++)
{ {
rect.Y = rect.Y - rect.Height - 10; for (int i = 0; i < itemCapacity; i++)
UpdateSlot(spriteBatch, rect, selectedSlot, i < containedItems.Count() ? containedItems[i] : null, true); {
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) protected void DrawSlot(SpriteBatch spriteBatch, Rectangle rect, Item item, bool isHighLighted, bool isSubSlot, bool drawItem=true)
Binary file not shown.