Revert Performance refactor
Ping will be broken off into it's own plugin at a later time.
This commit is contained in:
@@ -22,14 +22,14 @@
|
||||
* (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.performance;
|
||||
package net.runelite.client.plugins.fps;
|
||||
|
||||
import net.runelite.client.config.Config;
|
||||
import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
|
||||
@ConfigGroup(PerformancePlugin.CONFIG_GROUP_KEY)
|
||||
public interface PerformanceConfig extends Config
|
||||
@ConfigGroup(FpsPlugin.CONFIG_GROUP_KEY)
|
||||
public interface FpsConfig extends Config
|
||||
{
|
||||
@ConfigItem(
|
||||
keyName = "limitMode",
|
||||
@@ -22,7 +22,7 @@
|
||||
* (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.performance;
|
||||
package net.runelite.client.plugins.fps;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
@@ -44,7 +44,7 @@ public class FpsDrawListener implements Runnable
|
||||
{
|
||||
private static final int SAMPLE_SIZE = 4;
|
||||
|
||||
private final PerformanceConfig config;
|
||||
private final FpsConfig config;
|
||||
|
||||
private long targetDelay = 0;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class FpsDrawListener implements Runnable
|
||||
private long sleepDelay = 0;
|
||||
|
||||
@Inject
|
||||
private FpsDrawListener(PerformanceConfig config)
|
||||
private FpsDrawListener(FpsConfig config)
|
||||
{
|
||||
this.config = config;
|
||||
reloadConfig();
|
||||
@@ -22,7 +22,7 @@
|
||||
* (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.performance;
|
||||
package net.runelite.client.plugins.fps;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -22,7 +22,7 @@
|
||||
* (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.performance;
|
||||
package net.runelite.client.plugins.fps;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
@@ -47,18 +47,18 @@ import net.runelite.client.ui.overlay.OverlayUtil;
|
||||
* This locks "FPS:" into one position (the far top right corner of the canvas),
|
||||
* along with a locked position for the FPS value.
|
||||
*/
|
||||
public class PerformanceOverlay extends Overlay
|
||||
public class FpsOverlay extends Overlay
|
||||
{
|
||||
// Local dependencies
|
||||
private final PerformanceConfig config;
|
||||
private final FpsConfig config;
|
||||
private final Client client;
|
||||
private final PerformancePlugin plugin;
|
||||
private final FpsPlugin plugin;
|
||||
|
||||
// Often changing values
|
||||
private boolean isFocused = true;
|
||||
|
||||
@Inject
|
||||
private PerformanceOverlay(PerformancePlugin plugin, PerformanceConfig config, Client client)
|
||||
private FpsOverlay(FpsPlugin plugin, FpsConfig config, Client client)
|
||||
{
|
||||
this.config = config;
|
||||
this.client = client;
|
||||
@@ -22,7 +22,7 @@
|
||||
* (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.performance;
|
||||
package net.runelite.client.plugins.fps;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provides;
|
||||
@@ -63,7 +63,7 @@ import net.runelite.client.util.ping.Ping;
|
||||
tags = {"frames", "framerate", "limit", "overlay", "ping"},
|
||||
enabledByDefault = false
|
||||
)
|
||||
public class PerformancePlugin extends Plugin
|
||||
public class FpsPlugin extends Plugin
|
||||
{
|
||||
static final String CONFIG_GROUP_KEY = "fpscontrol";
|
||||
|
||||
@@ -74,7 +74,7 @@ public class PerformancePlugin extends Plugin
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private PerformanceOverlay overlay;
|
||||
private FpsOverlay overlay;
|
||||
|
||||
@Inject
|
||||
private FpsDrawListener drawListener;
|
||||
@@ -86,14 +86,14 @@ public class PerformancePlugin extends Plugin
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private PerformanceConfig performanceConfig;
|
||||
private FpsConfig fpsConfig;
|
||||
|
||||
private final ScheduledExecutorService pingExecutorService = new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor());
|
||||
|
||||
@Provides
|
||||
PerformanceConfig provideConfig(ConfigManager configManager)
|
||||
FpsConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(PerformanceConfig.class);
|
||||
return configManager.getConfig(FpsConfig.class);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@@ -131,7 +131,7 @@ public class PerformancePlugin extends Plugin
|
||||
|
||||
private void getPingToCurrentWorld()
|
||||
{
|
||||
if (client.getGameState().equals(GameState.LOGGED_IN) && performanceConfig.drawPing())
|
||||
if (client.getGameState().equals(GameState.LOGGED_IN) && fpsConfig.drawPing())
|
||||
{
|
||||
ping = Ping.ping(String.format("oldschool%d.runescape.com", client.getWorld() - 300));
|
||||
}
|
||||
Reference in New Issue
Block a user