Skip to content

Commit

Permalink
Added fovOverrideEnabled, fovOverrideValue
Browse files Browse the repository at this point in the history
resolved #59
  • Loading branch information
Fallen-Breath committed Jun 1, 2024
1 parent 2ceca48 commit 6118e07
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 3 deletions.
26 changes: 25 additions & 1 deletion docs/document-en_us.md
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ Notes: In vanilla, client can only select collide-able and non-spectator entitie

Client network delay simulator. Enabled when the value is greater than 0

Adds given delay (in milliseconds) before any packet processing
Adds half of given delay (in milliseconds) before packet read / write, so the total delay increases with the given value

Basically it stably adds your ping to the server with the given value

Expand Down Expand Up @@ -1469,6 +1469,30 @@ Overwrites fabric-carpet's rule creativeFlyDrag when the value is modified
- Maximum value: `1.0`


### fovOverrideEnabled

The switch of the FOV override

See also: option fovOverrideValue for the overridden value

- Category: MC Tweaks
- Type: hotkey togglable boolean (Tweak)
- Default value: *no hotkey*, `false`


### fovOverrideValue

The FOV value to be applied

See also: option fovOverrideEnabled for the switch

- Category: MC Tweaks
- Type: double (Generic)
- Default value: `70.0`
- Minimum value: `0.01`
- Maximum value: `179.99`


### itemTooltipHideUntilMouseMove

Hide item tooltips in container screens until the mouse has moved
Expand Down
26 changes: 25 additions & 1 deletion docs/document-zh_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ schematicBlockPlacement的严格模式

客户端网络延迟模拟器,于给定值大于0时启用

在任何数据包处理前插入给定的延迟 (单位毫秒)
在任何数据包的发送/接受前,延迟给定毫秒的一半,因此总延迟增加将为给定的值

可以认为它会稳定地将你的网络延迟ping值增加给定的值

Expand Down Expand Up @@ -1465,6 +1465,30 @@ Format error: 修复使用原版聊天缩放设置来缩放聊天信息HUD中的
- 最大值: `1.0`


### FOV覆盖-开关 (fovOverrideEnabled)

FOV覆盖的开关

另见:选项 FOV覆盖-取值,即FOV覆盖的取值

- 分类: MC修改
- 类型: 带热键布尔值 (工具)
- 默认值: *无快捷键*, `false`


### FOV覆盖-取值 (fovOverrideValue)

要应用FOV覆盖的,FOV实际取值

另见:选项 FOV覆盖-开关,即FOV覆盖的开关

- 分类: MC修改
- 类型: 实数 (通用)
- 默认值: `70.0`
- 最小值: `0.01`
- 最大值: `179.99`


### 隐藏物品悬浮文本直至鼠标移动 (itemTooltipHideUntilMouseMove)

在容器GUI中隐藏物品的悬浮文本,直至鼠标移动
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
import me.fallenbreath.tweakermore.impl.features.schematicProPlace.ProPlaceImpl;
import me.fallenbreath.tweakermore.impl.features.spectatorTeleportCommand.SpectatorTeleportCommand;
import me.fallenbreath.tweakermore.impl.mc_tweaks.flawlessFrames.FlawlessFramesHandler;
import me.fallenbreath.tweakermore.impl.mc_tweaks.windowSize.WindowSizeHelper;
import me.fallenbreath.tweakermore.impl.mc_tweaks.particleLimit.ParticleLimitHelper;
import me.fallenbreath.tweakermore.impl.mc_tweaks.windowSize.WindowSizeHelper;
import me.fallenbreath.tweakermore.impl.mod_tweaks.eCraftMassCraftCompact.EasierCraftingRegistrar;
import me.fallenbreath.tweakermore.impl.mod_tweaks.lmRemoveEntityCommand.LitematicaRemoveEntityCommandOverrider;
import me.fallenbreath.tweakermore.impl.mod_tweaks.ofPlayerExtraModelOverride.OptifinePlayerExtraModelOverrider;
Expand Down Expand Up @@ -495,6 +495,12 @@ public class TweakerMoreConfigs
@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigDouble FLY_DRAG = newConfigDouble("flyDrag", 0.09, 0, 1);

