-
Notifications
You must be signed in to change notification settings - Fork 59
Added the ability to add lights to equipment automatically and light up the fire/infernal cape #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PresNL
wants to merge
5
commits into
RS117:master
Choose a base branch
from
PresNL:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
08a9dc8
Added the ability to add lights to equipment automatically
invalid-email-address c023cbf
add null check to player composition
b90288a
Merge branch 'master' into master
PresNL 3e63a32
added lit bug lantern; adjusted fire/infernal cape variants; bring li…
7df28f1
Merge branch 'master' of https://github.com/PresNL/RLHD into equipmen…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package rs117.hd.lighting; | ||
|
|
||
| import com.google.common.collect.ImmutableMap; | ||
| import java.util.Map; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import net.runelite.api.ItemID; | ||
| import static net.runelite.api.ItemID.*; | ||
| import rs117.hd.lighting.LightManager.LightType; | ||
| import rs117.hd.lighting.LightManager.Alignment; | ||
|
|
||
| @AllArgsConstructor | ||
| @Getter | ||
| enum EquipmentLight | ||
| { | ||
| FIRE_CAPE(90, Alignment.BACK, 150, 6f, rgb(220, 156, 74), LightType.PULSE, 4000, 8, ItemID.FIRE_CAPE, FIRE_CAPE_10566), | ||
| FIRE_MAX_CAPE(90, Alignment.BACK, 150, 6f, rgb(220, 156, 74), LightType.PULSE, 4000, 8, ItemID.FIRE_MAX_CAPE, FIRE_MAX_CAPE_21186), | ||
| INFERNAL_CAPE(90, Alignment.BACK, 150, 6f, rgb(133, 64, 0), LightType.PULSE, 4000, 8, ItemID.INFERNAL_CAPE, INFERNAL_CAPE_21297, INFERNAL_CAPE_23622), | ||
| INFERNAL_MAX_CAPE(90, Alignment.BACK, 150, 6f, rgb(133, 64, 0), LightType.PULSE, 4000, 8, ItemID.INFERNAL_MAX_CAPE, INFERNAL_MAX_CAPE_21285), | ||
| LIT_BUG_LANTERN(50, Alignment.LEFT, 250, 6f, rgb(255, 233, 138), LightType.FLICKER, 0, 10, ItemID.LIT_BUG_LANTERN), | ||
| ; | ||
|
|
||
| private final int[] id; | ||
| private final int height; | ||
| private final Alignment alignment; | ||
| private final int size; | ||
| private final float strength; | ||
| private final int rgb; | ||
| private final LightType lightType; | ||
| private final float duration; | ||
| private final float range; | ||
|
|
||
| EquipmentLight(int height, Alignment alignment, int size, float strength, int rgb, LightType lightType, float duration, float range, int... ids) | ||
| { | ||
| this.height = height; | ||
| this.alignment = alignment; | ||
| this.size = size; | ||
| this.strength = strength; | ||
| this.rgb = rgb; | ||
| this.lightType = lightType; | ||
| this.duration = duration; | ||
| this.range = range; | ||
| this.id = ids; | ||
| } | ||
|
|
||
| private static final Map<Integer, EquipmentLight> LIGHTS; | ||
|
|
||
| static | ||
| { | ||
| ImmutableMap.Builder<Integer, EquipmentLight> builder = new ImmutableMap.Builder<>(); | ||
| for (EquipmentLight equipmentLight : values()) | ||
| { | ||
| for (int id : equipmentLight.id) | ||
| { | ||
| builder.put(id + 512, equipmentLight); | ||
| } | ||
| } | ||
| LIGHTS = builder.build(); | ||
| } | ||
|
|
||
| static EquipmentLight find(int id) | ||
| { | ||
| return LIGHTS.get(id); | ||
| } | ||
|
|
||
| private static int rgb(int r, int g, int b) | ||
| { | ||
| return (r << 16) | (g << 8) | b; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing a newline here
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also above here, is it worth/easy to add config for other bits of equipment?
The ones that come to mind are
Maybe even things like the charged dfs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more I think about it, the more pieces of equipment I can think of. Makes sense if you want to leave this PR as just infra and then a second one adding all the equipment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's generally pretty easy just got to setup the positioning and brightness etc. It works the same as adding lights for objects, npcs etc. just a bit outside of the scope of both the issue and the amount of time I had available to spend on writing this.