Merge pull request #8462 from Adam-/master+widgetitemoverlay
Add WidgetItemOverlay
This commit is contained in:
@@ -29,6 +29,7 @@ import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import net.runelite.api.MainBufferProvider;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
|
||||
/**
|
||||
* Interface of callbacks the injected client uses to send events
|
||||
@@ -79,6 +80,11 @@ public interface Callbacks
|
||||
*/
|
||||
void draw(MainBufferProvider mainBufferProvider, Graphics graphics, int x, int y);
|
||||
|
||||
/**
|
||||
* Called before the client will render an item widget.
|
||||
*/
|
||||
void drawItem(int itemId, WidgetItem widgetItem);
|
||||
|
||||
/**
|
||||
* Mouse pressed event. If this event will be consumed it will not be propagated further to client.
|
||||
*
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Devin French <https://github.com/devinfrench>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.api.queries;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
public class BankItemQuery extends WidgetItemQuery
|
||||
{
|
||||
private static final int ITEM_EMPTY = 6512;
|
||||
|
||||
@Override
|
||||
public WidgetItem[] result(Client client)
|
||||
{
|
||||
Collection<WidgetItem> widgetItems = getBankItems(client);
|
||||
if (widgetItems != null)
|
||||
{
|
||||
return widgetItems.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(predicate)
|
||||
.toArray(WidgetItem[]::new);
|
||||
}
|
||||
return new WidgetItem[0];
|
||||
}
|
||||
|
||||
private Collection<WidgetItem> getBankItems(Client client)
|
||||
{
|
||||
Collection<WidgetItem> widgetItems = new ArrayList<>();
|
||||
Widget bank = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER);
|
||||
if (bank != null && !bank.isHidden())
|
||||
{
|
||||
Widget[] children = bank.getDynamicChildren();
|
||||
for (int i = 0; i < children.length; i++)
|
||||
{
|
||||
Widget child = children[i];
|
||||
if (child.getItemId() == ITEM_EMPTY || child.isSelfHidden())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// set bounds to same size as default inventory
|
||||
Rectangle bounds = child.getBounds();
|
||||
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
||||
// Index is set to 0 because the widget's index does not correlate to the order in the bank
|
||||
widgetItems.add(new WidgetItem(child.getItemId(), child.getItemQuantity(), 0, bounds));
|
||||
}
|
||||
}
|
||||
return widgetItems;
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Devin French <https://github.com/devinfrench>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.api.queries;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
public class EquipmentItemQuery extends WidgetItemQuery
|
||||
{
|
||||
private static final WidgetInfo[] ALL_EQUIPMENT_WIDGET_INFOS =
|
||||
{
|
||||
WidgetInfo.EQUIPMENT_HELMET,
|
||||
WidgetInfo.EQUIPMENT_CAPE,
|
||||
WidgetInfo.EQUIPMENT_AMULET,
|
||||
WidgetInfo.EQUIPMENT_WEAPON,
|
||||
WidgetInfo.EQUIPMENT_BODY,
|
||||
WidgetInfo.EQUIPMENT_SHIELD,
|
||||
WidgetInfo.EQUIPMENT_LEGS,
|
||||
WidgetInfo.EQUIPMENT_GLOVES,
|
||||
WidgetInfo.EQUIPMENT_BOOTS,
|
||||
WidgetInfo.EQUIPMENT_RING,
|
||||
WidgetInfo.EQUIPMENT_AMMO,
|
||||
};
|
||||
|
||||
private final Collection<WidgetInfo> slots = new ArrayList<>();
|
||||
|
||||
public EquipmentItemQuery slotEquals(WidgetInfo... slotWidgetInfo)
|
||||
{
|
||||
slots.addAll(Arrays.asList(slotWidgetInfo));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WidgetItem[] result(Client client)
|
||||
{
|
||||
Collection<WidgetItem> widgetItems = getEquippedItems(client);
|
||||
if (widgetItems != null)
|
||||
{
|
||||
return widgetItems.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(predicate)
|
||||
.toArray(WidgetItem[]::new);
|
||||
}
|
||||
return new WidgetItem[0];
|
||||
}
|
||||
|
||||
private Collection<WidgetItem> getEquippedItems(Client client)
|
||||
{
|
||||
Collection<WidgetItem> widgetItems = new ArrayList<>();
|
||||
Widget equipment = client.getWidget(WidgetInfo.EQUIPMENT);
|
||||
if (equipment != null && !equipment.isHidden())
|
||||
{
|
||||
if (slots.isEmpty())
|
||||
{
|
||||
slots.addAll(Arrays.asList(ALL_EQUIPMENT_WIDGET_INFOS));
|
||||
}
|
||||
for (WidgetInfo slot : slots)
|
||||
{
|
||||
Widget parentWidget = client.getWidget(slot);
|
||||
Widget itemWidget = parentWidget.getChild(1);
|
||||
// Check if background icon is hidden. if hidden, item is equipped.
|
||||
boolean equipped = parentWidget.getChild(2).isSelfHidden();
|
||||
// set bounds to same size as default inventory
|
||||
Rectangle bounds = itemWidget.getBounds();
|
||||
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
||||
// Index is set to 0 because there is no set in stone order of equipment slots
|
||||
widgetItems.add(new WidgetItem(equipped ? itemWidget.getItemId() : -1, itemWidget.getItemQuantity(), 0, bounds));
|
||||
}
|
||||
}
|
||||
return widgetItems;
|
||||
}
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Devin French <https://github.com/devinfrench>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.api.queries;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
public class InventoryWidgetItemQuery extends WidgetItemQuery
|
||||
{
|
||||
private static final WidgetInfo[] INVENTORY_WIDGET_INFOS =
|
||||
{
|
||||
WidgetInfo.DEPOSIT_BOX_INVENTORY_ITEMS_CONTAINER,
|
||||
WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER,
|
||||
WidgetInfo.SHOP_INVENTORY_ITEMS_CONTAINER,
|
||||
WidgetInfo.GRAND_EXCHANGE_INVENTORY_ITEMS_CONTAINER,
|
||||
WidgetInfo.GUIDE_PRICES_INVENTORY_ITEMS_CONTAINER,
|
||||
WidgetInfo.EQUIPMENT_INVENTORY_ITEMS_CONTAINER,
|
||||
WidgetInfo.INVENTORY
|
||||
};
|
||||
|
||||
@Override
|
||||
public WidgetItem[] result(Client client)
|
||||
{
|
||||
Collection<WidgetItem> widgetItems = getInventoryItems(client);
|
||||
if (widgetItems != null)
|
||||
{
|
||||
return widgetItems.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(predicate)
|
||||
.toArray(WidgetItem[]::new);
|
||||
}
|
||||
return new WidgetItem[0];
|
||||
}
|
||||
|
||||
private Collection<WidgetItem> getInventoryItems(Client client)
|
||||
{
|
||||
Collection<WidgetItem> widgetItems = new ArrayList<>();
|
||||
for (WidgetInfo widgetInfo : INVENTORY_WIDGET_INFOS)
|
||||
{
|
||||
Widget inventory = client.getWidget(widgetInfo);
|
||||
if (inventory == null || inventory.isHidden())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (widgetInfo == WidgetInfo.INVENTORY)
|
||||
{
|
||||
widgetItems.addAll(inventory.getWidgetItems());
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Widget[] children = inventory.getDynamicChildren();
|
||||
for (int i = 0; i < children.length; i++)
|
||||
{
|
||||
Widget child = children[i];
|
||||
// set bounds to same size as default inventory
|
||||
Rectangle bounds = child.getBounds();
|
||||
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
||||
widgetItems.add(new WidgetItem(child.getItemId(), child.getItemQuantity(), i, bounds));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return widgetItems;
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Devin French <https://github.com/devinfrench>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.api.queries;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ShopItemQuery extends WidgetItemQuery
|
||||
{
|
||||
@Override
|
||||
public WidgetItem[] result(Client client)
|
||||
{
|
||||
Collection<WidgetItem> widgetItems = getShopItems(client);
|
||||
if (widgetItems != null)
|
||||
{
|
||||
return widgetItems.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(predicate)
|
||||
.toArray(WidgetItem[]::new);
|
||||
}
|
||||
return new WidgetItem[0];
|
||||
}
|
||||
|
||||
private Collection<WidgetItem> getShopItems(Client client)
|
||||
{
|
||||
Collection<WidgetItem> widgetItems = new ArrayList<>();
|
||||
Widget shop = client.getWidget(WidgetInfo.SHOP_ITEMS_CONTAINER);
|
||||
if (shop != null && !shop.isHidden())
|
||||
{
|
||||
Widget[] children = shop.getDynamicChildren();
|
||||
for (int i = 1; i < children.length; i++)
|
||||
{
|
||||
Widget child = children[i];
|
||||
// set bounds to same size as default inventory
|
||||
Rectangle bounds = child.getBounds();
|
||||
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
||||
widgetItems.add(new WidgetItem(child.getItemId(), child.getItemQuantity(), i - 1, bounds));
|
||||
}
|
||||
}
|
||||
return widgetItems;
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Devin French <https://github.com/devinfrench>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.api.queries;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Query;
|
||||
import net.runelite.api.widgets.WidgetItem;
|
||||
|
||||
public abstract class WidgetItemQuery extends Query<WidgetItem, WidgetItemQuery>
|
||||
{
|
||||
|
||||
public WidgetItemQuery idEquals(int... ids)
|
||||
{
|
||||
predicate = and(item ->
|
||||
{
|
||||
for (int id : ids)
|
||||
{
|
||||
if (item.getId() == id)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public WidgetItemQuery indexEquals(int... indexes)
|
||||
{
|
||||
predicate = and(item ->
|
||||
{
|
||||
for (int index : indexes)
|
||||
{
|
||||
if (item.getIndex() == index)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
public WidgetItemQuery quantityEquals(int quantity)
|
||||
{
|
||||
predicate = and(item -> item.getQuantity() == quantity);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract WidgetItem[] result(Client client);
|
||||
}
|
||||
@@ -25,11 +25,15 @@
|
||||
package net.runelite.api.widgets;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import net.runelite.api.Point;
|
||||
|
||||
/**
|
||||
* An item that is being represented in a {@link Widget}.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class WidgetItem
|
||||
{
|
||||
private final int id;
|
||||
@@ -37,20 +41,6 @@ public class WidgetItem
|
||||
private final int index;
|
||||
private final Rectangle canvasBounds;
|
||||
|
||||
public WidgetItem(int id, int quantity, int index, Rectangle canvasBounds)
|
||||
{
|
||||
this.id = id;
|
||||
this.quantity = quantity;
|
||||
this.index = index;
|
||||
this.canvasBounds = canvasBounds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "WidgetItem{" + "id=" + id + ", quantity=" + quantity + ", index=" + index + ", canvasBounds=" + canvasBounds + '}';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ID of the item represented.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user