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

The following examples show how to use net.runelite.api.widgets.Widget#setChildren() . 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: FriendsChatPlugin.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
private void resetChats()
{
	Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
	Widget chatTitleWidget = client.getWidget(WidgetInfo.FRIENDS_CHAT_TITLE);

	if (chatList == null)
	{
		return;
	}

	FriendsChatManager friendsChatManager = client.getFriendsChatManager();
	if (friendsChatManager == null || friendsChatManager.getCount() == 0)
	{
		chatList.setChildren(null);
	}

	chatTitleWidget.setText(TITLE);
}
 
Example 2
Source File: FriendsChatPlugin.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private void resetChats()
{
	Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
	Widget chatTitleWidget = client.getWidget(WidgetInfo.FRIENDS_CHAT_TITLE);

	if (chatList == null)
	{
		return;
	}

	FriendsChatManager friendsChatManager = client.getFriendsChatManager();
	if (friendsChatManager == null || friendsChatManager.getCount() == 0)
	{
		chatList.setChildren(null);
	}

	chatTitleWidget.setText(TITLE);
}
 
Example 3
Source File: FriendsChatPlugin.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
private void loadFriendsChats()
{
	Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
	if (chatList == null)
	{
		return;
	}

	int y = 2;
	chatList.setChildren(null);
	for (String chat : Lists.reverse(chats))
	{
		Widget widget = chatList.createChild(-1, WidgetType.TEXT);
		widget.setFontId(494);
		widget.setTextColor(0xffffff);
		widget.setText(chat);
		widget.setOriginalHeight(14);
		widget.setOriginalWidth(142);
		widget.setOriginalY(y);
		widget.setOriginalX(20);
		widget.revalidate();

		y += 14;
	}
}
 
Example 4
Source File: FriendsChatPlugin.java    From plugins with GNU General Public License v3.0 5 votes vote down vote up
private void loadFriendsChats()
{
	Widget chatList = client.getWidget(WidgetInfo.FRIENDS_CHAT_LIST);
	if (chatList == null)
	{
		return;
	}

	int y = 2;
	chatList.setChildren(null);
	for (String chat : Lists.reverse(chats))
	{
		Widget widget = chatList.createChild(-1, WidgetType.TEXT);
		widget.setFontId(494);
		widget.setHasListener(true);

		widget.setTextColor(0xffffff);
		widget.setText(chat);
		widget.setTextShadowed(true);
		widget.setBorderType(1);
		widget.setAction(0, String.format("Join %s", chat));
		widget.setOnOpListener(ScriptID.CUSTOM_JOIN_CLAN, widget.getText());
		widget.setOriginalHeight(14);
		widget.setOriginalWidth(142);
		widget.setOriginalY(y);
		widget.setOriginalX(20);
		widget.revalidate();

		y += 14;
	}
}