Improve visibility on radial wheel

This commit is contained in:
DBotThePony 2022-09-24 10:40:39 +07:00
parent b1e5fb14e6
commit 0000d70063
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 6 additions and 9 deletions

View File

@ -9,7 +9,6 @@ import ru.dbotthepony.mc.otm.capability.matter.IReplicationTaskProvider;
import ru.dbotthepony.mc.otm.capability.matter.IPatternStorage; import ru.dbotthepony.mc.otm.capability.matter.IPatternStorage;
import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode; import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode;
import ru.dbotthepony.mc.otm.graph.storage.IStorageGraphNode; import ru.dbotthepony.mc.otm.graph.storage.IStorageGraphNode;
import ru.dbotthepony.mc.otm.storage.IStorageStack;
import top.theillusivec4.curios.api.type.capability.ICurio; import top.theillusivec4.curios.api.type.capability.ICurio;
import top.theillusivec4.curios.api.type.capability.ICuriosItemHandler; import top.theillusivec4.curios.api.type.capability.ICuriosItemHandler;

View File

@ -9,11 +9,8 @@ import net.minecraftforge.client.event.InputEvent
import net.minecraftforge.client.event.RegisterKeyMappingsEvent import net.minecraftforge.client.event.RegisterKeyMappingsEvent
import net.minecraftforge.client.event.RenderGuiEvent import net.minecraftforge.client.event.RenderGuiEvent
import net.minecraftforge.client.settings.KeyConflictContext import net.minecraftforge.client.settings.KeyConflictContext
import org.lwjgl.glfw.GLFW.GLFW_CURSOR_DISABLED
import org.lwjgl.glfw.GLFW.GLFW_CURSOR_NORMAL
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.android.AndroidFeature import ru.dbotthepony.mc.otm.android.AndroidFeature
import ru.dbotthepony.mc.otm.android.AndroidFeatureType
import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature
import ru.dbotthepony.mc.otm.capability.matteryPlayer import ru.dbotthepony.mc.otm.capability.matteryPlayer
import ru.dbotthepony.mc.otm.client.render.TextAlign import ru.dbotthepony.mc.otm.client.render.TextAlign
@ -70,6 +67,7 @@ object AndroidMenuKeyMapping : KeyMapping("key.otm.android_menu", KeyConflictCon
if (selectedFeature != null) { if (selectedFeature != null) {
MatteryPlayerNetworkChannel.sendToServer(SwitchAndroidFeaturePacket(selectedFeature.type, !selectedFeature.isActive)) MatteryPlayerNetworkChannel.sendToServer(SwitchAndroidFeaturePacket(selectedFeature.type, !selectedFeature.isActive))
playGuiClickSound()
} }
} }
} }
@ -125,7 +123,7 @@ object AndroidMenuKeyMapping : KeyMapping("key.otm.android_menu", KeyConflictCon
val delta = (System.nanoTime() - lastRender) / 1_000_000.0 val delta = (System.nanoTime() - lastRender) / 1_000_000.0
lastRender = System.nanoTime() lastRender = System.nanoTime()
RenderSystem.setShaderColor(0f, 0f, 0f, 0.75f) RenderSystem.setShaderColor(0f, 0f, 0f, 0.6f)
val size = minecraft.window.guiScaledHeight.coerceAtMost(minecraft.window.guiScaledWidth).toFloat() * 0.35f val size = minecraft.window.guiScaledHeight.coerceAtMost(minecraft.window.guiScaledWidth).toFloat() * 0.35f
@ -226,10 +224,10 @@ object AndroidMenuKeyMapping : KeyMapping("key.otm.android_menu", KeyConflictCon
val sin = sin((index + 0.5) * degreePerSlice).toFloat() val sin = sin((index + 0.5) * degreePerSlice).toFloat()
val cos = cos((index + 0.5) * degreePerSlice).toFloat() val cos = cos((index + 0.5) * degreePerSlice).toFloat()
val selectedShift = linearInterpolation(lastSelectProgress.getFloat(feature), size * 0.6f, size * 0.8f) val shift = size * 0.6f
feature.renderIcon(event.poseStack, -iconSize / 2f + selectedShift * cos, -selectedShift * sin - iconSize / 2f, iconSize, iconSize) feature.renderIcon(event.poseStack, -iconSize / 2f + shift * cos, -shift * sin - iconSize / 2f, iconSize, iconSize)
minecraft.font.drawAligned(event.poseStack, feature.type.displayName, TextAlign.CENTER_CENTER, selectedShift * cos + 1f, -selectedShift * sin - iconSize / 1.5f + 1f, 0) minecraft.font.drawAligned(event.poseStack, feature.type.displayName, TextAlign.CENTER_CENTER, shift * cos + 1f, -shift * sin - iconSize / 1.5f + 1f, 0)
minecraft.font.drawAligned(event.poseStack, feature.type.displayName, TextAlign.CENTER_CENTER, selectedShift * cos, -selectedShift * sin - iconSize / 1.5f, if (feature.isActive) RGBAColor.DARK_GREEN else RGBAColor.DARK_RED) minecraft.font.drawAligned(event.poseStack, feature.type.displayName, TextAlign.CENTER_CENTER, shift * cos, -shift * sin - iconSize / 1.5f, if (feature.isActive) RGBAColor.DARK_GREEN else RGBAColor.DARK_RED)
} }
} }