Change name of RememberUsername plugin to UsernameSyncer
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.rememberusername;
|
package net.runelite.client.plugins.usernamesyncer;
|
||||||
|
|
||||||
import net.runelite.client.config.Config;
|
import net.runelite.client.config.Config;
|
||||||
import net.runelite.client.config.ConfigGroup;
|
import net.runelite.client.config.ConfigGroup;
|
||||||
@@ -30,10 +30,10 @@ import net.runelite.client.config.ConfigItem;
|
|||||||
|
|
||||||
@ConfigGroup(
|
@ConfigGroup(
|
||||||
keyName = "rememberusername",
|
keyName = "rememberusername",
|
||||||
name = "Remember Username",
|
name = "Username Syncer",
|
||||||
description = "Configuration for the remember username plugin"
|
description = "Syncs the username that is currently remembered between computers"
|
||||||
)
|
)
|
||||||
public interface RememberUsernameConfig extends Config
|
public interface UsernameSyncerConfig extends Config
|
||||||
{
|
{
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "username",
|
keyName = "username",
|
||||||
@@ -22,12 +22,11 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.rememberusername;
|
package net.runelite.client.plugins.usernamesyncer;
|
||||||
|
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.util.Objects;
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -39,16 +38,16 @@ import net.runelite.client.plugins.Plugin;
|
|||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Remember username"
|
name = "Username Syncer"
|
||||||
)
|
)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RememberUsernamePlugin extends Plugin
|
public class UsernameSyncerPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RememberUsernameConfig config;
|
private UsernameSyncerConfig config;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
@@ -57,9 +56,9 @@ public class RememberUsernamePlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
RememberUsernameConfig getConfig(ConfigManager configManager)
|
UsernameSyncerConfig getConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
return configManager.getConfig(RememberUsernameConfig.class);
|
return configManager.getConfig(UsernameSyncerConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -72,7 +71,7 @@ public class RememberUsernamePlugin extends Plugin
|
|||||||
else if (event.getGameState() == GameState.LOGGED_IN)
|
else if (event.getGameState() == GameState.LOGGED_IN)
|
||||||
{
|
{
|
||||||
String username = "";
|
String username = "";
|
||||||
|
|
||||||
if (client.getPreferences().getRememberedUsername() != null)
|
if (client.getPreferences().getRememberedUsername() != null)
|
||||||
{
|
{
|
||||||
username = client.getUsername();
|
username = client.getUsername();
|
||||||
Reference in New Issue
Block a user