diff --git a/runelite-api/src/main/java/net/runelite/api/ModelID.java b/runelite-api/src/main/java/net/runelite/api/ModelID.java new file mode 100644 index 0000000000..0a2ea46816 --- /dev/null +++ b/runelite-api/src/main/java/net/runelite/api/ModelID.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018 Magic fTail + * 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; + +public final class ModelID +{ + public static final int ANVIL = 1251; + public static final int WILLOW_TREE = 1570; + public static final int SLAYER_SKILL_MODEL = 1733; + public static final int FIREMAKING_SKILL_MODEL = 2260; + public static final int STEEL_KITESHIELD = 2339; + public static final int PURE_ESSENCE = 2349; + public static final int RAW_TUNA = 2355; + public static final int CLEAN_HERB = 2364; + public static final int HAMMER = 2376; + public static final int BLUE_WIZARD_HAT = 2483; + public static final int CHISEL = 2489; + public static final int HIGHWAYMAN_MASK = 2500; + public static final int STEEL_PICKAXE = 2529; + public static final int SHORTBOW = 2562; + public static final int STEEL_LONGSWORD = 2602; + public static final int STEEL_SWORD = 2604; + public static final int STEEL_ARROW = 2711; + public static final int PRAYER_SKILL_MODEL = 3325; + public static final int STRENGTH_SKILL_MODEL = 3327; + public static final int AGILITY_SKILL_MODEL = 3328; + public static final int HEARTH = 3326; + public static final int WATERING_CAN = 7331; + public static final int SAW = 12309; + public static final int FOOTPRINT = 19980; + public static final int COOKING_SKILL_MODEL = 27611; +} \ No newline at end of file diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java b/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java index 55a51700a7..b8cb626ae6 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java @@ -242,13 +242,6 @@ public interface Widget */ void setName(String name); - /** - * Gets the model ID displayed in the widget. - * - * @return the model ID - */ - int getModelId(); - /** * Gets the sprite ID displayed in the widget. * @@ -294,6 +287,76 @@ public interface Widget */ int getIndex(); + /** + * Gets the model ID displayed in the widget. + * + * @return the model ID + */ + int getModelId(); + + /** + * Sets the model ID displayed in the widget + * + * @param modelId the new model ID + */ + void setModelId(int modelId); + + /** + * Gets the x rotation of the model displayed in the widget + * + * @return the x rotation + */ + int getRotationX(); + + /** + * Sets the x rotation of the model displayed in the widget + * + * @param rotationX 0 = no rotation, 2047 = full rotation, outside range = crash + */ + void setRotationX(int rotationX); + + /** + * Gets the y rotation of the model displayed in the widget + * + * @return the y rotation + */ + int getRotationY(); + + /** + * Sets the y rotation of the model displayed in the widget + * + * @param rotationY 0 = no rotation, 2047 = full rotation, outside range = crash + */ + void setRotationY(int rotationY); + + /** + * Gets the z rotation of the model displayed in the widget + * + * @return the z rotation + */ + int getRotationZ(); + + /** + * Sets the z rotation of the model displayed in the widget + * + * @param rotationZ 0 = no rotation, 2047 = full rotation, outside range = crash + */ + void setRotationZ(int rotationZ); + + /** + * Gets the amount zoomed in on the model displayed in the widget + * + * @return the amount zoomed in + */ + int getModelZoom(); + + /** + * Sets the amount zoomed in on the model displayed in the widget + * + * @param modelZoom the new zoom amount + */ + void setModelZoom(int modelZoom); + /** * Gets the location the widget is being drawn on the canvas. *
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java
index a4a82072fe..c8a41586f4 100644
--- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java
@@ -76,6 +76,7 @@ import net.runelite.api.util.Text;
import net.runelite.api.widgets.Widget;
import static net.runelite.api.widgets.WidgetID.BARROWS_REWARD_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.CHAMBERS_OF_XERIC_REWARD_GROUP_ID;
+import static net.runelite.api.widgets.WidgetID.CHATBOX_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.CLUE_SCROLL_REWARD_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.DIALOG_SPRITE_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.KINGDOM_GROUP_ID;
@@ -303,11 +304,11 @@ public class ScreenshotPlugin extends Plugin
String fileName = null;
if (client.getWidget(WidgetInfo.LEVEL_UP_LEVEL) != null)
{
- fileName = parseLevelUpWidget(WidgetInfo.LEVEL_UP_LEVEL);
+ fileName = parseLevelUpWidget(client.getWidget(WidgetInfo.LEVEL_UP_LEVEL));
}
else if (client.getWidget(WidgetInfo.DIALOG_SPRITE_TEXT) != null)
{
- fileName = parseLevelUpWidget(WidgetInfo.DIALOG_SPRITE_TEXT);
+ fileName = parseLevelUpWidget(client.getWidget(WidgetInfo.DIALOG_SPRITE_TEXT));
}
else if (client.getWidget(WidgetInfo.QUEST_COMPLETED_NAME_TEXT) != null)
{
@@ -315,6 +316,10 @@ public class ScreenshotPlugin extends Plugin
String text = client.getWidget(WidgetInfo.QUEST_COMPLETED_NAME_TEXT).getText();
fileName = "Quest(" + text.substring(19, text.length() - 1) + ")";
}
+ else if (client.getWidget(WidgetInfo.CHATBOX_CONTAINER).getChild(1) != null)
+ {
+ fileName = parseLevelUpWidget(client.getWidget(WidgetInfo.CHATBOX_CONTAINER).getChild(1));
+ }
if (fileName != null)
{
@@ -485,6 +490,7 @@ public class ScreenshotPlugin extends Plugin
break;
case LEVEL_UP_GROUP_ID:
case DIALOG_SPRITE_GROUP_ID:
+ case CHATBOX_GROUP_ID:
if (!this.screenshotLevels)
{
return;
@@ -549,6 +555,7 @@ public class ScreenshotPlugin extends Plugin
case LEVEL_UP_GROUP_ID:
case DIALOG_SPRITE_GROUP_ID:
case QUEST_COMPLETED_GROUP_ID:
+ case CHATBOX_GROUP_ID:
{
// level up widget gets loaded prior to the text being set, so wait until the next tick
shouldTakeScreenshot = true;
@@ -574,22 +581,21 @@ public class ScreenshotPlugin extends Plugin
}
/**
- * Receives a WidgetInfo pointing to the middle widget of the level-up dialog,
+ * Receives a Widget containing the level-up dialog,
* and parses it into a shortened string for filename usage.
*
- * @param levelUpLevel WidgetInfo pointing to the required text widget,
- * with the format "Your Skill (level is/are) now 99."
+ * @param levelUpWidget Widget containing the level-up text,
+ * with the format "Your Skill (level is/are) now 99."
* @return Shortened string in the format "Skill(99)"
*/
- String parseLevelUpWidget(WidgetInfo levelUpLevel)
+ String parseLevelUpWidget(Widget levelUpWidget)
{
- Widget levelChild = client.getWidget(levelUpLevel);
- if (levelChild == null)
+ if (levelUpWidget == null)
{
return null;
}
- Matcher m = LEVEL_UP_PATTERN.matcher(levelChild.getText());
+ Matcher m = LEVEL_UP_PATTERN.matcher(levelUpWidget.getText());
if (!m.matches())
{
return null;
diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/virtuallevels/SkillModel.java b/runelite-client/src/main/java/net/runelite/client/plugins/virtuallevels/SkillModel.java
new file mode 100644
index 0000000000..dceeccde42
--- /dev/null
+++ b/runelite-client/src/main/java/net/runelite/client/plugins/virtuallevels/SkillModel.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2018, Magic fTail
+ * 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.client.plugins.virtuallevels;
+
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.ListMultimap;
+import java.util.List;
+import lombok.Getter;
+import net.runelite.api.ModelID;
+import net.runelite.api.Skill;
+
+@Getter
+public enum SkillModel
+{
+ CONSTRUCTION1(Skill.CONSTRUCTION, ModelID.HAMMER, 10, 14, 669, 15, 0, 329),
+ CONSTRUCTION2(Skill.CONSTRUCTION, ModelID.SAW, 11, 14, 615, 111, 0, 451),
+ COOKING(Skill.COOKING, ModelID.COOKING_SKILL_MODEL, 31, 59, 169, 1593, 0, 963),
+ CRAFTING1(Skill.CRAFTING, ModelID.HAMMER, 30, 24, 418, 14, 0, 496),
+ CRAFTING2(Skill.CRAFTING, ModelID.CHISEL, 39, 45, 353, 18, 0, 400),
+ DEFENCE(Skill.DEFENCE, ModelID.STEEL_KITESHIELD, 34, 37, 337, 1074, 0, 598),
+ FARMING(Skill.FARMING, ModelID.WATERING_CAN, 31, 52, 118, 1278, 0, 451),
+ FIREMAKING(Skill.FIREMAKING, ModelID.FIREMAKING_SKILL_MODEL, 29, 55, 115, 1689, 0, 771),
+ FISHING(Skill.FISHING, ModelID.RAW_TUNA, 33, 30, 351, 1865, 0, 517),
+ FLETCHING1(Skill.FLETCHING, ModelID.STEEL_ARROW, 43, 19, 254, 1257, 0, 408),
+ FLETCHING2(Skill.FLETCHING, ModelID.STEEL_ARROW, 46, 44, 223, 177, 0, 444),
+ HERBLORE(Skill.HERBLORE, ModelID.CLEAN_HERB, 20, 35, 550, 2024, 0, 344),
+ HITPOINTS(Skill.HITPOINTS, ModelID.HEARTH, 35, 58, 538, 0, 0, 250),
+ MAGIC(Skill.MAGIC, ModelID.BLUE_WIZARD_HAT, 29, 50, 131, 1913, 0, 344),
+ MINING(Skill.MINING, ModelID.STEEL_PICKAXE, 38, 33, 292, 1166, 0, 413),
+ PRAYER(Skill.PRAYER, ModelID.PRAYER_SKILL_MODEL, 29, 27, 582, 504, 0, 505),
+ RANGED1(Skill.RANGED, ModelID.STEEL_ARROW, 28, 34, 206, 195, 0, 405),
+ RANGED2(Skill.RANGED, ModelID.SHORTBOW, 42, 17, 422, 1618, 0, 397),
+ RUNECRAFT(Skill.RUNECRAFT, ModelID.PURE_ESSENCE, 35, 38, 242, 1979, 0, 328),
+ SLAYER(Skill.SLAYER, ModelID.SLAYER_SKILL_MODEL, 34, 60, 221, 1944, 0, 649),
+ SMITHING(Skill.SMITHING, ModelID.ANVIL, 34, 53, 97, 1868, 0, 716),
+ STRENGTH(Skill.STRENGTH, ModelID.STRENGTH_SKILL_MODEL, 35, 23, 512, 14, 0, 631),
+ AGILITY(Skill.AGILITY, ModelID.AGILITY_SKILL_MODEL, 29, 29, 533, 2040, 0, 685),
+ THIEVING(Skill.THIEVING, ModelID.HIGHWAYMAN_MASK, 42, 31, 366, 55, 0, 155),
+ WOODCUTTING(Skill.WOODCUTTING, ModelID.WILLOW_TREE, 20, 69, 116, 1978, 0, 1800),
+ ATTACK1(Skill.ATTACK, ModelID.STEEL_SWORD, 65, 38, 234, 148, 0, 444),
+ ATTACK2(Skill.ATTACK, ModelID.STEEL_LONGSWORD, 27, 29, 198, 1419, 0, 330),
+ HUNTER(Skill.HUNTER, ModelID.FOOTPRINT, 45, 48, 512, 0, 0, 1000);
+
+ private static final ListMultimap
";
+ private static final int X_OFFSET = 13;
+ private static final int Y_OFFSET = 16;
+
+ private final Map
Your Hunter level is now 2.");
- assertEquals("Hunter(2)", screenshotPlugin.parseLevelUpWidget(DIALOG_SPRITE_TEXT));
+ assertEquals("Hunter(2)", screenshotPlugin.parseLevelUpWidget(client.getWidget(DIALOG_SPRITE_TEXT)));
WidgetLoaded event = new WidgetLoaded();
event.setGroupId(DIALOG_SPRITE_GROUP_ID);
diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSWidget.java b/runescape-api/src/main/java/net/runelite/rs/api/RSWidget.java
index 78ec802de9..589074b78b 100644
--- a/runescape-api/src/main/java/net/runelite/rs/api/RSWidget.java
+++ b/runescape-api/src/main/java/net/runelite/rs/api/RSWidget.java
@@ -73,6 +73,10 @@ public interface RSWidget extends Widget
@Override
int getModelId();
+ @Import("modelId")
+ @Override
+ void setModelId(int modelId);
+
@Import("itemIds")
int[] getItemIds();
@@ -160,14 +164,37 @@ public interface RSWidget extends Widget
@Import("childIndex")
void setIndex(int index);
- //@Import("rotationX")
- //int getRotationX();
+ @Import("modelAngleX")
+ @Override
+ int getRotationX();
- //@Import("rotationY") --- All unused
- //int getRotationY();
+ @Import("modelAngleX")
+ @Override
+ void setRotationX(int rotationX);
- //@Import("rotationZ")
- //int getRotationZ();
+ @Import("modelAngleY")
+ @Override
+ int getRotationY();
+
+ @Import("modelAngleY")
+ @Override
+ void setRotationY(int rotationY);
+
+ @Import("modelAngleZ")
+ @Override
+ int getRotationZ();
+
+ @Import("modelAngleZ")
+ @Override
+ void setRotationZ(int rotationZ);
+
+ @Import("modelZoom")
+ @Override
+ int getModelZoom();
+
+ @Import("modelZoom")
+ @Override
+ void setModelZoom(int modelZoom);
@Import("contentType")
@Override