net.runelite.api.SpriteID Java Examples
The following examples show how to use
net.runelite.api.SpriteID.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PoisonActorOverlay.java From plugins with GNU General Public License v3.0 | 6 votes |
private void renderOverlayFor(Graphics2D g, Actor actor, int damage, String timeLeft, boolean venomed) { BufferedImage splat = plugin.getSplat(venomed ? SpriteID.HITSPLAT_DARK_GREEN_VENOM : SpriteID.HITSPLAT_GREEN_POISON, damage); LocalPoint localLocation = actor.getLocalLocation(); if (localLocation == null) { return; } Point overlayLocation = Perspective.getCanvasImageLocation(client, localLocation, splat, 0); if (overlayLocation == null) { return; } int textOffset = splat.getHeight() - (splat.getHeight() - fontSize) / 2; Point textLocation = new Point(overlayLocation.getX() + splat.getWidth() + 3, overlayLocation.getY() + textOffset); g.drawImage(splat, overlayLocation.getX(), overlayLocation.getY(), null); OverlayUtil.renderTextLocation(g, textLocation, timeLeft, Color.WHITE); }
Example #2
Source File: BarrowsPlugin.java From runelite with BSD 2-Clause "Simplified" License | 6 votes |
private void startPrayerDrainTimer() { if (config.showPrayerDrainTimer()) { final LoopTimer loopTimer = new LoopTimer( PRAYER_DRAIN_INTERVAL_MS, ChronoUnit.MILLIS, null, this, true); spriteManager.getSpriteAsync(SpriteID.TAB_PRAYER, 0, loopTimer); loopTimer.setPriority(InfoBoxPriority.MED); loopTimer.setTooltip("Prayer Drain"); infoBoxManager.addInfoBox(loopTimer); barrowsPrayerDrainTimer = loopTimer; } }
Example #3
Source File: BarrowsPlugin.java From plugins with GNU General Public License v3.0 | 6 votes |
private void startPrayerDrainTimer() { if (config.showPrayerDrainTimer()) { final LoopTimer loopTimer = new LoopTimer( PRAYER_DRAIN_INTERVAL_MS, ChronoUnit.MILLIS, null, this, true); spriteManager.getSpriteAsync(SpriteID.TAB_PRAYER, 0, loopTimer); loopTimer.setPriority(InfoBoxPriority.MED); loopTimer.setTooltip("Prayer Drain"); infoBoxManager.addInfoBox(loopTimer); barrowsPrayerDrainTimer = loopTimer; } }
Example #4
Source File: PlayerInfoPlugin.java From plugins with GNU General Public License v3.0 | 6 votes |
@Override protected void startUp() { clientThread.invoke(() -> { if (client.getGameState().ordinal() < GameState.LOGIN_SCREEN.ordinal()) { return false; } BufferedImage healthImg = spriteManager.getSprite(SpriteID.MINIMAP_ORB_HITPOINTS_ICON, 0); BufferedImage prayerImg = spriteManager.getSprite(SpriteID.MINIMAP_ORB_PRAYER_ICON, 0); BufferedImage energyImg = spriteManager.getSprite(SpriteID.MINIMAP_ORB_RUN_ICON, 0); BufferedImage combatImg = spriteManager.getSprite(SpriteID.MINIMAP_ORB_SPECIAL_ICON, 0); BufferedImage worldImg = spriteManager.getSprite(SpriteID.MINIMAP_ORB_WORLD_MAP_PLANET, 0); infoBoxManager.addInfoBox(new PlayerInfoCustomIndicator(healthImg, this, config, client, IndicatorType.HEALTH)); infoBoxManager.addInfoBox(new PlayerInfoCustomIndicator(prayerImg, this, config, client, IndicatorType.PRAYER)); infoBoxManager.addInfoBox(new PlayerInfoCustomIndicator(energyImg, this, config, client, IndicatorType.ENERGY)); infoBoxManager.addInfoBox(new PlayerInfoCustomIndicator(combatImg, this, config, client, IndicatorType.SPECIAL)); infoBoxManager.addInfoBox(new PlayerInfoCustomIndicator(worldImg, this, config, client, IndicatorType.WORLD)); return true; }); }
Example #5
Source File: MusicPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
private void addMusicButtons() { Widget header = client.getWidget(WidgetInfo.MUSIC_WINDOW); if (header == null) { return; } header.deleteAllChildren(); //Creation of the search and toggle status buttons musicSearchButton = header.createChild(-1, WidgetType.GRAPHIC); musicSearchButton.setSpriteId(SpriteID.GE_SEARCH); musicSearchButton.setOriginalWidth(18); musicSearchButton.setOriginalHeight(17); musicSearchButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); musicSearchButton.setOriginalX(5); musicSearchButton.setOriginalY(32); musicSearchButton.setHasListener(true); musicSearchButton.setAction(1, "Open"); musicSearchButton.setOnOpListener((JavaScriptCallback) e -> openSearch()); musicSearchButton.setName("Search"); musicSearchButton.revalidate(); musicFilterButton = header.createChild(-1, WidgetType.GRAPHIC); musicFilterButton.setSpriteId(SpriteID.MINIMAP_ORB_PRAYER); musicFilterButton.setOriginalWidth(15); musicFilterButton.setOriginalHeight(15); musicFilterButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); musicFilterButton.setOriginalX(25); musicFilterButton.setOriginalY(34); musicFilterButton.setHasListener(true); musicFilterButton.setAction(1, "Toggle"); musicFilterButton.setOnOpListener((JavaScriptCallback) e -> toggleStatus()); musicFilterButton.setName("All"); musicFilterButton.revalidate(); }
Example #6
Source File: ItemStatPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
private static void createSeparator(Widget parent, int y) { Widget separator = parent.createChild(-1, WidgetType.GRAPHIC); separator.setOriginalWidth(parent.getWidth()); separator.setOriginalY(y); separator.setOriginalHeight(32); separator.setSpriteId(SpriteID.UNKNOWN_BORDER_EDGE_HORIZONTAL_995); separator.revalidate(); }
Example #7
Source File: PoisonPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
private void checkHealthIcon() { if (!config.changeHealthIcon()) { return; } final BufferedImage newHeart; final int poison = client.getVar(VarPlayer.IS_POISONED); if (poison >= VENOM_THRESHOLD) { newHeart = HEART_VENOM; } else if (poison > 0) { newHeart = HEART_POISON; } else if (client.getVar(VarPlayer.DISEASE_VALUE) > 0) { newHeart = HEART_DISEASE; } else { resetHealthIcon(); return; } // Only update sprites when the heart icon actually changes if (newHeart != heart) { heart = newHeart; client.getWidgetSpriteCache().reset(); client.getSpriteOverrides().put(SpriteID.MINIMAP_ORB_HITPOINTS_ICON, ImageUtil.getImageSpritePixels(heart, client)); } }
Example #8
Source File: PoisonPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
private void checkHealthIcon() { if (!config.changeHealthIcon()) { return; } final BufferedImage newHeart; final int poison = client.getVar(VarPlayer.IS_POISONED); if (poison >= VENOM_THRESHOLD) { newHeart = HEART_VENOM; } else if (poison > 0) { newHeart = HEART_POISON; } else if (client.getVar(VarPlayer.DISEASE_VALUE) > 0) { newHeart = HEART_DISEASE; } else { resetHealthIcon(); return; } // Only update sprites when the heart icon actually changes if (newHeart != null && !newHeart.equals(heart)) { heart = newHeart; client.getWidgetSpriteCache().reset(); client.getSpriteOverrides().put(SpriteID.MINIMAP_ORB_HITPOINTS_ICON, ImageUtil.getImageSprite(heart, client)); } }
Example #9
Source File: PoisonPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
private void resetHealthIcon() { if (heart == null) { return; } client.getWidgetSpriteCache().reset(); client.getSpriteOverrides().remove(SpriteID.MINIMAP_ORB_HITPOINTS_ICON); heart = null; }
Example #10
Source File: FriendsChatPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
private void addCounter() { if (!config.showCounter() || membersIndicator != null || members.isEmpty()) { return; } final BufferedImage image = spriteManager.getSprite(SpriteID.TAB_FRIENDS_CHAT, 0); membersIndicator = new MembersIndicator(image, this); infoBoxManager.addInfoBox(membersIndicator); }
Example #11
Source File: WikiPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
private void onDeselect() { client.setAllWidgetsAreOpTargetable(false); wikiSelected = false; if (icon != null) { icon.setSpriteId(SpriteID.WIKI_DESELECTED); } }
Example #12
Source File: VirtualLevelsPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
@Override protected void startUp() throws Exception { clientThread.invoke(this::initializePreviousXpMap); overlayManager.add(overlay); spriteManager.getSpriteAsync(SpriteID.CHATBOX_REPORT_BUTTON, 0, s -> reportButton = s); }
Example #13
Source File: InterfaceStylesPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
private void removeGameframe() { restoreSprites(); restoreWidgetSprites(); BufferedImage compassImage = spriteManager.getSprite(SpriteID.COMPASS_TEXTURE, 0); if (compassImage != null) { SpritePixels compass = ImageUtil.getImageSpritePixels(compassImage, client); client.setCompass(compass); } }
Example #14
Source File: ItemStatPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
private static void createSeparator(Widget parent, int y) { Widget separator = parent.createChild(-1, WidgetType.GRAPHIC); separator.setOriginalWidth(parent.getWidth()); separator.setOriginalY(y); separator.setOriginalHeight(32); separator.setSpriteId(SpriteID.UNKNOWN_BORDER_EDGE_HORIZONTAL_995); separator.revalidate(); }
Example #15
Source File: TabInterface.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
private void openTag(final String tag) { bankSearch.search(InputType.SEARCH, TAG_SEARCH + tag, true); activateTab(tabManager.find(tag)); // When tab is selected with search window open, the search window closes but the search button // stays highlighted, this solves that issue Widget searchBackground = client.getWidget(WidgetInfo.BANK_SEARCH_BUTTON_BACKGROUND); searchBackground.setSpriteId(SpriteID.EQUIPMENT_SLOT_TILE); }
Example #16
Source File: FairyRingPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
@Subscribe public void onWidgetLoaded(WidgetLoaded widgetLoaded) { if (widgetLoaded.getGroupId() == WidgetID.FAIRY_RING_PANEL_GROUP_ID) { setWidgetTextToDestination(); Widget header = client.getWidget(WidgetInfo.FAIRY_RING_HEADER); if (header != null) { searchBtn = header.createChild(-1, WidgetType.GRAPHIC); searchBtn.setSpriteId(SpriteID.GE_SEARCH); searchBtn.setOriginalWidth(17); searchBtn.setOriginalHeight(17); searchBtn.setOriginalX(11); searchBtn.setOriginalY(11); searchBtn.setHasListener(true); searchBtn.setAction(1, MENU_OPEN); searchBtn.setOnOpListener((JavaScriptCallback) this::menuOpen); searchBtn.setName("Search"); searchBtn.revalidate(); codes = null; if (config.autoOpen()) { openSearch(); } } } }
Example #17
Source File: ScreenshotPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
@Override protected void startUp() throws Exception { overlayManager.add(screenshotOverlay); SCREENSHOT_DIR.mkdirs(); keyManager.registerKeyListener(hotkeyListener); final BufferedImage iconImage = ImageUtil.getResourceStreamFromClass(getClass(), "screenshot.png"); titleBarButton = NavigationButton.builder() .tab(false) .tooltip("Take screenshot") .icon(iconImage) .onClick(this::manualScreenshot) .popup(ImmutableMap .<String, Runnable>builder() .put("Open screenshot folder...", () -> { LinkBrowser.open(SCREENSHOT_DIR.toString()); }) .build()) .build(); clientToolbar.addNavigation(titleBarButton); spriteManager.getSpriteAsync(SpriteID.CHATBOX_REPORT_BUTTON, 0, s -> reportButton = s); }
Example #18
Source File: FriendsChatPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
private void addCounter() { if (!config.showCounter() || membersIndicator != null || members.isEmpty()) { return; } final BufferedImage image = spriteManager.getSprite(SpriteID.TAB_FRIENDS_CHAT, 0); membersIndicator = new MembersIndicator(image, this); infoBoxManager.addInfoBox(membersIndicator); }
Example #19
Source File: QuestListPlugin.java From runelite with BSD 2-Clause "Simplified" License | 5 votes |
private void addQuestButtons() { Widget header = client.getWidget(WidgetInfo.QUESTLIST_BOX); if (header != null) { header.deleteAllChildren(); questSearchButton = header.createChild(-1, WidgetType.GRAPHIC); questSearchButton.setSpriteId(SpriteID.GE_SEARCH); questSearchButton.setOriginalWidth(18); questSearchButton.setOriginalHeight(17); questSearchButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); questSearchButton.setOriginalX(5); questSearchButton.setOriginalY(0); questSearchButton.setHasListener(true); questSearchButton.setAction(1, MENU_OPEN); questSearchButton.setOnOpListener((JavaScriptCallback) e -> openSearch()); questSearchButton.setName(MENU_SEARCH); questSearchButton.revalidate(); questHideButton = header.createChild(-1, WidgetType.GRAPHIC); redrawHideButton(); questHideButton.setOriginalWidth(13); questHideButton.setOriginalHeight(13); questHideButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); questHideButton.setOriginalX(24); questHideButton.setOriginalY(2); questHideButton.setHasListener(true); questHideButton.setOnOpListener((JavaScriptCallback) e -> toggleHidden()); questHideButton.setAction(1, MENU_TOGGLE); questHideButton.revalidate(); questSet = new EnumMap<>(QuestContainer.class); updateFilter(); } }
Example #20
Source File: StatusOrbsPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
/** * Check player afflictions to determine health icon */ private void checkHealthIcon() { BufferedImage newHeart; int poison = client.getVar(VarPlayer.IS_POISONED); if (poison >= 1000000) { newHeart = HEART_VENOM; } else if (poison > 0) { newHeart = HEART_POISON; } else if (client.getVar(VarPlayer.DISEASE_VALUE) > 0) { newHeart = HEART_DISEASE; } else { heart = null; resetHealthIcon(); return; } // Only update sprites when the heart icon actually changes if (newHeart != heart) { heart = newHeart; client.getWidgetSpriteCache().reset(); client.getSpriteOverrides().put(SpriteID.MINIMAP_ORB_HITPOINTS_ICON, ImageUtil.getImageSprite(heart, client)); } }
Example #21
Source File: WikiPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
private void onDeselect() { client.setAllWidgetsAreOpTargetable(false); wikiSelected = false; if (icon != null) { icon.setSpriteId(SpriteID.WIKI_DESELECTED); } }
Example #22
Source File: MusicPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
private void addMusicButtons() { Widget header = client.getWidget(WidgetInfo.MUSIC_WINDOW); if (header == null) { return; } header.deleteAllChildren(); //Creation of the search and toggle status buttons musicSearchButton = header.createChild(-1, WidgetType.GRAPHIC); musicSearchButton.setSpriteId(SpriteID.GE_SEARCH); musicSearchButton.setOriginalWidth(18); musicSearchButton.setOriginalHeight(17); musicSearchButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); musicSearchButton.setOriginalX(5); musicSearchButton.setOriginalY(32); musicSearchButton.setHasListener(true); musicSearchButton.setAction(1, "Open"); musicSearchButton.setOnOpListener((JavaScriptCallback) e -> openSearch()); musicSearchButton.setName("Search"); musicSearchButton.revalidate(); musicFilterButton = header.createChild(-1, WidgetType.GRAPHIC); musicFilterButton.setSpriteId(SpriteID.MINIMAP_ORB_PRAYER); musicFilterButton.setOriginalWidth(15); musicFilterButton.setOriginalHeight(15); musicFilterButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); musicFilterButton.setOriginalX(25); musicFilterButton.setOriginalY(34); musicFilterButton.setHasListener(true); musicFilterButton.setAction(1, "Toggle"); musicFilterButton.setOnOpListener((JavaScriptCallback) e -> toggleStatus()); musicFilterButton.setName("All"); musicFilterButton.revalidate(); }
Example #23
Source File: SlayerPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
@Override protected void startUp() { weaknessOverlayAttached = false; overlayManager.add(overlay); overlayManager.add(targetClickboxOverlay); overlayManager.add(targetMinimapOverlay); if (slayerXpDropLookup == null) { // create this in startup since it needs to pull files during creation slayerXpDropLookup = new SlayerXpDropLookup(); } panel = new SlayerTaskPanel(this); spriteManager.getSpriteAsync(SpriteID.SKILL_SLAYER, 0, panel::loadHeaderIcon); final BufferedImage icon = ImageUtil.getResourceStreamFromClass(getClass(), "panel_icon.png"); navButton = NavigationButton.builder() .tooltip("Slayer Tracker") .icon(icon) .priority(6) .panel(panel) .build(); clientToolbar.addNavigation(navButton); if (client.getGameState() == GameState.LOGGED_IN) { cachedXp = client.getSkillExperience(SLAYER); } chatCommandManager.registerCommandAsync(TASK_COMMAND_STRING, this::taskLookup, this::taskSubmit); chatCommandManager.registerCommandAsync(POINTS_COMMAND_STRING, this::pointsLookup); //here }
Example #24
Source File: BronzeManPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
private void createSearchButton(Widget header) { searchButton = header.createChild(-1, WidgetType.GRAPHIC); searchButton.setSpriteId(SpriteID.GE_SEARCH); searchButton.setOriginalWidth(18); searchButton.setOriginalHeight(17); searchButton.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT); searchButton.setOriginalX(5); searchButton.setOriginalY(20); searchButton.setHasListener(true); searchButton.setAction(1, "Open"); searchButton.setOnOpListener((JavaScriptCallback) e -> openSearch()); searchButton.setName("Search"); searchButton.revalidate(); }
Example #25
Source File: SpecialAttackRenderer.java From plugins with GNU General Public License v3.0 | 5 votes |
@Override protected void update(Client client, StatusBarsOverlay overlay) { icon = spriteManager.getSprite(SpriteID.MINIMAP_ORB_SPECIAL_ICON, 0); currentValue = client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT) / 10; restore = 0; }
Example #26
Source File: EnergyRenderer.java From plugins with GNU General Public License v3.0 | 5 votes |
@Override protected void update(Client client, StatusBarsOverlay overlay) { icon = spriteManager.getSprite(SpriteID.MINIMAP_ORB_RUN_ICON, 0); currentValue = client.getEnergy(); restore = overlay.getRestoreValue("Run Energy"); }
Example #27
Source File: InterfaceStylesPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
private void removeGameframe() { restoreSprites(); restoreWidgetSprites(); BufferedImage compassImage = spriteManager.getSprite(SpriteID.COMPASS_TEXTURE, 0); if (compassImage != null) { Sprite compass = ImageUtil.getImageSprite(compassImage, client); client.setCompass(compass); } }
Example #28
Source File: TabInterface.java From plugins with GNU General Public License v3.0 | 5 votes |
private void openTag(final String tag) { activateTab(tabManager.find(tag)); bankSearch.search(InputType.SEARCH, TAG_SEARCH + tag, true); // When tab is selected with search window open, the search window closes but the search button // stays highlighted, this solves that issue Widget searchBackground = client.getWidget(WidgetInfo.BANK_SEARCH_BUTTON_BACKGROUND); searchBackground.setSpriteId(SpriteID.EQUIPMENT_SLOT_TILE); }
Example #29
Source File: FairyRingPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
@Subscribe private void onWidgetLoaded(WidgetLoaded widgetLoaded) { if (widgetLoaded.getGroupId() == WidgetID.FAIRY_RING_PANEL_GROUP_ID) { setWidgetTextToDestination(); Widget header = client.getWidget(WidgetInfo.FAIRY_RING_HEADER); if (header != null) { searchBtn = header.createChild(-1, WidgetType.GRAPHIC); searchBtn.setSpriteId(SpriteID.GE_SEARCH); searchBtn.setOriginalWidth(17); searchBtn.setOriginalHeight(17); searchBtn.setOriginalX(11); searchBtn.setOriginalY(11); searchBtn.setHasListener(true); searchBtn.setAction(1, MENU_OPEN); searchBtn.setOnOpListener((JavaScriptCallback) this::menuOpen); searchBtn.setName("Search"); searchBtn.revalidate(); codes = null; if (config.autoOpen()) { openSearch(); } } } }
Example #30
Source File: ScreenshotPlugin.java From plugins with GNU General Public License v3.0 | 5 votes |
@Override protected void startUp() { overlayManager.add(screenshotOverlay); SCREENSHOT_DIR.mkdirs(); keyManager.registerKeyListener(hotkeyListener); final BufferedImage iconImage = ImageUtil.getResourceStreamFromClass(getClass(), "screenshot.png"); titleBarButton = NavigationButton.builder() .tab(false) .tooltip("Take screenshot") .icon(iconImage) .onClick(this::manualScreenshot) .popup(ImmutableMap .<String, Runnable>builder() .put("Open screenshot folder...", () -> { LinkBrowser.open(SCREENSHOT_DIR.toString()); }) .build()) .build(); clientToolbar.addNavigation(titleBarButton); spriteManager.getSpriteAsync(SpriteID.CHATBOX_REPORT_BUTTON, 0, s -> reportButton = s); }