Java Code Examples for net.runelite.api.widgets.Widget#isSelfHidden()

The following examples show how to use net.runelite.api.widgets.Widget#isSelfHidden() . 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: MinimapPlugin.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
private void updateMinimapWidgetVisibility(boolean enable)
{
	final Widget resizableStonesWidget = client.getWidget(WidgetInfo.RESIZABLE_MINIMAP_STONES_WIDGET);

	if (resizableStonesWidget != null)
	{
		resizableStonesWidget.setHidden(enable);
	}

	final Widget resizableNormalWidget = client.getWidget(WidgetInfo.RESIZABLE_MINIMAP_WIDGET);

	if (resizableNormalWidget != null && !resizableNormalWidget.isSelfHidden())
	{
		for (Widget widget : resizableNormalWidget.getStaticChildren())
		{
			if (widget.getId() != WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_LOGOUT_BUTTON.getId() &&
				widget.getId() != WidgetInfo.RESIZABLE_MINIMAP_LOGOUT_BUTTON.getId())
			{
				widget.setHidden(enable);
			}
		}
	}
}
 
Example 2
Source File: MinimapPlugin.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private void updateMinimapWidgetVisibility(boolean enable)
{
	final Widget resizableStonesWidget = client.getWidget(WidgetInfo.RESIZABLE_MINIMAP_STONES_WIDGET);

	if (resizableStonesWidget != null)
	{
		resizableStonesWidget.setHidden(enable);
	}

	final Widget resizableNormalWidget = client.getWidget(WidgetInfo.RESIZABLE_MINIMAP_WIDGET);

	if (resizableNormalWidget != null && !resizableNormalWidget.isSelfHidden())
	{
		for (Widget widget : resizableNormalWidget.getStaticChildren())
		{
			if (widget.getId() != WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_LOGOUT_BUTTON.getId() &&
				widget.getId() != WidgetInfo.RESIZABLE_MINIMAP_LOGOUT_BUTTON.getId())
			{
				widget.setHidden(enable);
			}
		}
	}
}
 
Example 3
Source File: Anonymizer.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
private void parseWidget(Widget widget)
{
	if (widget == null || widget.isHidden() || widget.isSelfHidden())
	{
		return;
	}

	if (widget.getText() != null && widget.getText().contains(name))
	{
		String text = widget.getText().replace(name, ANON);
		widget.setText(text);
		widget.revalidate();
	}
}
 
Example 4
Source File: TimersPlugin.java    From runelite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Subscribe
public void onGameTick(GameTick event)
{
	loggedInRace = false;

	Player player = client.getLocalPlayer();
	WorldPoint currentWorldPoint = player.getWorldLocation();

	if (freezeTimer != null)
	{
		// assume movement means unfrozen
		if (freezeTime != client.getTickCount()
			&& !currentWorldPoint.equals(lastPoint))
		{
			removeGameTimer(freezeTimer.getTimer());
			freezeTimer = null;
		}
	}

	lastPoint = currentWorldPoint;

	if (!widgetHiddenChangedOnPvpWorld)
	{
		return;
	}

	widgetHiddenChangedOnPvpWorld = false;

	Widget widget = client.getWidget(PVP_WORLD_SAFE_ZONE);
	if (widget != null
		&& !widget.isSelfHidden())
	{
		log.debug("Entered safe zone in PVP world, clearing Teleblock timer.");
		removeTbTimers();
	}
}
 
Example 5
Source File: TimersPlugin.java    From plugins with GNU General Public License v3.0 4 votes vote down vote up
@Subscribe
private void onGameTick(GameTick event)
{
	loggedInRace = false;

	Player player = client.getLocalPlayer();

	if (player == null)
	{
		return;
	}

	WorldPoint currentWorldPoint = player.getWorldLocation();

	final boolean isSkulled = player.getSkullIcon() != null && player.getSkullIcon() != SkullIcon.SKULL_FIGHT_PIT;

	if (isSkulled != skulledLastTick && config.showSkull())
	{
		skulledLastTick = isSkulled;
		if (isSkulled)
		{
			createGameTimer(SKULL);
		}
		else
		{
			removeGameTimer(SKULL);
		}
	}

	if (freezeTimer != null &&
		// assume movement means unfrozen
		freezeTime != client.getTickCount()
		&& !currentWorldPoint.equals(lastPoint))
	{
		removeGameTimer(freezeTimer.getTimer());
		freezeTimer = null;
	}

	lastPoint = currentWorldPoint;

	if (!widgetHiddenChangedOnPvpWorld)
	{
		return;
	}

	widgetHiddenChangedOnPvpWorld = false;

	Widget widget = client.getWidget(PVP_WORLD_SAFE_ZONE);
	if (widget != null
		&& !widget.isSelfHidden())
	{
		log.debug("Entered safe zone in PVP world, clearing Teleblock timer.");
		removeTbTimers();
	}
}
 
Example 6
Source File: KeyRemappingPlugin.java    From plugins with GNU General Public License v3.0 4 votes vote down vote up
private boolean isHidden(WidgetInfo widgetInfo)
{
	Widget w = client.getWidget(widgetInfo);
	return w == null || w.isSelfHidden();
}
 
Example 7
Source File: KeyRemappingPlugin.java    From runelite with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private boolean isHidden(WidgetInfo widgetInfo)
{
	Widget w = client.getWidget(widgetInfo);
	return w == null || w.isSelfHidden();
}