Skip to content

Commit

Permalink
fix first person camera scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
r0yzer committed Jun 29, 2023
1 parent a717c68 commit 470594b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ package de.royzer.perspektive.mixinskt

import de.royzer.perspektive.Perspektive
import de.royzer.perspektive.settings.PerspektiveSettings
import net.minecraft.client.CameraType
import net.minecraft.client.Minecraft
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo
import kotlin.math.sign

object InventoryMixinKt {
@JvmStatic
fun onScroll(d: Double, ci: CallbackInfo) {
if (Minecraft.getInstance().options.cameraType == CameraType.FIRST_PERSON) return
if (!Perspektive.freeLookEnabled && !PerspektiveSettings.cameraDistanceAlsoIn3rdPerson) return
if (!PerspektiveSettings.scrollingEnabled) return
val i = sign(d)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/perspektive/lang/de_de.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"perspektive.scrollingEnabled": "Mausrad-Scrolling während in Freelook",
"perspektive.tooltips.scrollingEnabled": "Wirkt nur wenn Mausrad-Scrolling in Freelook an ist",
"perspektive.cameraDistanceInThirdPerson": "In thirdperson Kameradistanz nutzen",
"perspektive.tooltips.cameraDistanceInThirdPerson": "Auch in der 'normalen' thirdperson die angegebene Kameradistanz nutzen"
"perspektive.tooltips.cameraDistanceInThirdPerson": "Ermöglicht auch in der 'normalen' thirdperson die angegebene Kameradistanz nutzen und die Kameradistanz per Mausrad zu ändern"
}
2 changes: 1 addition & 1 deletion src/main/resources/assets/perspektive/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"perspektive.scrollingEnabled": "Scroll to change the camera distance",
"perspektive.tooltips.scrollingEnabled": "Only applies if scrolling to change the camera distance is enabled",
"perspektive.cameraDistanceInThirdPerson": "Use camera distance in third person",
"perspektive.tooltips.cameraDistanceInThirdPerson": "Also uses the specified camera distance in 'normal' third person view"
"perspektive.tooltips.cameraDistanceInThirdPerson": "Also uses the specified camera distance in 'normal' third person view and enables scrolling aswell"
}

0 comments on commit 470594b

Please sign in to comment.