-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Feature: ubiks cube reminder #3125
base: beta
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
at.hannibal2.skyhanni.skyhannimodule.ModuleProvider |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: SkyHanniInstallerFrame | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||
package at.hannibal2.skyhanni.features.rift.everywhere | ||||
|
||||
import at.hannibal2.skyhanni.events.LorenzChatEvent | ||||
import at.hannibal2.skyhanni.features.rift.RiftAPI | ||||
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule | ||||
import at.hannibal2.skyhanni.utils.ChatUtils | ||||
import at.hannibal2.skyhanni.utils.DelayedRun | ||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent | ||||
import kotlin.time.Duration.Companion.hours | ||||
|
||||
@SkyHanniModule | ||||
object Ubikreminder { | ||||
|
||||
private val config get() = RiftAPI.config.ubikReminder | ||||
|
||||
private var isTimerRunning = false | ||||
private val messageRegex = Regex("ROUND [1-9] \\(FINAL\\):") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use our repo patterns system instead. for an exampe, see SkyHanni/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt Line 53 in d4510fa
|
||||
|
||||
|
||||
@SubscribeEvent | ||||
fun onChat(event: LorenzChatEvent) { | ||||
if (!RiftAPI.config.ubikReminder) return | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. before checking if the feautre is enabled, pleas add additional checks, e.g. if the player is in the rift, the right region of the rift, etc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you would probably also want a reminder of this outside the rift, so at most this should be a setting imo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well the timer would only start inside of the rift, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, i probably didn't notice what hannibal was replying to |
||||
val message = event.message | ||||
if (messageRegex.matches(message) && !isTimerRunning) { | ||||
startTimer() | ||||
} | ||||
} | ||||
private fun startTimer() { | ||||
isTimerRunning = true | ||||
|
||||
DelayedRun.runDelayed(2.hours) { // 2 hours as a Duration | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of running a timer, please save the moment in time the player did the interaction, then check every second if the duration is over 2 hours. |
||||
ChatUtils.chat("§aUbik's cube is ready in the rift!") | ||||
isTimerRunning = false | ||||
|
||||
} | ||||
} | ||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: SkyHanniInstallerFrame | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: SkyHanniInstallerFrame | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Root xmlns="http://notenoughupdates.org/moulconfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://notenoughupdates.org/moulconfig https://raw.githubusercontent.com/NotEnoughUpdates/MoulConfig/master/MoulConfig.xsd"> | ||
<Gui> | ||
<Column> | ||
<Row> | ||
<Text text="Search: "/> | ||
<TextField value="@search"/> | ||
<Text text="@poll"/> | ||
</Row> | ||
<ScrollPanel width="560" height="400"> | ||
<Array data="@searchResults"> | ||
<Row> | ||
<Hover lines="@keyW"> | ||
<Text text="@key" width="200"/> | ||
</Hover> | ||
<Hover lines="@hoverRegex"> | ||
<Text text="@regex" width="300"/> | ||
</Hover> | ||
<Text text="@overriden" width="50"/> | ||
</Row> | ||
</Array> | ||
</ScrollPanel> | ||
</Column> | ||
</Gui> | ||
</Root> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#version 120 | ||
|
||
// Fragment Shader | ||
uniform sampler2D texture; | ||
uniform float darknessLevel; | ||
|
||
varying vec4 outColor; | ||
|
||
void main() { | ||
vec4 color = texture2D(texture, gl_TexCoord[0].st) * outColor; | ||
vec3 darkenedColor = color.rgb * darknessLevel; | ||
gl_FragColor = vec4(darkenedColor, color.a); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#version 120 | ||
|
||
varying vec4 outColor; | ||
|
||
void main() { | ||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
gl_TexCoord[0] = gl_MultiTexCoord0; | ||
outColor = gl_Color; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#version 120 | ||
|
||
uniform float scaleFactor; | ||
uniform float radius; | ||
uniform float smoothness; | ||
uniform vec2 halfSize; | ||
uniform vec2 centerPos; | ||
|
||
varying vec4 color; | ||
|
||
// From https://www.shadertoy.com/view/WtdSDs | ||
float roundedRectSDF(vec2 center, vec2 halfSize, float radius) { | ||
return length(max(abs(center) - halfSize + radius, 0.0)) - radius; | ||
} | ||
|
||
void main() { | ||
float xScale = gl_ModelViewMatrix[0][0]; | ||
float yScale = gl_ModelViewMatrix[1][1]; | ||
float xTranslation = gl_ModelViewMatrix[3][0]; | ||
float yTranslation = gl_ModelViewMatrix[3][1]; | ||
|
||
vec2 newHalfSize = vec2(halfSize.x * xScale, halfSize.y * yScale); | ||
|
||
float newCenterPosY = centerPos.y; | ||
if (yScale != 1.0) { | ||
newCenterPosY = centerPos.y - (halfSize.y * (yScale - 1)); | ||
} | ||
|
||
vec2 newCenterPos = vec2((centerPos.x * xScale) + (xTranslation * scaleFactor), newCenterPosY - (yTranslation * scaleFactor)); | ||
|
||
float distance = roundedRectSDF(gl_FragCoord.xy - newCenterPos, newHalfSize, radius); | ||
float smoothed = 1.0 - smoothstep(0.0, smoothness, distance); | ||
gl_FragColor = color * vec4(1.0, 1.0, 1.0, smoothed); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#version 120 | ||
|
||
varying vec4 color; | ||
|
||
void main() { | ||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
color = gl_Color; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#version 120 | ||
|
||
// Rect specific uniforms | ||
uniform float scaleFactor; | ||
uniform float radius; | ||
uniform vec2 halfSize; | ||
uniform vec2 centerPos; | ||
|
||
// Outline specific uniforms | ||
uniform float borderThickness; | ||
uniform float borderBlur; | ||
|
||
varying vec4 color; | ||
|
||
// From https://www.shadertoy.com/view/WtdSDs | ||
float roundedRectSDF(vec2 center, vec2 halfSize, float radius) { | ||
return length(max(abs(center) - halfSize + radius, 0.0)) - radius; | ||
} | ||
|
||
void main() { | ||
float xScale = gl_ModelViewMatrix[0][0]; | ||
float yScale = gl_ModelViewMatrix[1][1]; | ||
float xTranslation = gl_ModelViewMatrix[3][0]; | ||
float yTranslation = gl_ModelViewMatrix[3][1]; | ||
|
||
vec2 newHalfSize = vec2(halfSize.x * xScale, halfSize.y * yScale); | ||
|
||
float newCenterPosY = centerPos.y; | ||
if (yScale != 1.0) { | ||
newCenterPosY = centerPos.y - (halfSize.y * (yScale - 1)); | ||
} | ||
|
||
vec2 newCenterPos = vec2((centerPos.x * xScale) + (xTranslation * scaleFactor), newCenterPosY - (yTranslation * scaleFactor)); | ||
|
||
float distance = roundedRectSDF(gl_FragCoord.xy - newCenterPos, newHalfSize, max(radius, borderThickness)); | ||
|
||
// In testing, keeping the upper bound at 1.0 and letting the lower be changable seemed the most sensible for nice results | ||
float smoothed = 1.0 - smoothstep(borderBlur, 1.0, abs(distance / borderThickness)); | ||
gl_FragColor = color * vec4(1.0, 1.0, 1.0, smoothed); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#version 120 | ||
|
||
varying vec4 color; | ||
|
||
void main() { | ||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
color = gl_Color; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#version 120 | ||
|
||
uniform float scaleFactor; | ||
uniform float radius; | ||
uniform float smoothness; | ||
uniform vec2 halfSize; | ||
uniform vec2 centerPos; | ||
|
||
uniform sampler2D outTexture; | ||
|
||
varying vec2 outTextureCoords; | ||
varying vec4 outColor; | ||
|
||
// From https://www.shadertoy.com/view/WtdSDs | ||
float roundedRectSDF(vec2 center, vec2 halfSize, float radius) { | ||
return length(max(abs(center) - halfSize + radius, 0.0)) - radius; | ||
} | ||
|
||
void main() { | ||
float xScale = gl_ModelViewMatrix[0][0]; | ||
float yScale = gl_ModelViewMatrix[1][1]; | ||
float xTranslation = gl_ModelViewMatrix[3][0]; | ||
float yTranslation = gl_ModelViewMatrix[3][1]; | ||
|
||
vec2 newHalfSize = vec2(halfSize.x * xScale, halfSize.y * yScale); | ||
|
||
float newCenterPosY = centerPos.y; | ||
if (yScale != 1.0) { | ||
newCenterPosY = centerPos.y - (halfSize.y * (yScale - 1)); | ||
} | ||
|
||
vec2 newCenterPos = vec2((centerPos.x * xScale) + (xTranslation * scaleFactor), newCenterPosY - (yTranslation * scaleFactor)); | ||
|
||
float distance = roundedRectSDF(gl_FragCoord.xy - newCenterPos, newHalfSize, radius); | ||
float smoothed = 1.0 - smoothstep(0.0, smoothness, distance); | ||
gl_FragColor = (texture2D(outTexture, outTextureCoords) * outColor) * vec4(1.0, 1.0, 1.0, smoothed); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#version 120 | ||
|
||
varying vec2 outTextureCoords; | ||
varying vec4 outColor; | ||
|
||
void main(){ | ||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
outColor = gl_Color; | ||
outTextureCoords = gl_MultiTexCoord0.st; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Chroma Fragment Shader | ||
// (Same as textured_chroma.fsh but isn't restricted to textured elements) | ||
|
||
#version 120 | ||
|
||
uniform float chromaSize; | ||
uniform float timeOffset; | ||
uniform float saturation; | ||
uniform bool forwardDirection; | ||
|
||
varying vec4 originalColor; | ||
|
||
float rgb2b(vec3 rgb) { | ||
return max(max(rgb.r, rgb.g), rgb.b); | ||
} | ||
|
||
vec3 hsb2rgb_smooth(vec3 c) { | ||
vec3 rgb = clamp(abs(mod(c.x * 6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0); | ||
rgb = rgb * rgb * (3.0 - 2.0 * rgb); // Cubic smoothing | ||
return c.z * mix(vec3(1.0), rgb, c.y); | ||
} | ||
|
||
void main() { | ||
// Determine the direction chroma moves | ||
float fragCoord; | ||
if (forwardDirection) { | ||
fragCoord = gl_FragCoord.x - gl_FragCoord.y; | ||
} else { | ||
fragCoord = gl_FragCoord.x + gl_FragCoord.y; | ||
} | ||
|
||
// The hue takes in account the position, chroma settings, and time | ||
float hue = mod(((fragCoord) / chromaSize) - timeOffset, 1.0); | ||
|
||
// Set the color to use the new hue & original saturation/value/alpha values | ||
gl_FragColor = vec4(hsb2rgb_smooth(vec3(hue, saturation, rgb2b(originalColor.rgb))), originalColor.a); | ||
} |
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.
Please move it to the mountaintop category (i assume this is in mountaintop), and please describe WHAT it is you do with ubik a bit in the description. Also, the feature name is a title, please use first letter upper case formatting there, and a dot at the end of the description