Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3863c45f26 | ||
|
|
0036baee3e | ||
|
|
5323b72268 | ||
|
|
fdb1024ee3 | ||
|
|
d48952fec9 | ||
|
|
9deab7228d | ||
|
|
b4d82a7230 | ||
|
|
36e241e438 | ||
|
|
bdbee99fe2 | ||
|
|
439cd0858e | ||
|
|
617648cf57 | ||
|
|
89914a1b6e | ||
|
|
c272fb457f | ||
|
|
308b41094f | ||
|
|
bf7209083a | ||
|
|
187844db2b | ||
|
|
24ced76d06 | ||
|
|
aa75a58a4d | ||
|
|
1f675622f0 | ||
|
|
2d902bbf3c | ||
|
|
9cc5393703 | ||
|
|
8d08fdedf4 | ||
|
|
cdafde01f3 | ||
|
|
c07c4200f7 | ||
|
|
c70da21df6 | ||
|
|
f5d5d93c19 | ||
|
|
429b4ca607 | ||
|
|
dd173836ff | ||
|
|
203fd6cdb6 | ||
|
|
003f79d405 | ||
|
|
f48527402a | ||
|
|
8c4b705e65 | ||
|
|
1def693ae8 | ||
|
|
cfd05bb7b6 | ||
|
|
2e861470d8 | ||
|
|
e87ed53485 | ||
|
|
8847c7f499 | ||
|
|
da2773b1e9 | ||
|
|
3650e756c3 | ||
|
|
6b885beede | ||
|
|
abb3d1de3c | ||
|
|
a8cdfeeba9 | ||
|
|
ed4d310565 | ||
|
|
ac73c99506 | ||
|
|
d45eeac6dc | ||
|
|
77ff589544 | ||
|
|
ce5c0b22db | ||
|
|
98af13fd0b | ||
|
|
2387444d3a | ||
|
|
57860490c8 | ||
|
|
f46aa175a4 | ||
|
|
78390ca02f | ||
|
|
31821b4833 | ||
|
|
e34ba6025a | ||
|
|
9891cd2977 | ||
|
|
8566e859e3 | ||
|
|
735b9e8718 | ||
|
|
71ee3d8e0a | ||
|
|
11f102759c | ||
|
|
02dd543027 | ||
|
|
c247e51d00 | ||
|
|
e3052343d3 | ||
|
|
9e879f9230 | ||
|
|
bda436d863 | ||
|
|
98d2cdae63 | ||
|
|
8e0e444d15 | ||
|
|
f586647e07 | ||
|
|
73ab8456e7 | ||
|
|
1a3d7ce225 | ||
|
|
965ab57159 | ||
|
|
c8dba43b90 | ||
|
|
dd8e62c73e | ||
|
|
b24a158b9b |
51
README.md
@@ -1,29 +1,29 @@
|
||||
<div align="center">
|
||||
<img src=https://github.com/TeamMidnightDust/MidnightControls/blob/1.19/src/main/resources/assets/midnightcontrols/icon.png>
|
||||
|
||||
# MidnightControls
|
||||
|
||||
<!-- modrinth_exclude.start -->
|
||||
 <!-- modrinth_exclude.end -->
