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