Skip to content

Commit

Permalink
plugins: Merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Owain94 committed Feb 7, 2020
1 parent 591178a commit 7210b4f
Show file tree
Hide file tree
Showing 857 changed files with 14,438 additions and 16,657 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These are supported funding model platforms

patreon: Ganom
patreon: openosrs
54 changes: 50 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ jobs:
- name: Building plugins
run: ./gradlew build --stacktrace -x test -x checkstyleMain --console=plain

- name: Testing plugins
run: ./gradlew test --stacktrace --console=plain

test:
runs-on: ubuntu-latest
name: Test
Expand Down Expand Up @@ -215,9 +212,58 @@ jobs:
- name: Checking plugins code conventions (Test)
run: ./gradlew checkstyleTest --console=plain

bump:
name: Bump version numbers
needs: [build, test, checkstyleMain, checkstyleTest]
runs-on: ubuntu-latest

steps:
- name: Extract actor repo
shell: bash
run: echo "##[set-output name=repo;]$(echo $(jq --raw-output .pull_request.head.repo.full_name "$GITHUB_EVENT_PATH"))"
id: extract_actor_repo

- name: Extract actor repo branch
shell: bash
run: echo "##[set-output name=branch;]$(echo $(jq --raw-output .pull_request.head.ref "$GITHUB_EVENT_PATH"))"
id: extract_actor_repo_branch

- id: changedFiles
name: Changed files exporter
uses: futuratrepadeira/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up JDK 11
uses: actions/setup-java@master
with:
java-version: 11

- uses: actions/checkout@v1

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Bump version numbers
run: ./gradlew bumpVersion --newFiles="${{ steps.changedFiles.outputs.files_created }}" --changedFiles="${{ steps.changedFiles.outputs.files_updated }}" --console=plain

- name: Commit changed files
run: |
git add \*.kts
git diff-index --quiet HEAD \
|| git -c user.name="GitHub" -c user.email="[email protected]" commit \
--author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" \
-m "Bump version(s)"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ steps.extract_actor_repo.outputs.repo }}
branch: ${{ steps.extract_actor_repo_branch.outputs.branch }}

approve:
name: Approve
needs: [build, test, checkstyleMain, checkstyleTest]
needs: [build, test, checkstyleMain, checkstyleTest, bump]
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion achievementdiary/achievementdiary.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ProjectVersions.rlVersion
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

version = "0.0.1"
version = "0.0.2"

project.extra["PluginName"] = "Diary Requirements"
project.extra["PluginDescription"] = "Display level requirements in Achievement Diary interface"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
import java.util.Map;
import java.util.regex.Pattern;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.FontTypeFace;
import net.runelite.api.QuestState;
Expand Down Expand Up @@ -64,14 +62,12 @@
import org.pf4j.Extension;

@Extension
@Slf4j
@PluginDescriptor(
name = "Diary Requirements",
description = "Display level requirements in Achievement Diary interface",
tags = {"achievements", "tasks"},
type = PluginType.UTILITY
)
@Singleton
public class DiaryRequirementsPlugin extends Plugin
{
private static final String AND_JOINER = ", ";
Expand Down Expand Up @@ -123,7 +119,6 @@ private void showDiaryRequirements()
GenericDiaryRequirement requirements = getRequirementsForTitle(titleWidget.getText());
if (requirements == null)
{
log.debug("Unknown achievement diary {}", titleWidget.getText());
return;
}

Expand Down Expand Up @@ -174,16 +169,15 @@ else if (ourWidth < maxWidth)
if (runningWidth == 0 || wordWidth + runningWidth < maxWidth)
{
runningWidth += wordWidth;
b.append(word);
}
else
{
newRequirements.add(i + (offset++), b.toString());
b.delete(0, b.length());
runningWidth = wordWidth;
b.append(strike);
b.append(word);
}
b.append(word);
}
newRequirements.set(i + offset, b.toString());
}
Expand Down Expand Up @@ -332,7 +326,6 @@ private boolean satisfiesRequirement(Requirement r)
int realFavour = client.getVar(f.getHouse().getVarbit());
return (realFavour / 10) >= f.getPercent();
}
log.warn("Unknown requirement {}", r);
return false;
}
}
2 changes: 1 addition & 1 deletion agility/agility.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ProjectVersions.rlVersion
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

version = "0.0.1"
version = "0.0.2"

project.extra["PluginName"] = "Agility"
project.extra["PluginDescription"] = "Show helpful information about agility courses and obstacles"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;