|
||||
[](https://raw.githubusercontent.com/TeamMidnightDust/MidnightControls/master/LICENSE)
|
||||

|
||||
[![Mod loader: Quilt/Fabric]][quilt] <!-- modrinth_exclude.start -->
|
||||
[](https://github.com/TeamMidnightDust/MidnightControls/releases)
|
||||
[](https://www.curseforge.com/minecraft/mc-mods/midnightcontrols)
|
||||
<!-- modrinth_exclude.end -->
|
||||
[](https://www.curseforge.com/minecraft/mc-mods/midnightcontrols)
|
||||
[![Modrinth]](https://modrinth.com/mod/midnightcontrols)
|
||||
[](https://github.com/TeamMidnightDust/MidnightControls/releases)
|
||||

|
||||
[![Mod loader: Quilt/Fabric]][Quilt]
|
||||
[](https://www.oracle.com/java/technologies/downloads/#java17)
|
||||
[](LICENSE)
|
||||
|
||||
A Fabric Minecraft mod which adds better controls, reach-around and controller support.
|
||||
Forked from [LambdaControls](https://github.com/LambdAurora/LambdaControls) by the amazing [LambdAurora](https://github.com/LambdAurora), which was sadly discontinued.
|
||||
|
||||
</div>
|
||||
|
||||
## What's this mod?
|
||||
|
||||
This mod adds better controls, reach-around features, etc.
|
||||
MidnightControls is a mod which provides controller and touchscreen support in Minecraft: Java Edition.<br />It also includes some Bedrock Edition parity and reach-around features!
|
||||
|
||||
Haven't you dreamed to travel in your modded Minecraft world with your controller? Yes? Then this mod is made for you!
|
||||
|
||||
This mod also adds controller support.
|
||||
|
||||
## ✅ Features:
|
||||
## Features:
|
||||
|
||||
- Controller support
|
||||
- Touchscreen support (very experimental and buggy).
|
||||
- Touchscreen support
|
||||
- Keyboard controls to look around.
|
||||
- Toggleable on screen button indicator (like in Bedrock Edition).
|
||||
- Vertical reach-around.
|
||||
@@ -47,14 +47,23 @@ This mod also adds controller support.
|
||||
|
||||
## Screenshots
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
<!-- modrinth_exclude.start -->
|
||||
## Build
|
||||
|
||||
Just do `./gradlew build` and everything should build just fine!
|
||||
<!-- modrinth_exclude.end -->
|
||||
Clone the repo with:
|
||||
```
|
||||
git clone https://github.com/TeamMidnightDust/MidnightControls
|
||||
```
|
||||
Enter the folder created and run:
|
||||
```
|
||||
./gradlew build
|
||||
```
|
||||
After this is done, everything should be built just fine!
|
||||
|
||||
[Quilt]: https://quiltmc.org
|
||||
|
||||
[quilt]: https://quiltmc.org
|
||||
[Mod loader: Quilt/Fabric]: https://img.shields.io/badge/modloader-Quilt%2FFabric-blueviolet?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAADGAAAAxgGwdJvFAAAFU0lEQVR4nO1bwW7bOBCdCHtP+wUNxIvhS7yA7kkPOjf9AKPam4/OF2zzB96bblXhH0jPPkS5G1jnIvgib/IFtX/ALoYZemmKtEWRRe3aDzAsURbJGQ6HM4/02Wq1gmNGcNTSnxQA8IdakDK4AOCfJpj3SpiI98r2rAMAbxrWNWFFOMeL1nCJdXQa1gPTbpCbnm34ABIeBThv2hgAfOyVcF+2ZwkAfHGo54kVIRe6NVxiny4d6vpn2g36ugfqFLhwFB6kkUoc67k0XLv0qYKj9wEnBXiqZwEAf/ZKOOuV8BkLWBFesyI8A4C/LOt6AoC39C7HtBvg9Vt65hUnC/BUDzrOf1MGq5S9WkDZnuVle7ZqsBKgw/tO73K0hku8/u64EmhxsoA96MMvxdEroBIKO+CWoshnqqJPYTAGRJ8sql3QO3Op7D19D3z7AV8KeAGArFf+32lWhDwnKNuzuaUCclaE93KBiOU9hMQV+FLAOxz9lPHRR0VkZXs2oBDUNon5ULZnKOgcYwl4FTwna/K+CtRRwIK+dTnCCwkP9I0fkXmh4FcN+6UKqqtHblvtb+18po4TvKaPilsS8qVuYx5havsbJXS1I0ZVAXP1B5jfyzm+hAnN+We1XPluioX03kJtY9oNtG1T+b1aburDxhRAQVMGHw3z9k65F41nktmjUnjjrAj7ZXv27ECIyEKgBd7saBuka7lsPu0GA1MjR0+KVpwgMTlrMkN4YoztlZ/2camTvD0QjcWZF6KxMgcLyKbdAN+HKOb1y6PYH49gEsUwUKw1G48gi2KQZcApkYxH1eldUQBxeKbkRfXEQjDZ21+h2bMiHJDwH2wk1rSX0XWueHZd2yCZ/oVSnilTaA3VAiqjRRahQ0JBjuov3ijfPqAua0kUg67tmyjWCmvsS504wGQRnywjPJ8wtY3xw3827fjMBXziUalL3DcNrIzYRwXcTbvBZ7lgPHoNxKKYky1/+2xsHxXQbw2X/EIoggQHyjC9Yh8VcC6NshDc66jLOHpC5KSAPejDL8U+KuArboTQZgjHeARn+MFnvhvbRyfYaQ2XfNkTVFgUr/mIxlvkJuyjAjCae6BrYQUPW37vhDpT4MnAsCyIgbHBnYbcADJt7/t+deBCiSWsCG8sOv5IgU2FnJh2g+RnBDl1oCpgogqEx1TEURUFokx+tpCYnEzzjg1kh+fq/Ix9OXpG6OjjgI1VIGWcOMhlXh4PPdAz1VTe90rIU8Z/L9JUnALXSK4SjSUzOY+Y1ekyOlzjaamTvf3X8cjunBH1v6OeVtsG1QI66qYEVkoVmyA/O5fYmIHjgSsrskUavAc6q1BLeXXiANMZu0HKwGav7opGv+LticZqHOToLBeZrJRxC97qjOsowCTgZYO9OlNa25haMwgvsFMJPp3gLW1ji8b6dO89fhfYIbzAl23T4adtjyNvD6/mbbs9Xgs1hRcwWoIvCxDb47nQNm5aRDHvoPGcblNYCi+gtQSfU+AdLYfioLXYtHA9eruBhsILVJRwUIGQo/ACG0o4GAV4El5grQSffMA3SqbEnBdb1zeunfYsvAB3jL4UwE92KauA2NnNbLerNKhEqJ6Q+FIAOjpcATAVzjFHoC3qC9OurCW0W9s+6vXpAy4p0hPkSUL3ziNHiY3tqfNdQN4jORgnSEGMLyU8Udbq1QIEdEyRF3hSwlp4vKkwQimrHDuxAR6S4tleFIPzERnhSFXQEtbkD1kbwiMOlhJroISK8IiDpcQsp4NWeMRBc4I1lWAUHnHwpOgOJWwVHvFbsMIGJewUHvFb7QuQYxR/ttgIzbUAgB9KOM3uc+PN7QAAAABJRU5ErkJggg==
|
||||
|
||||
[Modrinth]: https://img.shields.io/modrinth/dt/bXX9h73M?logoColor=white&logo=data:image/svg%2bxml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUwMy4xNiAzMjMuNTZDNTE0LjU1IDI4MS40NyA1MTUuMzIgMjM1LjkxIDUwMy4yIDE5MC43NkM0NjYuNTcgNTQuMjI5OSAzMjYuMDQgLTI2LjgwMDEgMTg5LjMzIDkuNzc5OTFDODMuODEwMSAzOC4wMTk5IDExLjM4OTkgMTI4LjA3IDAuNjg5OTQxIDIzMC40N0g0My45OUM1NC4yOSAxNDcuMzMgMTEzLjc0IDc0LjcyOTggMTk5Ljc1IDUxLjcwOThDMzA2LjA1IDIzLjI1OTggNDE1LjEzIDgwLjY2OTkgNDUzLjE3IDE4MS4zOEw0MTEuMDMgMTkyLjY1QzM5MS42NCAxNDUuOCAzNTIuNTcgMTExLjQ1IDMwNi4zIDk2LjgxOThMMjk4LjU2IDE0MC42NkMzMzUuMDkgMTU0LjEzIDM2NC43MiAxODQuNSAzNzUuNTYgMjI0LjkxQzM5MS4zNiAyODMuOCAzNjEuOTQgMzQ0LjE0IDMwOC41NiAzNjkuMTdMMzIwLjA5IDQxMi4xNkMzOTAuMjUgMzgzLjIxIDQzMi40IDMxMC4zIDQyMi40MyAyMzUuMTRMNDY0LjQxIDIyMy45MUM0NjguOTEgMjUyLjYyIDQ2Ny4zNSAyODEuMTYgNDYwLjU1IDMwOC4wN0w1MDMuMTYgMzIzLjU2WiIgZmlsbD0iIzMwYjI3YiIvPgogIDxwYXRoIGQ9Ik0zMjEuOTkgNTA0LjIyQzE4NS4yNyA1NDAuOCA0NC43NTAxIDQ1OS43NyA4LjExMDExIDMyMy4yNEMzLjg0MDExIDMwNy4zMSAxLjE3IDI5MS4zMyAwIDI3NS40Nkg0My4yN0M0NC4zNiAyODcuMzcgNDYuNDY5OSAyOTkuMzUgNDkuNjc5OSAzMTEuMjlDNTMuMDM5OSAzMjMuOCA1Ny40NSAzMzUuNzUgNjIuNzkgMzQ3LjA3TDEwMS4zOCAzMjMuOTJDOTguMTI5OSAzMTYuNDIgOTUuMzkgMzA4LjYgOTMuMjEgMzAwLjQ3QzY5LjE3IDIxMC44NyAxMjIuNDEgMTE4Ljc3IDIxMi4xMyA5NC43NjAxQzIyOS4xMyA5MC4yMTAxIDI0Ni4yMyA4OC40NDAxIDI2Mi45MyA4OS4xNTAxTDI1NS4xOSAxMzNDMjQ0LjczIDEzMy4wNSAyMzQuMTEgMTM0LjQyIDIyMy41MyAxMzcuMjVDMTU3LjMxIDE1NC45OCAxMTguMDEgMjIyLjk1IDEzNS43NSAyODkuMDlDMTM2Ljg1IDI5My4xNiAxMzguMTMgMjk3LjEzIDEzOS41OSAzMDAuOTlMMTg4Ljk0IDI3MS4zOEwxNzQuMDcgMjMxLjk1TDIyMC42NyAxODQuMDhMMjc5LjU3IDE3MS4zOUwyOTYuNjIgMTkyLjM4TDI2OS40NyAyMTkuODhMMjQ1Ljc5IDIyNy4zM0wyMjguODcgMjQ0LjcyTDIzNy4xNiAyNjcuNzlDMjM3LjE2IDI2Ny43OSAyNTMuOTUgMjg1LjYzIDI1My45OCAyODUuNjRMMjc3LjcgMjc5LjMzTDI5NC41OCAyNjAuNzlMMzMxLjQ0IDI0OS4xMkwzNDIuNDIgMjczLjgyTDMwNC4zOSAzMjAuNDVMMjQwLjY2IDM0MC42M0wyMTIuMDggMzA4LjgxTDE2Mi4yNiAzMzguN0MxODcuOCAzNjcuNzggMjI2LjIgMzgzLjkzIDI2Ni4wMSAzODAuNTZMMjc3LjU0IDQyMy41NUMyMTguMTMgNDMxLjQxIDE2MC4xIDQwNi44MiAxMjQuMDUgMzYxLjY0TDg1LjYzOTkgMzg0LjY4QzEzNi4yNSA0NTEuMTcgMjIzLjg0IDQ4NC4xMSAzMDkuNjEgNDYxLjE2QzM3MS4zNSA0NDQuNjQgNDE5LjQgNDAyLjU2IDQ0NS40MiAzNDkuMzhMNDg4LjA2IDM2NC44OEM0NTcuMTcgNDMxLjE2IDM5OC4yMiA0ODMuODIgMzIxLjk5IDUwNC4yMloiIGZpbGw9IiMzMGIyN2IiLz4KPC9zdmc+
|
||||
|
||||
36
build.gradle
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '0.11-SNAPSHOT'
|
||||
id 'fabric-loom' version '1.0-SNAPSHOT'
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||
@@ -32,7 +32,7 @@ boolean isMCVersionNonRelease() {
|
||||
}
|
||||
|
||||
String getMCVersionString() {
|
||||
if (isMCVersionNonRelease()) {
|
||||
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.3") {
|
||||
return project.minecraft_version
|
||||
}
|
||||
def version = project.minecraft_version.split('\\.')
|
||||
@@ -68,11 +68,12 @@ repositories {
|
||||
url 'https://maven.gegy.dev'
|
||||
}
|
||||
maven {
|
||||
name 'CottonMC'
|
||||
url 'https://server.bbkr.space/artifactory/libs-snapshot'
|
||||
name = "CottonMC"
|
||||
url = "https://server.bbkr.space/artifactory/libs-release"
|
||||
}
|
||||
maven { url "https://maven.terraformersmc.com/releases/" }
|
||||
maven { url 'https://maven.kosmx.dev' }
|
||||
maven { url 'https://maven.isxander.dev/releases' }
|
||||
maven { url 'https://maven.shedaniel.me/' }
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url "https://api.modrinth.com/maven" }
|
||||
@@ -101,7 +102,9 @@ dependencies {
|
||||
}
|
||||
include 'org.aperlambda:lambdajcommon:1.8.1'
|
||||
|
||||
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
|
||||
modCompileOnlyApi ("com.terraformersmc:modmenu:${project.modmenu_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
|
||||
// Compatibility mods
|
||||
|
||||
@@ -109,17 +112,30 @@ dependencies {
|
||||
// modImplementation("maven.modrinth:ok-zoomer:${project.ok_zoomer_version}")
|
||||
// modImplementation "io.github.ennuil:LibZoomer:${project.libzoomer_version}"
|
||||
|
||||
modImplementation "org.quiltmc:quilt-json5:1.0.0"
|
||||
modApi "maven.modrinth:sodium:${project.sodium_version}"
|
||||
//modImplementation("maven.modrinth:emi:${project.emi_version}")
|
||||
modImplementation "maven.modrinth:emotecraft:${project.emotecraft_version}"
|
||||
modImplementation "io.github.kosmx:bendy-lib:${project.bendylib_version}"
|
||||
modCompileOnlyApi ("io.github.cottonmc:LibGui:${project.libgui_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
modCompileOnlyApi "org.quiltmc:quilt-json5:1.0.0"
|
||||
modCompileOnly "maven.modrinth:sodium:${project.sodium_version}"
|
||||
modImplementation "maven.modrinth:emi:${project.emi_version}"
|
||||
modCompileOnlyApi "maven.modrinth:emotecraft:${project.emotecraft_version}"
|
||||
modCompileOnlyApi "io.github.kosmx:bendy-lib:${project.bendylib_version}"
|
||||
modImplementation ("dev.isxander:yet-another-config-lib:${project.yacl_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
modCompileOnlyApi "maven.modrinth:inventory-tabs-updated:${project.inventorytabs_version}"
|
||||
modCompileOnlyApi "maven.modrinth:bedrockify:${project.bedrockify_version}"
|
||||
// Required for Inventory Tabs
|
||||
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
|
||||
modImplementation "maven.modrinth:midnightlib:${project.midnightlib_version}"
|
||||
include "maven.modrinth:midnightlib:${project.midnightlib_version}"
|
||||
|
||||
shadow 'com.electronwill.night-config:core:3.6.3'
|
||||
shadow 'com.electronwill.night-config:toml:3.6.3'
|
||||
apply plugin: 'java-library'
|
||||
}
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/midnightcontrols.accesswidener")
|
||||
|
||||
@@ -3,26 +3,31 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.19
|
||||
yarn_mappings=1.19+build.1
|
||||
loader_version=0.14.7
|
||||
minecraft_version=1.19.2
|
||||
yarn_mappings=1.19.2+build.28
|
||||
loader_version=0.14.12
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.3.0
|
||||
mod_version = 1.7.4
|
||||
maven_group = eu.midnightdust
|
||||
archives_base_name = midnightcontrols
|
||||
modrinth_id=bXX9h73M
|
||||
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
fabric_version=0.55.2+1.19
|
||||
sodium_version=mc1.19-0.4.2
|
||||
fabric_version=0.72.0+1.19.2
|
||||
sodium_version=mc1.19.2-0.4.4
|
||||
spruceui_version=4.0.0+1.19
|
||||
midnightlib_version=0.5.2
|
||||
modmenu_version=4.0.0
|
||||
midnightlib_version=1.0.0-fabric
|
||||
modmenu_version=5.0.1
|
||||
emotecraft_version=2.1.3-SNAPSHOT-build.29-MC1.19-fabric
|
||||
bendylib_version=2.0.+
|
||||
emi_version=0.1.1+1.18.2
|
||||
emi_version=0.5.3+1.19.2
|
||||
libgui_version=6.0.0+1.19
|
||||
inventorytabs_version=inventorytabs-0.9.beta-1.19.x
|
||||
clothconfig_version=7.0.72
|
||||
yacl_version=1.7.1
|
||||
bedrockify_version=1.5+mc1.19.1-2
|
||||
|
||||
# Ok Zoomer and LibZoomer are temporarily disabled for the time being, as we are currently using Reflection at runtime instead in OkZoomerCompat due to there being two major, completely incompatible API versions.
|
||||
# ok_zoomer_version=5.0.0-beta.3+1.17.1
|
||||
|
||||
BIN
icon.png
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 174 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 184 KiB |
@@ -9,6 +9,7 @@
|
||||
|
||||
package eu.midnightdust.midnightcontrols;
|
||||
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import eu.midnightdust.midnightcontrols.event.PlayerChangeControlsModeCallback;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
@@ -16,7 +17,6 @@ import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -24,15 +24,16 @@ import java.util.Optional;
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public enum ControllerType implements Nameable {
|
||||
DEFAULT(0, Text.of("Default")),
|
||||
DUALSHOCK(1, Text.of("Dualshock")),
|
||||
DUALSENSE(2, Text.of("Dualsense")),
|
||||
SWITCH(3, Text.of("Switch")),
|
||||
XBOX_360(4, Text.of("Xbox 360")),
|
||||
XBOX(5, Text.of("Xbox")),
|
||||
STEAM_DECK(6, Text.of("Steam Deck")),
|
||||
STEAM_CONTROLLER(7, Text.of("Steam Controller")),
|
||||
OUYA(8, Text.of("Ouya"));
|
||||
DEFAULT(0),
|
||||
DUALSHOCK(1),
|
||||
DUALSENSE(2),
|
||||
SWITCH(3),
|
||||
XBOX_360(4),
|
||||
XBOX(5),
|
||||
STEAM_DECK(6),
|
||||
STEAM_CONTROLLER(7),
|
||||
OUYA(8),
|
||||
NUMBERED(9);
|
||||
|
||||
private final int id;
|
||||
private final Text text;
|
||||
|
||||
@@ -15,6 +15,7 @@ import eu.midnightdust.midnightcontrols.MidnightControls;
|
||||
import eu.midnightdust.midnightcontrols.MidnightControlsConstants;
|
||||
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.VoxelMapCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonCategory;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.Controller;
|
||||
@@ -22,8 +23,9 @@ import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsHud;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.RingScreen;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.TouchscreenOverlay;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.KeyBindingIDAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.KeyBindingRegistryImplAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.ring.KeyBindingRingAction;
|
||||
import eu.midnightdust.midnightcontrols.client.ring.ButtonBindingRingAction;
|
||||
import eu.midnightdust.midnightcontrols.client.ring.MidnightRing;
|
||||
import dev.lambdaurora.spruceui.hud.HudManager;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
@@ -45,6 +47,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* Represents the midnightcontrols client mod.
|
||||
@@ -55,6 +59,7 @@ import java.io.File;
|
||||
*/
|
||||
public class MidnightControlsClient extends MidnightControls implements ClientModInitializer {
|
||||
public static boolean lateInitDone = false;
|
||||
public static boolean voxelmapInitDone = false;
|
||||
private static MidnightControlsClient INSTANCE;
|
||||
public static final KeyBinding BINDING_LOOK_UP = InputManager.makeKeyBinding(new Identifier(MidnightControlsConstants.NAMESPACE, "look_up"),
|
||||
InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_8, "key.categories.movement");
|
||||
@@ -84,10 +89,9 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
|
||||
KeyBindingHelper.registerKeyBinding(BINDING_LOOK_RIGHT);
|
||||
KeyBindingHelper.registerKeyBinding(BINDING_LOOK_DOWN);
|
||||
KeyBindingHelper.registerKeyBinding(BINDING_LOOK_LEFT);
|
||||
//KeyBindingHelper.registerKeyBinding(BINDING_RING);
|
||||
KeyBindingHelper.registerKeyBinding(BINDING_RING);
|
||||
|
||||
this.ring.registerAction("keybinding", KeyBindingRingAction.FACTORY);
|
||||
this.ring.load();
|
||||
this.ring.registerAction("buttonbinding", ButtonBindingRingAction.FACTORY);
|
||||
|
||||
ClientPlayNetworking.registerGlobalReceiver(CONTROLS_MODE_CHANNEL, (client, handler, buf, responseSender) ->
|
||||
responseSender.sendPacket(CONTROLS_MODE_CHANNEL, this.makeControlsModeBuffer(MidnightControlsConfig.controlsMode)));
|
||||
@@ -120,8 +124,18 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
|
||||
});
|
||||
|
||||
HudManager.register(this.hud = new MidnightControlsHud(this));
|
||||
FabricLoader.getInstance().getModContainer("midnightcontrols").ifPresent(modContainer ->
|
||||
ResourceManagerHelper.registerBuiltinResourcePack(new Identifier("midnightcontrols","bedrock"), modContainer, ResourcePackActivationType.NORMAL));
|
||||
FabricLoader.getInstance().getModContainer("midnightcontrols").ifPresent(modContainer -> {
|
||||
ResourceManagerHelper.registerBuiltinResourcePack(new Identifier("midnightcontrols","bedrock"), modContainer, ResourcePackActivationType.NORMAL);
|
||||
ResourceManagerHelper.registerBuiltinResourcePack(new Identifier("midnightcontrols","legacy"), modContainer, ResourcePackActivationType.NORMAL);
|
||||
});
|
||||
int delay = 0; // delay for 0 sec.
|
||||
int period = 1; // repeat every 0.001 sec. (100 times a second)
|
||||
Timer timer = new Timer();
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
public void run() {
|
||||
input.updateCamera(MinecraftClient.getInstance());
|
||||
}
|
||||
}, delay, period);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,10 +166,16 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
|
||||
* This method is called to initialize keybindings
|
||||
*/
|
||||
public void initKeybindings() {
|
||||
if (!voxelmapInitDone && FabricLoader.getInstance().isModLoaded("voxelmap") && KeyBindingIDAccessor.getKEYS_BY_ID().containsKey("key.minimap.toggleingamewaypoints")) {
|
||||
this.log("Adding VoxelMap compatibility...");
|
||||
new VoxelMapCompat().handle(this);
|
||||
InputManager.loadButtonBindings();
|
||||
voxelmapInitDone = true;
|
||||
}
|
||||
if (lateInitDone) return;
|
||||
if (KeyBindingRegistryImplAccessor.getModdedKeyBindings() == null || KeyBindingRegistryImplAccessor.getModdedKeyBindings().isEmpty()) return;
|
||||
for (int i = 0; i < KeyBindingRegistryImplAccessor.getModdedKeyBindings().size(); ++i) {
|
||||
KeyBinding keyBinding = KeyBindingRegistryImplAccessor.getModdedKeyBindings().get(i);
|
||||
if (KeyBindingRegistryImplAccessor.getMODDED_KEY_BINDINGS() == null || KeyBindingRegistryImplAccessor.getMODDED_KEY_BINDINGS().isEmpty()) return;
|
||||
for (int i = 0; i < KeyBindingRegistryImplAccessor.getMODDED_KEY_BINDINGS().size(); ++i) {
|
||||
KeyBinding keyBinding = KeyBindingRegistryImplAccessor.getMODDED_KEY_BINDINGS().get(i);
|
||||
if (!keyBinding.getTranslationKey().contains("midnightcontrols") && !keyBinding.getTranslationKey().contains("ok_zoomer") && !keyBinding.getTranslationKey().contains("okzoomer")) {
|
||||
category = null;
|
||||
InputManager.streamCategories().forEach(buttonCategory -> {
|
||||
@@ -188,12 +208,20 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
|
||||
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput))
|
||||
this.input.tickController(client);
|
||||
|
||||
// if (BINDING_RING.wasPressed()) {
|
||||
// client.setScreen(new RingScreen());
|
||||
// }
|
||||
if (BINDING_RING.wasPressed()) {
|
||||
ring.loadFromUnbound();
|
||||
client.setScreen(new RingScreen());
|
||||
}
|
||||
if (client.world != null && MidnightControlsConfig.enableHints && !MidnightControlsConfig.autoSwitchMode && MidnightControlsConfig.controlsMode == ControlsMode.DEFAULT && MidnightControlsConfig.getController().isGamepad()) {
|
||||
client.getToastManager().add(SystemToast.create(client, SystemToast.Type.PERIODIC_NOTIFICATION, Text.translatable("midnightcontrols.controller.tutorial.title"),
|
||||
Text.translatable("midnightcontrols.controller.tutorial.description", Text.translatable("options.title"), Text.translatable("controls.title"),
|
||||
Text.translatable("midnightcontrols.menu.title.controller"))));
|
||||
MidnightControlsConfig.enableHints = false;
|
||||
MidnightControlsConfig.save();
|
||||
}
|
||||
}
|
||||
public void onRender(MinecraftClient client) {
|
||||
this.input.onRender(client.getTickDelta(), client);
|
||||
//this.input.onRender(client);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,12 +10,15 @@
|
||||
package eu.midnightdust.midnightcontrols.client;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import eu.midnightdust.midnightcontrols.ControlsMode;
|
||||
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.Controller;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
@@ -23,13 +26,14 @@ import org.lwjgl.glfw.GLFW;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_LEFT_X;
|
||||
import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_LEFT_Y;
|
||||
import static org.lwjgl.glfw.GLFW.*;
|
||||
|
||||
/**
|
||||
* Represents MidnightControls configuration.
|
||||
*/
|
||||
public class MidnightControlsConfig extends MidnightConfig {
|
||||
public static boolean isEditing = false;
|
||||
@Hidden @Entry public static int configVersion = 1;
|
||||
// General
|
||||
@Entry(name = "midnightcontrols.menu.controls_mode") public static ControlsMode controlsMode = ControlsMode.DEFAULT;
|
||||
@Entry(name = "midnightcontrols.menu.auto_switch_mode") public static boolean autoSwitchMode = true;
|
||||
@@ -37,34 +41,53 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
// HUD
|
||||
@Entry(name = "midnightcontrols.menu.hud_enable") public static boolean hudEnable = true;
|
||||
@Entry(name = "midnightcontrols.menu.hud_side") public static HudSide hudSide = HudSide.LEFT;
|
||||
@Entry(name = "midnightcontrols.menu.move_chat") public static boolean moveChat = false;
|
||||
// Gameplay
|
||||
@Entry(name = "midnightcontrols.menu.analog_movement") public static boolean analogMovement = true;
|
||||
@Entry(name = "midnightcontrols.menu.double_tap_to_sprint") public static boolean doubleTapToSprint = true;
|
||||
@Entry(name = "midnightcontrols.menu.controller_toggle_sneak") public static boolean controllerToggleSneak = MinecraftClient.getInstance().options.getSneakToggled().getValue();
|
||||
@Entry(name = "midnightcontrols.menu.controller_toggle_sprint") public static boolean controllerToggleSprint = MinecraftClient.getInstance().options.getSprintToggled().getValue();
|
||||
@Entry(name = "midnightcontrols.menu.fast_block_placing") public static boolean fastBlockPlacing = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(name = "midnightcontrols.menu.fly_drifting") public static boolean flyDrifting = true; // Enabled by default as disabling this behaviour can be considered cheating on multiplayer servers. It can also conflict with some other mods.
|
||||
@Entry(name = "midnightcontrols.menu.fly_drifting_vertical") public static boolean verticalFlyDrifting = true; // Enabled by default as disabling this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(name = "midnightcontrols.menu.reacharound.horizontal") public static boolean horizontalReacharound = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(name = "midnightcontrols.menu.reacharound.vertical") public static boolean verticalReacharound = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(name = "Reacharound Outline") public static boolean shouldRenderReacharoundOutline = true;
|
||||
@Entry(name = "Reacharound Outline Color") public static int[] reacharoundOutlineColor = new int[]{255, 255, 255, 102};
|
||||
@Entry(name = "Reacharound Outline Color (WIP)", isColor = true) public static String reacharoundOutlineColorHex = "#ffffff";
|
||||
@Entry(name = "Reacharound Outline Alpha", min = 0, max = 255) public static int reacharoundOutlineColorAlpha = 102;
|
||||
@Entry(name = "midnightcontrols.menu.right_dead_zone") public static double rightDeadZone = 0.25;
|
||||
@Entry(name = "midnightcontrols.menu.left_dead_zone") public static double leftDeadZone = 0.25;
|
||||
@Entry(name = "midnightcontrols.menu.invert_right_y_axis") public static boolean invertRightYAxis = false;
|
||||
@Entry(name = "midnightcontrols.menu.invert_right_x_axis") public static boolean invertRightXAxis = false;
|
||||
@Entry(name = "midnightcontrols.menu.rotation_speed") public static double rotationSpeed = 40.0; //used for x axis, name kept for compatability
|
||||
@Entry(name = "midnightcontrols.menu.rotation_speed") public static double rotationSpeed = 40.0; //used for x-axis, name kept for compatability
|
||||
@Entry(name = "midnightcontrols.menu.y_axis_rotation_speed") public static double yAxisRotationSpeed = rotationSpeed;
|
||||
@Entry(name = "midnightcontrols.menu.mouse_speed") public static double mouseSpeed = 25.0;
|
||||
@Entry(name = "midnightcontrols.menu.joystick_as_mouse") public static boolean joystickAsMouse = false;
|
||||
@Entry(name = "midnightcontrols.menu.unfocused_input") public static boolean unfocusedInput = false;
|
||||
@Entry(name = "midnightcontrols.menu.virtual_mouse") public static boolean virtualMouse = false;
|
||||
@Entry(name = "midnightcontrols.menu.virtual_mouse.skin") public static VirtualMouseSkin virtualMouseSkin = VirtualMouseSkin.DEFAULT_LIGHT;
|
||||
@Entry(name = "Controller ID") public static Object controllerID = 0;
|
||||
@Entry(name = "2nd Controller ID") public static Object secondControllerID = -1;
|
||||
@Entry(name = "midnightcontrols.menu.controller_type") public static ControllerType controllerType = ControllerType.DEFAULT;
|
||||
@Entry(name = "Mouse screens") public static List<String> mouseScreens = Lists.newArrayList("me.jellysquid.mods.sodium.client.gui", "net.coderbot.iris.gui", "net.minecraft.client.gui.screen.advancement", "net.minecraft.client.gui.screen.pack.PackScreen", "net.minecraft.class_5375", "net.minecraft.class_457", "net.minecraft.class_408", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen");
|
||||
@Entry(name = "Keybindings") public static Map<String, String> BINDINGS = new HashMap<>();
|
||||
@Entry(name = "Mouse screens") public static List<String> mouseScreens = Lists.newArrayList("me.jellysquid.mods.sodium.client.gui",
|
||||
"net.coderbot.iris.gui", "net.minecraft.client.gui.screen.advancement", "net.minecraft.client.gui.screen.pack.PackScreen", "net.minecraft.class_5375",
|
||||
"net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen",
|
||||
"hardcorequesting.client.interfaces.GuiQuestBook", "hardcorequesting.client.interfaces.GuiReward", "hardcorequesting.client.interfaces.EditTrackerScreen",
|
||||
"me.shedaniel.clothconfig2.gui.ClothConfigScreen", "com.mamiyaotaru.voxelmap.gui.GuiWaypoints", "com.mamiyaotaru.voxelmap.gui.GuiPersistentMap");
|
||||
@Entry(name = "Arrow screens") public static List<String> arrowScreens = Lists.newArrayList(ChatScreen.class.getCanonicalName());
|
||||
@Entry(name = "WASD screens") public static List<String> wasdScreens = Lists.newArrayList("com.ultreon.devices.core.Laptop");
|
||||
@Entry(name = "Keybindings") public static Map<String, String> BINDING = new HashMap<>();
|
||||
|
||||
private static final Pattern BUTTON_BINDING_PATTERN = Pattern.compile("(-?\\d+)\\+?");
|
||||
@Entry(name = "Max analog values") public static double[] maxAnalogValues = new double[]{1, 1, 1, 1};
|
||||
@Entry(name = "Trigger button fix") public static boolean triggerFix = true;
|
||||
@Entry(name = "Enable Hints") public static boolean enableHints = true;
|
||||
@Entry(name = "Enable Shortcut in Controls Options") public static boolean shortcutInControls = true;
|
||||
@Entry(name = "Ring Bindings (WIP)") public static List<String> ringBindings = new ArrayList<>();
|
||||
@Entry(name = "Ignored Unbound Keys") public static List<String> ignoredUnboundKeys = Lists.newArrayList("inventorytabs.key.next_tab");
|
||||
@Entry @Hidden public static Map<String, Map<String, String>> controllerBindingProfiles = new HashMap<>();
|
||||
private static Map<String, String> currentBindingProfile = new HashMap<>();
|
||||
private static Controller prevController;
|
||||
|
||||
/**
|
||||
* Loads the configuration
|
||||
@@ -74,7 +97,6 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
MidnightControlsClient.get().log("Configuration loaded.");
|
||||
// Controller controls.
|
||||
InputManager.loadButtonBindings();
|
||||
//this.mod.ring.load(this.config);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,6 +107,15 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
MidnightControlsClient.get().log("Configuration saved.");
|
||||
MidnightControlsFeature.refreshEnabled();
|
||||
}
|
||||
public static void updateBindingsForController(Controller controller) {
|
||||
if (controller.isConnected() && controller.isGamepad() && controllerBindingProfiles.containsKey(controller.getGuid()))
|
||||
currentBindingProfile = controllerBindingProfiles.get(controller.getGuid());
|
||||
else currentBindingProfile = Maps.newHashMap(BINDING);
|
||||
InputManager.loadButtonBindings();
|
||||
}
|
||||
public static Map<String, String> getBindingsForController() {
|
||||
return currentBindingProfile;
|
||||
}
|
||||
/**
|
||||
* Gets the used controller.
|
||||
*
|
||||
@@ -92,12 +123,25 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
*/
|
||||
public static Controller getController() {
|
||||
var raw = MidnightControlsConfig.controllerID;
|
||||
Controller controller = Controller.byId(GLFW.GLFW_JOYSTICK_1);
|
||||
if (raw instanceof Number) {
|
||||
return Controller.byId(((Number) raw).intValue());
|
||||
controller = Controller.byId(((Number) raw).intValue());
|
||||
} else if (raw instanceof String) {
|
||||
return Controller.byGuid((String) raw).orElse(Controller.byId(GLFW.GLFW_JOYSTICK_1));
|
||||
controller = Controller.byGuid((String) raw).orElse(Controller.byId(GLFW.GLFW_JOYSTICK_1));
|
||||
}
|
||||
return Controller.byId(GLFW.GLFW_JOYSTICK_1);
|
||||
if ((!controller.isConnected() || !controller.isGamepad()) && MidnightControlsConfig.autoSwitchMode && !isEditing) {
|
||||
for (int i = 0; i < GLFW.GLFW_JOYSTICK_LAST; ++i) {
|
||||
Controller gamepad = Controller.byId(i);
|
||||
if (gamepad.isConnected() && gamepad.isGamepad()) {
|
||||
controller = gamepad;
|
||||
i = GLFW_JOYSTICK_LAST;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (controller.isConnected() && controller.isGamepad() && MidnightControlsConfig.autoSwitchMode && !isEditing) MidnightControlsConfig.controlsMode = ControlsMode.CONTROLLER;
|
||||
if (prevController != controller) updateBindingsForController(controller);
|
||||
prevController = controller;
|
||||
return controller;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,7 +215,7 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
*/
|
||||
public static void loadButtonBinding(@NotNull ButtonBinding button) {
|
||||
button.setButton(button.getDefaultButton());
|
||||
var code = MidnightControlsConfig.BINDINGS.getOrDefault("controller.controls." + button.getName(), button.getButtonCode());
|
||||
var code = getBindingsForController().getOrDefault("controller.controls." + button.getName(), button.getButtonCode());
|
||||
|
||||
var matcher = BUTTON_BINDING_PATTERN.matcher(code);
|
||||
|
||||
@@ -195,14 +239,14 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
button.setButton(buttons);
|
||||
} catch (Exception e) {
|
||||
MidnightControlsClient.get().warn("Malformed config value \"" + code + "\" for binding \"" + button.getName() + "\".");
|
||||
MidnightControlsConfig.BINDINGS.put("controller.controls." + button.getName(), button.getButtonCode());
|
||||
setButtonBinding(button, button.getButton());
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean checkValidity(@NotNull ButtonBinding binding, @NotNull String input, String group) {
|
||||
if (group == null) {
|
||||
MidnightControlsClient.get().warn("Malformed config value \"" + input + "\" for binding \"" + binding.getName() + "\".");
|
||||
MidnightControlsConfig.BINDINGS.put("controller.controls." + binding.getName(), binding.getButtonCode());
|
||||
setButtonBinding(binding, binding.getButton());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -216,7 +260,9 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
*/
|
||||
public static void setButtonBinding(@NotNull ButtonBinding binding, int[] button) {
|
||||
binding.setButton(button);
|
||||
MidnightControlsConfig.BINDINGS.put("controller.controls." + binding.getName(), binding.getButtonCode());
|
||||
getBindingsForController().put("controller.controls." + binding.getName(), binding.getButtonCode());
|
||||
if (controllerBindingProfiles.containsKey(getController().getGuid())) controllerBindingProfiles.get(getController().getGuid()).put("controller.controls." + binding.getName(), binding.getButtonCode());
|
||||
else BINDING.put("controller.controls." + binding.getName(), binding.getButtonCode());
|
||||
}
|
||||
|
||||
public static boolean isBackButton(int btn, boolean isBtn, int state) {
|
||||
@@ -261,13 +307,16 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
hudSide = HudSide.LEFT;
|
||||
analogMovement = true;
|
||||
doubleTapToSprint = true;
|
||||
controllerToggleSneak = MinecraftClient.getInstance().options.getSneakToggled().getValue();
|
||||
controllerToggleSprint = MinecraftClient.getInstance().options.getSprintToggled().getValue();
|
||||
fastBlockPlacing = false;
|
||||
flyDrifting = true;
|
||||
verticalFlyDrifting = true;
|
||||
horizontalReacharound = false;
|
||||
verticalReacharound = false;
|
||||
shouldRenderReacharoundOutline = true;
|
||||
reacharoundOutlineColor = new int[]{255, 255, 255, 102};
|
||||
reacharoundOutlineColorHex = "#ffffff";
|
||||
reacharoundOutlineColorAlpha = 102;
|
||||
rightDeadZone = 0.25;
|
||||
leftDeadZone = 0.25;
|
||||
invertRightYAxis = false;
|
||||
@@ -281,9 +330,15 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
controllerID = 0;
|
||||
secondControllerID = -1;
|
||||
controllerType = ControllerType.DEFAULT;
|
||||
mouseScreens = Lists.newArrayList("me.jellysquid.mods.sodium.client.gui", "net.coderbot.iris.gui", "net.minecraft.client.gui.screen.advancement", "net.minecraft.client.gui.screen.pack.PackScreen", "net.minecraft.class_5375", "net.minecraft.class_457", "net.minecraft.class_408", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen");
|
||||
BINDINGS = new HashMap<>();
|
||||
mouseScreens = Lists.newArrayList("me.jellysquid.mods.sodium.client.gui", "net.coderbot.iris.gui", "net.minecraft.client.gui.screen.advancement", "net.minecraft.client.gui.screen.pack.PackScreen", "net.minecraft.class_5375", "net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen", "me.shedaniel.clothconfig2.gui.ClothConfigScreen", "com.mamiyaotaru.voxelmap.gui.GuiWaypoints", "com.mamiyaotaru.voxelmap.gui.GuiPersistentMap");
|
||||
BINDING = new HashMap<>();
|
||||
maxAnalogValues = new double[]{1, 1, 1, 1};
|
||||
triggerFix = true;
|
||||
enableHints = true;
|
||||
shortcutInControls = true;
|
||||
ringBindings = new ArrayList<>();
|
||||
ignoredUnboundKeys = Lists.newArrayList("inventorytabs.key.next_tab");
|
||||
controllerBindingProfiles = new HashMap<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -297,9 +352,9 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
else if (controller.contains("xbox") || controller.contains("afterglow")) return ControllerType.XBOX;
|
||||
else if (controller.contains("steam deck")) return ControllerType.STEAM_DECK;
|
||||
else if (controller.contains("steam")) return ControllerType.STEAM_CONTROLLER;
|
||||
else if (controller.contains("dualsense")) return ControllerType.DUALSENSE;
|
||||
else if (controller.contains("dualshock") || controller.contains("ps4")) return ControllerType.DUALSHOCK;
|
||||
else if (controller.contains("switch") || controller.contains("joy-con")) return ControllerType.SWITCH;
|
||||
else if (controller.contains("dualsense") || controller.contains("ps5")) return ControllerType.DUALSENSE;
|
||||
else if (controller.contains("dualshock") || controller.contains("ps4") || controller.contains("sony")) return ControllerType.DUALSHOCK;
|
||||
else if (controller.contains("switch") || controller.contains("joy-con") || controller.contains("wii") || controller.contains("nintendo")) return ControllerType.SWITCH;
|
||||
else if (controller.contains("ouya")) return ControllerType.OUYA;
|
||||
else return ControllerType.DEFAULT;
|
||||
}
|
||||
|
||||
@@ -10,19 +10,18 @@
|
||||
package eu.midnightdust.midnightcontrols.client;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import dev.lambdaurora.spruceui.widget.AbstractSpruceWidget;
|
||||
import dev.lambdaurora.spruceui.widget.container.SpruceEntryListWidget;
|
||||
import dev.lambdaurora.spruceui.widget.container.SpruceOptionListWidget;
|
||||
import eu.midnightdust.midnightcontrols.MidnightControls;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.SodiumCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.*;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.Controller;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.RingScreen;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.TouchscreenOverlay;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.widget.ControllerControlsWidget;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.AdvancementsScreenAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.CreativeInventoryScreenAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.EntryListWidgetAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.*;
|
||||
import eu.midnightdust.midnightcontrols.client.ring.RingPage;
|
||||
import eu.midnightdust.midnightcontrols.client.util.HandledScreenAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.util.MouseAccessor;
|
||||
import dev.lambdaurora.spruceui.navigation.NavigationDirection;
|
||||
@@ -31,7 +30,6 @@ import dev.lambdaurora.spruceui.widget.AbstractSprucePressableButtonWidget;
|
||||
import dev.lambdaurora.spruceui.widget.SpruceElement;
|
||||
import dev.lambdaurora.spruceui.widget.SpruceLabelWidget;
|
||||
import dev.lambdaurora.spruceui.widget.container.SpruceParentWidget;
|
||||
import net.fabricmc.fabric.impl.item.group.CreativeGuiExtensions;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.Element;
|
||||
@@ -43,16 +41,15 @@ import net.minecraft.client.gui.screen.advancement.AdvancementsScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.MerchantScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.StonecutterScreen;
|
||||
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
|
||||
import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget;
|
||||
import net.minecraft.client.gui.screen.world.WorldListWidget;
|
||||
import net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget;
|
||||
import net.minecraft.client.gui.widget.EntryListWidget;
|
||||
import net.minecraft.client.gui.widget.PressableWidget;
|
||||
import net.minecraft.client.gui.widget.SliderWidget;
|
||||
import net.minecraft.client.gui.widget.*;
|
||||
import net.minecraft.client.input.Input;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.screen.slot.SlotActionType;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableTextContent;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.aperlambda.lambdacommon.utils.Pair;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -76,6 +73,7 @@ public class MidnightInput {
|
||||
// Cooldowns
|
||||
public int actionGuiCooldown = 0;
|
||||
public boolean ignoreNextARelease = false;
|
||||
public boolean ignoreNextXRelease = false;
|
||||
private double targetYaw = 0.0;
|
||||
private double targetPitch = 0.0;
|
||||
private float prevXAxis = 0.f;
|
||||
@@ -85,6 +83,7 @@ public class MidnightInput {
|
||||
private float mouseSpeedX = 0.f;
|
||||
private float mouseSpeedY = 0.f;
|
||||
public int inventoryInteractionCooldown = 0;
|
||||
public int screenCloseCooldown = 0;
|
||||
|
||||
private ControllerControlsWidget controlsInput = null;
|
||||
|
||||
@@ -125,10 +124,13 @@ public class MidnightInput {
|
||||
// Decreases the cooldown for GUI actions.
|
||||
if (this.actionGuiCooldown > 0)
|
||||
--this.actionGuiCooldown;
|
||||
if (this.screenCloseCooldown > 0)
|
||||
--this.screenCloseCooldown;
|
||||
|
||||
InputManager.updateStates();
|
||||
|
||||
var controller = MidnightControlsConfig.getController();
|
||||
|
||||
if (controller.isConnected()) {
|
||||
var state = controller.getState();
|
||||
this.fetchButtonInput(client, state, false);
|
||||
@@ -141,10 +143,7 @@ public class MidnightInput {
|
||||
this.fetchAxeInput(client, state, true);
|
||||
});
|
||||
|
||||
boolean allowInput = true;
|
||||
|
||||
if (this.controlsInput != null && this.controlsInput.focusedBinding != null)
|
||||
allowInput = false;
|
||||
boolean allowInput = this.controlsInput == null || this.controlsInput.focusedBinding == null;
|
||||
|
||||
if (allowInput)
|
||||
InputManager.updateBindings(client);
|
||||
@@ -177,11 +176,11 @@ public class MidnightInput {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called when Minecraft renders.
|
||||
* This method is called to update the camera
|
||||
*
|
||||
* @param client the client instance
|
||||
*/
|
||||
public void onRender(float tickDelta, @NotNull MinecraftClient client) {
|
||||
public void updateCamera(@NotNull MinecraftClient client) {
|
||||
if (!(client.currentScreen == null || client.currentScreen instanceof TouchscreenOverlay))
|
||||
return;
|
||||
|
||||
@@ -190,16 +189,29 @@ public class MidnightInput {
|
||||
return;
|
||||
|
||||
if (this.targetYaw != 0.f || this.targetPitch != 0.f) {
|
||||
float rotationYaw = (float) (player.prevYaw + (this.targetYaw / 0.10) * tickDelta);
|
||||
float rotationPitch = (float) (player.prevPitch + (this.targetPitch / 0.10) * tickDelta);
|
||||
float rotationYaw = (float) (client.player.prevYaw + (this.targetYaw * 0.175));
|
||||
float rotationPitch = (float) (client.player.prevPitch + (this.targetPitch * 0.175));
|
||||
client.player.prevYaw = rotationYaw;
|
||||
client.player.prevPitch = MathHelper.clamp(rotationPitch, -90.f, 90.f);
|
||||
client.player.setYaw(rotationYaw);
|
||||
client.player.setPitch(MathHelper.clamp(rotationPitch, -90.f, 90.f));
|
||||
if (client.player.isRiding()) {
|
||||
if (client.player.isRiding() && client.player.getVehicle() != null) {
|
||||
client.player.getVehicle().onPassengerLookAround(client.player);
|
||||
}
|
||||
client.getTutorialManager().onUpdateMouse(this.targetPitch, this.targetYaw);
|
||||
MidnightControlsCompat.HANDLERS.forEach(handler -> handler.handleCamera(client, targetYaw, targetPitch));
|
||||
this.onRender(client);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This method is deprecated and will be removed in future versions
|
||||
* It is just kept, because the current version of 'Do a Barrel Roll' mixins into this method
|
||||
*
|
||||
* @param client the client instance
|
||||
*/
|
||||
@Deprecated
|
||||
public void onRender(@NotNull MinecraftClient client) {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called when a Screen is opened.
|
||||
@@ -263,7 +275,30 @@ public class MidnightInput {
|
||||
value *= -1.0F;
|
||||
|
||||
int state = value > MidnightControlsConfig.rightDeadZone ? 1 : (value < -MidnightControlsConfig.rightDeadZone ? 2 : 0);
|
||||
this.handleAxe(client, axis, value, absValue, state);
|
||||
if (!(client.currentScreen instanceof RingScreen || (MidnightControlsCompat.isEmotecraftPresent() && EmotecraftCompat.isEmotecraftScreen(client.currentScreen)))) this.handleAxe(client, axis, value, absValue, state);
|
||||
}
|
||||
if (client.currentScreen instanceof RingScreen || (MidnightControlsCompat.isEmotecraftPresent() && EmotecraftCompat.isEmotecraftScreen(client.currentScreen))) {
|
||||
float x = Math.abs(buffer.get(GLFW_GAMEPAD_AXIS_LEFT_X)) > MidnightControlsConfig.leftDeadZone ? buffer.get(GLFW_GAMEPAD_AXIS_LEFT_X) : 0;
|
||||
float y = Math.abs(buffer.get(GLFW_GAMEPAD_AXIS_LEFT_Y)) > MidnightControlsConfig.leftDeadZone ? buffer.get(GLFW_GAMEPAD_AXIS_LEFT_Y) : 0;
|
||||
if (x == 0 && y == 0) {
|
||||
x = Math.abs(buffer.get(GLFW_GAMEPAD_AXIS_RIGHT_X)) > MidnightControlsConfig.rightDeadZone ? buffer.get(GLFW_GAMEPAD_AXIS_RIGHT_X) : 0;
|
||||
y = Math.abs(buffer.get(GLFW_GAMEPAD_AXIS_RIGHT_Y)) > MidnightControlsConfig.rightDeadZone ? buffer.get(GLFW_GAMEPAD_AXIS_RIGHT_Y) : 0;
|
||||
}
|
||||
int index = -1;
|
||||
if (x < 0) {
|
||||
if (y < 0) index = 0;
|
||||
if (y == 0) index = 3;
|
||||
if (y > 0) index = 5;
|
||||
} else if (x == 0) {
|
||||
if (y < 0) index = 1;
|
||||
if (y > 0) index = 6;
|
||||
} else if (x > 0) {
|
||||
if (y < 0) index = 2;
|
||||
if (y == 0) index = 4;
|
||||
if (y > 0) index = 7;
|
||||
}
|
||||
if (client.currentScreen instanceof RingScreen && index > -1) RingPage.selected = index;
|
||||
if (MidnightControlsCompat.isEmotecraftPresent() && EmotecraftCompat.isEmotecraftScreen(client.currentScreen)) EmotecraftCompat.handleEmoteSelector(index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,12 +317,33 @@ public class MidnightInput {
|
||||
return;
|
||||
}
|
||||
|
||||
if (action == 0 || action == 2) {
|
||||
if (client.currentScreen != null && (action == 0 || action == 2) && button == GLFW_GAMEPAD_BUTTON_Y &&
|
||||
MidnightControlsConfig.arrowScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
||||
pressKeyboardKey(client, GLFW.GLFW_KEY_ENTER);
|
||||
this.screenCloseCooldown = 5;
|
||||
}
|
||||
else if (action == 0 || action == 2) {
|
||||
if (client.currentScreen != null
|
||||
&& (button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_UP || button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN
|
||||
|| button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_LEFT || button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_RIGHT)) {
|
||||
if (this.actionGuiCooldown == 0) {
|
||||
if (button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_UP) {
|
||||
if (MidnightControlsConfig.arrowScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
||||
switch (button) {
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> pressKeyboardKey(client, GLFW.GLFW_KEY_UP);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> pressKeyboardKey(client, GLFW.GLFW_KEY_DOWN);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_LEFT -> pressKeyboardKey(client, GLFW.GLFW_KEY_LEFT);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> pressKeyboardKey(client, GLFW.GLFW_KEY_RIGHT);
|
||||
}
|
||||
}
|
||||
else if (MidnightControlsConfig.wasdScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
||||
switch (button) {
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> pressKeyboardKey(client, GLFW.GLFW_KEY_W);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> pressKeyboardKey(client, GLFW.GLFW_KEY_S);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_LEFT -> pressKeyboardKey(client, GLFW.GLFW_KEY_A);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> pressKeyboardKey(client, GLFW.GLFW_KEY_D);
|
||||
}
|
||||
}
|
||||
else if (button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_UP) {
|
||||
this.changeFocus(client.currentScreen, NavigationDirection.UP);
|
||||
} else if (button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN) {
|
||||
this.changeFocus(client.currentScreen, NavigationDirection.DOWN);
|
||||
@@ -307,39 +363,68 @@ public class MidnightInput {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (button == GLFW.GLFW_GAMEPAD_BUTTON_B) {
|
||||
if (client.currentScreen != null && client.currentScreen.getClass() != TitleScreen.class) {
|
||||
if (!MidnightControlsCompat.handleMenuBack(client, client.currentScreen))
|
||||
if (!this.tryGoBack(client.currentScreen))
|
||||
client.currentScreen.close();
|
||||
return;
|
||||
else if (FabricLoader.getInstance().isModLoaded("libgui")) LibGuiCompat.handlePress(client.currentScreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (button == GLFW.GLFW_GAMEPAD_BUTTON_A && client.currentScreen != null && !isScreenInteractive(client.currentScreen)
|
||||
&& this.actionGuiCooldown == 0) {
|
||||
if (client.currentScreen instanceof CreativeInventoryScreen creativeScreen && ((HandledScreenAccessor) creativeScreen).midnightcontrols$getSlotAt(
|
||||
if (client.currentScreen instanceof HandledScreen<?> handledScreen && ((HandledScreenAccessor) handledScreen).midnightcontrols$getSlotAt(
|
||||
client.mouse.getX() * (double) client.getWindow().getScaledWidth() / (double) client.getWindow().getWidth(),
|
||||
client.mouse.getY() * (double) client.getWindow().getScaledHeight() / (double) client.getWindow().getHeight()) != null) return;
|
||||
if (!this.ignoreNextARelease) {
|
||||
double mouseX = client.mouse.getX() * (double) client.getWindow().getScaledWidth() / (double) client.getWindow().getWidth();
|
||||
double mouseY = client.mouse.getY() * (double) client.getWindow().getScaledHeight() / (double) client.getWindow().getHeight();
|
||||
if (action == 0) {
|
||||
Screen.wrapScreenError(() -> client.currentScreen.mouseClicked(mouseX, mouseY, GLFW.GLFW_MOUSE_BUTTON_1),
|
||||
Screen.wrapScreenError(() -> {
|
||||
((MouseAccessor) client.mouse).setLeftButtonClicked(false);
|
||||
client.currentScreen.mouseClicked(mouseX, mouseY, GLFW.GLFW_MOUSE_BUTTON_1);
|
||||
},
|
||||
"mouseClicked event handler", client.currentScreen.getClass().getCanonicalName());
|
||||
} else if (action == 1) {
|
||||
Screen.wrapScreenError(() -> client.currentScreen.mouseReleased(mouseX, mouseY, GLFW.GLFW_MOUSE_BUTTON_1),
|
||||
Screen.wrapScreenError(() -> {
|
||||
((MouseAccessor) client.mouse).setLeftButtonClicked(false);
|
||||
client.currentScreen.mouseReleased(mouseX, mouseY, GLFW.GLFW_MOUSE_BUTTON_1);
|
||||
},
|
||||
"mouseReleased event handler", client.currentScreen.getClass().getCanonicalName());
|
||||
} else if (action == 2) {
|
||||
Screen.wrapScreenError(() -> {
|
||||
client.currentScreen.setDragging(true);
|
||||
((MouseAccessor) client.mouse).setLeftButtonClicked(true);
|
||||
((MouseAccessor) client.mouse).midnightcontrols$onCursorPos(client.getWindow().getHandle(), client.mouse.getX(), client.mouse.getY());
|
||||
client.currentScreen.setDragging(false);
|
||||
},
|
||||
"mouseClicked event handler", client.currentScreen.getClass().getCanonicalName());
|
||||
}
|
||||
this.actionGuiCooldown = 5;
|
||||
this.screenCloseCooldown = 5;
|
||||
} else {
|
||||
this.ignoreNextARelease = false;
|
||||
}
|
||||
}
|
||||
else if (button == GLFW.GLFW_GAMEPAD_BUTTON_X && client.currentScreen != null && !isScreenInteractive(client.currentScreen)
|
||||
&& this.actionGuiCooldown == 0) {
|
||||
if (client.currentScreen instanceof HandledScreen<?> handledScreen && ((HandledScreenAccessor) handledScreen).midnightcontrols$getSlotAt(
|
||||
client.mouse.getX() * (double) client.getWindow().getScaledWidth() / (double) client.getWindow().getWidth(),
|
||||
client.mouse.getY() * (double) client.getWindow().getScaledHeight() / (double) client.getWindow().getHeight()) != null) return;
|
||||
if (!this.ignoreNextXRelease) {
|
||||
double mouseX = client.mouse.getX() * (double) client.getWindow().getScaledWidth() / (double) client.getWindow().getWidth();
|
||||
double mouseY = client.mouse.getY() * (double) client.getWindow().getScaledHeight() / (double) client.getWindow().getHeight();
|
||||
if (action == 0) {
|
||||
Screen.wrapScreenError(() -> client.currentScreen.mouseClicked(mouseX, mouseY, GLFW.GLFW_MOUSE_BUTTON_2),
|
||||
"mouseClicked event handler", client.currentScreen.getClass().getCanonicalName());
|
||||
} else if (action == 1) {
|
||||
Screen.wrapScreenError(() -> client.currentScreen.mouseReleased(mouseX, mouseY, GLFW.GLFW_MOUSE_BUTTON_2),
|
||||
"mouseReleased event handler", client.currentScreen.getClass().getCanonicalName());
|
||||
}
|
||||
this.screenCloseCooldown = 5;
|
||||
} else {
|
||||
this.ignoreNextXRelease = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void pressKeyboardKey(MinecraftClient client, int key) {
|
||||
client.keyboard.onKey(client.getWindow().getHandle(), key, 0, 1, 0);
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -351,13 +436,16 @@ public class MidnightInput {
|
||||
*/
|
||||
public boolean tryGoBack(@NotNull Screen screen) {
|
||||
var set = ImmutableSet.of("gui.back", "gui.done", "gui.cancel", "gui.toTitle", "gui.toMenu");
|
||||
|
||||
return screen.children().stream().filter(element -> element instanceof PressableWidget)
|
||||
.map(element -> (PressableWidget) element)
|
||||
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
||||
.anyMatch(element -> {
|
||||
if (set.stream().anyMatch(key -> element.getMessage().getContent().toString().equals(key))) {
|
||||
element.onPress();
|
||||
return true;
|
||||
if (element.getMessage().getContent() instanceof TranslatableTextContent translatableText) {
|
||||
if (set.stream().anyMatch(key -> translatableText.getKey().equals(key))) {
|
||||
element.onPress();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
@@ -371,11 +459,24 @@ public class MidnightInput {
|
||||
private void handleAxe(@NotNull MinecraftClient client, int axis, float value, float absValue, int state) {
|
||||
int asButtonState = value > .5f ? 1 : (value < -.5f ? 2 : 0);
|
||||
|
||||
|
||||
if (axis == GLFW_GAMEPAD_AXIS_LEFT_TRIGGER || axis == GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
|
||||
|| axis == ButtonBinding.controller2Button(GLFW.GLFW_GAMEPAD_AXIS_LEFT_TRIGGER)
|
||||
|| axis == ButtonBinding.controller2Button(GLFW.GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER))
|
||||
if (asButtonState == 2)
|
||||
|| axis == ButtonBinding.controller2Button(GLFW.GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER)) {
|
||||
if (asButtonState == 2) {
|
||||
asButtonState = 0;
|
||||
}
|
||||
else {
|
||||
// Fixes Triggers not working correctly on some controllers
|
||||
if (MidnightControlsConfig.triggerFix) {
|
||||
value = 1.0f;
|
||||
absValue = 1.0f;
|
||||
state = 1;
|
||||
asButtonState = 1;
|
||||
}
|
||||
if (MidnightControlsConfig.debug) System.out.println(axis + " "+ value + " " + absValue + " " + state);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
boolean currentPlusState = asButtonState == 1;
|
||||
@@ -452,6 +553,14 @@ public class MidnightInput {
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else if (client.currentScreen instanceof StonecutterScreen stonecutterScreen) {
|
||||
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_Y) {
|
||||
// @TODO allow rebinding to left stick
|
||||
if (absValue >= deadZone) {
|
||||
stonecutterScreen.mouseScrolled(0.0, 0.0, -(value * 1.5f));
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else if (client.currentScreen instanceof AdvancementsScreen advancementsScreen) {
|
||||
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_X || axis == GLFW_GAMEPAD_AXIS_RIGHT_Y) {
|
||||
var accessor = (AdvancementsScreenAccessor) advancementsScreen;
|
||||
@@ -463,21 +572,26 @@ public class MidnightInput {
|
||||
}
|
||||
} else if (client.currentScreen != null) {
|
||||
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_Y && absValue >= deadZone) {
|
||||
client.currentScreen.children().stream().filter(element -> element instanceof EntryListWidget)
|
||||
float finalValue = value;
|
||||
if (client.currentScreen.children().stream().filter(element -> element instanceof SpruceEntryListWidget)
|
||||
.map(element -> (SpruceEntryListWidget<?>) element)
|
||||
.filter(AbstractSpruceWidget::isFocusedOrHovered)
|
||||
.noneMatch(element -> {
|
||||
element.mouseScrolled(0.0, 0.0, -finalValue);
|
||||
return true;
|
||||
})
|
||||
&&
|
||||
client.currentScreen.children().stream().filter(element -> element instanceof EntryListWidget)
|
||||
.map(element -> (EntryListWidget<?>) element)
|
||||
.filter(element -> element.getType().isFocused())
|
||||
.anyMatch(element -> {
|
||||
element.mouseScrolled(0.0, 0.0, -value);
|
||||
.noneMatch(element -> {
|
||||
element.mouseScrolled(0.0, 0.0, -finalValue);
|
||||
return true;
|
||||
});
|
||||
client.currentScreen.children().stream().filter(element -> element instanceof SpruceEntryListWidget)
|
||||
.map(element -> (SpruceEntryListWidget<?>) element)
|
||||
.filter(element -> element.getType().isFocused())
|
||||
.anyMatch(element -> {
|
||||
MidnightControls.get().log(String.valueOf(value));
|
||||
element.mouseScrolled(0.0, 0.0, -value);
|
||||
return true;
|
||||
});
|
||||
}))
|
||||
{
|
||||
client.currentScreen.mouseScrolled(0.0, 0.0, -(value * 1.5f));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -578,6 +692,8 @@ public class MidnightInput {
|
||||
var childFocused = widget.getFocused();
|
||||
if (childFocused != null)
|
||||
return this.handleAButton(screen, childFocused);
|
||||
} else if (FabricLoader.getInstance().isModLoaded("yet-another-config-lib") && YACLCompat.handleAButton(screen, focused)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -594,6 +710,10 @@ public class MidnightInput {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
}
|
||||
if (FabricLoader.getInstance().isModLoaded("yet-another-config-lib") && YACLCompat.handleLeftRight(screen, right)) {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
}
|
||||
var focused = screen.getFocused();
|
||||
if (focused != null)
|
||||
if (this.handleRightLeftElement(focused, right))
|
||||
@@ -612,7 +732,7 @@ public class MidnightInput {
|
||||
this.actionGuiCooldown = 2; // Prevent to press too quickly the focused element, so we have to skip 5 ticks.
|
||||
return false;
|
||||
} else if (element instanceof AlwaysSelectedEntryListWidget) {
|
||||
((EntryListWidgetAccessor) element).midnightcontrols$moveSelection(right ? EntryListWidget.MoveDirection.UP : EntryListWidget.MoveDirection.DOWN);
|
||||
((EntryListWidgetAccessor) element).midnightcontrols$moveSelection(right ? EntryListWidget.MoveDirection.DOWN : EntryListWidget.MoveDirection.UP);
|
||||
return false;
|
||||
} else if (element instanceof ParentElement entryList) {
|
||||
var focused = entryList.getFocused();
|
||||
@@ -653,27 +773,95 @@ public class MidnightInput {
|
||||
}
|
||||
|
||||
private boolean changeFocus(@NotNull Screen screen, NavigationDirection direction) {
|
||||
if (screen instanceof SpruceScreen spruceScreen) {
|
||||
if (spruceScreen.onNavigation(direction, false)) {
|
||||
this.actionGuiCooldown = 5;
|
||||
if (!isScreenInteractive(screen) && !screen.getClass().getCanonicalName().contains("me.jellysquid.mods.sodium.client.gui")) return false;
|
||||
try {
|
||||
if (screen instanceof SpruceScreen spruceScreen) {
|
||||
if (spruceScreen.onNavigation(direction, false)) {
|
||||
this.actionGuiCooldown = 5;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (FabricLoader.getInstance().isModLoaded("sodium")) SodiumCompat.handleInput(screen, direction.isLookingForward());
|
||||
if (!screen.changeFocus(direction.isLookingForward())) {
|
||||
if (screen.changeFocus(direction.isLookingForward())) {
|
||||
if (FabricLoader.getInstance().isModLoaded("sodium"))
|
||||
SodiumCompat.handleInput(screen, direction.isLookingForward());
|
||||
// This still needs some work
|
||||
// ScreenAccessor accessor = (ScreenAccessor) screen;
|
||||
// if (accessor.getSelected() != null && accessor.getSelected() instanceof ClickableWidget selected && accessor.getSelectables() != null) {
|
||||
// //System.out.println(direction);
|
||||
// if (accessor.getSelectables().size() >= 2) {
|
||||
// //System.out.println(direction + " 2");
|
||||
// int xDifference = Integer.MAX_VALUE;
|
||||
// int yDifference = Integer.MAX_VALUE;
|
||||
// ClickableWidget newWidget = null;
|
||||
// for (int i = 0; i < accessor.getSelectables().size(); ++i) {
|
||||
// if (accessor.getSelectables().get(i) instanceof ClickableWidget candidate) {
|
||||
// if (!(candidate.x == selected.x && candidate.y == selected.y)) {
|
||||
// int canXDifference = Math.abs(candidate.x - selected.x);
|
||||
// int canYDifference = Math.abs(candidate.y - selected.y);
|
||||
// if (direction.isHorizontal()) {
|
||||
// if (direction.isLookingForward()) {
|
||||
// if (candidate.x >= selected.x && canYDifference <= yDifference && canXDifference <= xDifference) {
|
||||
// System.out.println(direction + " forward horizontal " + candidate);
|
||||
// newWidget = candidate;
|
||||
// xDifference = canXDifference;
|
||||
// yDifference = canYDifference;
|
||||
// }
|
||||
// } else {
|
||||
// if (candidate.x <= selected.x && canYDifference <= yDifference && canXDifference >= xDifference) {
|
||||
// System.out.println(direction + " backward horizontal " + candidate);
|
||||
// newWidget = candidate;
|
||||
// xDifference = canXDifference;
|
||||
// yDifference = canYDifference;
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// if (direction.isLookingForward()) {
|
||||
// if (candidate.y >= selected.y && canYDifference <= yDifference && canXDifference <= xDifference) {
|
||||
// System.out.println(direction + " forward vertical " + candidate);
|
||||
// newWidget = candidate;
|
||||
// xDifference = canXDifference;
|
||||
// yDifference = canYDifference;
|
||||
// }
|
||||
// } else {
|
||||
// if (candidate.y <= selected.y && canYDifference >= yDifference && canXDifference <= xDifference) {
|
||||
// System.out.println(direction + " backward vertical " + candidate);
|
||||
// newWidget = candidate;
|
||||
// xDifference = canXDifference;
|
||||
// yDifference = canYDifference;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (newWidget != null) {
|
||||
// //selected.changeFocus(true);
|
||||
// ((ClickableWidgetAccessor) selected).setFocused(false);
|
||||
// ((ClickableWidgetAccessor) newWidget).setFocused(true);
|
||||
// screen.setFocused(newWidget);
|
||||
// screen.changeFocus(false);
|
||||
// screen.changeFocus(true);
|
||||
// this.actionGuiCooldown = 5;
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
if (!screen.changeFocus(direction.isLookingForward())) {
|
||||
if (screen.changeFocus(direction.isLookingForward())) {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
}
|
||||
} catch (Exception exception) {MidnightControls.get().warn("Unknown exception encountered while trying to change focus: "+exception);}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isScreenInteractive(@NotNull Screen screen) {
|
||||
return !(screen instanceof HandledScreen || MidnightControlsConfig.mouseScreens.stream().anyMatch(a -> screen.getClass().toString().contains(a))
|
||||
return !(screen instanceof HandledScreen || MidnightControlsConfig.joystickAsMouse || MidnightControlsConfig.mouseScreens.stream().anyMatch(a -> screen.getClass().toString().contains(a))
|
||||
|| (screen instanceof SpruceScreen && ((SpruceScreen) screen).requiresCursor())
|
||||
|| MidnightControlsCompat.requireMouseOnScreen(screen));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright © 2022 Motschen <motschen@midnightdust.eu>
|
||||
*
|
||||
* This file is part of midnightcontrols.
|
||||
*
|
||||
* Licensed under the MIT license. For more information,
|
||||
* see the LICENSE file.
|
||||
*/
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.compat;
|
||||
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import me.juancarloscp52.bedrockify.client.BedrockifyClient;
|
||||
import me.juancarloscp52.bedrockify.client.BedrockifyClientSettings;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import org.aperlambda.lambdacommon.utils.LambdaReflection;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Represents HQM compatibility handler.
|
||||
*
|
||||
* @author Motschen
|
||||
* @version 1.7.0
|
||||
* @since 1.7.0
|
||||
*/
|
||||
public class BedrockifyCompat implements CompatHandler {
|
||||
|
||||
@Override
|
||||
public void handle(@NotNull MidnightControlsClient mod) {
|
||||
BedrockifyClient.getInstance().settings.disableFlyingMomentum = false;
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,13 @@ public interface CompatHandler {
|
||||
*/
|
||||
void handle(@NotNull MidnightControlsClient mod);
|
||||
|
||||
/**
|
||||
* Handles custom camera updates
|
||||
*
|
||||
* @param client the Minecraft client instance
|
||||
*/
|
||||
default void handleCamera(@NotNull MinecraftClient client, double targetYaw, double targetPitch) {};
|
||||
|
||||
/**
|
||||
* Returns whether the mouse is required on the specified screen.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package eu.midnightdust.midnightcontrols.client.compat;
|
||||
|
||||
import dev.emi.emi.config.EmiConfig;
|
||||
import dev.emi.emi.screen.EmiScreen;
|
||||
import dev.emi.emi.screen.EmiScreenManager;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonCategory;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import org.aperlambda.lambdacommon.Identifier;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class EMICompat implements CompatHandler {
|
||||
public static boolean handleTabs(boolean direction) {
|
||||
if (isEMIEnabled() && MidnightControlsClient.get().input.actionGuiCooldown == 0 && EmiScreenManager.getSearchPanel() != null && EmiScreenManager.getSearchPanel().pageLeft != null && EmiScreenManager.getSearchPanel().pageRight != null) {
|
||||
if (direction) EmiScreenManager.getSearchPanel().pageRight.onPress();
|
||||
else EmiScreenManager.getSearchPanel().pageLeft.onPress();
|
||||
MidnightControlsClient.get().input.actionGuiCooldown = 5;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public void handle(@NotNull MidnightControlsClient mod) {
|
||||
ButtonCategory category = new ButtonCategory(new Identifier("midnightcontrols","category.emi"));
|
||||
InputManager.registerCategory(category);
|
||||
new ButtonBinding.Builder("emi_page_left")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_LEFT_BUMPER, ButtonBinding.axisAsButton(GLFW.GLFW_GAMEPAD_AXIS_LEFT_TRIGGER, true))
|
||||
.category(category)
|
||||
.action((client,action,value,buttonState)->handleTabs(false)).cooldown()
|
||||
.filter(((client, buttonBinding) -> client.currentScreen instanceof HandledScreen<?> || client.currentScreen instanceof EmiScreen))
|
||||
.register();
|
||||
new ButtonBinding.Builder("emi_page_right")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER, ButtonBinding.axisAsButton(GLFW.GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER, true))
|
||||
.category(category)
|
||||
.action((client,action,value,buttonState)->handleTabs(true)).cooldown()
|
||||
.filter(((client, buttonBinding) -> client.currentScreen instanceof HandledScreen<?> || client.currentScreen instanceof EmiScreen))
|
||||
.register();
|
||||
}
|
||||
public static boolean isEMIEnabled() {
|
||||
return EmiConfig.enabled;
|
||||
}
|
||||
public static boolean isSearchBarCentered() {
|
||||
return EmiConfig.centerSearchBar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package eu.midnightdust.midnightcontrols.client.compat;
|
||||
|
||||
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
import io.github.kosmx.emotes.arch.gui.screen.ingame.FastChosseScreen;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
|
||||
public class EmotecraftCompat {
|
||||
public static boolean isEmotecraftScreen(Screen screen) {
|
||||
return screen instanceof FastChosseScreen;
|
||||
}
|
||||
public static void handleEmoteSelector(int index) {
|
||||
MinecraftClient client = MinecraftClient.getInstance();
|
||||
if (client.currentScreen instanceof FastChosseScreen) {
|
||||
int x = client.getWindow().getWidth() / 2;
|
||||
int y = client.getWindow().getHeight() / 2;
|
||||
if (index == 0) InputManager.queueMousePosition(x-200, y-200);
|
||||
if (index == 1) InputManager.queueMousePosition(x, y-200);
|
||||
if (index == 2) InputManager.queueMousePosition(x+200, y-200);
|
||||
if (index == 3) InputManager.queueMousePosition(x-200, y);
|
||||
if (index == 4) InputManager.queueMousePosition(x+200, y);
|
||||
if (index == 5) InputManager.queueMousePosition(x-200, y+200);
|
||||
if (index == 6) InputManager.queueMousePosition(x, y+200);
|
||||
if (index == 7) InputManager.queueMousePosition(x+200, y+200);
|
||||
|
||||
InputManager.INPUT_MANAGER.updateMousePosition(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package eu.midnightdust.midnightcontrols.client.compat;
|
||||
|
||||
import com.kqp.inventorytabs.tabs.TabManager;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
|
||||
public class InventoryTabsCompat {
|
||||
|
||||
public static void handleInventoryTabs(Screen screen, boolean next) {
|
||||
if (screen instanceof HandledScreen<?> && !(screen instanceof CreativeInventoryScreen)) {
|
||||
TabManager tabManager = TabManager.getInstance();
|
||||
int tabIndex = tabManager.tabs.indexOf(tabManager.currentTab);
|
||||
if (next) {
|
||||
if (tabIndex < tabManager.tabs.size() - 1) tabManager.onTabClick(tabManager.tabs.get(tabIndex + 1));
|
||||
else tabManager.onTabClick(tabManager.tabs.get(0));
|
||||
} else {
|
||||
if (tabIndex > 0) tabManager.onTabClick(tabManager.tabs.get(tabIndex - 1));
|
||||
else tabManager.onTabClick(tabManager.tabs.get(tabManager.tabs.size() - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void handleInventoryPage(Screen screen, boolean next) {
|
||||
if (screen instanceof HandledScreen<?> && !(screen instanceof CreativeInventoryScreen)) {
|
||||
TabManager tabManager = TabManager.getInstance();
|
||||
if (next) {
|
||||
if (tabManager.canGoForwardAPage()) tabManager.setCurrentPage(tabManager.currentPage + 1);
|
||||
} else {
|
||||
if (tabManager.canGoBackAPage()) tabManager.setCurrentPage(tabManager.currentPage - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package eu.midnightdust.midnightcontrols.client.compat;
|
||||
|
||||
import io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl;
|
||||
import io.github.cottonmc.cotton.gui.widget.WButton;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.sound.PositionedSoundInstance;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public class LibGuiCompat {
|
||||
public static boolean handlePress(@NotNull Screen screen) {
|
||||
if (screen instanceof CottonScreenImpl cottonScreen) {
|
||||
if (cottonScreen.getDescription() != null && cottonScreen.getDescription().getFocus() != null) {
|
||||
if (cottonScreen.getDescription().getFocus() instanceof WButton button && button.getOnClick() != null) {
|
||||
button.getOnClick().run();
|
||||
MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -45,14 +45,18 @@ public class MidnightControlsCompat {
|
||||
mod.log("Adding Ok Zoomer compatibility...");
|
||||
HANDLERS.add(new OkZoomerCompat());
|
||||
}
|
||||
/*if (isReiPresent()) {
|
||||
mod.log("Adding REI compatiblity...");
|
||||
HANDLERS.add(new ReiCompat());
|
||||
}*/
|
||||
if (isEMIPresent()) {
|
||||
mod.log("Adding EMI compatibility...");
|
||||
HANDLERS.add(new EMICompat());
|
||||
}
|
||||
if (FabricLoader.getInstance().isModLoaded("hardcorequesting") && LambdaReflection.doesClassExist(HQMCompat.GUI_BASE_CLASS_PATH)) {
|
||||
mod.log("Adding HQM compatibility...");
|
||||
HANDLERS.add(new HQMCompat());
|
||||
}
|
||||
if (FabricLoader.getInstance().isModLoaded("bedrockify")) {
|
||||
mod.log("Adding Bedrockify compatibility...");
|
||||
HANDLERS.add(new BedrockifyCompat());
|
||||
}
|
||||
HANDLERS.forEach(handler -> handler.handle(mod));
|
||||
InputManager.loadButtonBindings();
|
||||
}
|
||||
@@ -167,4 +171,20 @@ public class MidnightControlsCompat {
|
||||
public static boolean isEMIPresent() {
|
||||
return FabricLoader.getInstance().isModLoaded("emi");
|
||||
}
|
||||
/**
|
||||
* Returns whether InventoryTabs is present.
|
||||
*
|
||||
* @return true if InventoryTabs is present, else false
|
||||
*/
|
||||
public static boolean isInventoryTabsPresent() {
|
||||
return FabricLoader.getInstance().isModLoaded("inventorytabs");
|
||||
}
|
||||
/**
|
||||
* Returns whether Emotecraft is present.
|
||||
*
|
||||
* @return true if Emotecraft is present, else false
|
||||
*/
|
||||
public static boolean isEmotecraftPresent() {
|
||||
return FabricLoader.getInstance().isModLoaded("emotecraft");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,10 @@ public class SodiumCompat {
|
||||
i = (direction ? ((max > i) ? ++i : 0) : (i > 0 ? --i : max));
|
||||
|
||||
var dimensions = accessor.getControls().get(i).getDimensions();
|
||||
InputManager.INPUT_MANAGER.targetMouseX = (int) (client.getWindow().getScaleFactor() * dimensions.getCenterX());
|
||||
InputManager.INPUT_MANAGER.targetMouseY = (int) (client.getWindow().getScaleFactor() * dimensions.getCenterY());
|
||||
int x = (int) (client.getWindow().getScaleFactor() * dimensions.getCenterX());
|
||||
int y = (int) (client.getWindow().getScaleFactor() * dimensions.getCenterY());
|
||||
InputManager.queueMousePosition(x,y);
|
||||
InputManager.INPUT_MANAGER.updateMousePosition(client);
|
||||
MidnightControlsClient.get().input.actionGuiCooldown = 5;
|
||||
if (MidnightControlsConfig.debug) MidnightControls.get().log(i+" "+accessor.getControls().size()+" | " + dimensions.getCenterX() + " " + dimensions.getCenterY());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright © 2022 Motschen <motschen@midnightdust.eu>
|
||||
*
|
||||
* This file is part of MidnightControls.
|
||||
*
|
||||
* Licensed under the MIT license. For more information,
|
||||
* see the LICENSE file.
|
||||
*/
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.compat;
|
||||
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonCategory;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.KeyBindingIDAccessor;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import org.aperlambda.lambdacommon.Identifier;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
/**
|
||||
* Represents a compatibility handler for VoxelMap.
|
||||
*
|
||||
* @author Motschen
|
||||
* @version 1.8.0
|
||||
* @since 1.8.0
|
||||
*/
|
||||
public class VoxelMapCompat implements CompatHandler {
|
||||
|
||||
private final KeyBinding voxelMapZoomKey = KeyBindingIDAccessor.getKEYS_BY_ID().getOrDefault("key.minimap.zoom", null);
|
||||
private final KeyBinding voxelmapFullscreenKey = KeyBindingIDAccessor.getKEYS_BY_ID().getOrDefault("key.minimap.togglefullscreen", null);
|
||||
private final KeyBinding voxelmapMenuKey = KeyBindingIDAccessor.getKEYS_BY_ID().getOrDefault("key.minimap.voxelmapmenu", null);;
|
||||
private final KeyBinding voxelmapWaypointMenuKey = KeyBindingIDAccessor.getKEYS_BY_ID().getOrDefault("key.minimap.waypointmenu", null);;
|
||||
private final KeyBinding voxelmapWaypointKey = KeyBindingIDAccessor.getKEYS_BY_ID().getOrDefault("key.minimap.waypointhotkey", null);
|
||||
private final KeyBinding voxelmapMobToggleKey = KeyBindingIDAccessor.getKEYS_BY_ID().getOrDefault("key.minimap.togglemobs", null);
|
||||
private final KeyBinding voxelmapWaypointToggleKey = KeyBindingIDAccessor.getKEYS_BY_ID().getOrDefault("key.minimap.toggleingamewaypoints", null);
|
||||
private static final ButtonCategory VOXELMAP_CATEGORY = InputManager.registerCategory(new Identifier("minecraft","controls.minimap.title"));
|
||||
|
||||
|
||||
@Override
|
||||
public void handle(@NotNull MidnightControlsClient mod) {
|
||||
if (MidnightControlsConfig.debug && KeyBindingIDAccessor.getKEYS_BY_ID() != null) KeyBindingIDAccessor.getKEYS_BY_ID().forEach((a, b) -> System.out.println(a + " - " + b));
|
||||
new ButtonBinding.Builder("key.minimap.zoom")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN, GLFW.GLFW_GAMEPAD_BUTTON_X)
|
||||
.onlyInGame()
|
||||
.cooldown(true)
|
||||
.category(VOXELMAP_CATEGORY)
|
||||
.linkKeybind(voxelMapZoomKey)
|
||||
.register();
|
||||
new ButtonBinding.Builder("key.minimap.togglefullscreen")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN, GLFW.GLFW_GAMEPAD_BUTTON_Y)
|
||||
.onlyInGame()
|
||||
.cooldown(true)
|
||||
.category(VOXELMAP_CATEGORY)
|
||||
.linkKeybind(voxelmapFullscreenKey)
|
||||
.register();
|
||||
new ButtonBinding.Builder("key.minimap.voxelmapmenu")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN, GLFW.GLFW_GAMEPAD_BUTTON_START)
|
||||
.onlyInGame()
|
||||
.cooldown(true)
|
||||
.category(VOXELMAP_CATEGORY)
|
||||
.linkKeybind(voxelmapMenuKey)
|
||||
.register();
|
||||
new ButtonBinding.Builder("key.minimap.waypointmenu")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN, GLFW.GLFW_GAMEPAD_BUTTON_GUIDE)
|
||||
.onlyInGame()
|
||||
.cooldown(true)
|
||||
.category(VOXELMAP_CATEGORY)
|
||||
.linkKeybind(voxelmapWaypointMenuKey)
|
||||
.register();
|
||||
new ButtonBinding.Builder("key.minimap.waypointhotkey")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN, GLFW.GLFW_GAMEPAD_BUTTON_BACK)
|
||||
.onlyInGame()
|
||||
.cooldown(true)
|
||||
.category(VOXELMAP_CATEGORY)
|
||||
.linkKeybind(voxelmapWaypointKey)
|
||||
.register();
|
||||
new ButtonBinding.Builder("key.minimap.togglemobs")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN, GLFW.GLFW_GAMEPAD_BUTTON_A)
|
||||
.onlyInGame()
|
||||
.cooldown(true)
|
||||
.category(VOXELMAP_CATEGORY)
|
||||
.linkKeybind(voxelmapMobToggleKey)
|
||||
.register();
|
||||
new ButtonBinding.Builder("key.minimap.toggleingamewaypoints")
|
||||
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN, GLFW.GLFW_GAMEPAD_BUTTON_B)
|
||||
.onlyInGame()
|
||||
.cooldown(true)
|
||||
.category(VOXELMAP_CATEGORY)
|
||||
.linkKeybind(voxelmapWaypointToggleKey)
|
||||
.register();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package eu.midnightdust.midnightcontrols.client.compat;
|
||||
|
||||
import dev.isxander.yacl.gui.AbstractWidget;
|
||||
import dev.isxander.yacl.gui.OptionListWidget;
|
||||
import dev.isxander.yacl.gui.YACLScreen;
|
||||
import dev.isxander.yacl.gui.controllers.ControllerWidget;
|
||||
import dev.isxander.yacl.gui.controllers.slider.SliderControllerElement;
|
||||
import net.minecraft.client.gui.Element;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class YACLCompat {
|
||||
public static boolean handleAButton(Screen screen, Element element) {
|
||||
if (element instanceof AbstractWidget abstractWidget) {
|
||||
// imitate ender key press
|
||||
return abstractWidget.keyPressed(GLFW.GLFW_KEY_ENTER, 0, 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean handleLeftRight(Screen screen, boolean direction) {
|
||||
if (screen instanceof YACLScreen yaclScreen) {
|
||||
SliderControllerElement focusedSlider = yaclScreen.optionList.children().stream()
|
||||
.filter(OptionListWidget.OptionEntry.class::isInstance)
|
||||
.map(entry -> ((OptionListWidget.OptionEntry) entry).widget)
|
||||
.filter(ControllerWidget.class::isInstance)
|
||||
.map(ControllerWidget.class::cast)
|
||||
.filter(SliderControllerElement.class::isInstance)
|
||||
.map(SliderControllerElement.class::cast)
|
||||
.filter(ControllerWidget::isHovered)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (focusedSlider == null)
|
||||
return false;
|
||||
|
||||
focusedSlider.incrementValue(direction ? 1 : -1);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean handleCategories(Screen screen, boolean direction) {
|
||||
if (screen instanceof YACLScreen yaclScreen) {
|
||||
int categoryIdx = yaclScreen.getCurrentCategoryIdx();
|
||||
if (direction) categoryIdx++; else categoryIdx--;
|
||||
if (categoryIdx < 0) categoryIdx = yaclScreen.config.categories().size() - 1;
|
||||
if (categoryIdx >= yaclScreen.config.categories().size()) categoryIdx = 0;
|
||||
|
||||
yaclScreen.changeCategory(categoryIdx);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@
|
||||
package eu.midnightdust.midnightcontrols.client.controller;
|
||||
|
||||
import eu.midnightdust.midnightcontrols.client.ButtonState;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.RingScreen;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.option.GameOptions;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
@@ -44,6 +46,15 @@ public class ButtonBinding {
|
||||
public static final ButtonBinding BACK = new Builder("back").buttons(axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_Y, false))
|
||||
.action(MovementHandler.HANDLER).onlyInGame().register();
|
||||
public static final ButtonBinding CHAT = new Builder("chat").buttons(GLFW_GAMEPAD_BUTTON_DPAD_RIGHT).onlyInGame().cooldown().register();
|
||||
public static final ButtonBinding CONTROLS_RING = new Builder("controls_ring").buttons(GLFW_GAMEPAD_BUTTON_GUIDE).onlyInGame().cooldown()
|
||||
.action((client, button1, value, action) -> {
|
||||
if (action.isPressed()) {
|
||||
MidnightControlsClient.get().ring.loadFromUnbound();
|
||||
client.setScreen(new RingScreen());
|
||||
}
|
||||
if (action.isUnpressed() && client.currentScreen != null) client.currentScreen.close();
|
||||
return true;
|
||||
}).register();
|
||||
public static final ButtonBinding DROP_ITEM = new Builder("drop_item").buttons(GLFW_GAMEPAD_BUTTON_B).onlyInGame().cooldown().register();
|
||||
public static final ButtonBinding FORWARD = new Builder("forward").buttons(axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_Y, true))
|
||||
.action(MovementHandler.HANDLER).onlyInGame().register();
|
||||
@@ -52,6 +63,8 @@ public class ButtonBinding {
|
||||
public static final ButtonBinding HOTBAR_RIGHT = new Builder("hotbar_right").buttons(GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER)
|
||||
.action(InputHandlers.handleHotbar(true)).onlyInGame().cooldown().register();
|
||||
public static final ButtonBinding INVENTORY = new Builder("inventory").buttons(GLFW_GAMEPAD_BUTTON_Y).onlyInGame().cooldown().register();
|
||||
public static final ButtonBinding EXIT = new Builder("exit").buttons(GLFW_GAMEPAD_BUTTON_B).filter((client, buttonBinding) -> client.currentScreen != null && buttonBinding.cooldown == 0 && INVENTORY.cooldown == 0)
|
||||
.action(InputHandlers.handleExit()).cooldown().register();
|
||||
public static final ButtonBinding JUMP = new Builder("jump").buttons(GLFW_GAMEPAD_BUTTON_A).onlyInGame().register();
|
||||
public static final ButtonBinding LEFT = new Builder("left").buttons(axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_X, false))
|
||||
.action(MovementHandler.HANDLER).onlyInGame().register();
|
||||
@@ -62,6 +75,9 @@ public class ButtonBinding {
|
||||
.action(MovementHandler.HANDLER).onlyInGame().register();
|
||||
public static final ButtonBinding SCREENSHOT = new Builder("screenshot").buttons(GLFW_GAMEPAD_BUTTON_DPAD_UP, GLFW_GAMEPAD_BUTTON_A)
|
||||
.action(InputHandlers::handleScreenshot).cooldown().register();
|
||||
|
||||
public static final ButtonBinding DEBUG_SCREEN = new Builder("debug_screen").buttons(GLFW_GAMEPAD_BUTTON_DPAD_UP, GLFW_GAMEPAD_BUTTON_B)
|
||||
.action((client,binding,value,action) -> {if (action == ButtonState.PRESS) client.options.debugEnabled = !client.options.debugEnabled; return true;}).cooldown().register();
|
||||
public static final ButtonBinding SLOT_DOWN = new Builder("slot_down").buttons(GLFW_GAMEPAD_BUTTON_DPAD_DOWN)
|
||||
.action(InputHandlers.handleInventorySlotPad(1)).onlyInInventory().cooldown().register();
|
||||
public static final ButtonBinding SLOT_LEFT = new Builder("slot_left").buttons(GLFW_GAMEPAD_BUTTON_DPAD_LEFT)
|
||||
@@ -70,26 +86,26 @@ public class ButtonBinding {
|
||||
.action(InputHandlers.handleInventorySlotPad(2)).onlyInInventory().cooldown().register();
|
||||
public static final ButtonBinding SLOT_UP = new Builder("slot_up").buttons(GLFW_GAMEPAD_BUTTON_DPAD_UP)
|
||||
.action(InputHandlers.handleInventorySlotPad(0)).onlyInInventory().cooldown().register();
|
||||
public static final ButtonBinding SMOOTH_CAMERA = new Builder("toggle_smooth_camera").onlyInGame().cooldown().register();
|
||||
public static final ButtonBinding SNEAK = new Builder("sneak").buttons(GLFW_GAMEPAD_BUTTON_RIGHT_THUMB)
|
||||
.actions(InputHandlers::handleToggleSneak).onlyInGame().cooldown().register();
|
||||
public static final ButtonBinding SPRINT = new Builder("sprint").buttons(GLFW_GAMEPAD_BUTTON_LEFT_THUMB).onlyInGame().register();
|
||||
public static final ButtonBinding SPRINT = new Builder("sprint").buttons(GLFW_GAMEPAD_BUTTON_LEFT_THUMB)
|
||||
.actions(InputHandlers::handleToggleSprint).onlyInGame().register();
|
||||
public static final ButtonBinding SWAP_HANDS = new Builder("swap_hands").buttons(GLFW_GAMEPAD_BUTTON_X).onlyInGame().cooldown().register();
|
||||
public static final ButtonBinding TAB_LEFT = new Builder("tab_back").buttons(GLFW_GAMEPAD_BUTTON_LEFT_BUMPER)
|
||||
.action(InputHandlers.handleHotbar(false)).filter(Predicates.or(InputHandlers::inInventory, InputHandlers::inAdvancements).or((client, binding) -> client.currentScreen != null && client.currentScreen.getClass().toString().contains("sodium"))).cooldown().register();
|
||||
.action(InputHandlers.handleHotbar(false)).filter(Predicates.or(InputHandlers::inInventory, InputHandlers::inAdvancements).or((client, binding) -> client.currentScreen != null)).cooldown().register();
|
||||
public static final ButtonBinding TAB_RIGHT = new Builder("tab_next").buttons(GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER)
|
||||
.action(InputHandlers.handleHotbar(true)).filter(Predicates.or(InputHandlers::inInventory, InputHandlers::inAdvancements).or((client, binding) -> client.currentScreen != null && client.currentScreen.getClass().toString().contains("sodium"))).cooldown().register();
|
||||
.action(InputHandlers.handleHotbar(true)).filter(Predicates.or(InputHandlers::inInventory, InputHandlers::inAdvancements).or((client, binding) -> client.currentScreen != null)).cooldown().register();
|
||||
public static final ButtonBinding PAGE_LEFT = new Builder("page_back").buttons(axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_TRIGGER, true))
|
||||
.action(InputHandlers.handlePage(false)).filter(InputHandlers::inInventory).cooldown().register();
|
||||
.action(InputHandlers.handlePage(false)).filter(InputHandlers::inInventory).cooldown(30).register();
|
||||
public static final ButtonBinding PAGE_RIGHT = new Builder("page_next").buttons(axisAsButton(GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER, true))
|
||||
.action(InputHandlers.handlePage(true)).filter(InputHandlers::inInventory).cooldown().register();
|
||||
.action(InputHandlers.handlePage(true)).filter(InputHandlers::inInventory).cooldown(30).register();
|
||||
public static final ButtonBinding TAKE = new Builder("take").buttons(GLFW_GAMEPAD_BUTTON_X)
|
||||
.action(InputHandlers.handleActions()).filter(InputHandlers::inInventory).cooldown().register();
|
||||
public static final ButtonBinding TAKE_ALL = new Builder("take_all").buttons(GLFW_GAMEPAD_BUTTON_A)
|
||||
.action(InputHandlers.handleActions()).filter(InputHandlers::inInventory).cooldown().register();
|
||||
public static final ButtonBinding QUICK_MOVE = new Builder("quick_move").buttons(GLFW_GAMEPAD_BUTTON_Y)
|
||||
.action(InputHandlers.handleActions()).filter(InputHandlers::inInventory).cooldown().register();
|
||||
public static final ButtonBinding TOGGLE_PERSPECTIVE = new Builder("toggle_perspective").buttons(GLFW_GAMEPAD_BUTTON_DPAD_UP, GLFW_GAMEPAD_BUTTON_Y).cooldown().register();
|
||||
public static final ButtonBinding TOGGLE_PERSPECTIVE = new Builder("toggle_perspective").filter(InputHandlers::inGame).buttons(GLFW_GAMEPAD_BUTTON_DPAD_UP, GLFW_GAMEPAD_BUTTON_Y).cooldown().register();
|
||||
public static final ButtonBinding USE = new Builder("use").buttons(axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_TRIGGER, true)).register();
|
||||
|
||||
private int[] button;
|
||||
@@ -100,6 +116,7 @@ public class ButtonBinding {
|
||||
protected PairPredicate<MinecraftClient, ButtonBinding> filter;
|
||||
private final List<PressAction> actions = new ArrayList<>(Collections.singletonList(PressAction.DEFAULT_ACTION));
|
||||
private boolean hasCooldown;
|
||||
private int cooldownLength = 5;
|
||||
private int cooldown = 0;
|
||||
boolean pressed = false;
|
||||
|
||||
@@ -111,10 +128,22 @@ public class ButtonBinding {
|
||||
this.actions.addAll(actions);
|
||||
this.hasCooldown = hasCooldown;
|
||||
}
|
||||
public ButtonBinding(String key, int[] defaultButton, List<PressAction> actions, PairPredicate<MinecraftClient, ButtonBinding> filter, boolean hasCooldown, int cooldownLength) {
|
||||
this.setButton(this.defaultButton = defaultButton);
|
||||
this.key = key;
|
||||
this.text = Text.translatable(this.key);
|
||||
this.filter = filter;
|
||||
this.actions.addAll(actions);
|
||||
this.hasCooldown = hasCooldown;
|
||||
this.cooldownLength = cooldownLength;
|
||||
}
|
||||
|
||||
public ButtonBinding(String key, int[] defaultButton, boolean hasCooldown) {
|
||||
this(key, defaultButton, Collections.emptyList(), Predicates.pairAlwaysTrue(), hasCooldown);
|
||||
}
|
||||
public ButtonBinding(String key, int[] defaultButton, boolean hasCooldown, int cooldownLength) {
|
||||
this(key, defaultButton, Collections.emptyList(), Predicates.pairAlwaysTrue(), hasCooldown, cooldownLength);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the button bound.
|
||||
@@ -231,7 +260,7 @@ public class ButtonBinding {
|
||||
if (state == ButtonState.REPEAT && this.hasCooldown && this.cooldown != 0)
|
||||
return;
|
||||
if (this.hasCooldown && state.isPressed()) {
|
||||
this.cooldown = 5;
|
||||
this.cooldown = cooldownLength;
|
||||
}
|
||||
for (int i = this.actions.size() - 1; i >= 0; i--) {
|
||||
if (this.actions.get(i).press(client, this, value, state))
|
||||
@@ -317,7 +346,6 @@ public class ButtonBinding {
|
||||
PLAYER_LIST.mcKeyBinding = options.playerListKey;
|
||||
RIGHT.mcKeyBinding = options.rightKey;
|
||||
SCREENSHOT.mcKeyBinding = options.screenshotKey;
|
||||
SMOOTH_CAMERA.mcKeyBinding = options.smoothCameraKey;
|
||||
SNEAK.mcKeyBinding = options.sneakKey;
|
||||
SPRINT.mcKeyBinding = options.sprintKey;
|
||||
SWAP_HANDS.mcKeyBinding = options.swapHandsKey;
|
||||
@@ -382,23 +410,33 @@ public class ButtonBinding {
|
||||
ButtonBinding.USE
|
||||
));
|
||||
INVENTORY_CATEGORY = InputManager.registerDefaultCategory("key.categories.inventory", category -> category.registerAllBindings(
|
||||
ButtonBinding.EXIT,
|
||||
ButtonBinding.DROP_ITEM,
|
||||
ButtonBinding.HOTBAR_LEFT,
|
||||
ButtonBinding.HOTBAR_RIGHT,
|
||||
ButtonBinding.INVENTORY,
|
||||
ButtonBinding.SWAP_HANDS,
|
||||
ButtonBinding.TAB_LEFT,
|
||||
ButtonBinding.TAB_RIGHT,
|
||||
ButtonBinding.PAGE_LEFT,
|
||||
ButtonBinding.PAGE_RIGHT,
|
||||
ButtonBinding.TAKE,
|
||||
ButtonBinding.TAKE_ALL,
|
||||
ButtonBinding.QUICK_MOVE
|
||||
ButtonBinding.QUICK_MOVE,
|
||||
ButtonBinding.SLOT_UP,
|
||||
ButtonBinding.SLOT_DOWN,
|
||||
ButtonBinding.SLOT_LEFT,
|
||||
ButtonBinding.SLOT_RIGHT
|
||||
));
|
||||
MULTIPLAYER_CATEGORY = InputManager.registerDefaultCategory("key.categories.multiplayer",
|
||||
category -> category.registerAllBindings(ButtonBinding.CHAT, ButtonBinding.PLAYER_LIST));
|
||||
MISC_CATEGORY = InputManager.registerDefaultCategory("key.categories.misc", category -> category.registerAllBindings(
|
||||
ButtonBinding.SCREENSHOT,
|
||||
ButtonBinding.TOGGLE_PERSPECTIVE,
|
||||
ButtonBinding.PAUSE_GAME,
|
||||
//SMOOTH_CAMERA,
|
||||
ButtonBinding.TOGGLE_PERSPECTIVE
|
||||
ButtonBinding.DEBUG_SCREEN,
|
||||
ButtonBinding.CONTROLS_RING
|
||||
));
|
||||
}
|
||||
|
||||
@@ -427,6 +465,7 @@ public class ButtonBinding {
|
||||
private final List<PressAction> actions = new ArrayList<>();
|
||||
private PairPredicate<MinecraftClient, ButtonBinding> filter = Predicates.pairAlwaysTrue();
|
||||
private boolean cooldown = false;
|
||||
private int cooldownLength = 5;
|
||||
private ButtonCategory category = null;
|
||||
private KeyBinding mcBinding = null;
|
||||
|
||||
@@ -529,6 +568,17 @@ public class ButtonBinding {
|
||||
this.cooldown = cooldown;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Sets the cooldown enabled with a custom duration for {@link ButtonBinding}.
|
||||
*
|
||||
* @param cooldownLength duration of {@link ButtonBinding} cooldown
|
||||
* @return the builder instance
|
||||
*/
|
||||
public Builder cooldown(int cooldownLength) {
|
||||
this.cooldownLength = cooldownLength;
|
||||
this.cooldown = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts a cooldown on the {@link ButtonBinding}.
|
||||
@@ -568,7 +618,7 @@ public class ButtonBinding {
|
||||
* @return the built {@link ButtonBinding}
|
||||
*/
|
||||
public ButtonBinding build() {
|
||||
var binding = new ButtonBinding(this.key, this.buttons, this.actions, this.filter, this.cooldown);
|
||||
var binding = new ButtonBinding(this.key, this.buttons, this.actions, this.filter, this.cooldown, this.cooldownLength);
|
||||
if (this.category != null)
|
||||
this.category.registerBinding(binding);
|
||||
if (this.mcBinding != null)
|
||||
|
||||
@@ -11,34 +11,38 @@ package eu.midnightdust.midnightcontrols.client.controller;
|
||||
|
||||
import eu.midnightdust.midnightcontrols.client.ButtonState;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightInput;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.InventoryTabsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.SodiumCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.YACLCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.RingScreen;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.AdvancementsScreenAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.CreativeInventoryScreenAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.mixin.RecipeBookWidgetAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.util.HandledScreenAccessor;
|
||||
import net.fabricmc.fabric.impl.item.group.CreativeGuiExtensions;
|
||||
import eu.midnightdust.midnightcontrols.client.util.MouseAccessor;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gl.Framebuffer;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.screen.advancement.AdvancementsScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.*;
|
||||
import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
|
||||
import net.minecraft.client.gui.widget.PressableWidget;
|
||||
import net.minecraft.client.util.ScreenshotRecorder;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.screen.slot.Slot;
|
||||
import net.minecraft.screen.slot.SlotActionType;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.aperlambda.lambdacommon.utils.Pair;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.lwjgl.glfw.GLFW.*;
|
||||
import static org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_2;
|
||||
@@ -50,6 +54,7 @@ import static org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_2;
|
||||
* @version 1.7.0
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public class InputHandlers {
|
||||
private InputHandlers() {
|
||||
}
|
||||
@@ -59,13 +64,25 @@ public class InputHandlers {
|
||||
if (action == ButtonState.RELEASE)
|
||||
return false;
|
||||
|
||||
// When ingame
|
||||
// When in-game
|
||||
if (client.currentScreen == null && client.player != null) {
|
||||
if (next)
|
||||
client.player.getInventory().selectedSlot = client.player.getInventory().selectedSlot == 8 ? 0 : client.player.getInventory().selectedSlot + 1;
|
||||
else
|
||||
client.player.getInventory().selectedSlot = client.player.getInventory().selectedSlot == 0 ? 8 : client.player.getInventory().selectedSlot - 1;
|
||||
if (!client.player.isSpectator()) {
|
||||
if (next)
|
||||
client.player.getInventory().scrollInHotbar(-1.0);
|
||||
else
|
||||
client.player.getInventory().scrollInHotbar(1.0);
|
||||
}
|
||||
else {
|
||||
if (client.inGameHud.getSpectatorHud().isOpen()) {
|
||||
client.inGameHud.getSpectatorHud().cycleSlot(next ? -1 : 1);
|
||||
} else {
|
||||
float g = MathHelper.clamp(client.player.getAbilities().getFlySpeed() + (next ? 1 : -1) * 0.005F, 0.0F, 0.2F);
|
||||
client.player.getAbilities().setFlySpeed(g);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (client.currentScreen instanceof RingScreen) {
|
||||
MidnightControlsClient.get().ring.cyclePage(next);
|
||||
} else if (client.currentScreen instanceof CreativeInventoryScreenAccessor inventory) {
|
||||
int currentTab = CreativeInventoryScreenAccessor.getSelectedTab();
|
||||
int nextTab = currentTab + (next ? 1 : -1);
|
||||
@@ -75,24 +92,30 @@ public class InputHandlers {
|
||||
nextTab = 0;
|
||||
inventory.midnightcontrols$setSelectedTab(ItemGroup.GROUPS[nextTab]);
|
||||
return true;
|
||||
} else if (client.currentScreen instanceof InventoryScreen inventoryScreen) {
|
||||
var recipeBook = (RecipeBookWidgetAccessor) inventoryScreen.getRecipeBookWidget();
|
||||
var tabs = recipeBook.getTabButtons();
|
||||
var currentTab = recipeBook.getCurrentTab();
|
||||
if (currentTab == null)
|
||||
} else if (client.currentScreen instanceof InventoryScreen || client.currentScreen instanceof CraftingScreen || client.currentScreen instanceof AbstractFurnaceScreen<?>) {
|
||||
RecipeBookWidget recipeBook;
|
||||
if (client.currentScreen instanceof InventoryScreen inventoryScreen) recipeBook = inventoryScreen.getRecipeBookWidget();
|
||||
else if (client.currentScreen instanceof CraftingScreen craftingScreen) recipeBook = craftingScreen.getRecipeBookWidget();
|
||||
else recipeBook = ((AbstractFurnaceScreen<?>)client.currentScreen).getRecipeBookWidget();
|
||||
var recipeBookAccessor = (RecipeBookWidgetAccessor) recipeBook;
|
||||
var tabs = recipeBookAccessor.getTabButtons();
|
||||
var currentTab = recipeBookAccessor.getCurrentTab();
|
||||
if (currentTab == null || !recipeBook.isOpen()) {
|
||||
if (MidnightControlsCompat.isInventoryTabsPresent()) InventoryTabsCompat.handleInventoryTabs(client.currentScreen, next);
|
||||
return false;
|
||||
}
|
||||
int nextTab = tabs.indexOf(currentTab) + (next ? 1 : -1);
|
||||
if (nextTab < 0)
|
||||
nextTab = tabs.size() - 1;
|
||||
else if (nextTab >= tabs.size())
|
||||
nextTab = 0;
|
||||
currentTab.setToggled(false);
|
||||
recipeBook.setCurrentTab(currentTab = tabs.get(nextTab));
|
||||
recipeBookAccessor.setCurrentTab(currentTab = tabs.get(nextTab));
|
||||
currentTab.setToggled(true);
|
||||
recipeBook.midnightcontrols$refreshResults(true);
|
||||
recipeBookAccessor.midnightcontrols$refreshResults(true);
|
||||
return true;
|
||||
} else if (client.currentScreen instanceof AdvancementsScreenAccessor screen) {
|
||||
var tabs = screen.getTabs().values().stream().distinct().collect(Collectors.toList());
|
||||
var tabs = screen.getTabs().values().stream().distinct().toList();
|
||||
var tab = screen.getSelectedTab();
|
||||
if (tab == null)
|
||||
return false;
|
||||
@@ -108,7 +131,13 @@ public class InputHandlers {
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (FabricLoader.getInstance().isModLoaded("sodium")) SodiumCompat.handleTabs(client.currentScreen, next);
|
||||
} else {
|
||||
if (FabricLoader.getInstance().isModLoaded("sodium"))
|
||||
SodiumCompat.handleTabs(client.currentScreen, next);
|
||||
if (FabricLoader.getInstance().isModLoaded("yet-another-config-lib") && YACLCompat.handleCategories(client.currentScreen, next))
|
||||
return true;
|
||||
}
|
||||
if (MidnightControlsCompat.isInventoryTabsPresent()) InventoryTabsCompat.handleInventoryTabs(client.currentScreen, next);
|
||||
return false;
|
||||
};
|
||||
}
|
||||
@@ -118,12 +147,43 @@ public class InputHandlers {
|
||||
var screen = (HandledScreenAccessor) client.currentScreen;
|
||||
try {
|
||||
if (next) {
|
||||
((CreativeGuiExtensions) screen).fabric_nextPage();
|
||||
return client.currentScreen.children().stream().filter(element -> element instanceof PressableWidget)
|
||||
.map(element -> (PressableWidget) element)
|
||||
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
||||
.anyMatch(element -> {
|
||||
if (element.getMessage().getString().equals(">")) {
|
||||
element.onPress();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
((CreativeGuiExtensions) screen).fabric_previousPage();
|
||||
return client.currentScreen.children().stream().filter(element -> element instanceof PressableWidget)
|
||||
.map(element -> (PressableWidget) element)
|
||||
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
||||
.anyMatch(element -> {
|
||||
if (element.getMessage().getString().equals("<")) {
|
||||
element.onPress();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
if (MidnightControlsCompat.isInventoryTabsPresent()) InventoryTabsCompat.handleInventoryPage(client.currentScreen, next);
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
public static PressAction handleExit() {
|
||||
return (client, button, value, action) -> {
|
||||
if (client.currentScreen != null && client.currentScreen.getClass() != TitleScreen.class) {
|
||||
if (!MidnightControlsCompat.handleMenuBack(client, client.currentScreen))
|
||||
if (!MidnightControlsClient.get().input.tryGoBack(client.currentScreen))
|
||||
client.currentScreen.close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
@@ -144,6 +204,7 @@ public class InputHandlers {
|
||||
int slotId;
|
||||
if (slot == null) {
|
||||
if (button.getName().equals("take_all")) {
|
||||
((MouseAccessor) client.mouse).setLeftButtonClicked(true);
|
||||
return false;
|
||||
}
|
||||
slotId = accessor.midnightcontrols$isClickOutsideBounds(x, y, accessor.getX(), accessor.getY(), GLFW_MOUSE_BUTTON_1) ? -999 : -1;
|
||||
@@ -155,24 +216,21 @@ public class InputHandlers {
|
||||
|
||||
MidnightControlsClient.get().input.inventoryInteractionCooldown = 5;
|
||||
switch (button.getName()) {
|
||||
case "take_all":
|
||||
if (accessor instanceof CreativeInventoryScreen) {
|
||||
if (((CreativeInventoryScreenAccessor) accessor).midnightcontrols$isCreativeInventorySlot(slot))
|
||||
case "take_all": {
|
||||
if (screen instanceof CreativeInventoryScreen) {
|
||||
if (slot != null && (((CreativeInventoryScreenAccessor) accessor).midnightcontrols$isCreativeInventorySlot(slot) || MidnightControlsCompat.streamCompatHandlers().anyMatch(handler -> handler.isCreativeSlot(screen, slot))))
|
||||
actionType = SlotActionType.CLONE;
|
||||
if (slot != null && MidnightControlsCompat.streamCompatHandlers().anyMatch(handler -> handler.isCreativeSlot(screen, slot)))
|
||||
actionType = SlotActionType.CLONE;
|
||||
} else {
|
||||
if (slot != null && screen.getScreenHandler().getCursorStack() != null) {
|
||||
return screen.mouseReleased(x, y, GLFW.GLFW_MOUSE_BUTTON_1);
|
||||
} else actionType = SlotActionType.PICKUP_ALL;
|
||||
}
|
||||
break;
|
||||
case "take":
|
||||
}
|
||||
case "take": {
|
||||
clickData = GLFW_MOUSE_BUTTON_2;
|
||||
break;
|
||||
case "quick_move":
|
||||
}
|
||||
case "quick_move": {
|
||||
actionType = SlotActionType.QUICK_MOVE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -184,7 +242,7 @@ public class InputHandlers {
|
||||
public static boolean handlePauseGame(@NotNull MinecraftClient client, @NotNull ButtonBinding binding, float value, @NotNull ButtonState action) {
|
||||
if (action == ButtonState.PRESS) {
|
||||
// If in game, then pause the game.
|
||||
if (client.currentScreen == null)
|
||||
if (client.currentScreen == null || client.currentScreen instanceof RingScreen)
|
||||
client.openPauseMenu(false);
|
||||
else if (client.currentScreen instanceof HandledScreen && client.player != null) // If the current screen is a container then close it.
|
||||
client.player.closeHandledScreen();
|
||||
@@ -214,9 +272,28 @@ public class InputHandlers {
|
||||
boolean sneakToggled = client.options.getSneakToggled().getValue();
|
||||
if (client.player.getAbilities().flying && sneakToggled)
|
||||
client.options.getSneakToggled().setValue(false);
|
||||
else if (MidnightControlsConfig.controllerToggleSneak != sneakToggled)
|
||||
client.options.getSneakToggled().setValue(!sneakToggled);
|
||||
binding.setPressed(button.pressed);
|
||||
if (client.player.getAbilities().flying && sneakToggled)
|
||||
client.options.getSneakToggled().setValue(true);
|
||||
else if (MidnightControlsConfig.controllerToggleSneak != sneakToggled)
|
||||
client.options.getSneakToggled().setValue(sneakToggled);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
public static boolean handleToggleSprint(@NotNull MinecraftClient client, @NotNull ButtonBinding button, float value, @NotNull ButtonState action) {
|
||||
button.asKeyBinding().ifPresent(binding -> {
|
||||
boolean sprintToggled = client.options.getSprintToggled().getValue();
|
||||
if (client.player.getAbilities().flying && sprintToggled)
|
||||
client.options.getSprintToggled().setValue(false);
|
||||
else if (MidnightControlsConfig.controllerToggleSneak != sprintToggled)
|
||||
client.options.getSprintToggled().setValue(!sprintToggled);
|
||||
binding.setPressed(button.pressed);
|
||||
if (client.player.getAbilities().flying && sprintToggled)
|
||||
client.options.getSprintToggled().setValue(true);
|
||||
else if (MidnightControlsConfig.controllerToggleSneak != sprintToggled)
|
||||
client.options.getSprintToggled().setValue(sprintToggled);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
@@ -307,7 +384,7 @@ public class InputHandlers {
|
||||
* @return true if the client is in game, else false
|
||||
*/
|
||||
public static boolean inGame(@NotNull MinecraftClient client, @NotNull ButtonBinding binding) {
|
||||
return client.currentScreen == null;
|
||||
return (client.currentScreen == null && MidnightControlsClient.get().input.screenCloseCooldown <= 0) || client.currentScreen instanceof RingScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@ import it.unimi.dsi.fastutil.ints.*;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.aperlambda.lambdacommon.Identifier;
|
||||
@@ -51,6 +52,10 @@ public class InputManager {
|
||||
}
|
||||
|
||||
public void tick(@NotNull MinecraftClient client) {
|
||||
if (MidnightControlsConfig.autoSwitchMode && !MidnightControlsConfig.isEditing && MidnightControlsConfig.controlsMode != ControlsMode.TOUCHSCREEN)
|
||||
if (MidnightControlsConfig.getController().isConnected() && MidnightControlsConfig.getController().isGamepad())
|
||||
MidnightControlsConfig.controlsMode = ControlsMode.CONTROLLER;
|
||||
else MidnightControlsConfig.controlsMode = ControlsMode.DEFAULT;
|
||||
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER) {
|
||||
this.controllerTick(client);
|
||||
}
|
||||
@@ -124,6 +129,29 @@ public class InputManager {
|
||||
public static boolean hasBinding(@NotNull Identifier identifier) {
|
||||
return hasBinding(identifier.getNamespace() + "." + identifier.getName());
|
||||
}
|
||||
private static ButtonBinding tempBinding;
|
||||
/**
|
||||
* Returns the binding matching the given string.
|
||||
*
|
||||
* @param name the name of the binding to get
|
||||
* @return true if the binding is registered, else false
|
||||
*/
|
||||
public static ButtonBinding getBinding(@NotNull String name) {
|
||||
if (BINDINGS.parallelStream().map(ButtonBinding::getName).anyMatch(binding -> binding.equalsIgnoreCase(name)))
|
||||
BINDINGS.forEach(binding -> {
|
||||
if (binding.getName().equalsIgnoreCase(name)) InputManager.tempBinding = binding;
|
||||
});
|
||||
return tempBinding;
|
||||
}
|
||||
private static List<ButtonBinding> unboundBindings;
|
||||
public static List<ButtonBinding> getUnboundBindings() {
|
||||
unboundBindings = new ArrayList<>();
|
||||
BINDINGS.forEach(binding -> {
|
||||
if (binding.isNotBound() && !MidnightControlsConfig.ignoredUnboundKeys.contains(binding.getTranslationKey())) unboundBindings.add(binding);
|
||||
});
|
||||
unboundBindings.sort(Comparator.comparing(s -> I18n.translate(s.getTranslationKey())));
|
||||
return unboundBindings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a button binding.
|
||||
|
||||
@@ -13,7 +13,17 @@ import eu.midnightdust.midnightcontrols.client.ButtonState;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.input.Input;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.client.tutorial.MovementTutorialStepHandler;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
import net.minecraft.enchantment.SoulSpeedEnchantment;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.NbtList;
|
||||
import net.minecraft.nbt.scanner.SimpleNbtScanner;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
@@ -30,6 +40,7 @@ public final class MovementHandler implements PressAction {
|
||||
private boolean pressingBack = false;
|
||||
private boolean pressingLeft = false;
|
||||
private boolean pressingRight = false;
|
||||
private float slowdownFactor = 1.f;
|
||||
private float movementForward = 0.f;
|
||||
private float movementSideways = 0.f;
|
||||
|
||||
@@ -42,14 +53,22 @@ public final class MovementHandler implements PressAction {
|
||||
* @param player The client player.
|
||||
*/
|
||||
public void applyMovement(@NotNull ClientPlayerEntity player) {
|
||||
double movementR, movementTheta;
|
||||
|
||||
if (!this.shouldOverrideMovement)
|
||||
return;
|
||||
player.input.pressingForward = this.pressingForward;
|
||||
player.input.pressingBack = this.pressingBack;
|
||||
player.input.pressingLeft = this.pressingLeft;
|
||||
player.input.pressingRight = this.pressingRight;
|
||||
player.input.movementForward = this.movementForward;
|
||||
player.input.movementSideways = this.movementSideways;
|
||||
|
||||
// Do an implicit square here
|
||||
movementR = this.slowdownFactor * (Math.pow(this.movementSideways, 2) + Math.pow(this.movementForward, 2));
|
||||
movementR = MathHelper.clamp(movementR, 0.f, 1.f);
|
||||
movementTheta = Math.atan2(this.movementForward, this.movementSideways);
|
||||
player.input.movementForward = (float) (movementR * Math.sin(movementTheta));
|
||||
player.input.movementSideways = (float) (movementR * Math.cos(movementTheta));
|
||||
|
||||
this.shouldOverrideMovement = false;
|
||||
}
|
||||
|
||||
@@ -69,28 +88,26 @@ public final class MovementHandler implements PressAction {
|
||||
|
||||
this.shouldOverrideMovement = direction != 0;
|
||||
|
||||
if (MidnightControlsConfig.analogMovement) {
|
||||
value = (float) Math.pow(value, 2);
|
||||
} else value = 1.f;
|
||||
if (!MidnightControlsConfig.analogMovement) {
|
||||
value = 1.f;
|
||||
}
|
||||
|
||||
this.slowdownFactor = client.player.shouldSlowDown() ? (MathHelper.clamp(
|
||||
0.3F + EnchantmentHelper.getSwiftSneakSpeedBoost(client.player),
|
||||
0.0F,
|
||||
1.0F
|
||||
)) : 1.f;
|
||||
|
||||
if (button == ButtonBinding.FORWARD || button == ButtonBinding.BACK) {
|
||||
// Handle forward movement.
|
||||
this.pressingForward = direction > 0;
|
||||
this.pressingBack = direction < 0;
|
||||
this.movementForward = direction * value;
|
||||
|
||||
// Slowing down if sneaking.
|
||||
if (client.player.input.sneaking)
|
||||
this.movementForward *= 0.3D;
|
||||
} else {
|
||||
// Handle sideways movement.
|
||||
this.pressingLeft = direction > 0;
|
||||
this.pressingRight = direction < 0;
|
||||
this.movementSideways = direction * value;
|
||||
|
||||
// Slowing down if sneaking.
|
||||
if (client.player.input.sneaking)
|
||||
this.movementSideways *= 0.3D;
|
||||
}
|
||||
|
||||
return this.shouldOverrideMovement;
|
||||
|
||||
@@ -14,7 +14,6 @@ import eu.midnightdust.midnightcontrols.MidnightControlsConstants;
|
||||
import eu.midnightdust.midnightcontrols.client.HudSide;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightInput;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import dev.lambdaurora.spruceui.hud.Hud;
|
||||
@@ -47,13 +46,14 @@ public class MidnightControlsHud extends Hud {
|
||||
private int inventoryButtonWidth = 0;
|
||||
private int swapHandsWidth = 0;
|
||||
private int swapHandsButtonWidth = 0;
|
||||
private boolean showSwapHandsAction = false;
|
||||
private int useWidth = 0;
|
||||
private int useButtonWidth = 0;
|
||||
private BlockHitResult placeHitResult;
|
||||
private String attackAction = "";
|
||||
private String placeAction = "";
|
||||
private int ticksDisplayedCrosshair = 0;
|
||||
private static float scale = 1f;
|
||||
private static boolean isCrammed = false;
|
||||
|
||||
public MidnightControlsHud(@NotNull MidnightControlsClient mod) {
|
||||
super(new Identifier(MidnightControlsConstants.NAMESPACE, "hud/button_indicator"));
|
||||
@@ -72,26 +72,24 @@ public class MidnightControlsHud extends Hud {
|
||||
this.dropItemButtonWidth = MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.DROP_ITEM);
|
||||
this.attackButtonWidth = MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.ATTACK);
|
||||
this.useButtonWidth = MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.USE);
|
||||
if (client.getWindow().getScaleFactor() >= 4) {
|
||||
scale = (float) (0.75f * (client.getWindow().getScaleFactor()-3));
|
||||
} else scale = 1f;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the midnightcontrols' HUD.
|
||||
* Renders the MidnightControls HUD.
|
||||
*/
|
||||
@Override
|
||||
public void render(MatrixStack matrices, float tickDelta) {
|
||||
if (this.client == null) return;
|
||||
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && this.client.currentScreen == null) {
|
||||
isCrammed = client.getWindow().getScaledWidth() < 520;
|
||||
int y = bottom(2);
|
||||
if (scale != 1f) matrices.scale(scale,scale,scale);
|
||||
this.renderFirstIcons(matrices, MidnightControlsConfig.hudSide == HudSide.LEFT ? 2 : (int) ((client.getWindow().getScaledWidth() - 2) * (1 / scale)), y);
|
||||
this.renderSecondIcons(matrices, MidnightControlsConfig.hudSide == HudSide.RIGHT ? 2 : (int) ((client.getWindow().getScaledWidth() - 2) * (1 / scale)), y);
|
||||
this.renderFirstSection(matrices, MidnightControlsConfig.hudSide == HudSide.LEFT ? 2 : (int) ((client.getWindow().getScaledWidth() - 2) * (1 / scale)), y);
|
||||
this.renderSecondSection(matrices, MidnightControlsConfig.hudSide == HudSide.RIGHT ? 2 : (int) ((client.getWindow().getScaledWidth() - 2) * (1 / scale)), y);
|
||||
if (scale != 1f) matrices.scale(1,1,1);
|
||||
matrices.push();
|
||||
this.renderFirstIcons(matrices, MidnightControlsConfig.hudSide == HudSide.LEFT ? 2 : client.getWindow().getScaledWidth() - 2, y);
|
||||
this.renderSecondIcons(matrices, MidnightControlsConfig.hudSide == HudSide.RIGHT ? 2 : client.getWindow().getScaledWidth() - 2, y);
|
||||
this.renderFirstSection(matrices, MidnightControlsConfig.hudSide == HudSide.LEFT ? 2 : client.getWindow().getScaledWidth() - 2, y);
|
||||
this.renderSecondSection(matrices, MidnightControlsConfig.hudSide == HudSide.RIGHT ? 2 : client.getWindow().getScaledWidth() - 2, y);
|
||||
matrices.pop();
|
||||
}
|
||||
|
||||
if (this.mod.reacharound.isLastReacharoundVertical()) {
|
||||
@@ -111,22 +109,29 @@ public class MidnightControlsHud extends Hud {
|
||||
public void renderFirstIcons(MatrixStack matrices, int x, int y) {
|
||||
int offset = 2 + this.inventoryWidth + this.inventoryButtonWidth + 4;
|
||||
int currentX = MidnightControlsConfig.hudSide == HudSide.LEFT ? x : x - this.inventoryButtonWidth;
|
||||
this.drawButton(matrices, currentX, y, ButtonBinding.INVENTORY, true);
|
||||
this.drawButton(matrices, currentX += (MidnightControlsConfig.hudSide == HudSide.LEFT ? offset : -offset), y, ButtonBinding.SWAP_HANDS, true);
|
||||
if (!ButtonBinding.INVENTORY.isNotBound()) this.drawButton(matrices, currentX, y, ButtonBinding.INVENTORY, true);
|
||||
if (!ButtonBinding.SWAP_HANDS.isNotBound() && !isCrammed && showSwapHandsAction) this.drawButton(matrices, currentX += (MidnightControlsConfig.hudSide == HudSide.LEFT ? offset : -offset), y, ButtonBinding.SWAP_HANDS, true);
|
||||
offset = 2 + this.swapHandsWidth + this.dropItemButtonWidth + 4;
|
||||
if (this.client.options.getShowSubtitles().getValue() && MidnightControlsConfig.hudSide == HudSide.RIGHT) {
|
||||
currentX += -offset;
|
||||
} else {
|
||||
currentX = MidnightControlsConfig.hudSide == HudSide.LEFT ? x : x - this.dropItemButtonWidth;
|
||||
y -= 24;
|
||||
y -= 20;
|
||||
}
|
||||
this.drawButton(matrices, currentX, y, ButtonBinding.DROP_ITEM, !this.client.player.getMainHandStack().isEmpty());
|
||||
if (!ButtonBinding.DROP_ITEM.isNotBound()) this.drawButton(matrices, currentX, y, ButtonBinding.DROP_ITEM, !this.client.player.getMainHandStack().isEmpty());
|
||||
}
|
||||
|
||||
public void renderSecondIcons(MatrixStack matrices, int x, int y) {
|
||||
int offset;
|
||||
int currentX = x;
|
||||
if (!this.placeAction.isEmpty()) {
|
||||
if (isCrammed && showSwapHandsAction && !this.client.options.getShowSubtitles().getValue() && !ButtonBinding.SWAP_HANDS.isNotBound()) {
|
||||
if (MidnightControlsConfig.hudSide == HudSide.LEFT)
|
||||
currentX -= this.useButtonWidth;
|
||||
this.drawButton(matrices, currentX, y, ButtonBinding.SWAP_HANDS, true);
|
||||
currentX = x;
|
||||
y -= 20;
|
||||
}
|
||||
if (!this.placeAction.isEmpty() && (!ButtonBinding.USE.isNotBound()) ) {
|
||||
if (MidnightControlsConfig.hudSide == HudSide.LEFT)
|
||||
currentX -= this.useButtonWidth;
|
||||
this.drawButton(matrices, currentX, y, ButtonBinding.USE, true);
|
||||
@@ -135,34 +140,42 @@ public class MidnightControlsHud extends Hud {
|
||||
currentX -= offset;
|
||||
} else {
|
||||
currentX = x;
|
||||
y -= 24;
|
||||
y -= 20;
|
||||
}
|
||||
}
|
||||
|
||||
if (MidnightControlsConfig.hudSide == HudSide.LEFT)
|
||||
currentX -= this.attackButtonWidth;
|
||||
|
||||
this.drawButton(matrices, currentX, y, ButtonBinding.ATTACK, this.attackWidth != 0);
|
||||
if (!ButtonBinding.ATTACK.isNotBound()) this.drawButton(matrices, currentX, y, ButtonBinding.ATTACK, this.attackWidth != 0);
|
||||
}
|
||||
|
||||
public void renderFirstSection(MatrixStack matrices, int x, int y) {
|
||||
int currentX = MidnightControlsConfig.hudSide == HudSide.LEFT ? x + this.inventoryButtonWidth + 2 : x - this.inventoryButtonWidth - 2 - this.inventoryWidth;
|
||||
this.drawTip(matrices, currentX, y, ButtonBinding.INVENTORY, true);
|
||||
if (!ButtonBinding.INVENTORY.isNotBound()) this.drawTip(matrices, currentX, y, ButtonBinding.INVENTORY, true);
|
||||
currentX += MidnightControlsConfig.hudSide == HudSide.LEFT ? this.inventoryWidth + 4 + this.swapHandsButtonWidth + 2
|
||||
: -this.swapHandsWidth - 2 - this.swapHandsButtonWidth - 4;
|
||||
this.drawTip(matrices, currentX, y, ButtonBinding.SWAP_HANDS, true);
|
||||
if (!ButtonBinding.SWAP_HANDS.isNotBound() && !isCrammed && showSwapHandsAction) this.drawTip(matrices, currentX, y, ButtonBinding.SWAP_HANDS, true);
|
||||
if (this.client.options.getShowSubtitles().getValue() && MidnightControlsConfig.hudSide == HudSide.RIGHT) {
|
||||
currentX += -this.dropItemWidth - 2 - this.dropItemButtonWidth - 4;
|
||||
} else {
|
||||
y -= 24;
|
||||
y -= 20;
|
||||
currentX = MidnightControlsConfig.hudSide == HudSide.LEFT ? x + this.dropItemButtonWidth + 2 : x - this.dropItemButtonWidth - 2 - this.dropItemWidth;
|
||||
}
|
||||
this.drawTip(matrices, currentX, y, ButtonBinding.DROP_ITEM, !this.client.player.getMainHandStack().isEmpty());
|
||||
if (!ButtonBinding.DROP_ITEM.isNotBound()) this.drawTip(matrices, currentX, y, ButtonBinding.DROP_ITEM, !this.client.player.getMainHandStack().isEmpty());
|
||||
}
|
||||
|
||||
public void renderSecondSection(MatrixStack matrices, int x, int y) {
|
||||
int currentX = x;
|
||||
|
||||
if (isCrammed && showSwapHandsAction && !this.client.options.getShowSubtitles().getValue() && !ButtonBinding.SWAP_HANDS.isNotBound()) {
|
||||
currentX += MidnightControlsConfig.hudSide == HudSide.RIGHT ? this.swapHandsButtonWidth + 2 : -this.swapHandsButtonWidth - 2 - this.swapHandsWidth;
|
||||
|
||||
this.drawTip(matrices, currentX, y, ButtonBinding.SWAP_HANDS, true);
|
||||
|
||||
currentX = x;
|
||||
y -= 20;
|
||||
}
|
||||
if (!this.placeAction.isEmpty()) {
|
||||
currentX += MidnightControlsConfig.hudSide == HudSide.RIGHT ? this.useButtonWidth + 2 : -this.useButtonWidth - 2 - this.useWidth;
|
||||
|
||||
@@ -172,13 +185,13 @@ public class MidnightControlsHud extends Hud {
|
||||
currentX -= 4;
|
||||
} else {
|
||||
currentX = x;
|
||||
y -= 24;
|
||||
y -= 20;
|
||||
}
|
||||
}
|
||||
|
||||
currentX += MidnightControlsConfig.hudSide == HudSide.RIGHT ? this.attackButtonWidth + 2 : -this.attackButtonWidth - 2 - this.attackWidth;
|
||||
|
||||
this.drawTip(matrices, currentX, y, this.attackAction, this.attackWidth != 0);
|
||||
if (!ButtonBinding.ATTACK.isNotBound()) this.drawTip(matrices, currentX, y, this.attackAction, this.attackWidth != 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,6 +252,7 @@ public class MidnightControlsHud extends Hud {
|
||||
placeAction = customUseAction;
|
||||
|
||||
this.placeAction = placeAction;
|
||||
this.showSwapHandsAction = !this.client.player.getMainHandStack().isEmpty() || !this.client.player.getOffHandStack().isEmpty();
|
||||
|
||||
// Cache the "Use" tip width.
|
||||
if (this.placeAction.isEmpty())
|
||||
@@ -254,7 +268,7 @@ public class MidnightControlsHud extends Hud {
|
||||
}
|
||||
|
||||
private int bottom(int y) {
|
||||
return (int) ((this.client.getWindow().getScaledHeight() * (1/scale)) - y - MidnightControlsRenderer.ICON_SIZE);
|
||||
return (this.client.getWindow().getScaledHeight() - y - MidnightControlsRenderer.ICON_SIZE);
|
||||
}
|
||||
|
||||
private int width(@NotNull ButtonBinding binding) {
|
||||
|
||||
@@ -57,12 +57,16 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
private final SpruceOption rotationSpeedOption;
|
||||
private final SpruceOption yAxisRotationSpeedOption;
|
||||
private final SpruceOption mouseSpeedOption;
|
||||
private final SpruceOption joystickAsMouseOption;
|
||||
private final SpruceOption virtualMouseOption;
|
||||
private final SpruceOption resetOption;
|
||||
private final SpruceOption advancedConfigOption;
|
||||
// Gameplay options
|
||||
private final SpruceOption analogMovementOption;
|
||||
private final SpruceOption doubleTapToSprintOption;
|
||||
private final SpruceOption autoJumpOption;
|
||||
private final SpruceOption controllerToggleSneakOption;
|
||||
private final SpruceOption controllerToggleSprintOption;
|
||||
private final SpruceOption fastBlockPlacingOption;
|
||||
private final SpruceOption frontBlockPlacingOption;
|
||||
private final SpruceOption verticalReacharoundOption;
|
||||
@@ -73,6 +77,7 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
private final SpruceOption virtualMouseSkinOption;
|
||||
private final SpruceOption hudEnableOption;
|
||||
private final SpruceOption hudSideOption;
|
||||
private final SpruceOption moveChatOption;
|
||||
// Controller options
|
||||
private final SpruceOption controllerOption =
|
||||
new SpruceCyclingOption("midnightcontrols.menu.controller",
|
||||
@@ -116,6 +121,7 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
private final SpruceOption unfocusedInputOption;
|
||||
private final SpruceOption invertsRightXAxis;
|
||||
private final SpruceOption invertsRightYAxis;
|
||||
private final SpruceOption toggleControllerProfileOption;
|
||||
private final SpruceOption rightDeadZoneOption;
|
||||
private final SpruceOption leftDeadZoneOption;
|
||||
private final SpruceOption[] maxAnalogValueOptions = new SpruceOption[]{
|
||||
@@ -154,6 +160,7 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
|
||||
public MidnightControlsSettingsScreen(Screen parent, boolean hideControls) {
|
||||
super(Text.translatable("midnightcontrols.title.settings"));
|
||||
MidnightControlsConfig.isEditing = true;
|
||||
this.parent = parent;
|
||||
// General options
|
||||
this.inputModeOption = new SpruceCyclingOption("midnightcontrols.menu.controls_mode",
|
||||
@@ -162,7 +169,7 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
MidnightControlsConfig.controlsMode = next;
|
||||
MidnightControlsConfig.save();
|
||||
|
||||
if (this.client.player != null) {
|
||||
if (this.client != null && this.client.player != null) {
|
||||
ClientPlayNetworking.getSender().sendPacket(MidnightControls.CONTROLS_MODE_CHANNEL, this.mod.makeControlsModeBuffer(next));
|
||||
}
|
||||
}, option -> option.getDisplayText(Text.translatable(MidnightControlsConfig.controlsMode.getTranslationKey())),
|
||||
@@ -180,13 +187,16 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
this.mouseSpeedOption = new SpruceDoubleOption("midnightcontrols.menu.mouse_speed", 0.0, 150.0, .5f,
|
||||
() -> MidnightControlsConfig.mouseSpeed,
|
||||
value -> MidnightControlsConfig.mouseSpeed = value, option -> option.getDisplayText(Text.literal(String.valueOf(option.get()))),
|
||||
Text.translatable("midnightcontrols.tooltip.mouse_speed"));
|
||||
Text.translatable("midnightcontrols.tooltip.joystick_as_mouse"));
|
||||
this.joystickAsMouseOption = new SpruceToggleBooleanOption("midnightcontrols.menu.joystick_as_mouse",
|
||||
() -> MidnightControlsConfig.joystickAsMouse, value -> MidnightControlsConfig.joystickAsMouse = value,
|
||||
Text.translatable("midnightcontrols.tooltip.joystick_as_mouse"));
|
||||
this.resetOption = SpruceSimpleActionOption.reset(btn -> {
|
||||
// TODO
|
||||
MidnightControlsConfig.reset();
|
||||
var client = MinecraftClient.getInstance();
|
||||
this.init(client, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
|
||||
});
|
||||
this.advancedConfigOption = SpruceSimpleActionOption.of("midnightcontrols.midnightconfig.title", button -> client.setScreen(MidnightControlsConfig.getScreen(this, "midnightcontrols")));
|
||||
// Gameplay options
|
||||
this.analogMovementOption = new SpruceToggleBooleanOption("midnightcontrols.menu.analog_movement",
|
||||
() -> MidnightControlsConfig.analogMovement, value -> MidnightControlsConfig.analogMovement = value,
|
||||
@@ -198,6 +208,12 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
() -> this.client.options.getAutoJump().getValue(),
|
||||
newValue -> this.client.options.getAutoJump().setValue(newValue),
|
||||
null);
|
||||
this.controllerToggleSneakOption = new SpruceToggleBooleanOption("midnightcontrols.menu.controller_toggle_sneak",
|
||||
() -> MidnightControlsConfig.controllerToggleSneak, value -> MidnightControlsConfig.controllerToggleSneak = value,
|
||||
null);
|
||||
this.controllerToggleSprintOption = new SpruceToggleBooleanOption("midnightcontrols.menu.controller_toggle_sprint",
|
||||
() -> MidnightControlsConfig.controllerToggleSprint, value -> MidnightControlsConfig.controllerToggleSprint = value,
|
||||
null);
|
||||
this.fastBlockPlacingOption = new SpruceToggleBooleanOption("midnightcontrols.menu.fast_block_placing", () -> MidnightControlsConfig.fastBlockPlacing,
|
||||
value -> MidnightControlsConfig.fastBlockPlacing = value, Text.translatable("midnightcontrols.tooltip.fast_block_placing"));
|
||||
this.frontBlockPlacingOption = new SpruceToggleBooleanOption("midnightcontrols.menu.reacharound.horizontal", () -> MidnightControlsConfig.horizontalReacharound,
|
||||
@@ -223,7 +239,19 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
amount -> MidnightControlsConfig.hudSide = MidnightControlsConfig.hudSide.next(),
|
||||
option -> option.getDisplayText(MidnightControlsConfig.hudSide.getTranslatedText()),
|
||||
Text.translatable("midnightcontrols.tooltip.hud_side"));
|
||||
this.moveChatOption = new SpruceToggleBooleanOption("midnightcontrols.menu.move_chat", () -> MidnightControlsConfig.moveChat,
|
||||
value -> MidnightControlsConfig.moveChat = value, Text.translatable("midnightcontrols.tooltip.move_chat"));
|
||||
// Controller options
|
||||
this.toggleControllerProfileOption = new SpruceToggleBooleanOption("midnightcontrols.menu.separate_controller_profile", () -> MidnightControlsConfig.controllerBindingProfiles.containsKey(MidnightControlsConfig.getController().getGuid()), value -> {
|
||||
if (value) {
|
||||
MidnightControlsConfig.controllerBindingProfiles.put(MidnightControlsConfig.getController().getGuid(), MidnightControlsConfig.getBindingsForController());
|
||||
MidnightControlsConfig.updateBindingsForController(MidnightControlsConfig.getController());
|
||||
} else {
|
||||
MidnightControlsConfig.controllerBindingProfiles.remove(MidnightControlsConfig.getController().getGuid());
|
||||
MidnightControlsConfig.updateBindingsForController(MidnightControlsConfig.getController());
|
||||
}
|
||||
|
||||
}, Text.translatable(""));
|
||||
this.rightDeadZoneOption = new SpruceDoubleOption("midnightcontrols.menu.right_dead_zone", 0.05, 1.0, .05f,
|
||||
() -> MidnightControlsConfig.rightDeadZone,
|
||||
value -> MidnightControlsConfig.rightDeadZone = value, option -> {
|
||||
@@ -248,12 +276,14 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
|
||||
@Override
|
||||
public void removed() {
|
||||
MidnightControlsConfig.isEditing = false;
|
||||
MidnightControlsConfig.save();
|
||||
super.removed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
MidnightControlsConfig.isEditing = false;
|
||||
MidnightControlsConfig.save();
|
||||
super.close();
|
||||
}
|
||||
@@ -269,8 +299,7 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
this.buildTabs();
|
||||
|
||||
this.addDrawableChild(this.resetOption.createWidget(Position.of(this.width / 2 - 155, this.height - 29), 150));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155 + 160, this.height - 29, 150, 20, SpruceTexts.GUI_DONE,
|
||||
btn -> this.client.setScreen(this.parent)));
|
||||
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155 + 160, this.height - 29, 150, 20, SpruceTexts.GUI_DONE, btn -> this.client.setScreen(this.parent)));
|
||||
}
|
||||
|
||||
public void buildTabs() {
|
||||
@@ -308,6 +337,8 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
list.addSingleOptionEntry(this.yAxisRotationSpeedOption);
|
||||
list.addSingleOptionEntry(this.mouseSpeedOption);
|
||||
list.addSingleOptionEntry(this.virtualMouseOption);
|
||||
list.addSingleOptionEntry(this.joystickAsMouseOption);
|
||||
list.addSingleOptionEntry(this.advancedConfigOption);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -316,6 +347,8 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
list.setBackground(new MidnightControlsBackground(130));
|
||||
list.addSingleOptionEntry(this.analogMovementOption);
|
||||
list.addSingleOptionEntry(this.doubleTapToSprintOption);
|
||||
list.addSingleOptionEntry(this.controllerToggleSneakOption);
|
||||
list.addSingleOptionEntry(this.controllerToggleSprintOption);
|
||||
if (MidnightControls.isExtrasLoaded) list.addSingleOptionEntry(this.fastBlockPlacingOption);
|
||||
if (MidnightControls.isExtrasLoaded) list.addSingleOptionEntry(this.frontBlockPlacingOption);
|
||||
if (MidnightControls.isExtrasLoaded) list.addSingleOptionEntry(this.verticalReacharoundOption);
|
||||
@@ -333,6 +366,7 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
list.addSingleOptionEntry(new SpruceSeparatorOption("midnightcontrols.menu.title.hud", true, null));
|
||||
list.addSingleOptionEntry(this.hudEnableOption);
|
||||
list.addSingleOptionEntry(this.hudSideOption);
|
||||
list.addSingleOptionEntry(this.moveChatOption);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -369,6 +403,7 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
list.setBackground(new MidnightControlsBackground(130));
|
||||
list.addSingleOptionEntry(this.controllerOption);
|
||||
list.addSingleOptionEntry(this.secondControllerOption);
|
||||
list.addSingleOptionEntry(this.toggleControllerProfileOption);
|
||||
list.addSingleOptionEntry(this.unfocusedInputOption);
|
||||
list.addOptionEntry(this.invertsRightXAxis, this.invertsRightYAxis);
|
||||
list.addSingleOptionEntry(this.rightDeadZoneOption);
|
||||
|
||||
@@ -10,8 +10,10 @@
|
||||
package eu.midnightdust.midnightcontrols.client.gui;
|
||||
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.ring.RingButtonMode;
|
||||
import eu.midnightdust.midnightcontrols.client.ring.RingPage;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
@@ -30,6 +32,15 @@ public class RingScreen extends Screen {
|
||||
this.mod = MidnightControlsClient.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
if (mod.ring.getMaxPages() > 1) {
|
||||
this.addDrawableChild(new ButtonWidget(5, 5, 20, 20, Text.of("◀"), button -> this.mod.ring.cyclePage(false)));
|
||||
this.addDrawableChild(new ButtonWidget(width - 25, 5, 20, 20, Text.of("▶"), button -> this.mod.ring.cyclePage(true)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldPause() {
|
||||
return false;
|
||||
@@ -40,13 +51,36 @@ public class RingScreen extends Screen {
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
|
||||
RingPage page = this.mod.ring.getCurrentPage();
|
||||
|
||||
page.render(matrices, this.textRenderer, this.width, this.height, mouseX, mouseY, delta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
super.close();
|
||||
assert client != null;
|
||||
client.currentScreen = null;
|
||||
RingPage page = this.mod.ring.getCurrentPage();
|
||||
if (RingPage.selected >= 0 && page.actions[RingPage.selected] != null)
|
||||
page.actions[RingPage.selected].activate(RingButtonMode.PRESS);
|
||||
RingPage.selected = -1;
|
||||
this.removed();
|
||||
}
|
||||
@Override
|
||||
public boolean changeFocus(boolean lookForwards) {
|
||||
if (lookForwards) {
|
||||
if (RingPage.selected < 7) ++RingPage.selected;
|
||||
else RingPage.selected = -1;
|
||||
}
|
||||
else {
|
||||
if (RingPage.selected > -1) --RingPage.selected;
|
||||
else RingPage.selected = 7;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseReleased(double mouseX, double mouseY, int button) {
|
||||
if (mod.ring.getCurrentPage().onClick(client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight(), (int) mouseX, (int) mouseY)) {
|
||||
if (mod.ring.getCurrentPage().onClick(width, height, (int) mouseX, (int) mouseY)) {
|
||||
this.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ChatScreen.class)
|
||||
public abstract class ChatScreenMixin extends Screen {
|
||||
@Shadow protected TextFieldWidget chatField;
|
||||
|
||||
protected ChatScreenMixin(Text title) {
|
||||
super(title);
|
||||
}
|
||||
|
||||
@Inject(at = @At("TAIL"), method = "init")
|
||||
private void midnightcontrols$moveInputField(CallbackInfo ci) {
|
||||
if (MidnightControlsConfig.moveChat) chatField.y = 4;
|
||||
}
|
||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;setTextFieldFocused(Z)V", shift = At.Shift.AFTER))
|
||||
private void midnightcontrols$moveInputFieldBackground(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (MidnightControlsConfig.moveChat) matrices.translate(0f, -this.height + 16, 0f);
|
||||
}
|
||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;render(Lnet/minecraft/client/util/math/MatrixStack;IIF)V", shift = At.Shift.BEFORE))
|
||||
private void midnightcontrols$dontMoveOtherStuff(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (MidnightControlsConfig.moveChat) matrices.translate(0f, this.height - 16, 0f);
|
||||
}
|
||||
}
|
||||
@@ -17,4 +17,6 @@ import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
public interface ClickableWidgetAccessor {
|
||||
@Accessor("height")
|
||||
int getHeight();
|
||||
@Accessor("focused")
|
||||
void setFocused(boolean value);
|
||||
}
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
|
||||
import eu.midnightdust.lib.util.screen.TexturedOverlayButtonWidget;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsSettingsScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.option.ControlsOptionsScreen;
|
||||
import net.minecraft.client.gui.screen.option.GameOptionsScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.option.GameOptions;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
@@ -29,13 +30,10 @@ public abstract class ControlsOptionsScreenMixin extends GameOptionsScreen {
|
||||
public ControlsOptionsScreenMixin(Screen parent, GameOptions gameOptions, Text text) {
|
||||
super(parent, gameOptions, text);
|
||||
}
|
||||
@Inject(method = "init", at = @At(value = "INVOKE", ordinal = 4, shift = At.Shift.AFTER, target = "Lnet/minecraft/client/gui/screen/option/ControlsOptionsScreen;addDrawableChild(Lnet/minecraft/client/gui/Element;)Lnet/minecraft/client/gui/Element;"))
|
||||
@Inject(method = "init", at = @At(value = "INVOKE", ordinal = 1, shift = At.Shift.AFTER, target = "Lnet/minecraft/client/gui/screen/option/ControlsOptionsScreen;addDrawableChild(Lnet/minecraft/client/gui/Element;)Lnet/minecraft/client/gui/Element;"))
|
||||
private void addControllerButton(CallbackInfo ci) {
|
||||
int i = this.width / 2 - 155;
|
||||
int j = i + 160;
|
||||
int k = this.height / 6 - 12 + 48;;
|
||||
this.addDrawableChild(new ButtonWidget(j, k, 150, 20, Text.translatable("midnightcontrols.menu.title.controller").append("..."), (button) -> {
|
||||
this.addDrawableChild(new TexturedOverlayButtonWidget(this.width / 2 + 158, this.height / 6 - 12, 20, 20,0,0,20, new Identifier("midnightcontrols", "textures/gui/midnightcontrols_button.png"), 32, 64, (button) -> {
|
||||
this.client.setScreen(new MidnightControlsSettingsScreen(this, false));
|
||||
}));
|
||||
}, Text.translatable("midnightcontrols.menu.title.controller")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class GameRendererMixin {
|
||||
@Final
|
||||
private MinecraftClient client;
|
||||
|
||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Mouse;getX()D"))
|
||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Mouse;getX()D", shift = At.Shift.BEFORE))
|
||||
private void onRender(float tickDelta, long startTime, boolean fullRender, CallbackInfo ci) {
|
||||
if (this.client.currentScreen != null && MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER)
|
||||
MidnightControlsClient.get().input.onPreRenderScreen(this.client, this.client.currentScreen);
|
||||
|
||||
@@ -12,6 +12,7 @@ package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
import eu.midnightdust.midnightcontrols.ControlsMode;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightInput;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.EMICompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsRenderer;
|
||||
@@ -37,8 +38,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
*/
|
||||
@Mixin(HandledScreen.class)
|
||||
public abstract class HandledScreenMixin implements HandledScreenAccessor {
|
||||
@Unique private static float scale = 1f;
|
||||
|
||||
@Accessor("x")
|
||||
public abstract int getX();
|
||||
|
||||
@@ -57,28 +56,27 @@ public abstract class HandledScreenMixin implements HandledScreenAccessor {
|
||||
|
||||
@Inject(method = "render", at = @At("RETURN"))
|
||||
public void onRender(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER) {
|
||||
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && MidnightControlsConfig.hudEnable) {
|
||||
var client = MinecraftClient.getInstance();
|
||||
if (client.getWindow().getScaleFactor() >= 4) {
|
||||
scale = (float) (0.75f * (client.getWindow().getScaleFactor()-3));
|
||||
} else scale = 1f;
|
||||
if (scale != 1f) matrices.scale(scale,scale,scale);
|
||||
int x = 2, y = (int) (client.getWindow().getScaledHeight() * (1 / scale) - 2 - MidnightControlsRenderer.ICON_SIZE);
|
||||
if (MidnightControlsCompat.isEMIPresent()) {
|
||||
x += 40 * (1 / scale);
|
||||
matrices.push();
|
||||
int x = 2, y = client.getWindow().getScaledHeight() - 2 - MidnightControlsRenderer.ICON_SIZE;
|
||||
if (MidnightControlsCompat.isEMIPresent() && EMICompat.isEMIEnabled()) {
|
||||
x += 42;
|
||||
}
|
||||
x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_A}, "midnightcontrols.action.pickup_all", true, client) + 2;
|
||||
x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_B}, "midnightcontrols.action.exit", true, client) + 2;
|
||||
if (!ButtonBinding.TAKE_ALL.isNotBound()) x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, ButtonBinding.TAKE_ALL,true, client) + 2;
|
||||
if (!ButtonBinding.EXIT.isNotBound()) x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, ButtonBinding.EXIT, true, client) + 2;
|
||||
if (MidnightControlsCompat.isReiPresent()) {
|
||||
x = 2;
|
||||
y -= 24;
|
||||
}
|
||||
if (MidnightControlsCompat.isEMIPresent()) {
|
||||
x = (int) (client.getWindow().getScaledWidth() * (1 / scale) - 55 - client.textRenderer.getWidth(Text.translatable("midnightcontrols.action.pickup")) * (1 / scale) - client.textRenderer.getWidth(Text.translatable("midnightcontrols.action.quick_move")) - MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.TAKE) - MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.QUICK_MOVE));
|
||||
if (MidnightControlsCompat.isEMIPresent() && EMICompat.isEMIEnabled() && EMICompat.isSearchBarCentered()) {
|
||||
x = client.getWindow().getScaledWidth() - 55 - client.textRenderer.getWidth(Text.translatable("midnightcontrols.action.pickup"))
|
||||
- client.textRenderer.getWidth(Text.translatable("midnightcontrols.action.quick_move"))
|
||||
- MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.TAKE) - MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.QUICK_MOVE);
|
||||
}
|
||||
x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_X}, "midnightcontrols.action.pickup", true, client);
|
||||
MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_Y}, "midnightcontrols.action.quick_move", true, client);
|
||||
if (scale != 1f) matrices.scale(1,1,1);
|
||||
if (!ButtonBinding.TAKE.isNotBound()) x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, ButtonBinding.TAKE, true, client);
|
||||
if (!ButtonBinding.QUICK_MOVE.isNotBound()) MidnightControlsRenderer.drawButtonTip(matrices, x, y, ButtonBinding.QUICK_MOVE, true, client);
|
||||
matrices.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mixin(KeyBinding.class)
|
||||
public interface KeyBindingIDAccessor {
|
||||
@Accessor @Final
|
||||
static Map<String, KeyBinding> getKEYS_BY_ID() {return null;};
|
||||
}
|
||||
@@ -10,8 +10,10 @@ import java.util.List;
|
||||
|
||||
@Mixin(value = KeyBindingRegistryImpl.class, remap = false)
|
||||
public interface KeyBindingRegistryImplAccessor {
|
||||
|
||||
@Accessor @Final
|
||||
static List<KeyBinding> getModdedKeyBindings() {
|
||||
static List<KeyBinding> getMODDED_KEY_BINDINGS() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -100,29 +100,19 @@ public abstract class MinecraftClientMixin {
|
||||
this.midnightcontrols$lastTargetSide = side;
|
||||
}
|
||||
// Removed front placing sprinting as way too cheaty.
|
||||
else if (this.player.isSprinting()) {
|
||||
hitResult = MidnightControlsClient.get().reacharound.getLastReacharoundResult();
|
||||
if (hitResult != null) {
|
||||
if (cooldown > 0)
|
||||
this.itemUseCooldown = 0;
|
||||
}
|
||||
}
|
||||
// else if (this.player.isSprinting()) {
|
||||
// hitResult = MidnightControlsClient.get().reacharound.getLastReacharoundResult();
|
||||
// if (hitResult != null) {
|
||||
// if (cooldown > 0)
|
||||
// this.itemUseCooldown = 0;
|
||||
// }
|
||||
// }
|
||||
this.midnightcontrols$lastPos = this.player.getPos();
|
||||
}
|
||||
// Applied three times for smooth camera turning even on low FPS
|
||||
@Inject(method = "run", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Recorder;startTick()V", shift = At.Shift.AFTER))
|
||||
private void onPreRender(CallbackInfo ci) {
|
||||
MidnightControlsClient.get().onRender((MinecraftClient) (Object) (this));
|
||||
}
|
||||
@Inject(method = "render", at = @At("HEAD"))
|
||||
private void onRender(CallbackInfo ci) {
|
||||
MidnightControlsClient.get().onRender((MinecraftClient) (Object) (this));
|
||||
}
|
||||
@Inject(method = "render", at = @At("TAIL"))
|
||||
private void onPostRender(CallbackInfo ci) {
|
||||
MidnightControlsClient.get().onRender((MinecraftClient) (Object) (this));
|
||||
}
|
||||
|
||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;render(FJZ)V", shift = At.Shift.AFTER))
|
||||
private void renderVirtualCursor(boolean fullRender, CallbackInfo ci) {
|
||||
MidnightControlsRenderer.renderVirtualCursor(new MatrixStack(), (MinecraftClient) (Object) this);
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.lwjgl.glfw.GLFW;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
@@ -35,6 +36,9 @@ public abstract class MouseMixin implements MouseAccessor {
|
||||
@Final
|
||||
private MinecraftClient client;
|
||||
|
||||
@Accessor
|
||||
public abstract void setLeftButtonClicked(boolean value);
|
||||
|
||||
@Invoker("onCursorPos")
|
||||
public abstract void midnightcontrols$onCursorPos(long window, double x, double y);
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
|
||||
import net.minecraft.client.gui.Selectable;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public interface ScreenAccessor {
|
||||
@Accessor
|
||||
List<Selectable> getSelectables();
|
||||
@Accessor @Nullable
|
||||
Selectable getSelected();
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
|
||||
import eu.midnightdust.lib.util.MidnightColorUtil;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import net.minecraft.block.ShapeContext;
|
||||
@@ -30,6 +31,8 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* Represents a mixin to WorldRenderer.
|
||||
* <p>
|
||||
@@ -49,7 +52,7 @@ public abstract class WorldRendererMixin {
|
||||
private BufferBuilderStorage bufferBuilders;
|
||||
|
||||
@Shadow
|
||||
private static void drawShapeOutline(MatrixStack matrixStack, VertexConsumer vertexConsumer, VoxelShape voxelShape, double d, double e, double f, float g, float h, float i, float j) {
|
||||
private static void drawCuboidShapeOutline(MatrixStack matrices, VertexConsumer vertexConsumer, VoxelShape shape, double offsetX, double offsetY, double offsetZ, float red, float green, float blue, float alpha) {
|
||||
}
|
||||
|
||||
@Inject(
|
||||
@@ -69,7 +72,7 @@ public abstract class WorldRendererMixin {
|
||||
if (result == null)
|
||||
return;
|
||||
var blockPos = result.getBlockPos();
|
||||
if (this.world.getWorldBorder().contains(blockPos)) {
|
||||
if (this.world.getWorldBorder().contains(blockPos) && this.client.player != null) {
|
||||
var stack = this.client.player.getStackInHand(Hand.MAIN_HAND);
|
||||
if (stack == null || !(stack.getItem() instanceof BlockItem))
|
||||
return;
|
||||
@@ -86,12 +89,14 @@ public abstract class WorldRendererMixin {
|
||||
var pos = camera.getPos();
|
||||
|
||||
var outlineShape = placementState.getOutlineShape(this.client.world, blockPos, ShapeContext.of(camera.getFocusedEntity()));
|
||||
int[] color = MidnightControlsConfig.reacharoundOutlineColor;
|
||||
|
||||
Color rgb = MidnightColorUtil.hex2Rgb(MidnightControlsConfig.reacharoundOutlineColorHex);
|
||||
if (MidnightControlsConfig.reacharoundOutlineColorHex.isEmpty()) rgb = MidnightColorUtil.radialRainbow(1,1);
|
||||
matrices.push();
|
||||
var vertexConsumer = this.bufferBuilders.getEntityVertexConsumers().getBuffer(RenderLayer.getLines());
|
||||
drawShapeOutline(matrices, vertexConsumer, outlineShape,
|
||||
drawCuboidShapeOutline(matrices, vertexConsumer, outlineShape,
|
||||
(double) blockPos.getX() - pos.getX(), (double) blockPos.getY() - pos.getY(), (double) blockPos.getZ() - pos.getZ(),
|
||||
color[0] / 255.f, color[1] / 255.f, color[2] / 255.f, color[3] / 255.f);
|
||||
rgb.getRed() / 255.f, rgb.getGreen() / 255.f, rgb.getBlue() / 255.f, MidnightControlsConfig.reacharoundOutlineColorAlpha / 255.f);
|
||||
matrices.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,23 +10,29 @@
|
||||
package eu.midnightdust.midnightcontrols.client.ring;
|
||||
|
||||
import com.electronwill.nightconfig.core.Config;
|
||||
import eu.midnightdust.midnightcontrols.client.ButtonState;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.util.KeyBindingAccessor;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.option.KeyBinding;
|
||||
import net.minecraft.client.option.StickyKeyBinding;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.OrderedText;
|
||||
import net.minecraft.text.Text;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class KeyBindingRingAction extends RingAction {
|
||||
public class ButtonBindingRingAction extends RingAction {
|
||||
public static final Factory FACTORY = new Factory();
|
||||
public final KeyBinding binding;
|
||||
public final ButtonBinding binding;
|
||||
|
||||
public KeyBindingRingAction(@NotNull Config config, @NotNull KeyBinding binding) {
|
||||
super(config);
|
||||
public ButtonBindingRingAction(@NotNull ButtonBinding binding) {
|
||||
super();
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
@@ -37,19 +43,19 @@ public class KeyBindingRingAction extends RingAction {
|
||||
|
||||
@Override
|
||||
public void onAction(@NotNull RingButtonMode mode) {
|
||||
KeyBindingAccessor accessor = (KeyBindingAccessor) this.binding;
|
||||
switch (mode) {
|
||||
case PRESS, HOLD -> accessor.midnightcontrols$handlePressState(this.activated);
|
||||
case TOGGLE -> {
|
||||
accessor.midnightcontrols$handlePressState(!this.binding.isPressed());
|
||||
this.activated = !this.binding.isPressed();
|
||||
}
|
||||
binding.handle(MinecraftClient.getInstance(), 1.0f, ButtonState.PRESS);
|
||||
if (binding.asKeyBinding().isPresent()) {
|
||||
binding.asKeyBinding().get().setPressed(true);
|
||||
((KeyBindingAccessor)binding.asKeyBinding().get()).midnightcontrols$press();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawIcon(@NotNull MatrixStack matrices, @NotNull TextRenderer textRenderer, int x, int y, boolean hovered) {
|
||||
drawCenteredText(matrices, textRenderer, Text.translatable(this.getName()), x + 25, y + 25 - textRenderer.fontHeight / 2, 0xffffff);
|
||||
List<OrderedText> lines = textRenderer.wrapLines(Text.translatable(this.getName()), MidnightRing.ELEMENT_SIZE);
|
||||
for (int i = 0; i < lines.size(); ++i) {
|
||||
drawCenteredTextWithShadow(matrices, textRenderer, lines.get(i), x + MidnightRing.ELEMENT_SIZE / 2, y + MidnightRing.ELEMENT_SIZE / 2 - textRenderer.fontHeight / 2 * (lines.size()-1) - textRenderer.fontHeight / 2 + textRenderer.fontHeight * i, 0xffffff);
|
||||
}
|
||||
}
|
||||
|
||||
protected static class Factory implements RingAction.Factory {
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
|
||||
*
|
||||
* This file is part of midnightcontrols.
|
||||
*
|
||||
* Licensed under the MIT license. For more information,
|
||||
* see the LICENSE file.
|
||||
*/
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.ring;
|
||||
|
||||
import com.electronwill.nightconfig.core.Config;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class DummyRingAction extends RingAction {
|
||||
public DummyRingAction(@NotNull Config config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getName() {
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAction(@NotNull RingButtonMode mode) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawIcon(@NotNull MatrixStack matrices, @NotNull TextRenderer textRenderer, int x, int y, boolean hovered) {
|
||||
drawCenteredText(matrices, textRenderer, this.getName(), x + 25, y + 25 - textRenderer.fontHeight / 2, 0xffffff);
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,12 @@
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.ring;
|
||||
|
||||
import com.electronwill.nightconfig.core.Config;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,7 +30,7 @@ import java.util.Map;
|
||||
* @since 1.4.0
|
||||
*/
|
||||
public final class MidnightRing {
|
||||
public static final int ELEMENT_SIZE = 50;
|
||||
public static final int ELEMENT_SIZE = 75;
|
||||
|
||||
private final Map<String, RingAction.Factory> actionFactories = new Object2ObjectOpenHashMap<>();
|
||||
private final List<RingPage> pages = new ArrayList<>(Collections.singletonList(RingPage.DEFAULT));
|
||||
@@ -41,7 +43,7 @@ public final class MidnightRing {
|
||||
|
||||
public void registerAction(@NotNull String name, @NotNull RingAction.Factory factory) {
|
||||
if (this.actionFactories.containsKey(name)) {
|
||||
this.mod.warn("Tried to register twice a ring action: \"" + name + "\".");
|
||||
this.mod.warn("Tried to register a ring action twice: \"" + name + "\".");
|
||||
return;
|
||||
}
|
||||
this.actionFactories.put(name, factory);
|
||||
@@ -50,18 +52,55 @@ public final class MidnightRing {
|
||||
/**
|
||||
* Loads the ring from configuration.
|
||||
*/
|
||||
public void load() {
|
||||
List<Config> configPages = null;
|
||||
if (configPages != null) {
|
||||
public void loadFromConfig() {
|
||||
List<String> configBindings = MidnightControlsConfig.ringBindings;
|
||||
if (configBindings != null) {
|
||||
this.pages.clear();
|
||||
for (var configPage : configPages) {
|
||||
RingPage.parseRingPage(configPage).ifPresent(this.pages::add);
|
||||
int bindingIndex = 0;
|
||||
for (int i = 0; i < MathHelper.ceil(configBindings.size() / 8f); ++i) {
|
||||
this.pages.add(new RingPage(i+1 + " / " + MathHelper.ceil(configBindings.size() / 8f)));
|
||||
}
|
||||
|
||||
for (String binding : configBindings) {
|
||||
ButtonBinding buttonBinding = InputManager.getBinding(binding);
|
||||
if (buttonBinding != null) {
|
||||
RingPage page = this.pages.get(MathHelper.fastFloor(bindingIndex / 8f));
|
||||
page.actions[bindingIndex - 8 * (MathHelper.fastFloor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
||||
++bindingIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.pages.isEmpty()) {
|
||||
this.pages.add(RingPage.DEFAULT);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Loads the ring from all unbound keys.
|
||||
*/
|
||||
public void loadFromUnbound() {
|
||||
List<ButtonBinding> unboundBindings = InputManager.getUnboundBindings();
|
||||
if (unboundBindings != null) {
|
||||
this.pages.clear();
|
||||
int bindingIndex = 0;
|
||||
for (int i = 0; i < MathHelper.ceil(unboundBindings.size() / 8f); ++i) {
|
||||
this.pages.add(new RingPage(i+1 + " / " + MathHelper.ceil(unboundBindings.size() / 8f)));
|
||||
}
|
||||
|
||||
for (ButtonBinding buttonBinding : unboundBindings) {
|
||||
if (buttonBinding != null) {
|
||||
RingPage page = this.pages.get(MathHelper.fastFloor(bindingIndex / 8f));
|
||||
page.actions[bindingIndex - 8 * (MathHelper.fastFloor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
||||
++bindingIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.pages.isEmpty()) {
|
||||
this.pages.add(RingPage.DEFAULT);
|
||||
}
|
||||
}
|
||||
public int getMaxPages() {
|
||||
return this.pages.size();
|
||||
}
|
||||
|
||||
public @NotNull RingPage getCurrentPage() {
|
||||
if (this.currentPage >= this.pages.size())
|
||||
@@ -70,4 +109,13 @@ public final class MidnightRing {
|
||||
this.currentPage = 0;
|
||||
return this.pages.get(this.currentPage);
|
||||
}
|
||||
public void cyclePage(boolean forwards) {
|
||||
if (forwards) {
|
||||
if (currentPage < pages.size()-1) ++currentPage;
|
||||
else currentPage = 0;
|
||||
} else {
|
||||
if (currentPage > 0) --currentPage;
|
||||
else currentPage = pages.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,9 @@ import java.util.function.Supplier;
|
||||
* @since 1.4.0
|
||||
*/
|
||||
public abstract class RingAction extends DrawableHelper implements Nameable {
|
||||
protected Config config;
|
||||
protected boolean activated = false;
|
||||
|
||||
public RingAction(@NotNull Config config) {
|
||||
this.config = config;
|
||||
public RingAction() {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,8 +60,8 @@ public abstract class RingAction extends DrawableHelper implements Nameable {
|
||||
|
||||
public abstract void onAction(@NotNull RingButtonMode mode);
|
||||
|
||||
public void render(@NotNull MatrixStack matrices, @NotNull TextRenderer textRenderer, int x, int y, boolean hovered) {
|
||||
fill(matrices, x, y, x + MidnightRing.ELEMENT_SIZE, y + MidnightRing.ELEMENT_SIZE, hovered ? 0xbb777777 : 0xbb000000);
|
||||
public void render(@NotNull MatrixStack matrices, @NotNull TextRenderer textRenderer, int x, int y, boolean hovered, int index) {
|
||||
fill(matrices, x, y, x + MidnightRing.ELEMENT_SIZE, y + MidnightRing.ELEMENT_SIZE, hovered || RingPage.selected == index ? 0xbb777777 : 0xbb000000);
|
||||
drawIcon(matrices, textRenderer, x, y, hovered);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ package eu.midnightdust.midnightcontrols.client.ring;
|
||||
|
||||
import com.electronwill.nightconfig.core.Config;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
@@ -33,18 +35,14 @@ public class RingPage extends DrawableHelper {
|
||||
public static final RingPage DEFAULT = new RingPage("Default");
|
||||
|
||||
public final String name;
|
||||
private RingAction[] actions = new RingAction[8];
|
||||
public static int selected = -1;
|
||||
public RingAction[] actions = new RingAction[8];
|
||||
|
||||
public RingPage(@NotNull String name) {
|
||||
this.name = name;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
this.actions[i] = null;
|
||||
}
|
||||
this.actions[0] = new DummyRingAction(null);
|
||||
this.actions[1] = new KeyBindingRingAction(null, MidnightControlsClient.BINDING_LOOK_UP);
|
||||
this.actions[2] = new KeyBindingRingAction(null, MidnightControlsClient.BINDING_LOOK_LEFT);
|
||||
this.actions[3] = new KeyBindingRingAction(null, MidnightControlsClient.BINDING_LOOK_RIGHT);
|
||||
this.actions[4] = new KeyBindingRingAction(null, MidnightControlsClient.BINDING_LOOK_DOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,6 +58,7 @@ public class RingPage extends DrawableHelper {
|
||||
public void render(@NotNull MatrixStack matrices, @NotNull TextRenderer textRenderer, int width, int height, int mouseX, int mouseY, float tickDelta) {
|
||||
int centerX = width / 2;
|
||||
int centerY = height / 2;
|
||||
if (MidnightControlsClient.get().ring.getMaxPages() > 1) drawCenteredText(matrices, textRenderer, name, centerX, 5, 0xffffff);
|
||||
|
||||
int offset = MidnightRing.ELEMENT_SIZE + (MidnightRing.ELEMENT_SIZE / 2) + 5;
|
||||
|
||||
@@ -68,29 +67,29 @@ public class RingPage extends DrawableHelper {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
var ringAction = this.actions[i];
|
||||
if (ringAction != null)
|
||||
ringAction.render(matrices, textRenderer, x, y, isHovered(x, y, mouseX, mouseY));
|
||||
x += 55;
|
||||
ringAction.render(matrices, textRenderer, x, y, isHovered(x, y, mouseX, mouseY), i);
|
||||
x += MidnightRing.ELEMENT_SIZE + 5;
|
||||
}
|
||||
y += 55;
|
||||
y += MidnightRing.ELEMENT_SIZE + 5;
|
||||
x = centerX - offset;
|
||||
for (int i = 3; i < 5; i++) {
|
||||
var ringAction = this.actions[i];
|
||||
if (ringAction != null)
|
||||
ringAction.render(matrices, textRenderer, x, y, isHovered(x, y, mouseX, mouseY));
|
||||
x += 55 * 2;
|
||||
ringAction.render(matrices, textRenderer, x, y, isHovered(x, y, mouseX, mouseY), i);
|
||||
x += (MidnightRing.ELEMENT_SIZE + 5) * 2;
|
||||
}
|
||||
y += 55;
|
||||
y += MidnightRing.ELEMENT_SIZE + 5;
|
||||
x = centerX - offset;
|
||||
for (int i = 5; i < 8; i++) {
|
||||
var ringAction = this.actions[i];
|
||||
if (ringAction != null)
|
||||
ringAction.render(matrices, textRenderer, x, y, isHovered(x, y, mouseX, mouseY));
|
||||
x += 55;
|
||||
ringAction.render(matrices, textRenderer, x, y, isHovered(x, y, mouseX, mouseY), i);
|
||||
x += MidnightRing.ELEMENT_SIZE + 5;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isHovered(int x, int y, int mouseX, int mouseY) {
|
||||
return mouseX >= x && mouseY >= y && mouseX <= x + MidnightRing.ELEMENT_SIZE && mouseY <= y + MidnightRing.ELEMENT_SIZE;
|
||||
return mouseX >= x && mouseY >= y && mouseX <= x + MidnightRing.ELEMENT_SIZE && mouseY <= y + MidnightRing.ELEMENT_SIZE && selected < 0;
|
||||
}
|
||||
/**
|
||||
* Renders the ring page.
|
||||
@@ -114,9 +113,9 @@ public class RingPage extends DrawableHelper {
|
||||
ringAction.activate(RingButtonMode.PRESS);
|
||||
return true;
|
||||
}
|
||||
x += 55;
|
||||
x += MidnightRing.ELEMENT_SIZE + 5;
|
||||
}
|
||||
y += 55;
|
||||
y += MidnightRing.ELEMENT_SIZE + 5;
|
||||
x = centerX - offset;
|
||||
for (int i = 3; i < 5; i++) {
|
||||
var ringAction = this.actions[i];
|
||||
@@ -124,9 +123,9 @@ public class RingPage extends DrawableHelper {
|
||||
ringAction.activate(RingButtonMode.PRESS);
|
||||
return true;
|
||||
}
|
||||
x += 55 * 2;
|
||||
x += (MidnightRing.ELEMENT_SIZE + 5) * 2;
|
||||
}
|
||||
y += 55;
|
||||
y += MidnightRing.ELEMENT_SIZE + 5;
|
||||
x = centerX - offset;
|
||||
for (int i = 5; i < 8; i++) {
|
||||
var ringAction = this.actions[i];
|
||||
@@ -134,27 +133,8 @@ public class RingPage extends DrawableHelper {
|
||||
ringAction.activate(RingButtonMode.PRESS);
|
||||
return true;
|
||||
}
|
||||
x += 55;
|
||||
x += MidnightRing.ELEMENT_SIZE + 5;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to parse a ring page configuration.
|
||||
*
|
||||
* @param config the configuration
|
||||
* @return an optional ring page
|
||||
*/
|
||||
public static @NotNull Optional<RingPage> parseRingPage(@NotNull Config config) {
|
||||
String name = config.get("name");
|
||||
if (name == null)
|
||||
return Optional.empty();
|
||||
|
||||
var page = new RingPage(name);
|
||||
|
||||
List<Config> actionConfigs = config.get("actions");
|
||||
|
||||
|
||||
return Optional.of(page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,5 @@ package eu.midnightdust.midnightcontrols.client.util;
|
||||
*/
|
||||
public interface MouseAccessor {
|
||||
void midnightcontrols$onCursorPos(long window, double x, double y);
|
||||
void setLeftButtonClicked(boolean value);
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -4,10 +4,11 @@
|
||||
"key.midnightcontrols.look_left": "Nach links schauen",
|
||||
"key.midnightcontrols.look_right": "Nach rechts schauen",
|
||||
"key.midnightcontrols.look_up": "Nach oben schauen",
|
||||
"key.midnightcontrols.ring": "Zeige Steuerungsring",
|
||||
"key.midnightcontrols.ring": "Öffne Ring mit ungebundenen Aktionen",
|
||||
"midnightcontrols.action.attack": "Angreifen",
|
||||
"midnightcontrols.action.back": "Zurück",
|
||||
"midnightcontrols.action.chat": "Chat öffnen",
|
||||
"midnightcontrols.action.controls_ring": "Öffne Ring mit ungebundenen Aktionen",
|
||||
"midnightcontrols.action.drop_item": "Item droppen",
|
||||
"midnightcontrols.action.exit": "Schließen",
|
||||
"midnightcontrols.action.forward": "Vorwärts",
|
||||
@@ -40,8 +41,6 @@
|
||||
"midnightcontrols.action.zoom_in": "Zoom erhöhen",
|
||||
"midnightcontrols.action.zoom_out": "Zoom verringern",
|
||||
"midnightcontrols.action.zoom_reset": "Zoom zurücksetzen",
|
||||
"midnightcontrols.action.key.emotecraft.fastchoose": "Emote Schnellauswahl",
|
||||
"midnightcontrols.action.key.emotecraft.stop": "Emote stoppen",
|
||||
"midnightcontrols.button.left_bumper": "Linke Schultertaste",
|
||||
"midnightcontrols.button.right_bumper": "Rechte Schultertaste",
|
||||
"midnightcontrols.button.back": "Zurück",
|
||||
@@ -68,6 +67,8 @@
|
||||
"midnightcontrols.axis.right_x-": "Rechts X-",
|
||||
"midnightcontrols.axis.right_y-": "Rechts Y-",
|
||||
"midnightcontrols.button.unknown": "Unbekannt (%d)",
|
||||
"midnightcontrols.controller.tutorial.title": "Spiele Minecraft mit Controller!",
|
||||
"midnightcontrols.controller.tutorial.description": "Gehe zu %s -> %s -> %s",
|
||||
"midnightcontrols.controller.connected": "Controller %d verbunden.",
|
||||
"midnightcontrols.controller.disconnected": "Controller %d getrennt.",
|
||||
"midnightcontrols.controller.mappings.1": "Um die Controller-Mappings anzupassen, benutze %s",
|
||||
@@ -76,16 +77,12 @@
|
||||
"midnightcontrols.controller.mappings.error.write": "Fehler beim Schreiben der Controller Mappings.",
|
||||
"midnightcontrols.controller.mappings.updated": "Mappings aktualisiert!",
|
||||
"midnightcontrols.controller_type.default": "Standard",
|
||||
"midnightcontrols.controller_type.dualshock": "DualShock",
|
||||
"midnightcontrols.controller_type.switch": "Switch",
|
||||
"midnightcontrols.controller_type.xbox": "Xbox",
|
||||
"midnightcontrols.controller_type.steam": "Steam",
|
||||
"midnightcontrols.controller_type.ouya": "OUYA",
|
||||
"midnightcontrols.controller_type.numbered": "Nummerierter Controller",
|
||||
"midnightcontrols.controls_mode.default": "Tastatur/Maus",
|
||||
"midnightcontrols.controls_mode.controller": "Controller",
|
||||
"midnightcontrols.controls_mode.touchscreen": "Touchscreen",
|
||||
"midnightcontrols.hud_side.left": "links",
|
||||
"midnightcontrols.hud_side.right": "rechts",
|
||||
"midnightcontrols.controls_mode.touchscreen": "Touchscreen (In Arbeit)",
|
||||
"midnightcontrols.hud_side.left": "Links",
|
||||
"midnightcontrols.hud_side.right": "Rechts",
|
||||
"midnightcontrols.menu.analog_movement": "Analoge Bewegung",
|
||||
"midnightcontrols.menu.auto_switch_mode": "Automatischer Wechsel",
|
||||
"midnightcontrols.menu.controller": "Controller",
|
||||
@@ -101,7 +98,7 @@
|
||||
"midnightcontrols.menu.invert_right_x_axis": "X rechts umkehren",
|
||||
"midnightcontrols.menu.invert_right_y_axis": "Y rechts umkehren",
|
||||
"midnightcontrols.menu.keyboard_controls": "Tastatureinstellungen...",
|
||||
"midnightcontrols.menu.left_dead_zone": "Linke tote Zone",
|
||||
"midnightcontrols.menu.left_dead_zone": "Tote Zone des linken Sticks",
|
||||
"midnightcontrols.menu.mappings.open_input_str": "Öffne den Controller-Mapping Editor",
|
||||
"midnightcontrols.menu.max_left_x_value": "Maximalwert Linke X-Achse",
|
||||
"midnightcontrols.menu.max_left_y_value": "Maximalwert Linke Y-Achse",
|
||||
@@ -111,14 +108,15 @@
|
||||
"midnightcontrols.menu.reacharound.horizontal": "Vorderes Blockplatzieren",
|
||||
"midnightcontrols.menu.reacharound.vertical": "Vertikales Umgreifen",
|
||||
"midnightcontrols.menu.reload_controller_mappings": "Controller-Mappings neuladen",
|
||||
"midnightcontrols.menu.right_dead_zone": "Rechte tote Zone",
|
||||
"midnightcontrols.menu.right_dead_zone": "Tote Zone des rechten Sticks",
|
||||
"midnightcontrols.menu.rotation_speed": "Rotationsgeschwindigkeit (X-Achse)",
|
||||
"midnightcontrols.menu.y_axis_rotation_speed": "Rotationsgeschwindigkeit (Y-Achse)",
|
||||
"midnightcontrols.menu.separate_controller_profile": "Separates Controller-Profil",
|
||||
"midnightcontrols.menu.separator.controller": "Controller",
|
||||
"midnightcontrols.menu.separator.general": "Generell",
|
||||
"midnightcontrols.menu.title": "MidnightControls - Einstellungen",
|
||||
"midnightcontrols.menu.title.controller": "Controlleroptionen",
|
||||
"midnightcontrols.menu.title.controller_controls": "Controller Steuerung",
|
||||
"midnightcontrols.menu.title.controller_controls": "Controller Aktionen",
|
||||
"midnightcontrols.menu.title.gameplay": "Gameplay Optionen",
|
||||
"midnightcontrols.menu.title.general": "Generelle Optionen",
|
||||
"midnightcontrols.menu.title.hud": "HUD Optionen",
|
||||
|
||||
@@ -1,15 +1,36 @@
|
||||
{
|
||||
"midnightcontrols.midnightconfig.title": "MidnightControls Advanced Config",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.DEFAULT_LIGHT": "Default Light",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.DEFAULT_DARK": "Default Dark",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.SECOND_LIGHT": "Second Light",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.SECOND_DARK": "Second Dark",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DEFAULT": "Default",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DUALSHOCK": "DualShock",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DUALSENSE": "DualSense",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.SWITCH": "Switch/Wii Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.XBOX": "Xbox One/Series Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.XBOX_360": "Xbox 360 Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.STEAM_CONTROLLER": "Steam Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.STEAM_DECK": "Steam Deck",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.OUYA": "OUYA Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.NUMBERED": "Numbered Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.DEFAULT": "Keyboard/Mouse",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.CONTROLLER": "Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.TOUCHSCREEN": "Touchscreen (WIP)",
|
||||
"midnightcontrols.midnightconfig.enum.HudSide.LEFT": "Left",
|
||||
"midnightcontrols.midnightconfig.enum.HudSide.RIGHT": "Right",
|
||||
"key.midnightcontrols.look_down": "Look down",
|
||||
"key.midnightcontrols.look_left": "Look left",
|
||||
"key.midnightcontrols.look_right": "Look right",
|
||||
"key.midnightcontrols.look_up": "Look up",
|
||||
"key.midnightcontrols.ring": "Show controls ring",
|
||||
"key.midnightcontrols.ring": "Open Unbound Keybind Ring",
|
||||
"midnightcontrols.action.attack": "Attack",
|
||||
"midnightcontrols.action.back": "Back",
|
||||
"midnightcontrols.action.chat": "Open Chat",
|
||||
"midnightcontrols.action.controls_ring": "Open Unbound Keybind Ring",
|
||||
"midnightcontrols.action.debug_screen": "Open Debug HUD (F3)",
|
||||
"midnightcontrols.action.drop_item": "Drop Item",
|
||||
"midnightcontrols.action.exit": "Exit",
|
||||
"midnightcontrols.action.exit": "Exit Screen",
|
||||
"midnightcontrols.action.forward": "Forward",
|
||||
"midnightcontrols.action.hit": "Hit",
|
||||
"midnightcontrols.action.hotbar_left": "Hotbar left",
|
||||
@@ -26,6 +47,10 @@
|
||||
"midnightcontrols.action.quick_move": "Quick move",
|
||||
"midnightcontrols.action.right": "Right",
|
||||
"midnightcontrols.action.screenshot": "Take Screenshot",
|
||||
"midnightcontrols.action.slot_up": "Move Slot up",
|
||||
"midnightcontrols.action.slot_down": "Move Slot down",
|
||||
"midnightcontrols.action.slot_left": "Move Slot left",
|
||||
"midnightcontrols.action.slot_right": "Move Slot right",
|
||||
"midnightcontrols.action.sneak": "Sneak",
|
||||
"midnightcontrols.action.sprint": "Sprint",
|
||||
"midnightcontrols.action.swap_hands": "Swap Hands",
|
||||
@@ -33,6 +58,8 @@
|
||||
"midnightcontrols.action.toggle_smooth_camera": "Toggle Cinematic Camera",
|
||||
"midnightcontrols.action.page_back": "Previous Page",
|
||||
"midnightcontrols.action.page_next": "Next Page",
|
||||
"midnightcontrols.action.tab_back": "Previous Tab",
|
||||
"midnightcontrols.action.tab_next": "Next Tab",
|
||||
"midnightcontrols.action.take": "Take Item",
|
||||
"midnightcontrols.action.take_all": "Take Stack",
|
||||
"midnightcontrols.action.use": "Use",
|
||||
@@ -40,8 +67,9 @@
|
||||
"midnightcontrols.action.zoom_in": "Increase Zoom",
|
||||
"midnightcontrols.action.zoom_out": "Decrease Zoom",
|
||||
"midnightcontrols.action.zoom_reset": "Reset Zoom",
|
||||
"midnightcontrols.action.key.emotecraft.fastchoose": "Fast Choose Emote",
|
||||
"midnightcontrols.action.key.emotecraft.stop": "Stop Emote",
|
||||
"midnightcontrols.action.emi_page_left": "Previous Page",
|
||||
"midnightcontrols.action.emi_page_right": "Next Page",
|
||||
"midnightcontrols.category.emi": "EMI",
|
||||
"midnightcontrols.button.a": "A",
|
||||
"midnightcontrols.button.b": "B",
|
||||
"midnightcontrols.button.x": "X",
|
||||
@@ -72,6 +100,8 @@
|
||||
"midnightcontrols.axis.right_x-": "Right X-",
|
||||
"midnightcontrols.axis.right_y-": "Right Y-",
|
||||
"midnightcontrols.button.unknown": "Unknown (%d)",
|
||||
"midnightcontrols.controller.tutorial.title": "Play the game with a Controller!",
|
||||
"midnightcontrols.controller.tutorial.description": "Go to %s -> %s -> %s",
|
||||
"midnightcontrols.controller.connected": "Controller %d connected.",
|
||||
"midnightcontrols.controller.disconnected": "Controller %d disconnected.",
|
||||
"midnightcontrols.controller.mappings.1": "To configure the controller mappings, please use %s",
|
||||
@@ -79,21 +109,27 @@
|
||||
"midnightcontrols.controller.mappings.error": "Error while loading mappings.",
|
||||
"midnightcontrols.controller.mappings.error.write": "Error while writing mappings to file.",
|
||||
"midnightcontrols.controller.mappings.updated": "Updated mappings!",
|
||||
"midnightcontrols.controller_type.default": "default",
|
||||
"midnightcontrols.controller_type.default": "Default",
|
||||
"midnightcontrols.controller_type.dualshock": "DualShock",
|
||||
"midnightcontrols.controller_type.switch": "Switch",
|
||||
"midnightcontrols.controller_type.xbox": "Xbox",
|
||||
"midnightcontrols.controller_type.steam": "Steam",
|
||||
"midnightcontrols.controller_type.ouya": "OUYA",
|
||||
"midnightcontrols.controller_type.dualsense": "DualSense",
|
||||
"midnightcontrols.controller_type.switch": "Switch/Wii Controller",
|
||||
"midnightcontrols.controller_type.xbox": "Xbox One/Series Controller",
|
||||
"midnightcontrols.controller_type.xbox_360": "Xbox 360 Controller",
|
||||
"midnightcontrols.controller_type.steam_controller": "Steam Controller",
|
||||
"midnightcontrols.controller_type.steam_deck": "Steam Deck",
|
||||
"midnightcontrols.controller_type.ouya": "OUYA Controller",
|
||||
"midnightcontrols.controller_type.numbered": "Numbered Controller",
|
||||
"midnightcontrols.controls_mode.default": "Keyboard/Mouse",
|
||||
"midnightcontrols.controls_mode.controller": "Controller",
|
||||
"midnightcontrols.controls_mode.touchscreen": "Touchscreen",
|
||||
"midnightcontrols.hud_side.left": "left",
|
||||
"midnightcontrols.hud_side.right": "right",
|
||||
"midnightcontrols.controls_mode.touchscreen": "Touchscreen (WIP)",
|
||||
"midnightcontrols.hud_side.left": "Left",
|
||||
"midnightcontrols.hud_side.right": "Right",
|
||||
"midnightcontrols.menu.analog_movement": "Analog Movement",
|
||||
"midnightcontrols.menu.auto_switch_mode": "Auto Switch Mode",
|
||||
"midnightcontrols.menu.controller": "Controller",
|
||||
"midnightcontrols.menu.controller2": "Second Controller",
|
||||
"midnightcontrols.menu.controller_toggle_sneak": "Toggle Sneak on Controller",
|
||||
"midnightcontrols.menu.controller_toggle_sprint": "Toggle Sprint on Controller",
|
||||
"midnightcontrols.menu.controller_type": "Controller Type",
|
||||
"midnightcontrols.menu.controls_mode": "Mode",
|
||||
"midnightcontrols.menu.double_tap_to_sprint": "Double-Tap to Sprint",
|
||||
@@ -104,25 +140,28 @@
|
||||
"midnightcontrols.menu.hud_side": "HUD Side",
|
||||
"midnightcontrols.menu.invert_right_x_axis": "Invert Right X",
|
||||
"midnightcontrols.menu.invert_right_y_axis": "Invert Right Y",
|
||||
"midnightcontrols.menu.joystick_as_mouse": "Always use left stick as mouse",
|
||||
"midnightcontrols.menu.keyboard_controls": "Keyboard Controls...",
|
||||
"midnightcontrols.menu.left_dead_zone": "Left Dead Zone",
|
||||
"midnightcontrols.menu.left_dead_zone": "Left Stick Dead Zone",
|
||||
"midnightcontrols.menu.mappings.open_input_str": "Open Mappings File Editor",
|
||||
"midnightcontrols.menu.max_left_x_value": "Left X Axis Max Value",
|
||||
"midnightcontrols.menu.max_left_y_value": "Left Y Axis Max Value",
|
||||
"midnightcontrols.menu.max_right_x_value": "Right X Axis Max Value",
|
||||
"midnightcontrols.menu.max_right_y_value": "Right Y Axis Max Value",
|
||||
"midnightcontrols.menu.mouse_speed": "Mouse Speed",
|
||||
"midnightcontrols.menu.move_chat": "Move chat input box to top",
|
||||
"midnightcontrols.menu.reacharound.horizontal": "Front Block Placing",
|
||||
"midnightcontrols.menu.reacharound.vertical": "Vertical Reacharound",
|
||||
"midnightcontrols.menu.reload_controller_mappings": "Reload Controller Mappings",
|
||||
"midnightcontrols.menu.right_dead_zone": "Right Dead Zone",
|
||||
"midnightcontrols.menu.right_dead_zone": "Right Stick Dead Zone",
|
||||
"midnightcontrols.menu.rotation_speed": "X Axis Rotation Speed",
|
||||
"midnightcontrols.menu.y_axis_rotation_speed": "Y Axis Rotation Speed",
|
||||
"midnightcontrols.menu.separate_controller_profile": "Separate Controller Profile",
|
||||
"midnightcontrols.menu.separator.controller": "Controller",
|
||||
"midnightcontrols.menu.separator.general": "General",
|
||||
"midnightcontrols.menu.title": "MidnightControls - Settings",
|
||||
"midnightcontrols.menu.title.controller": "Controller Options",
|
||||
"midnightcontrols.menu.title.controller_controls": "Controller Controls",
|
||||
"midnightcontrols.menu.title.controller_controls": "Controller Bindings",
|
||||
"midnightcontrols.menu.title.gameplay": "Gameplay Options",
|
||||
"midnightcontrols.menu.title.general": "General Options",
|
||||
"midnightcontrols.menu.title.hud": "HUD Options",
|
||||
@@ -133,33 +172,36 @@
|
||||
"midnightcontrols.menu.virtual_mouse.skin": "Virtual Mouse Skin",
|
||||
"midnightcontrols.narrator.unbound": "Unbound %s",
|
||||
"midnightcontrols.not_bound": "Not bound",
|
||||
"midnightcontrols.tooltip.analog_movement": "Enables analog movement when possible.",
|
||||
"midnightcontrols.tooltip.auto_switch_mode": "If the controls mode should be switched to Controller automatically if one is connected.",
|
||||
"midnightcontrols.tooltip.controller2": "Second controller to use, which allows Joy-Cons support for example.",
|
||||
"midnightcontrols.tooltip.controller_type": "The controller type to display the correct buttons.",
|
||||
"midnightcontrols.tooltip.analog_movement": "When possible, enables analog movement.",
|
||||
"midnightcontrols.tooltip.auto_switch_mode": "Whether the controls mode should be switched to Controller automatically if one is connected.",
|
||||
"midnightcontrols.tooltip.controller2": "Second controller to use, which allows (for example) Joy-Cons support.",
|
||||
"midnightcontrols.tooltip.controller_type": "The controller type you're using (needed to display the correct buttons)",
|
||||
"midnightcontrols.tooltip.controls_mode": "The controls mode.",
|
||||
"midnightcontrols.tooltip.double_tap_to_sprint": "Toggles whether the Walk Forwards key makes the player sprint when double-tapped quickly",
|
||||
"midnightcontrols.tooltip.fast_block_placing": "While flying in creative mode, enables fast block placing depending on your speed. §cOn some servers this might be considered as cheating.",
|
||||
"midnightcontrols.tooltip.fly_drifting": "While flying, enables Vanilla drifting/inertia.",
|
||||
"midnightcontrols.tooltip.fly_drifting_vertical": "While flying, enables Vanilla vertical drifting/intertia.",
|
||||
"midnightcontrols.tooltip.hud_enable": "Toggles the on-screen controller button indicator.",
|
||||
"midnightcontrols.tooltip.hud_side": "The position of the HUD.",
|
||||
"midnightcontrols.tooltip.left_dead_zone": "The dead zone for the controller's left analogue stick.",
|
||||
"midnightcontrols.tooltip.joystick_as_mouse": "Make the joystick behave like a mouse in every menu.",
|
||||
"midnightcontrols.tooltip.left_dead_zone": "The dead zone for the controller's left analog stick.",
|
||||
"midnightcontrols.tooltip.max_left_x_value": "Changes what the mod considers the highest value for the left X axis. Useful if your axis does not use the full range and seems slow.",
|
||||
"midnightcontrols.tooltip.max_left_y_value": "Changes what the mod considers the highest value for the left Y axis. Useful if your axis does not use the full range and seems slow.",
|
||||
"midnightcontrols.tooltip.max_right_x_value": "Changes what the mod considers the highest value for the right X axis. Useful if your axis does not use the full range and seems slow.",
|
||||
"midnightcontrols.tooltip.max_right_y_value": "Changes what the mod considers the highest value for the right Y axis. Useful if your axis does not use the full range and seems slow.",
|
||||
"midnightcontrols.tooltip.mouse_speed": "The controller's emulated mouse speed.",
|
||||
"midnightcontrols.tooltip.move_chat": "Moves the chat input field to the top, for better input on devices with on-screen keyboards.",
|
||||
"midnightcontrols.tooltip.reacharound.horizontal": "Enables front block placing, §cmight be considered cheating on some servers§r.",
|
||||
"midnightcontrols.tooltip.reacharound.vertical": "Enables vertical reacharound, §cmight be considered cheating on some servers§r.",
|
||||
"midnightcontrols.tooltip.reload_controller_mappings": "Reloads the controller mappings file.",
|
||||
"midnightcontrols.tooltip.right_dead_zone": "The dead zone for the controller's right analogue stick.",
|
||||
"midnightcontrols.tooltip.rotation_speed": "The camera X Axis rotation speed in controller mode.",
|
||||
"midnightcontrols.tooltip.y_axis_rotation_speed": "The camera Y Axis rotation speed in controller mode.",
|
||||
"midnightcontrols.tooltip.unfocused_input": "Allow controller input when the window is not focused.",
|
||||
"midnightcontrols.tooltip.virtual_mouse": "Enable the virtual mouse which is handful in the case of a splitscreen.",
|
||||
"midnightcontrols.tooltip.right_dead_zone": "The dead zone for the controller's right analog stick.",
|
||||
"midnightcontrols.tooltip.rotation_speed": "The camera's X Axis rotation speed in controller mode.",
|
||||
"midnightcontrols.tooltip.y_axis_rotation_speed": "The camera's Y Axis rotation speed in controller mode.",
|
||||
"midnightcontrols.tooltip.unfocused_input": "Allows controller input when the window is not focused.",
|
||||
"midnightcontrols.tooltip.virtual_mouse": "Enables the virtual mouse, which is useful during splitscreen.",
|
||||
"midnightcontrols.virtual_mouse.skin.default_light": "Default Light",
|
||||
"midnightcontrols.virtual_mouse.skin.default_dark": "Default Dark",
|
||||
"midnightcontrols.virtual_mouse.skin.second_light": "Second Light",
|
||||
"midnightcontrols.virtual_mouse.skin.second_dark": "Second Dark",
|
||||
"modmenu.descriptionTranslation.midnightcontrols": "Adds controller support and enhanced controls overall.\nForked from LambdaControls, which sadly got discontinued."
|
||||
}
|
||||
}
|
||||
|
||||
132
src/main/resources/assets/midnightcontrols/lang/et_ee.json
Normal file
@@ -0,0 +1,132 @@
|
||||
{
|
||||
"midnightcontrols.midnightconfig.title": "MidnightControls täpsem seadistus",
|
||||
"key.midnightcontrols.look_down": "Vaata alla",
|
||||
"key.midnightcontrols.look_left": "Vaata vasakule",
|
||||
"key.midnightcontrols.look_right": "Vaata paremale",
|
||||
"key.midnightcontrols.look_up": "Vaata üles",
|
||||
"key.midnightcontrols.ring": "Kuva juhtnupuringi",
|
||||
"midnightcontrols.action.attack": "Ründa",
|
||||
"midnightcontrols.action.back": "Tagasi",
|
||||
"midnightcontrols.action.chat": "Ava vestlus",
|
||||
"midnightcontrols.action.drop_item": "Viska ese",
|
||||
"midnightcontrols.action.exit": "Välju",
|
||||
"midnightcontrols.action.forward": "Edasi",
|
||||
"midnightcontrols.action.hit": "Löö",
|
||||
"midnightcontrols.action.hotbar_left": "Plokiriba vasakule",
|
||||
"midnightcontrols.action.hotbar_right": "Plokiriba paremale",
|
||||
"midnightcontrols.action.inventory": "Seljakott",
|
||||
"midnightcontrols.action.jump": "Hüppa",
|
||||
"midnightcontrols.action.left": "Vasakule",
|
||||
"midnightcontrols.action.pause_game": "Mäng pausile",
|
||||
"midnightcontrols.action.pick_block": "Vali plokk",
|
||||
"midnightcontrols.action.pickup": "Korja üles",
|
||||
"midnightcontrols.action.pickup_all": "Korja kõik üles",
|
||||
"midnightcontrols.action.place": "Aseta",
|
||||
"midnightcontrols.action.player_list": "Mängijate loend",
|
||||
"midnightcontrols.action.quick_move": "Kiirliigutus",
|
||||
"midnightcontrols.action.right": "Paremale",
|
||||
"midnightcontrols.action.screenshot": "Loo kuvatõmmis",
|
||||
"midnightcontrols.action.sneak": "Hiili",
|
||||
"midnightcontrols.action.sprint": "Jookse",
|
||||
"midnightcontrols.action.swap_hands": "Vaheta käsi",
|
||||
"midnightcontrols.action.toggle_perspective": "Lülita perspektiivi",
|
||||
"midnightcontrols.action.toggle_smooth_camera": "Lülita kinemaatilist kaamerat",
|
||||
"midnightcontrols.action.page_back": "Eelmine leht",
|
||||
"midnightcontrols.action.page_next": "Järgmine leht",
|
||||
"midnightcontrols.action.take": "Võta ese",
|
||||
"midnightcontrols.action.take_all": "Võta kuhi",
|
||||
"midnightcontrols.action.use": "Kasuta",
|
||||
"midnightcontrols.action.zoom": "Suumi",
|
||||
"midnightcontrols.action.zoom_in": "Suurenda suumi",
|
||||
"midnightcontrols.action.zoom_out": "Vähenda suumi",
|
||||
"midnightcontrols.action.zoom_reset": "Lähtesta suum",
|
||||
"midnightcontrols.action.key.emotecraft.fastchoose": "Vali kiirelt liigutus",
|
||||
"midnightcontrols.action.key.emotecraft.stop": "Peata liigutus",
|
||||
|
||||
"midnightcontrols.button.left_bumper": "Vasak külgnupp",
|
||||
"midnightcontrols.button.right_bumper": "Parem külgnupp",
|
||||
|
||||
"midnightcontrols.button.left_thumb": "Vasak pöidlanupp",
|
||||
"midnightcontrols.button.right_thumb": "Parem pöidlanupp",
|
||||
"midnightcontrols.button.dpad_up": "DPAD üles",
|
||||
"midnightcontrols.button.dpad_right": "DPAD paremale",
|
||||
"midnightcontrols.button.dpad_down": "DPAD alla",
|
||||
"midnightcontrols.button.dpad_left": "DPAD vasakule",
|
||||
|
||||
"midnightcontrols.axis.left_x+": "Vasak X+",
|
||||
"midnightcontrols.axis.left_y+": "Vasak Y+",
|
||||
"midnightcontrols.axis.right_x+": "Parem X+",
|
||||
"midnightcontrols.axis.right_y+": "Parem Y+",
|
||||
"midnightcontrols.axis.left_trigger": "Vasak käiviti",
|
||||
"midnightcontrols.axis.right_trigger": "Parem käiviti",
|
||||
"midnightcontrols.axis.left_x-": "Vasak X-",
|
||||
"midnightcontrols.axis.left_y-": "Vasak Y-",
|
||||
"midnightcontrols.axis.right_x-": "Parem X-",
|
||||
"midnightcontrols.axis.right_y-": "Parem Y-",
|
||||
"midnightcontrols.button.unknown": "Teadmata (%d)",
|
||||
"midnightcontrols.controller.tutorial.title": "Mängi mängu oma juhtpuldiga!",
|
||||
"midnightcontrols.controller.tutorial.description": "Mine %s -> %s -> %s",
|
||||
"midnightcontrols.controller.connected": "Mängupult %d ühendatud.",
|
||||
"midnightcontrols.controller.disconnected": "Mängupult %d lahti ühendatud.",
|
||||
"midnightcontrols.controller.mappings.1": "Mängupuldi vastenduste seadistamiseks palun kasuta %s",
|
||||
"midnightcontrols.controller.mappings.3": "ning aseta vastendus vastenduste failiredaktorisse.",
|
||||
"midnightcontrols.controller.mappings.error": "Vastenduste laadimisel esines viga.",
|
||||
"midnightcontrols.controller.mappings.error.write": "Vastenduste faili kirjutamisel esines viga.",
|
||||
"midnightcontrols.controller.mappings.updated": "Vastendused uuendatud!",
|
||||
"midnightcontrols.controller_type.default": "vaikimisi",
|
||||
|
||||
"midnightcontrols.controls_mode.default": "klaviatuur/hiir",
|
||||
"midnightcontrols.controls_mode.controller": "mängupult",
|
||||
"midnightcontrols.controls_mode.touchscreen": "puuteekraan (arenduses)",
|
||||
"midnightcontrols.hud_side.left": "vasak",
|
||||
"midnightcontrols.hud_side.right": "parem",
|
||||
"midnightcontrols.menu.analog_movement": "Analoogliikumine",
|
||||
"midnightcontrols.menu.auto_switch_mode": "Vaheta režiimi automaatselt",
|
||||
"midnightcontrols.menu.controller": "Mängupult",
|
||||
"midnightcontrols.menu.controller2": "Teine mängupult",
|
||||
"midnightcontrols.menu.controller_type": "Mängupuldi tüüp",
|
||||
"midnightcontrols.menu.controls_mode": "Režiim",
|
||||
"midnightcontrols.menu.double_tap_to_sprint": "Jooksmiseks topeltkoputa",
|
||||
"midnightcontrols.menu.fast_block_placing": "Kiire plokiasetus",
|
||||
"midnightcontrols.menu.fly_drifting": "Lennutriivimine",
|
||||
"midnightcontrols.menu.fly_drifting_vertical": "Vertikaalne lennutriivimine",
|
||||
"midnightcontrols.menu.hud_enable": "Nähtav liides",
|
||||
"midnightcontrols.menu.hud_side": "Liidese pool",
|
||||
"midnightcontrols.menu.invert_right_x_axis": "Pööratud parem X",
|
||||
"midnightcontrols.menu.invert_right_y_axis": "Pööratud parem Y",
|
||||
"midnightcontrols.menu.keyboard_controls": "Klaviatuuri juhtnupud...",
|
||||
"midnightcontrols.menu.left_dead_zone": "Vasak surnud tsoon",
|
||||
"midnightcontrols.menu.mappings.open_input_str": "Ava vastenduste failiredaktor",
|
||||
"midnightcontrols.menu.max_left_x_value": "Vasaku X-telje maks. väärtus",
|
||||
"midnightcontrols.menu.max_left_y_value": "Vasaku Y-telje maks. väärtus",
|
||||
"midnightcontrols.menu.max_right_x_value": "Parema X-telje maks. väärtus",
|
||||
"midnightcontrols.menu.max_right_y_value": "Parema Y-telje maks. väärtus",
|
||||
"midnightcontrols.menu.mouse_speed": "Hiire kiirus",
|
||||
"midnightcontrols.menu.reacharound.horizontal": "Ploki etteasetus",
|
||||
"midnightcontrols.menu.reacharound.vertical": "Vertikaalne ümberasetus",
|
||||
"midnightcontrols.menu.reload_controller_mappings": "Laadi mängupuldi vastendused uuesti",
|
||||
"midnightcontrols.menu.right_dead_zone": "Parem surnud tsoon",
|
||||
"midnightcontrols.menu.rotation_speed": "X-telje pöördekiirus",
|
||||
"midnightcontrols.menu.y_axis_rotation_speed": "Y-telje pöördekiirus",
|
||||
"midnightcontrols.menu.separator.controller": "Mängupult",
|
||||
"midnightcontrols.menu.separator.general": "Üldine",
|
||||
"midnightcontrols.menu.title": "MidnightControls - seaded",
|
||||
"midnightcontrols.menu.title.controller": "Mängupuldi valikud",
|
||||
"midnightcontrols.menu.title.controller_controls": "Mängupuldi juhtnupud",
|
||||
"midnightcontrols.menu.title.gameplay": "Mängukogemuse valikud",
|
||||
"midnightcontrols.menu.title.general": "Üldised valikud",
|
||||
"midnightcontrols.menu.title.hud": "Liidese valikud",
|
||||
"midnightcontrols.menu.title.mappings.string": "Vastenduste failiredaktor",
|
||||
"midnightcontrols.menu.title.visual": "Välimuse valikud",
|
||||
"midnightcontrols.menu.unfocused_input": "Fookustamata sisend",
|
||||
"midnightcontrols.menu.virtual_mouse": "Virtuaalne hiir",
|
||||
"midnightcontrols.menu.virtual_mouse.skin": "Virtuaalse hiire välimus",
|
||||
"midnightcontrols.narrator.unbound": "Määramata %s",
|
||||
"midnightcontrols.not_bound": "määramata",
|
||||
|
||||
"midnightcontrols.virtual_mouse.skin.default_light": "vaikimisi hele",
|
||||
"midnightcontrols.virtual_mouse.skin.default_dark": "vaikimisi tume",
|
||||
"midnightcontrols.virtual_mouse.skin.second_light": "teine hele",
|
||||
"midnightcontrols.virtual_mouse.skin.second_dark": "teine tume",
|
||||
"modmenu.descriptionTranslation.midnightcontrols": "Lisab mängupuldi toe ning täiendab juhtnuppe üldiselt.\nFork loodud LambdaControls-ist, mille toetamine kahjuks lõpetati."
|
||||
}
|
||||
203
src/main/resources/assets/midnightcontrols/lang/it_it.json
Normal file
@@ -0,0 +1,203 @@
|
||||
{
|
||||
"midnightcontrols.midnightconfig.title": "Configurazione Avanzata MidnightControls",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.DEFAULT_LIGHT": "Default Chiaro",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.DEFAULT_DARK": "Default Scuro",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.SECOND_LIGHT": "Chiaro Secondario",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.SECOND_DARK": "Scuro secondario",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DEFAULT": "Default",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DUALSHOCK": "DualShock",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DUALSENSE": "DualSense",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.SWITCH": "Controller Switch/Wii",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.XBOX": "Controller Xbox One/Series",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.XBOX_360": "Controller Xbox 360",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.STEAM_CONTROLLER": "Controller Steam",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.STEAM_DECK": "Steam Deck",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.OUYA": "Controller OUYA",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.NUMBERED": "Controller Numerato",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.DEFAULT": "Tastiera/Mouse",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.CONTROLLER": "Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.TOUCHSCREEN": "Touchscreen (WIP)",
|
||||
"midnightcontrols.midnightconfig.enum.HudSide.LEFT": "Sinistra",
|
||||
"midnightcontrols.midnightconfig.enum.HudSide.RIGHT": "Destra",
|
||||
"key.midnightcontrols.look_down": "Guarda in basso",
|
||||
"key.midnightcontrols.look_left": "Guarda a sinistra",
|
||||
"key.midnightcontrols.look_right": "Guarda a destra",
|
||||
"key.midnightcontrols.look_up": "Guarda sopra",
|
||||
"key.midnightcontrols.ring": "Apri Tasti non impostati",
|
||||
"midnightcontrols.action.attack": "Attacca",
|
||||
"midnightcontrols.action.back": "Indietro",
|
||||
"midnightcontrols.action.chat": "Apri Chat",
|
||||
"midnightcontrols.action.controls_ring": "Apri Tasti non impostati",
|
||||
"midnightcontrols.action.debug_screen": "Apri HUD di Debug (F3)",
|
||||
"midnightcontrols.action.drop_item": "Rilascia oggetto",
|
||||
"midnightcontrols.action.exit": "Esci",
|
||||
"midnightcontrols.action.forward": "Avanti",
|
||||
"midnightcontrols.action.hit": "Colpisci",
|
||||
"midnightcontrols.action.hotbar_left": "Hotbar sinistra",
|
||||
"midnightcontrols.action.hotbar_right": "Hotbar destra",
|
||||
"midnightcontrols.action.inventory": "Inventario",
|
||||
"midnightcontrols.action.jump": "Salta",
|
||||
"midnightcontrols.action.left": "Sinistra",
|
||||
"midnightcontrols.action.pause_game": "Pausa il gioco",
|
||||
"midnightcontrols.action.pick_block": "Prendi Blocco",
|
||||
"midnightcontrols.action.pickup": "Raccogli",
|
||||
"midnightcontrols.action.pickup_all": "Raccogli Tutto",
|
||||
"midnightcontrols.action.place": "Piazza",
|
||||
"midnightcontrols.action.player_list": "Lista Giocatori",
|
||||
"midnightcontrols.action.quick_move": "Muovi veloce",
|
||||
"midnightcontrols.action.right": "Destra",
|
||||
"midnightcontrols.action.screenshot": "Fai uno Screenshot",
|
||||
"midnightcontrols.action.slot_up": "Muovi slot sopra",
|
||||
"midnightcontrols.action.slot_down": "Muovi slot sotto",
|
||||
"midnightcontrols.action.slot_left": "Muovi slot a sinistra",
|
||||
"midnightcontrols.action.slot_right": "Muovi slot a destra",
|
||||
"midnightcontrols.action.sneak": "Accovaccia",
|
||||
"midnightcontrols.action.sprint": "Corri",
|
||||
"midnightcontrols.action.swap_hands": "Scambia le mani",
|
||||
"midnightcontrols.action.toggle_perspective": "Cambia la prospettiva",
|
||||
"midnightcontrols.action.toggle_smooth_camera": "Cambia Camera Cinematica",
|
||||
"midnightcontrols.action.page_back": "Pagina precedente",
|
||||
"midnightcontrols.action.page_next": "Pagina Successica",
|
||||
"midnightcontrols.action.tab_back": "Tab Precedente",
|
||||
"midnightcontrols.action.tab_next": "Tab Successiva",
|
||||
"midnightcontrols.action.take": "Prendi Item",
|
||||
"midnightcontrols.action.take_all": "Prendi Stack",
|
||||
"midnightcontrols.action.use": "Usa",
|
||||
"midnightcontrols.action.zoom": "Zoom",
|
||||
"midnightcontrols.action.zoom_in": "Aumenta Zoom",
|
||||
"midnightcontrols.action.zoom_out": "Diminuisci Zoom",
|
||||
"midnightcontrols.action.zoom_reset": "Resetta Zoom",
|
||||
"midnightcontrols.action.emi_page_left": "Pagina Precedente",
|
||||
"midnightcontrols.action.emi_page_right": "Pagina Successiva",
|
||||
"midnightcontrols.category.emi": "EMI",
|
||||
"midnightcontrols.button.a": "A",
|
||||
"midnightcontrols.button.b": "B",
|
||||
"midnightcontrols.button.x": "X",
|
||||
"midnightcontrols.button.y": "Y",
|
||||
"midnightcontrols.button.left_bumper": "Bumper Destro",
|
||||
"midnightcontrols.button.right_bumper": "Bumper Sinistro",
|
||||
"midnightcontrols.button.back": "Indietro",
|
||||
"midnightcontrols.button.start": "Avvia",
|
||||
"midnightcontrols.button.guide": "Guida",
|
||||
"midnightcontrols.button.left_thumb": "Pollice Sinistro",
|
||||
"midnightcontrols.button.right_thumb": "Pollice Destro",
|
||||
"midnightcontrols.button.dpad_up": "DPAD Sopra",
|
||||
"midnightcontrols.button.dpad_right": "DPAD Destra",
|
||||
"midnightcontrols.button.dpad_down": "DPAD Sotto",
|
||||
"midnightcontrols.button.dpad_left": "DPAD Sinistra",
|
||||
"midnightcontrols.button.l4": "L4",
|
||||
"midnightcontrols.button.l5": "L5",
|
||||
"midnightcontrols.button.r4": "R4",
|
||||
"midnightcontrols.button.r5": "L5",
|
||||
"midnightcontrols.axis.left_x+": "Sinistra X+",
|
||||
"midnightcontrols.axis.left_y+": "Sinistra Y+",
|
||||
"midnightcontrols.axis.right_x+": "Destra X+",
|
||||
"midnightcontrols.axis.right_y+": "Destra Y+",
|
||||
"midnightcontrols.axis.left_trigger": "Trigger Sinistro",
|
||||
"midnightcontrols.axis.right_trigger": "Trigger Destro",
|
||||
"midnightcontrols.axis.left_x-": "Sinistra X-",
|
||||
"midnightcontrols.axis.left_y-": "Sinistra Y-",
|
||||
"midnightcontrols.axis.right_x-": "Destra X-",
|
||||
"midnightcontrols.axis.right_y-": "Destra Y-",
|
||||
"midnightcontrols.button.unknown": "Sconosciuto",
|
||||
"midnightcontrols.controller.tutorial.title": "Gioca il gioco con un Controller!",
|
||||
"midnightcontrols.controller.tutorial.description": "Vai a %s -> %s -> %s",
|
||||
"midnightcontrols.controller.connected": "Controller %d connesso.",
|
||||
"midnightcontrols.controller.disconnected": "Controller %d disconnesso",
|
||||
"midnightcontrols.controller.mappings.1": "Per configurare le mappature dei controller, per favore usa %s",
|
||||
"midnightcontrols.controller.mappings.3": "e incolla le mappature nel file editor.",
|
||||
"midnightcontrols.controller.mappings.error": "Errore durante il caricamento delle mappature",
|
||||
"midnightcontrols.controller.mappings.error.write": "Errore durante la scrittura delle mappature su file",
|
||||
"midnightcontrols.controller.mappings.updated": "Aggiornate le mappature!",
|
||||
"midnightcontrols.controller_type.default": "Default",
|
||||
"midnightcontrols.controller_type.dualshock": "DualShock",
|
||||
"midnightcontrols.controller_type.dualsense": "DualSense",
|
||||
"midnightcontrols.controller_type.switch": "Controller Switch/Wii",
|
||||
"midnightcontrols.controller_type.xbox": "Controller Xbox One/Series",
|
||||
"midnightcontrols.controller_type.xbox_360": "Controller Xbox 360",
|
||||
"midnightcontrols.controller_type.steam_controller": "Controller Steam",
|
||||
"midnightcontrols.controller_type.steam_deck": "Steam Deck",
|
||||
"midnightcontrols.controller_type.ouya": "Controller OUYA",
|
||||
"midnightcontrols.controller_type.numbered": "Controller Numerato",
|
||||
"midnightcontrols.controls_mode.default": "Tastiera/Mouse",
|
||||
"midnightcontrols.controls_mode.controller": "Controller",
|
||||
"midnightcontrols.controls_mode.touchscreen": "Touchscreen (WIP)",
|
||||
"midnightcontrols.hud_side.left": "Left",
|
||||
"midnightcontrols.hud_side.right": "Destra",
|
||||
"midnightcontrols.menu.analog_movement": "Movimento Analogo",
|
||||
"midnightcontrols.menu.auto_switch_mode": "Modalità Cambio Automatico",
|
||||
"midnightcontrols.menu.controller": "Controller",
|
||||
"midnightcontrols.menu.controller2": "Controller Secondario",
|
||||
"midnightcontrols.menu.controller_toggle_sneak": "Attiva/Disattiva Accovacciamento su Controller",
|
||||
"midnightcontrols.menu.controller_toggle_sprint": "Attiva/Disattiva Correre su Controller",
|
||||
"midnightcontrols.menu.controller_type": "Tipo di Controller",
|
||||
"midnightcontrols.menu.controls_mode": "Modalità",
|
||||
"midnightcontrols.menu.double_tap_to_sprint": "Doppio Tap per Sprintare",
|
||||
"midnightcontrols.menu.fast_block_placing": "Veloce Piazzamento di Blocchi",
|
||||
"midnightcontrols.menu.fly_drifting": "Drift in Volo",
|
||||
"midnightcontrols.menu.fly_drifting_vertical": "Drift in Volo Verticale",
|
||||
"midnightcontrols.menu.hud_enable": "Attiva HUD",
|
||||
"midnightcontrols.menu.hud_side": "Lato HUD",
|
||||
"midnightcontrols.menu.invert_right_x_axis": "Inverti Destro X",
|
||||
"midnightcontrols.menu.invert_right_y_axis": "Inverti Destro Y",
|
||||
"midnightcontrols.menu.keyboard_controls": "Controlli da Tastiera...",
|
||||
"midnightcontrols.menu.left_dead_zone": "Zona Morta dello Stick Sinistro",
|
||||
"midnightcontrols.menu.mappings.open_input_str": "Apri il File Editor delle Mappature",
|
||||
"midnightcontrols.menu.max_left_x_value": "Asse X Sinistro Massimo Valore",
|
||||
"midnightcontrols.menu.max_left_y_value": "Asse Y Sinistro Massimo Valore",
|
||||
"midnightcontrols.menu.max_right_x_value": "Asse Destro X Massimo Valore",
|
||||
"midnightcontrols.menu.max_right_y_value": "Asse Destro Y Massimo Valore",
|
||||
"midnightcontrols.menu.mouse_speed": "Velocità Mouse",
|
||||
"midnightcontrols.menu.reacharound.horizontal": "Piazza blocchi Davanti",
|
||||
"midnightcontrols.menu.reacharound.vertical": "Reach Verticale",
|
||||
"midnightcontrols.menu.reload_controller_mappings": "Ricarica Mappature del Controller",
|
||||
"midnightcontrols.menu.right_dead_zone": "Zona Morta Stick Destro",
|
||||
"midnightcontrols.menu.rotation_speed": "Velocità di rotazione dell'Asse X",
|
||||
"midnightcontrols.menu.y_axis_rotation_speed": "Velocità di rotazione dell'Asse Y",
|
||||
"midnightcontrols.menu.separate_controller_profile": "Profilo Controller Separato",
|
||||
"midnightcontrols.menu.separator.controller": "Controller",
|
||||
"midnightcontrols.menu.separator.general": "Generale",
|
||||
"midnightcontrols.menu.title": "MidnightControls - Impostazioni",
|
||||
"midnightcontrols.menu.title.controller": "Opzioni Controller",
|
||||
"midnightcontrols.menu.title.controller_controls": "Tasti Controller",
|
||||
"midnightcontrols.menu.title.gameplay": "Opzioni del Gameplay",
|
||||
"midnightcontrols.menu.title.general": "Impostazioni Generali",
|
||||
"midnightcontrols.menu.title.hud": "Opzioni della HUD",
|
||||
"midnightcontrols.menu.title.mappings.string": "Editor di file delle Mappature",
|
||||
"midnightcontrols.menu.title.visual": "Aspetto",
|
||||
"midnightcontrols.menu.unfocused_input": "Input non a fuoco",
|
||||
"midnightcontrols.menu.virtual_mouse": "Mouse Virtuale",
|
||||
"midnightcontrols.menu.virtual_mouse.skin": "Aspetto Mouse Virtuale",
|
||||
"midnightcontrols.narrator.unbound": "Disimpostato %s",
|
||||
"midnightcontrols.not_bound": "Non Impostato",
|
||||
"midnightcontrols.tooltip.analog_movement": "Quando possibile, attiva movimento analogo.",
|
||||
"midnightcontrols.tooltip.auto_switch_mode": "Quando la modalità controlli dovrebbe passare a Controller automaticamente se uno è connesso",
|
||||
"midnightcontrols.tooltip.controller2": "Secondo controller da usare, che permette (per esempio) Supporto dei Joy-Cons.",
|
||||
"midnightcontrols.tooltip.controller_type": "Il tipo di controller che stai usando (usato per mostrare i pulsanti corretti)",
|
||||
"midnightcontrols.tooltip.controls_mode": "Modalita controlli.",
|
||||
"midnightcontrols.tooltip.double_tap_to_sprint": "Attiva quando il tasto \"Cammina Avanti\" fa correre il giocatore con doppio tap velocemente",
|
||||
"midnightcontrols.tooltip.fast_block_placing": "Quando si vola in creativa, attiva il movimento veloce dei blocchi in base alla tua velocità. §cSu alcuni server potrebbe essere considerato un cheat.§r",
|
||||
"midnightcontrols.tooltip.fly_drifting": "Quando si vola, attiva L'inerzia del Vanilla",
|
||||
"midnightcontrols.tooltip.fly_drifting_vertical": "Quando si vola, attiva l'inerzia verticale Vanilla",
|
||||
"midnightcontrols.tooltip.hud_enable": "Attiva gli indicatori dei pulsanti dei controller sullo schermo.",
|
||||
"midnightcontrols.tooltip.hud_side": "La posizione della HUD",
|
||||
"midnightcontrols.tooltip.left_dead_zone": "La zona morta per lo stick sinistro del controller.",
|
||||
"midnightcontrols.tooltip.max_left_x_value": "Cambia cosa la mod considera il più alto valore per l'asse X sinistro. Utile se il tuo asse non usa il range massimo e sembra lento",
|
||||
"midnightcontrols.tooltip.max_left_y_value": "Cambia cosa la mod considera il più alto valore per l'asse Y sinistro. Utile se il tuo asse non usa il range massimo e sembra lento",
|
||||
"midnightcontrols.tooltip.max_right_x_value": "Cambia cosa la mod considera il più alto valore per l'asse X Destro. Utile se il tuo asse non usa il range massimo e sembra lento.",
|
||||
"midnightcontrols.tooltip.max_right_y_value": "Cambia cosa la mod considera il più alto valore per l'asse Y Destro. Utile se il tuo asse non usa il range massimo e sembra lento.",
|
||||
"midnightcontrols.tooltip.mouse_speed": "La velocità del controller emulato.",
|
||||
"midnightcontrols.tooltip.reacharound.horizontal": "Attiva il piazzare blocchi davanti, Potrebbe essere considerato un cheat su alcuni server.",
|
||||
"midnightcontrols.tooltip.reacharound.vertical": "Attiva il reach verticale, potrebbe essere considerato cheating su alcuni server",
|
||||
"midnightcontrols.tooltip.reload_controller_mappings": "Riavvia il file dlle mappature del controller",
|
||||
"midnightcontrols.tooltip.right_dead_zone": "La zona morta per lo stick destro del controller",
|
||||
"midnightcontrols.tooltip.rotation_speed": "L'asse X della velocità di rotazione della camera im modalità controller",
|
||||
"midnightcontrols.tooltip.y_axis_rotation_speed": "L'asse Y della velocità di rotazione della camera im modalità controller",
|
||||
"midnightcontrols.tooltip.unfocused_input": "Permette imput dei controller quando la finestra non è messa a fuoco",
|
||||
"midnightcontrols.tooltip.virtual_mouse": "Attiva il mouse virtuale, che può essere utile nello schermo diviso.",
|
||||
"midnightcontrols.virtual_mouse.skin.default_light": "Chiaro Default",
|
||||
"midnightcontrols.virtual_mouse.skin.default_dark": "Scuro Default",
|
||||
"midnightcontrols.virtual_mouse.skin.second_light": "Chiaro Secondario",
|
||||
"midnightcontrols.virtual_mouse.skin.second_dark": "Scuro Secondario",
|
||||
"modmenu.descriptionTranslation.midnightcontrols": "Aggiunge supporto e controlli migliorati in generale. \\nProveniente da LambdaControls, che è stato rimosso."
|
||||
}
|
||||
177
src/main/resources/assets/midnightcontrols/lang/ru_ru.json
Normal file
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"midnightcontrols.midnightconfig.title": "Расширенная Конфигурация MidnightControls",
|
||||
"key.midnightcontrols.look_down": "Смотреть Вниз",
|
||||
"key.midnightcontrols.look_left": "Смотреть Налево",
|
||||
"key.midnightcontrols.look_right": "Смотреть Направо",
|
||||
"key.midnightcontrols.look_up": "Смотрeть Вверх",
|
||||
"key.midnightcontrols.ring": "Показать Кольцо Управления",
|
||||
"midnightcontrols.action.attack": "Атаковать",
|
||||
"midnightcontrols.action.back": "Назад",
|
||||
"midnightcontrols.action.chat": "Открыть Чат",
|
||||
"midnightcontrols.action.debug_screen": "Открыть Отладку (F3)",
|
||||
"midnightcontrols.action.drop_item": "Выбросить Предмет",
|
||||
"midnightcontrols.action.exit": "Выйти",
|
||||
"midnightcontrols.action.forward": "Вперед",
|
||||
"midnightcontrols.action.hit": "Ударить",
|
||||
"midnightcontrols.action.hotbar_left": "Панель Быстрого Доступа Налево",
|
||||
"midnightcontrols.action.hotbar_right": "Панель Быстрого Доступа Направо",
|
||||
"midnightcontrols.action.inventory": "Инвентарь",
|
||||
"midnightcontrols.action.jump": "Прыжок",
|
||||
"midnightcontrols.action.left": "Налево",
|
||||
"midnightcontrols.action.pause_game": "Приостановить игру",
|
||||
"midnightcontrols.action.pick_block": "Выбор Блока",
|
||||
"midnightcontrols.action.pickup": "Взять Половину",
|
||||
"midnightcontrols.action.pickup_all": "Взять Всё",
|
||||
"midnightcontrols.action.place": "Поставить",
|
||||
"midnightcontrols.action.player_list": "Лист Игроков",
|
||||
"midnightcontrols.action.quick_move": "Переложить",
|
||||
"midnightcontrols.action.right": "Направо",
|
||||
"midnightcontrols.action.screenshot": "Сделать Скриншот",
|
||||
"midnightcontrols.action.slot_up": "Двинуть На Слот Вверх",
|
||||
"midnightcontrols.action.slot_down": "Двинуть На Слот Вниз",
|
||||
"midnightcontrols.action.slot_left": "Двинуть На Слот Влево",
|
||||
"midnightcontrols.action.slot_right": "Двинуть На Слот Вправо",
|
||||
"midnightcontrols.action.sneak": "Красться",
|
||||
"midnightcontrols.action.sprint": "Бег",
|
||||
"midnightcontrols.action.swap_hands": "Поменять Руку",
|
||||
"midnightcontrols.action.toggle_perspective": "Переключить Перспективу",
|
||||
"midnightcontrols.action.toggle_smooth_camera": "Переключить Кинематографическую Камеру",
|
||||
"midnightcontrols.action.page_back": "Предыдущая Страница",
|
||||
"midnightcontrols.action.page_next": "Следующая Страница",
|
||||
"midnightcontrols.action.tab_back": "Предыдущая Секция",
|
||||
"midnightcontrols.action.tab_next": "Следующая Секция",
|
||||
"midnightcontrols.action.take": "Взять Предмет",
|
||||
"midnightcontrols.action.take_all": "Взять Стак",
|
||||
"midnightcontrols.action.use": "Использовать",
|
||||
"midnightcontrols.action.zoom": "Приблизить",
|
||||
"midnightcontrols.action.zoom_in": "Увеличить Масштаб",
|
||||
"midnightcontrols.action.zoom_out": "Уменьшить Масштаб",
|
||||
"midnightcontrols.action.zoom_reset": "Сбросить Масштаб",
|
||||
"midnightcontrols.action.emi_page_left": "Предыдущая Страница",
|
||||
"midnightcontrols.action.emi_page_right": "Следующая Страница",
|
||||
"midnightcontrols.category.emi": "ЕМИ",
|
||||
"midnightcontrols.button.a": "A",
|
||||
"midnightcontrols.button.b": "B",
|
||||
"midnightcontrols.button.x": "X",
|
||||
"midnightcontrols.button.y": "Y",
|
||||
"midnightcontrols.button.left_bumper": "Левый Бампер",
|
||||
"midnightcontrols.button.right_bumper": "Правый Бампер",
|
||||
"midnightcontrols.button.back": "Назад",
|
||||
"midnightcontrols.button.start": "Старт",
|
||||
"midnightcontrols.button.guide": "Гайд Кнопка",
|
||||
"midnightcontrols.button.left_thumb": "Левый Стик",
|
||||
"midnightcontrols.button.right_thumb": "Правый Стик",
|
||||
"midnightcontrols.button.dpad_up": "Крестовина Вверх",
|
||||
"midnightcontrols.button.dpad_right": "Крестовина Вправо",
|
||||
"midnightcontrols.button.dpad_down": "Крестовина Вниз",
|
||||
"midnightcontrols.button.dpad_left": "Крестовина Влево",
|
||||
"midnightcontrols.button.l4": "L4",
|
||||
"midnightcontrols.button.l5": "L5",
|
||||
"midnightcontrols.button.r4": "R4",
|
||||
"midnightcontrols.button.r5": "L5",
|
||||
"midnightcontrols.axis.left_x+": "Левый Стик X+",
|
||||
"midnightcontrols.axis.left_y+": "Левый Стик Y+",
|
||||
"midnightcontrols.axis.right_x+": "Правый Стик X+",
|
||||
"midnightcontrols.axis.right_y+": "Правый Стик Y+",
|
||||
"midnightcontrols.axis.left_trigger": "Левый Триггер",
|
||||
"midnightcontrols.axis.right_trigger": "Правый Триггер",
|
||||
"midnightcontrols.axis.left_x-": "Левый Стик X-",
|
||||
"midnightcontrols.axis.left_y-": "Левый Стик Y-",
|
||||
"midnightcontrols.axis.right_x-": "Правый Стик X-",
|
||||
"midnightcontrols.axis.right_y-": "Правый Стик Y-",
|
||||
"midnightcontrols.button.unknown": "Неизвестный (%d)",
|
||||
"midnightcontrols.controller.connected": "Контроллер %d Был Присоединен.",
|
||||
"midnightcontrols.controller.disconnected": "Контроллер %d Был Отключён.",
|
||||
"midnightcontrols.controller.mappings.1": "Чтобы настроить раскладку контроллера, используйте %s",
|
||||
"midnightcontrols.controller.mappings.3": "и вставте ваш итог в редактор файлов раскладок.",
|
||||
"midnightcontrols.controller.mappings.error": "Ошибка при загрузке раскладки.",
|
||||
"midnightcontrols.controller.mappings.error.write": "Ошибка при записи раскладки в файл.",
|
||||
"midnightcontrols.controller.mappings.updated": "Раскладка обновлена!",
|
||||
"midnightcontrols.controller_type.default": "По стандарту",
|
||||
"midnightcontrols.controller_type.dualshock": "DualShock",
|
||||
"midnightcontrols.controller_type.dualsense": "DualSense",
|
||||
"midnightcontrols.controller_type.switch": "Switch",
|
||||
"midnightcontrols.controller_type.xbox": "Xbox",
|
||||
"midnightcontrols.controller_type.xbox_360": "Xbox 360",
|
||||
"midnightcontrols.controller_type.steam_controller": "Steam Controller",
|
||||
"midnightcontrols.controller_type.steam_deck": "Steam Deck",
|
||||
"midnightcontrols.controller_type.ouya": "OUYA",
|
||||
"midnightcontrols.controls_mode.default": "Клавиатура/Мышь",
|
||||
"midnightcontrols.controls_mode.controller": "Контроллер",
|
||||
"midnightcontrols.controls_mode.touchscreen": "Сенсорный Экран (Разраб.)",
|
||||
"midnightcontrols.hud_side.left": "Больше Налево",
|
||||
"midnightcontrols.hud_side.right": "Больше Направо",
|
||||
"midnightcontrols.menu.analog_movement": "Аналоговое Движение",
|
||||
"midnightcontrols.menu.auto_switch_mode": "Автоматическое Переключение",
|
||||
"midnightcontrols.menu.controller": "Контроллер",
|
||||
"midnightcontrols.menu.controller2": "Дополнительный Контроллер",
|
||||
"midnightcontrols.menu.controller_type": "Тип контроллера",
|
||||
"midnightcontrols.menu.controls_mode": "Тип",
|
||||
"midnightcontrols.menu.double_tap_to_sprint": "Дважды Отвести Левый Стик, Чтобы Начать Бежать",
|
||||
"midnightcontrols.menu.fast_block_placing": "Быстрая Поставка Блоков",
|
||||
"midnightcontrols.menu.fly_drifting": "Инерция При Полёте",
|
||||
"midnightcontrols.menu.fly_drifting_vertical": "Вертикальная Инерция При Полёте",
|
||||
"midnightcontrols.menu.hud_enable": "Включить Иконоки Контроллера",
|
||||
"midnightcontrols.menu.hud_side": "Расположение Интерфейса",
|
||||
"midnightcontrols.menu.invert_right_x_axis": "Инвертировать Правый X",
|
||||
"midnightcontrols.menu.invert_right_y_axis": "Инвертировать Правый Y",
|
||||
"midnightcontrols.menu.keyboard_controls": "Клавиатурная Настройка...",
|
||||
"midnightcontrols.menu.left_dead_zone": "Мертвая Зона Левого Стика",
|
||||
"midnightcontrols.menu.mappings.open_input_str": "Открыть Редактор Файлов Раскладок",
|
||||
"midnightcontrols.menu.max_left_x_value": "Максимальное Значение Ось Левого X",
|
||||
"midnightcontrols.menu.max_left_y_value": "Максимальное Значение Ось Левого Y",
|
||||
"midnightcontrols.menu.max_right_x_value": "Максимальное Значение Ось Правого X",
|
||||
"midnightcontrols.menu.max_right_y_value": "Максимальное Значение Ось Правого Y",
|
||||
"midnightcontrols.menu.mouse_speed": "Скорость Курсора",
|
||||
"midnightcontrols.menu.reacharound.horizontal": "Размещение Переднего Блока",
|
||||
"midnightcontrols.menu.reacharound.vertical": "Вертикальный Охват",
|
||||
"midnightcontrols.menu.reload_controller_mappings": "Перезагрузить Раскладку Контроллера",
|
||||
"midnightcontrols.menu.right_dead_zone": "Мертвая Зона Правого Стика",
|
||||
"midnightcontrols.menu.rotation_speed": "Скорость Вращения По Оси X",
|
||||
"midnightcontrols.menu.y_axis_rotation_speed": "Скорость Вращения По Оси Y",
|
||||
"midnightcontrols.menu.separator.controller": "Контроллер",
|
||||
"midnightcontrols.menu.separator.general": "Общие",
|
||||
"midnightcontrols.menu.title": "MidnightControls - Настройки",
|
||||
"midnightcontrols.menu.title.controller": "Настройки Контроллера",
|
||||
"midnightcontrols.menu.title.controller_controls": "Управление Контроллером",
|
||||
"midnightcontrols.menu.title.gameplay": "Во Время Игры Настройки",
|
||||
"midnightcontrols.menu.title.general": "Общие Настройки",
|
||||
"midnightcontrols.menu.title.hud": "Настройка Интерфейса",
|
||||
"midnightcontrols.menu.title.mappings.string": "Редактор Файлов Раскладок",
|
||||
"midnightcontrols.menu.title.visual": "Настройка Внешнего Вида",
|
||||
"midnightcontrols.menu.unfocused_input": "Несфокусированный Ввод",
|
||||
"midnightcontrols.menu.virtual_mouse": "Виртуальныя Мышка",
|
||||
"midnightcontrols.menu.virtual_mouse.skin": "Дизайн Виртуальной Мышки",
|
||||
"midnightcontrols.narrator.unbound": "Освобождённый %s",
|
||||
"midnightcontrols.not_bound": "Не Назначанно",
|
||||
"midnightcontrols.tooltip.analog_movement": "Включает аналоговое движение, когда это возможно.",
|
||||
"midnightcontrols.tooltip.auto_switch_mode": "Автоматическое переключение на новый, только подключенный контроллер.",
|
||||
"midnightcontrols.tooltip.controller2": "Дополнительный контроллер, например для Джой-конов.",
|
||||
"midnightcontrols.tooltip.controller_type": "Тип контроллера, чтобы правильно сопоставить иконки кнопок.",
|
||||
"midnightcontrols.tooltip.controls_mode": "Тип контроля над игрой.",
|
||||
"midnightcontrols.tooltip.double_tap_to_sprint": "При двойном перемещением на левый стик, персонаж начинает бежать.",
|
||||
"midnightcontrols.tooltip.fast_block_placing": "Во время полета в творческом режиме позволяет быстро размещать блоки в зависимости от вашей скорости. §cНа некоторых серверах это может расцениваться как читерство.§r",
|
||||
"midnightcontrols.tooltip.fly_drifting": "Во время полета включает ванильную инерцию.",
|
||||
"midnightcontrols.tooltip.fly_drifting_vertical": "Во время полета включает ванильную вертикальную инерцию.",
|
||||
"midnightcontrols.tooltip.hud_enable": "Переключает видение иконок кнопок контроллера на экране.",
|
||||
"midnightcontrols.tooltip.hud_side": "Расположение интерфейса в определённую сторону.",
|
||||
"midnightcontrols.tooltip.left_dead_zone": "Мертвая зона для левого аналогового стика контроллера.",
|
||||
"midnightcontrols.tooltip.max_left_x_value": "Изменяет то, что мод в итоге считает максимальным значением для левой оси X. Полезно, если ваша ось не использует весь диапазон и кажется медленной.",
|
||||
"midnightcontrols.tooltip.max_left_y_value": "Изменяет то, что мод в итоге считает максимальным значением для левой оси Y. Полезно, если ваша ось не использует весь диапазон и кажется медленной.",
|
||||
"midnightcontrols.tooltip.max_right_x_value": "Изменяет то, что мод в итоге считает максимальным значением для правой оси X. Полезно, если ваша ось не использует весь диапазон и кажется медленной.",
|
||||
"midnightcontrols.tooltip.max_right_y_value": "Изменяет то, что мод в итоге считает максимальным значением для правой оси Y. Полезно, если ваша ось не использует весь диапазон и кажется медленной.",
|
||||
"midnightcontrols.tooltip.mouse_speed": "Скорость мыши, эмулируемая контроллером.",
|
||||
"midnightcontrols.tooltip.reacharound.horizontal": "Позволяет размещать передний блок перед собой. §cМожет рассматриваться как читерство на некоторых серверах§r.",
|
||||
"midnightcontrols.tooltip.reacharound.vertical": "Обеспечивает вертикальный охват. §cМожет рассматриваться как мошенничество на некоторых серверах§r.",
|
||||
"midnightcontrols.tooltip.reload_controller_mappings": "Перезагружает файл раскладки контроллеров.",
|
||||
"midnightcontrols.tooltip.right_dead_zone": "Мертвая зона для правого аналогового стика контроллера.",
|
||||
"midnightcontrols.tooltip.rotation_speed": "Скорость вращения камеры по оси X в режиме контроллера.",
|
||||
"midnightcontrols.tooltip.y_axis_rotation_speed": "Скорость вращения камеры по оси Y в режиме контроллера.",
|
||||
"midnightcontrols.tooltip.unfocused_input": "Разрешить ввод с контроллера, даже если игра на сфокусирована.",
|
||||
"midnightcontrols.tooltip.virtual_mouse": "Включить виртуальную мышь, очень полезно при игре двоём на одном компьютере.",
|
||||
"midnightcontrols.virtual_mouse.skin.default_light": "Обычный Светлый",
|
||||
"midnightcontrols.virtual_mouse.skin.default_dark": "Обычный Тёмный",
|
||||
"midnightcontrols.virtual_mouse.skin.second_light": "Дополнительный Светлый",
|
||||
"midnightcontrols.virtual_mouse.skin.second_dark": "Дополнительный Тёмный",
|
||||
"modmenu.descriptionTranslation.midnightcontrols": "Добавление поддержки контроллера и улучшенние элементов управления в целом.\nРазветвлен от LambdaControls, поддержка которого, к сожалению, прекращена.."
|
||||
}
|
||||
152
src/main/resources/assets/midnightcontrols/lang/zh_tw.json
Normal file
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"key.midnightcontrols.look_down": "視角下移",
|
||||
"key.midnightcontrols.look_left": "視角左移",
|
||||
"key.midnightcontrols.look_right": "視角右移",
|
||||
"key.midnightcontrols.look_up": "視角上移",
|
||||
"key.midnightcontrols.ring": "顯示額外按鍵菜單",
|
||||
"midnightcontrols.action.attack": "攻擊",
|
||||
"midnightcontrols.action.back": "向後移動",
|
||||
"midnightcontrols.action.chat": "打開聊天欄",
|
||||
"midnightcontrols.action.drop_item": "丟棄所選物品",
|
||||
"midnightcontrols.action.exit": "退出",
|
||||
"midnightcontrols.action.forward": "向前移動",
|
||||
"midnightcontrols.action.hit": "挖掘",
|
||||
"midnightcontrols.action.hotbar_left": "向左循環選擇快捷欄",
|
||||
"midnightcontrols.action.hotbar_right": "向右循環選擇快捷欄",
|
||||
"midnightcontrols.action.inventory": "物品欄",
|
||||
"midnightcontrols.action.jump": "跳躍",
|
||||
"midnightcontrols.action.left": "向左移動",
|
||||
"midnightcontrols.action.pause_game": "暫停遊戲",
|
||||
"midnightcontrols.action.pick_block": "選取方塊",
|
||||
"midnightcontrols.action.pickup": "拿取一個/拿取一半",
|
||||
"midnightcontrols.action.pickup_all": "拿取一組/拿取全部",
|
||||
"midnightcontrols.action.place": "放置方塊",
|
||||
"midnightcontrols.action.player_list": "玩家列表",
|
||||
"midnightcontrols.action.quick_move": "快速移動物品",
|
||||
"midnightcontrols.action.right": "向右移動",
|
||||
"midnightcontrols.action.screenshot": "截圖",
|
||||
"midnightcontrols.action.sneak": "潛行",
|
||||
"midnightcontrols.action.sprint": "疾跑",
|
||||
"midnightcontrols.action.swap_hands": "與副手交換",
|
||||
"midnightcontrols.action.toggle_perspective": "切換視角",
|
||||
"midnightcontrols.action.toggle_smooth_camera": "切換電影視角",
|
||||
"midnightcontrols.action.use": "使用物品/放置方塊",
|
||||
"midnightcontrols.action.zoom": "視野縮放",
|
||||
"midnightcontrols.action.zoom_in": "縮放時將視野推近",
|
||||
"midnightcontrols.action.zoom_out": "縮放時將視野拉遠",
|
||||
"midnightcontrols.action.zoom_reset": "縮放時重置縮放距離",
|
||||
"midnightcontrols.button.a": "A",
|
||||
"midnightcontrols.button.b": "B",
|
||||
"midnightcontrols.button.x": "X",
|
||||
"midnightcontrols.button.y": "Y",
|
||||
"midnightcontrols.button.left_bumper": "LB 鍵",
|
||||
"midnightcontrols.button.right_bumper": "RB 鍵",
|
||||
"midnightcontrols.button.back": "選擇鍵",
|
||||
"midnightcontrols.button.start": "開始鍵",
|
||||
"midnightcontrols.button.guide": "功能鍵",
|
||||
"midnightcontrols.button.left_thumb": "左搖桿(按壓)",
|
||||
"midnightcontrols.button.right_thumb": "右搖桿(按壓)",
|
||||
"midnightcontrols.button.dpad_up": "十字鍵上",
|
||||
"midnightcontrols.button.dpad_right": "十字鍵右",
|
||||
"midnightcontrols.button.dpad_down": "十字鍵下",
|
||||
"midnightcontrols.button.dpad_left": "十字鍵左",
|
||||
"midnightcontrols.axis.left_x+": "左搖桿右(X軸正向)",
|
||||
"midnightcontrols.axis.left_y+": "左搖桿上(Y軸正向)",
|
||||
"midnightcontrols.axis.right_x+": "右搖桿右(X軸正向)",
|
||||
"midnightcontrols.axis.right_y+": "右搖桿上(Y軸正向)",
|
||||
"midnightcontrols.axis.left_trigger": "左扳機鍵",
|
||||
"midnightcontrols.axis.right_trigger": "右扳機鍵",
|
||||
"midnightcontrols.axis.left_x-": "左搖桿左(X軸負向)",
|
||||
"midnightcontrols.axis.left_y-": "左搖桿下(Y軸負向)",
|
||||
"midnightcontrols.axis.right_x-": "右搖桿左(X軸負向)",
|
||||
"midnightcontrols.axis.right_y-": "右搖桿下(Y軸負向)",
|
||||
"midnightcontrols.button.unknown": "未知(%d)",
|
||||
"midnightcontrols.controller.connected": "手把 %d 已連接。",
|
||||
"midnightcontrols.controller.disconnected": "手把 %d 已斷開。",
|
||||
"midnightcontrols.controller.mappings.1": "請使用 %s 配置手把按鍵映射",
|
||||
"midnightcontrols.controller.mappings.3": "並將按鍵映射文件放入此路徑:`%s.minecraft/config/gamecontrollerdb.txt%s`。",
|
||||
"midnightcontrols.controller.mappings.error": "發生錯誤,無法讀取按鍵映射文件。",
|
||||
"midnightcontrols.controller.mappings.error.write": "發生錯誤,無法保存按鍵映射文件。",
|
||||
"midnightcontrols.controller.mappings.updated": "按鍵映射已更新!",
|
||||
"midnightcontrols.controller_type.default": "默認",
|
||||
"midnightcontrols.controller_type.dualshock": "DualShock",
|
||||
"midnightcontrols.controller_type.switch": "Switch",
|
||||
"midnightcontrols.controller_type.xbox": "Xbox",
|
||||
"midnightcontrols.controller_type.steam": "Steam",
|
||||
"midnightcontrols.controller_type.ouya": "OUYA",
|
||||
"midnightcontrols.controls_mode.default": "鍵鼠",
|
||||
"midnightcontrols.controls_mode.controller": "手把",
|
||||
"midnightcontrols.controls_mode.touchscreen": "觸摸屏",
|
||||
"midnightcontrols.hud_side.left": "左側",
|
||||
"midnightcontrols.hud_side.right": "右側",
|
||||
"midnightcontrols.menu.analog_movement": "識別搖桿輸入的精確值",
|
||||
"midnightcontrols.menu.auto_switch_mode": "自動切換模式",
|
||||
"midnightcontrols.menu.controller": "手把",
|
||||
"midnightcontrols.menu.controller2": "額外手把",
|
||||
"midnightcontrols.menu.controller_type": "手把類型",
|
||||
"midnightcontrols.menu.controls_mode": "模式",
|
||||
"midnightcontrols.menu.fast_block_placing": "方塊快速放置",
|
||||
"midnightcontrols.menu.fly_drifting": "水平方向飛行慣性",
|
||||
"midnightcontrols.menu.fly_drifting_vertical": "垂直方向飛行慣性",
|
||||
"midnightcontrols.menu.hud_enable": "啟用HUD",
|
||||
"midnightcontrols.menu.hud_side": "HUD位置",
|
||||
"midnightcontrols.menu.invert_right_x_axis": "反轉右搖桿X軸",
|
||||
"midnightcontrols.menu.invert_right_y_axis": "反轉右搖桿Y軸",
|
||||
"midnightcontrols.menu.keyboard_controls": "鍵盤控制…",
|
||||
"midnightcontrols.menu.left_dead_zone": "左搖桿死區",
|
||||
"midnightcontrols.menu.mappings.open_input_str": "編輯按鍵映射文件",
|
||||
"midnightcontrols.menu.max_left_x_value": "左搖桿X軸最大值識別範圍",
|
||||
"midnightcontrols.menu.max_left_y_value": "左搖桿Y軸最大值識別範圍",
|
||||
"midnightcontrols.menu.max_right_x_value": "右搖桿X軸最大值識別範圍",
|
||||
"midnightcontrols.menu.max_right_y_value": "右搖桿Y軸最大值識別範圍",
|
||||
"midnightcontrols.menu.mouse_speed": "鼠標移動速度",
|
||||
"midnightcontrols.menu.reacharound.horizontal": "水平方向方塊放置輔助",
|
||||
"midnightcontrols.menu.reacharound.vertical": "垂直方向方塊放置輔助",
|
||||
"midnightcontrols.menu.reload_controller_mappings": "重新加載手把按鍵映射",
|
||||
"midnightcontrols.menu.right_dead_zone": "右搖桿死區",
|
||||
"midnightcontrols.menu.rotation_speed": "鏡頭旋轉速度 (X)",
|
||||
"midnightcontrols.menu.y_axis_rotation_speed": "鏡頭旋轉速度 (Y)",
|
||||
"midnightcontrols.menu.separator.controller": "手把",
|
||||
"midnightcontrols.menu.separator.general": "通用",
|
||||
"midnightcontrols.menu.title": "midnightcontrols — 設置",
|
||||
"midnightcontrols.menu.title.controller": "手把選項",
|
||||
"midnightcontrols.menu.title.controller_controls": "手把控制",
|
||||
"midnightcontrols.menu.title.gameplay": "遊戲內容選項",
|
||||
"midnightcontrols.menu.title.general": "通用選項",
|
||||
"midnightcontrols.menu.title.hud": "HUD選項",
|
||||
"midnightcontrols.menu.title.mappings.string": "編輯按鍵映射文件",
|
||||
"midnightcontrols.menu.title.visual": "界面選項",
|
||||
"midnightcontrols.menu.unfocused_input": "非活動狀態輸入",
|
||||
"midnightcontrols.menu.virtual_mouse": "虛擬鼠標",
|
||||
"midnightcontrols.menu.virtual_mouse.skin": "虛擬鼠標指針樣式",
|
||||
"midnightcontrols.narrator.unbound": "取消綁定 %s",
|
||||
"midnightcontrols.not_bound": "未綁定",
|
||||
"midnightcontrols.tooltip.analog_movement": "若遊戲機制允許,則可根據推動搖桿的力度與幅度決定移動的速度。",
|
||||
"midnightcontrols.tooltip.auto_switch_mode": "如果已有手把連接,則自動切換為手把操作模式。",
|
||||
"midnightcontrols.tooltip.controller2": "使用額外的手把,比如將一左一右的兩個 Joy-Con 合為一個功能完全的手把。",
|
||||
"midnightcontrols.tooltip.controller_type": "選擇手把類型,以顯示對應的按鍵圖標。",
|
||||
"midnightcontrols.tooltip.controls_mode": "操作模式",
|
||||
"midnightcontrols.tooltip.fast_block_placing": "在創造模式中處於飛行狀態時,可以根據你飛行的速度快速放置方塊。\n§c在部分服務器可能會被認定為作弊。",
|
||||
"midnightcontrols.tooltip.fly_drifting": "處於飛行狀態時,啟用原版的水平方向飛行慣性(緩停滑行)。",
|
||||
"midnightcontrols.tooltip.fly_drifting_vertical": "處於飛行狀態時,啟用原版的垂直方向飛行慣性(緩停滑行)。",
|
||||
"midnightcontrols.tooltip.hud_enable": "顯示手把按鍵操作提示。",
|
||||
"midnightcontrols.tooltip.hud_side": "HUD的位置位於畫面的哪一側。",
|
||||
"midnightcontrols.tooltip.left_dead_zone": "左搖桿配置的死區。\n死區決定搖桿要偏離中心位置多遠才能讓搖桿的輸入有效。",
|
||||
"midnightcontrols.tooltip.max_left_x_value": "更改左搖桿X軸最大值的識別範圍。\n若感覺即便推滿搖桿也未達到最大的輸入值,導致在識別搖桿輸入的精確值的情況下,左右移動較為緩慢等問題,本項可能會有所幫助。",
|
||||
"midnightcontrols.tooltip.max_left_y_value": "更改左搖桿Y軸最大值的識別範圍。\n若感覺即便推滿搖桿也未達到最大的輸入值,導致在識別搖桿輸入的精確值的情況下,前後移動較為緩慢等問題,本項可能會有所幫助。",
|
||||
"midnightcontrols.tooltip.max_right_x_value": "更改右搖桿X軸最大值的識別範圍。\n若感覺即便推滿搖桿也未達到最大的輸入值,導致鏡頭左右旋轉較為緩慢等問題,本項可能會有所幫助。",
|
||||
"midnightcontrols.tooltip.max_right_y_value": "更改右搖桿Y軸最大值的識別範圍。\n若感覺即便推滿搖桿也未達到最大的輸入值,導致鏡頭上下旋轉較為緩慢等問題,本項可能會有所幫助。",
|
||||
"midnightcontrols.tooltip.mouse_speed": "手把模擬的鼠標的移動速度。",
|
||||
"midnightcontrols.tooltip.reacharound.horizontal": "啟用水平方向方塊放置輔助,可在腳下方塊的前方放置方塊。\n§c在部分服務器可能會被認定為作弊。",
|
||||
"midnightcontrols.tooltip.reacharound.vertical": "啟用垂直方向方塊放置輔助,可在腳下方塊的下方放置方塊。\n§c在部分服務器可能會被認定為作弊。",
|
||||
"midnightcontrols.tooltip.reload_controller_mappings": "重新加載手把的按鍵映射文件。",
|
||||
"midnightcontrols.tooltip.right_dead_zone": "右搖桿配置的死區。\n死區決定搖桿要偏離中心位置多遠才能讓搖桿的輸入有效。",
|
||||
"midnightcontrols.tooltip.rotation_speed": "手把操作模式下的鏡頭旋轉速度。(X)",
|
||||
"midnightcontrols.tooltip.y_axis_rotation_speed": "手把操作模式下的鏡頭旋轉速度。(Y)",
|
||||
"midnightcontrols.tooltip.unfocused_input": "即使遊戲窗口處於非活動狀態,也允許手把進行按鍵輸入。",
|
||||
"midnightcontrols.tooltip.virtual_mouse": "啟用虛擬鼠標,在分屏的情況下很有用。",
|
||||
"midnightcontrols.virtual_mouse.skin.default_light": "默認樣式(白色)",
|
||||
"midnightcontrols.virtual_mouse.skin.default_dark": "默認樣式(黑色)",
|
||||
"midnightcontrols.virtual_mouse.skin.second_light": "額外樣式(白色)",
|
||||
"midnightcontrols.virtual_mouse.skin.second_dark": "額外樣式(黑色)"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 327 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -11,12 +11,20 @@
|
||||
"contributors": [
|
||||
"akemin-dayo",
|
||||
"DioEgizio",
|
||||
"Ivanoks",
|
||||
"FlashyReese",
|
||||
"Hambaka",
|
||||
"joaoh1",
|
||||
"dogtopus",
|
||||
"egeesin",
|
||||
"EnnuiL",
|
||||
"egeesin"
|
||||
"FlashyReese",
|
||||
"gyular",
|
||||
"Hambaka",
|
||||
"Ivanoks",
|
||||
"joaoh1",
|
||||
"KiskaUWU",
|
||||
"Madis0",
|
||||
"RaptaG",
|
||||
"ronniedude",
|
||||
"spudpiggy",
|
||||
"TrueHorse"
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://modrinth.com/mod/midnightcontrols",
|
||||
@@ -44,8 +52,8 @@
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.11.3",
|
||||
"fabric": ">=0.36.0",
|
||||
"minecraft": ">=1.17",
|
||||
"fabric": ">=0.71.0",
|
||||
"minecraft": "<1.19.3",
|
||||
"spruceui": ">=3.2.0",
|
||||
"java": ">=17"
|
||||
},
|
||||
@@ -53,9 +61,10 @@
|
||||
"modmenu": ">=1.12.2"
|
||||
},
|
||||
"suggests": {
|
||||
"quilt_loader": "*"
|
||||
"kontrolo": "*"
|
||||
},
|
||||
"breaks": {
|
||||
"emi": "<0.5.0",
|
||||
"lambdacontrols": "*",
|
||||
"modmenu": "<1.12.2"
|
||||
}
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
"KeyBindingMixin",
|
||||
"MinecraftClientMixin",
|
||||
"MouseMixin",
|
||||
"ChatScreenMixin",
|
||||
"RecipeBookWidgetAccessor",
|
||||
"WorldRendererMixin",
|
||||
"KeyBindingRegistryImplAccessor"
|
||||
"KeyBindingRegistryImplAccessor",
|
||||
"KeyBindingIDAccessor",
|
||||
"ScreenAccessor"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 4.9 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"pack_format": 9,
|
||||
"description": "Makes the controller buttons look like from Bedrock Edition"
|
||||
"pack_format": 12,
|
||||
"description": "Makes controller tooltips use similar icons to Bedrock Edition"
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 1.8 KiB |
4
src/main/resources/resourcepacks/legacy/CREDITS
Normal file
@@ -0,0 +1,4 @@
|
||||
Some of the textures in this Resourcepack are directly taken from the Console Edition assets and are therefore © Mojang Studios.
|
||||
Credits go to Ivanoks for redrawing the Console Generic, Dualshock, DualSense, Switch, Xbox 360 and XBox One controller icons in 15x15,
|
||||
Motschen for creating the assets for the other controllers
|
||||
and LambdAurora for the original assets, part of which are also included.
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
6
src/main/resources/resourcepacks/legacy/pack.mcmeta
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"pack_format": 12,
|
||||
"description": "Makes controller icons look similar to Legacy Console Edit."
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/resourcepacks/legacy/pack.png
Normal file
|
After Width: | Height: | Size: 14 KiB |