Merge pull request #606 from runelite-extended/clan-chat-merge

Updated Clan Chat Plugin - Merged remember clan into clanchat
This commit is contained in:
Tyler Bochard
2019-06-15 02:22:30 -04:00
committed by GitHub
4 changed files with 17 additions and 124 deletions

View File

@@ -137,4 +137,15 @@ public interface ClanChatConfig extends Config
{
return false;
}
@ConfigItem(
position = 9,
keyName = "clanname",
name = "Default Clan Name",
description = "Clan name to always remember"
)
default String clanname()
{
return "";
}
}

View File

@@ -68,6 +68,7 @@ import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.widgets.WidgetType;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.chat.ChatMessageBuilder;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.game.ClanManager;
@@ -111,6 +112,9 @@ public class ClanChatPlugin extends Plugin
@Inject
private ClientThread clientThread;
@Inject
private ChatMessageManager chatMessageManager;
private List<String> chats = new ArrayList<>();
@@ -267,6 +271,8 @@ public class ClanChatPlugin extends Plugin
return;
}
client.setVar(VarClientStr.RECENT_CLAN_CHAT, config.clanname());
Widget clanChatTitleWidget = client.getWidget(WidgetInfo.CLAN_CHAT_TITLE);
if (clanChatTitleWidget != null)
{

View File

@@ -1,48 +0,0 @@
/*
* Copyright (c) 2018, Infinitay <https://github.com/Infinitay>
* Copyright (c) 2018, Shaun Dreclin <https://github.com/ShaunDreclin>
*
* 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.rememberclan;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@ConfigGroup("rememberclan")
public interface RememberClanConfig extends Config
{
@ConfigItem(
position = 1,
keyName = "clanname",
name = "Clan Name",
description = "Clanname to always remember"
)
default String clanname()
{
return "";
}
}

View File

@@ -1,76 +0,0 @@
/*
* Copyright (c) 2018, Infinitay <https://github.com/Infinitay>
* Copyright (c) 2018, Shaun Dreclin <https://github.com/ShaunDreclin>
* 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.rememberclan;
import com.google.inject.Provides;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.VarClientStr;
import net.runelite.api.events.GameTick;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
@PluginDescriptor(
name = "Remember Clan",
description = "Remember a specific clan!",
type = PluginType.UTILITY,
enabledByDefault = false
)
public class RememberClanPlugin extends Plugin
{
@Inject
private Client client;
@Inject
private RememberClanConfig config;
@Inject
private ChatMessageManager chatMessageManager;
private boolean loggingIn;
@Provides
RememberClanConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(RememberClanConfig.class);
}
@Subscribe
public void onGameTick(GameTick event)
{
client.setVar(VarClientStr.RECENT_CLAN_CHAT, config.clanname());
}
}