@ConfigGroup("agility")
public interface AgilityConfig extends Config
Expand All @@ -51,14 +52,25 @@ default Title mainConfig()
description = "This will remove the distance cap on rendering overlays for agility.",
warning = "<html><center>Enabling this setting on a low end machine may severely affect your fps." +
"<br>Click yes to enable this setting, knowing it might affect performance.</center></html>",
position = 1,
position = 0,
titleSection = "mainConfig"
)
default boolean removeDistanceCap()
{
return false;
}

@ConfigItem(
keyName = "showCourseClickboxes",
name = "Show course Clickboxes",
description = "Show agility course obstacle clickboxes",
position = 1
)
default boolean showCourseClickboxes()
{
return true;
}

@ConfigItem(
keyName = "showLapCount",
name = "Show Lap Count",
Expand All @@ -80,6 +92,7 @@ default boolean showLapCount()
hidden = true,
unhide = "showLapCount"
)
@Units(Units.MINUTES)
default int lapTimeout()
{
return 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ class AgilityOverlay extends Overlay
private static final Color SHORTCUT_HIGH_LEVEL_COLOR = Color.ORANGE;

private final Client client;
private final AgilityConfig config;
private final AgilityPlugin plugin;

@Inject
private AgilityOverlay(final Client client, final AgilityPlugin plugin)
private AgilityOverlay(final Client client, final AgilityConfig config, final AgilityPlugin plugin)
{
super(plugin);
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.ABOVE_SCENE);
this.client = client;
this.config = config;
this.plugin = plugin;
}

Expand All @@ -70,8 +72,9 @@ public Dimension render(Graphics2D graphics)
final List<Tile> marksOfGrace = plugin.getMarksOfGrace();
plugin.getObstacles().forEach((object, obstacle) ->
{
if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !plugin.isHighlightShortcuts() ||
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !plugin.isShowTrapOverlay())
if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !config.highlightShortcuts() ||
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !config.showTrapOverlay() ||
Obstacles.COURSE_OBSTACLE_IDS.contains(object.getId()) && !config.showCourseClickboxes())
{
return;
}
Expand All @@ -86,18 +89,18 @@ public Dimension render(Graphics2D graphics)
Polygon polygon = object.getCanvasTilePoly();
if (polygon != null)
{
OverlayUtil.renderPolygon(graphics, polygon, plugin.getTrapColor());
OverlayUtil.renderPolygon(graphics, polygon, config.getTrapColor());
}
return;
}
Shape objectClickbox = object.getClickbox();
if (objectClickbox != null)
{
AgilityShortcut agilityShortcut = obstacle.getShortcut();
Color configColor = agilityShortcut == null || agilityShortcut.getLevel() <= plugin.getAgilityLevel() ? plugin.getOverlayColor() : SHORTCUT_HIGH_LEVEL_COLOR;
if (plugin.isHighlightMarks() && !marksOfGrace.isEmpty())
Color configColor = agilityShortcut == null || agilityShortcut.getLevel() <= plugin.getAgilityLevel() ? config.getOverlayColor() : SHORTCUT_HIGH_LEVEL_COLOR;
if (config.highlightMarks() && !marksOfGrace.isEmpty())
{
configColor = plugin.getMarkColor();
configColor = config.getMarkColor();
}

OverlayUtil.renderClickBox(graphics, mousePosition, objectClickbox, configColor);
Expand All @@ -106,7 +109,7 @@ public Dimension render(Graphics2D graphics)

});

if (plugin.isHighlightMarks() && !marksOfGrace.isEmpty())
if (config.highlightMarks() && !marksOfGrace.isEmpty())
{
for (Tile markOfGraceTile : marksOfGrace)
{
Expand All @@ -120,7 +123,7 @@ && checkDistance(markOfGraceTile.getLocalLocation(), playerLocation))
continue;
}

OverlayUtil.renderPolygon(graphics, poly, plugin.getMarkColor());
OverlayUtil.renderPolygon(graphics, poly, config.getMarkColor());
}
}
}
Expand All @@ -130,7 +133,7 @@ && checkDistance(markOfGraceTile.getLocalLocation(), playerLocation))

private boolean checkDistance(LocalPoint localPoint, LocalPoint playerPoint)
{
if (plugin.isRemoveDistanceCap())
if (config.removeDistanceCap())
{
return true;
}
Expand Down
Loading

0 comments on commit 7210b4f

Please sign in to comment.