@Config(type = Config.Type.TWEAK, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBooleanHotkeyed FOV_OVERRIDE_ENABLED = newConfigBooleanHotkeyed("fovOverrideEnabled");

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigDouble FOV_OVERRIDE_VALUE = newConfigDouble("fovOverrideValue", 70, 0.01, 180 - 0.01);

@Config(type = Config.Type.GENERIC, category = Config.Category.MC_TWEAKS)
public static final TweakerMoreConfigBoolean ITEM_TOOLTIP_HIDE_UNTIL_MOUSE_MOVE = newConfigBoolean("itemTooltipHideUntilMouseMove", false);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* This file is part of the TweakerMore project, licensed under the
* GNU Lesser General Public License v3.0
*
* Copyright (C) 2024 Fallen_Breath and contributors
*
* TweakerMore is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TweakerMore is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with TweakerMore. If not, see <https://www.gnu.org/licenses/>.
*/

package me.fallenbreath.tweakermore.mixins.tweaks.mc_tweaks.fovOverride;

import me.fallenbreath.tweakermore.config.TweakerMoreConfigs;
import net.minecraft.client.render.GameRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(GameRenderer.class)
public abstract class GameRendererMixin
{
@Inject(
method = "getFov",
at = @At(
value = "FIELD",
target = "Lnet/minecraft/client/MinecraftClient;options:Lnet/minecraft/client/options/GameOptions;"
),
cancellable = true
)
private void applyFovOverride_fovOverride(CallbackInfoReturnable<Double> cir)
{
if (TweakerMoreConfigs.FOV_OVERRIDE_ENABLED.getBooleanValue())
{
cir.setReturnValue(TweakerMoreConfigs.FOV_OVERRIDE_VALUE.getDoubleValue());
}
}
}
10 changes: 10 additions & 0 deletions src/main/resources/assets/tweakermore/lang/en_us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,16 @@ tweakermore:
comment: |-
Overwrite the drag factor when flying in creative or spectator mode
Overwrites fabric-carpet's rule creativeFlyDrag when the value is modified
fovOverrideEnabled:
.: fovOverrideEnabled
comment: |-
The switch of the FOV override
See also: option @option#fovOverrideValue@ for the overridden value
fovOverrideValue:
.: fovOverrideValue
comment: |-
The FOV value to be applied
See also: option @option#fovOverrideEnabled@ for the switch
itemTooltipHideUntilMouseMove:
.: itemTooltipHideUntilMouseMove
comment: |-
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/assets/tweakermore/lang/zh_cn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,16 @@ tweakermore:
comment: |-
覆盖玩家在创造模式或旁观模式下的飞行阻力因子
在该选项被修改时,fabric-carpet规则creativeFlyDrag的效果将被覆盖
fovOverrideEnabled:
.: FOV覆盖-开关
comment: |-
FOV覆盖的开关
另见:选项 @option#fovOverrideValue@,即FOV覆盖的取值
fovOverrideValue:
.: FOV覆盖-取值
comment: |-
要应用FOV覆盖的,FOV实际取值
另见:选项 @option#fovOverrideEnabled@,即FOV覆盖的开关
itemTooltipHideUntilMouseMove:
.: 隐藏物品悬浮文本直至鼠标移动
comment: |-
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/tweakermore.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
"tweaks.mc_tweaks.fixHoverTextScale.ChatScreenMixin",
"tweaks.mc_tweaks.fixHoverTextScale.HoverTextRendererClassMixin",
"tweaks.mc_tweaks.flyDrag.LivingEntityMixin",
"tweaks.mc_tweaks.fovOverride.GameRendererMixin",
"tweaks.mc_tweaks.itemTooltipHideUntilMouseMove.ContainerScreenMixin",
"tweaks.mc_tweaks.keepMessageHistoryOnReconfiguration.InGameHudMixin",
"tweaks.mc_tweaks.keepMessageHistoryOnReconfiguration.MinecraftClientMixin",
Expand Down

0 comments on commit 6118e07

Please sign in to comment.