├── logo.png ├── src └── main │ ├── resources │ ├── logo.png │ ├── pack.mcmeta │ ├── assets │ │ └── ingameinfo │ │ │ ├── gui │ │ │ ├── missing_texture.png │ │ │ ├── button │ │ │ │ └── vanilla │ │ │ │ │ ├── center.png │ │ │ │ │ ├── top_left.png │ │ │ │ │ ├── top_right.png │ │ │ │ │ ├── bottom_left.png │ │ │ │ │ ├── bottom_right.png │ │ │ │ │ ├── center_left.png │ │ │ │ │ ├── center_right.png │ │ │ │ │ ├── top_center.png │ │ │ │ │ └── bottom_center.png │ │ │ └── background │ │ │ │ └── vanilla │ │ │ │ ├── center.png │ │ │ │ ├── top_left.png │ │ │ │ ├── top_center.png │ │ │ │ ├── top_right.png │ │ │ │ ├── bottom_center.png │ │ │ │ ├── bottom_left.png │ │ │ │ ├── bottom_right.png │ │ │ │ ├── center_left.png │ │ │ │ └── center_right.png │ │ │ └── shaders │ │ │ ├── mesh2d_frag.glsl │ │ │ ├── post_processing_vertex.glsl │ │ │ ├── post_processing_frag.glsl │ │ │ └── mesh2d_vertex.glsl │ ├── mixins.ingameinfo.early.json │ └── mcmod.info │ └── java │ └── com │ └── tttsaurus │ └── ingameinfo │ ├── common │ ├── core │ │ ├── function │ │ │ ├── IAction.java │ │ │ ├── IFunc.java │ │ │ ├── IAction_1Param.java │ │ │ ├── IFunc_1Param.java │ │ │ ├── IAction_2Param.java │ │ │ ├── IFunc_2Param.java │ │ │ ├── IAction_3Param.java │ │ │ └── IFunc_3Param.java │ │ ├── render │ │ │ ├── IGlDisposable.java │ │ │ ├── AlphaBlendMode.java │ │ │ ├── texture │ │ │ │ ├── ITexture2D.java │ │ │ │ ├── param │ │ │ │ │ ├── FilterMode.java │ │ │ │ │ └── WrapMode.java │ │ │ │ ├── McTextureWrapper.java │ │ │ │ ├── ImagePrefab.java │ │ │ │ ├── Texture2D.java │ │ │ │ └── TextureSliced2D.java │ │ │ ├── shader │ │ │ │ ├── uniform │ │ │ │ │ ├── UniformTypeKind.java │ │ │ │ │ ├── Variant.java │ │ │ │ │ └── UniformField.java │ │ │ │ ├── ShaderLoadingUtils.java │ │ │ │ └── ShaderParseUtils.java │ │ │ ├── CommonBuffers.java │ │ │ └── GlResourceManager.java │ │ ├── igievent │ │ │ ├── IEvent.java │ │ │ └── EventBase.java │ │ ├── gui │ │ │ ├── screen │ │ │ │ ├── IGuiScreenDrawScreen.java │ │ │ │ ├── IGuiScreenKeyTyped.java │ │ │ │ └── IgiDummyScreen.java │ │ │ ├── property │ │ │ │ ├── lerp │ │ │ │ │ ├── ICopyableLerpTarget.java │ │ │ │ │ ├── ITargetingLerpTarget.java │ │ │ │ │ ├── ILerpablePropertyGetter.java │ │ │ │ │ ├── LerpCenter.java │ │ │ │ │ ├── LerpTarget.java │ │ │ │ │ ├── LerpableProperty.java │ │ │ │ │ └── LerpTargetCopyUtils.java │ │ │ │ └── style │ │ │ │ │ ├── CallbackInfo.java │ │ │ │ │ ├── IStylePropertySyncTo.java │ │ │ │ │ ├── wrapped │ │ │ │ │ ├── ByteProperty.java │ │ │ │ │ ├── FloatProperty.java │ │ │ │ │ ├── IntProperty.java │ │ │ │ │ ├── LongProperty.java │ │ │ │ │ ├── ShortProperty.java │ │ │ │ │ ├── CharProperty.java │ │ │ │ │ ├── DoubleProperty.java │ │ │ │ │ ├── BooleanProperty.java │ │ │ │ │ └── WrappedStyleProperty.java │ │ │ │ │ ├── IStylePropertyGetter.java │ │ │ │ │ ├── IStylePropertySetter.java │ │ │ │ │ ├── IStylePropertyCallbackPost.java │ │ │ │ │ ├── IStylePropertyCallbackPre.java │ │ │ │ │ └── StylePropertyCallback.java │ │ │ ├── render │ │ │ │ ├── decorator │ │ │ │ │ ├── RenderOpPhase.java │ │ │ │ │ └── visual │ │ │ │ │ │ ├── IVisualModifier.java │ │ │ │ │ │ ├── command │ │ │ │ │ │ ├── IArgsGenerator.java │ │ │ │ │ │ ├── VC_RenderItem.java │ │ │ │ │ │ ├── VisualCommandSet.java │ │ │ │ │ │ ├── VC_RenderRect.java │ │ │ │ │ │ ├── VC_RenderImagePrefab.java │ │ │ │ │ │ ├── VC_RenderText.java │ │ │ │ │ │ ├── VC_RenderGradientRect.java │ │ │ │ │ │ ├── VC_RenderRectOutline.java │ │ │ │ │ │ ├── VC_RenderRoundedRect.java │ │ │ │ │ │ ├── VC_RenderFormattedText.java │ │ │ │ │ │ └── VC_RenderRoundedRectOutline.java │ │ │ │ │ │ ├── VisualBuilder.java │ │ │ │ │ │ └── VisualBuilderAccessor.java │ │ │ │ ├── op │ │ │ │ │ ├── IRenderOp.java │ │ │ │ │ ├── MaskEndOp.java │ │ │ │ │ ├── MaskStartOp.java │ │ │ │ │ └── DebugRectOp.java │ │ │ │ ├── RenderOpQueue.java │ │ │ │ └── RenderContext.java │ │ │ ├── event │ │ │ │ ├── UIEventListenerType.java │ │ │ │ ├── IUIEventListener.java │ │ │ │ └── UIEvent.java │ │ │ ├── layout │ │ │ │ ├── Skewness.java │ │ │ │ ├── Pivot.java │ │ │ │ ├── Alignment.java │ │ │ │ ├── Slot.java │ │ │ │ └── Padding.java │ │ │ ├── ElementProperty.java │ │ │ ├── registry │ │ │ │ └── RegisterElement.java │ │ │ ├── control │ │ │ │ ├── Sized.java │ │ │ │ └── Interactable.java │ │ │ └── GuiLifecycleHolder.java │ │ ├── mvvm │ │ │ ├── binding │ │ │ │ ├── IReactiveCallback.java │ │ │ │ ├── ISlotAccessorGetter.java │ │ │ │ ├── IReactiveObjectGetter.java │ │ │ │ ├── IReactiveCollectionGetter.java │ │ │ │ ├── Reactive.java │ │ │ │ ├── EventListenerBinder.java │ │ │ │ ├── ReactiveCollection.java │ │ │ │ ├── SlotAccessor.java │ │ │ │ └── ReactiveObject.java │ │ │ ├── context │ │ │ │ ├── SharedContext.java │ │ │ │ └── ContextKey.java │ │ │ └── compose │ │ │ │ ├── ComposeNode.java │ │ │ │ ├── ComposeNodeWorkspace.java │ │ │ │ └── UpdatePlan.java │ │ ├── serialization │ │ │ ├── IDeserializer.java │ │ │ └── Deserializer.java │ │ ├── appcommunication │ │ │ └── spotify │ │ │ │ ├── SpotifyUserInfo.java │ │ │ │ ├── TrackPlaying.java │ │ │ │ └── Token.java │ │ ├── forgeevent │ │ │ ├── IgiGuiLifecycleInitEvent.java │ │ │ ├── IgiGuiLifecycleRegainScreenFocusEvent.java │ │ │ ├── IgiGuiLifecycleEvent.java │ │ │ └── IgiRuntimeEntryPointEvent.java │ │ ├── IgiRuntimeLocator.java │ │ ├── animation │ │ │ ├── text │ │ │ │ ├── ITextAnimDef.java │ │ │ │ └── CharInfo.java │ │ │ └── SmoothDamp.java │ │ ├── shutdown │ │ │ └── ShutdownHooks.java │ │ ├── input │ │ │ ├── IKeyboard.java │ │ │ ├── IMouse.java │ │ │ ├── InputFrameGenerator.java │ │ │ ├── IgiKeyboard.java │ │ │ └── IgiMouse.java │ │ ├── commonutils │ │ │ ├── MouseUtils.java │ │ │ ├── RlReaderUtils.java │ │ │ └── FileUtils.java │ │ └── reflection │ │ │ └── FieldUtils.java │ └── impl │ │ ├── gui │ │ ├── control │ │ │ ├── EmptyBlock.java │ │ │ ├── Separator.java │ │ │ ├── Item.java │ │ │ ├── ProgressBar.java │ │ │ └── Image.java │ │ ├── render │ │ │ └── op │ │ │ │ ├── SeparatorOp.java │ │ │ │ ├── ItemOp.java │ │ │ │ ├── TextOp.java │ │ │ │ ├── ImageOp.java │ │ │ │ ├── UrlImageOp.java │ │ │ │ └── AnimTextOp.java │ │ ├── DefaultLifecycleHolder.java │ │ └── layout │ │ │ └── DraggableContainerGroup.java │ │ ├── igievent │ │ ├── GameFpsEvent.java │ │ ├── SpotifyOverlayEditEvent.java │ │ ├── GameMemoryEvent.java │ │ ├── IgiGuiFpsEvent.java │ │ ├── SpotifyOverlayEvent.java │ │ ├── EnterBiomeEvent.java │ │ ├── GameTpsMsptEvent.java │ │ ├── IgiGuiFboRefreshRateEvent.java │ │ ├── modcompat │ │ │ ├── DeepResonanceEvent.java │ │ │ ├── SimpleDifficultyEvent.java │ │ │ ├── BloodMagicEvent.java │ │ │ ├── ToughAsNailsEvent.java │ │ │ └── RfToolsDimEvent.java │ │ └── EventCenter.java │ │ ├── serialization │ │ ├── PivotDeserializer.java │ │ ├── SkewnessDeserializer.java │ │ ├── AlignmentDeserializer.java │ │ ├── ItemDeserializer.java │ │ ├── PaddingDeserializer.java │ │ └── ElementPropertiesDeserializer.java │ │ ├── mvvm │ │ └── TemplateView.java │ │ ├── network │ │ ├── tps │ │ │ ├── RespondTpsMsptPacket.java │ │ │ └── RequestTpsMsptPacket.java │ │ └── common │ │ │ └── RespondNbtPacket.java │ │ └── IgiRuntimeEntryPoint.java │ ├── plugin │ ├── crt │ │ ├── api │ │ │ ├── viewmodel │ │ │ │ ├── IGuiExit.java │ │ │ │ ├── IViewModelStart.java │ │ │ │ └── IViewModelFixedUpdate.java │ │ │ ├── Types.java │ │ │ ├── igievent │ │ │ │ ├── IGameFpsEventListener.java │ │ │ │ ├── IIgiGuiFpsEventListener.java │ │ │ │ ├── IBloodMagicEventListener.java │ │ │ │ ├── IDeepResonanceEventListener.java │ │ │ │ ├── IGameMemoryEventListener.java │ │ │ │ ├── IEnterBiomeEventListener.java │ │ │ │ ├── IGameTpsMsptEventListener.java │ │ │ │ ├── IToughAsNailsEventListener.java │ │ │ │ ├── ISimpleDifficultyEventListener.java │ │ │ │ ├── IIgiGuiFboRefreshRateEventListener.java │ │ │ │ ├── IRfToolsDimEventListener.java │ │ │ │ ├── IThaumcraftEventListener.java │ │ │ │ └── ISereneSeasonsEventListener.java │ │ │ └── event │ │ │ │ └── IIgiRuntimeEntryPointEvent.java │ │ └── impl │ │ │ ├── CrtMvvm.java │ │ │ ├── CrtIgiGuiManager.java │ │ │ ├── CrtView.java │ │ │ ├── types │ │ │ ├── SkewnessWrapper.java │ │ │ ├── PivotWrapper.java │ │ │ ├── GhostableItemWrapper.java │ │ │ ├── AlignmentWrapper.java │ │ │ └── PaddingWrapper.java │ │ │ ├── ReactiveCollectionWrapper.java │ │ │ ├── event │ │ │ └── McIgiRuntimeEntryPointEvent.java │ │ │ ├── input │ │ │ └── DirectInput.java │ │ │ ├── animation │ │ │ └── SmoothDampWrapper.java │ │ │ ├── ElementAccessorWrapper.java │ │ │ └── CrtEventManager.java │ └── jei │ │ ├── JeiCompatPlugin.java │ │ └── JeiExclusionHandler.java │ ├── deprecated │ ├── VertexIndexUtils.java │ ├── ScaledRes2NdcUtils.java │ └── mesh2d │ │ └── RectMesh.java │ ├── proxy │ └── ServerProxy.java │ ├── mixin │ └── early │ │ ├── GlStateManagerMixin.java │ │ ├── ForgeHooksClientMixin.java │ │ └── MinecraftMixin.java │ ├── InGameInfoRebornCoremod.java │ └── config │ └── IgiDefaultLifecycleProviderConfig.java ├── repositories.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── THIRD-PARTY-LICENSES └── Configurate │ └── LICENSE_HEADER.txt ├── settings.gradle ├── src_demo └── main │ └── java │ └── com │ └── tttsaurus │ └── ingameinfo │ └── demo │ ├── DemoMvvmRegistration.java │ └── eg1 │ ├── Eg1Compose.java │ └── Eg1View.java ├── .gitignore └── LICENSE.txt /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/logo.png -------------------------------------------------------------------------------- /src/main/resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/logo.png -------------------------------------------------------------------------------- /repositories.gradle: -------------------------------------------------------------------------------- 1 | // Add any additional repositories for your dependencies here 2 | 3 | repositories { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "pack_format": 3, 4 | "description": "In-Game Info Reborn Resource Pack" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/missing_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/missing_texture.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/shaders/mesh2d_frag.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec4 FragColor; 4 | 5 | void main() 6 | { 7 | FragColor = vec4(1.0, 0.5, 0.2, 1.0); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/center.png -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/function/IAction.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.function; 2 | 3 | public interface IAction 4 | { 5 | void invoke(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/top_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/top_left.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/top_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/top_right.png -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/function/IFunc.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.function; 2 | 3 | public interface IFunc 4 | { 5 | TReturn invoke(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/center.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/top_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/top_left.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/bottom_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/bottom_left.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/bottom_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/bottom_right.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/center_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/center_left.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/center_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/center_right.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/top_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/top_center.png -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/IGlDisposable.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render; 2 | 3 | public interface IGlDisposable 4 | { 5 | void dispose(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/top_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/top_center.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/top_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/top_right.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/button/vanilla/bottom_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/button/vanilla/bottom_center.png -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/igievent/IEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.igievent; 2 | 3 | public interface IEvent 4 | { 5 | void addListener(T listener); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/bottom_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/bottom_center.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/bottom_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/bottom_left.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/bottom_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/bottom_right.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/center_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/center_left.png -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/gui/background/vanilla/center_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tttsaurus/Ingame-Info-Reborn/HEAD/src/main/resources/assets/ingameinfo/gui/background/vanilla/center_right.png -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/function/IAction_1Param.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.function; 2 | 3 | public interface IAction_1Param 4 | { 5 | void invoke(T0 arg0); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/screen/IGuiScreenDrawScreen.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.screen; 2 | 3 | public interface IGuiScreenDrawScreen 4 | { 5 | void draw(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/function/IFunc_1Param.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.function; 2 | 3 | public interface IFunc_1Param 4 | { 5 | TReturn invoke(T0 arg0); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/function/IAction_2Param.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.function; 2 | 3 | public interface IAction_2Param 4 | { 5 | void invoke(T0 arg0, T1 arg1); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/screen/IGuiScreenKeyTyped.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.screen; 2 | 3 | public interface IGuiScreenKeyTyped 4 | { 5 | void type(int keycode); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/lerp/ICopyableLerpTarget.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.lerp; 2 | 3 | public interface ICopyableLerpTarget 4 | { 5 | Object copy(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/CallbackInfo.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style; 2 | 3 | public class CallbackInfo 4 | { 5 | public boolean cancel = false; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/IReactiveCallback.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | public interface IReactiveCallback 4 | { 5 | void invoke(Object value); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/function/IFunc_2Param.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.function; 2 | 3 | public interface IFunc_2Param 4 | { 5 | TReturn invoke(T0 arg0, T1 arg1); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/IStylePropertySyncTo.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style; 2 | 3 | public interface IStylePropertySyncTo 4 | { 5 | void sync(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/RenderOpPhase.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator; 2 | 3 | public enum RenderOpPhase 4 | { 5 | BEFORE_EXE, 6 | AFTER_EXE 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/function/IAction_3Param.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.function; 2 | 3 | public interface IAction_3Param 4 | { 5 | void invoke(T0 arg0, T1 arg1, T2 arg2); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/lerp/ITargetingLerpTarget.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.lerp; 2 | 3 | public interface ITargetingLerpTarget 4 | { 5 | Object getTarget(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/function/IFunc_3Param.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.function; 2 | 3 | public interface IFunc_3Param 4 | { 5 | TReturn invoke(T0 arg0, T1 arg1, T2 arg2); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/AlphaBlendMode.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render; 2 | 3 | public enum AlphaBlendMode 4 | { 5 | ADDITIVE, 6 | FORCE_SRC, 7 | FORCE_DEST, 8 | ZERO 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/ByteProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | public final class ByteProperty extends WrappedStyleProperty 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/FloatProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | public final class FloatProperty extends WrappedStyleProperty 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/IntProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | public final class IntProperty extends WrappedStyleProperty 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/LongProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | public final class LongProperty extends WrappedStyleProperty 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/ShortProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | public final class ShortProperty extends WrappedStyleProperty 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/event/UIEventListenerType.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.event; 2 | 3 | public enum UIEventListenerType 4 | { 5 | CAPTURE, 6 | TARGET, 7 | BUBBLE, 8 | LOCAL 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/CharProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | public final class CharProperty extends WrappedStyleProperty 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/DoubleProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | public final class DoubleProperty extends WrappedStyleProperty 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/BooleanProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | public final class BooleanProperty extends WrappedStyleProperty 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/IVisualModifier.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual; 2 | 3 | public interface IVisualModifier 4 | { 5 | void apply(VisualBuilder builder); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/event/IUIEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.event; 2 | 3 | public interface IUIEventListener 4 | { 5 | void handle(T event); 6 | UIEventListenerType type(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/serialization/IDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.serialization; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | public interface IDeserializer 6 | { 7 | @Nullable 8 | T deserialize(String raw); 9 | } 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/texture/ITexture2D.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.texture; 2 | 3 | public interface ITexture2D 4 | { 5 | int getGlTextureID(); 6 | boolean isGlRegistered(); 7 | int getWidth(); 8 | int getHeight(); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/appcommunication/spotify/SpotifyUserInfo.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.appcommunication.spotify; 2 | 3 | public final class SpotifyUserInfo 4 | { 5 | public static String userName = ""; 6 | public static Token token = new Token(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/IStylePropertyGetter.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | 5 | public interface IStylePropertyGetter 6 | { 7 | Object get(Element target); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/IStylePropertySetter.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | 5 | public interface IStylePropertySetter 6 | { 7 | void set(Element target, Object value); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/ISlotAccessorGetter.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.mvvm.viewmodel.ViewModel; 4 | 5 | public interface ISlotAccessorGetter 6 | { 7 | SlotAccessor get(ViewModel target); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/lerp/ILerpablePropertyGetter.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.lerp; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | 5 | public interface ILerpablePropertyGetter 6 | { 7 | LerpableProperty get(Element target); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/IReactiveObjectGetter.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.mvvm.viewmodel.ViewModel; 4 | 5 | public interface IReactiveObjectGetter 6 | { 7 | ReactiveObject get(ViewModel target); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/IReactiveCollectionGetter.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.mvvm.viewmodel.ViewModel; 4 | 5 | public interface IReactiveCollectionGetter 6 | { 7 | ReactiveCollection get(ViewModel target); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/forgeevent/IgiGuiLifecycleInitEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.forgeevent; 2 | 3 | public class IgiGuiLifecycleInitEvent extends IgiGuiLifecycleEvent 4 | { 5 | public IgiGuiLifecycleInitEvent(String lifecycleOwner) 6 | { 7 | super(lifecycleOwner); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/IgiRuntimeLocator.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core; 2 | 3 | public final class IgiRuntimeLocator 4 | { 5 | private IgiRuntimeLocator() { } 6 | 7 | public static IgiRuntime get() 8 | { 9 | return InternalMethods.instance.IgiRuntime$instance$getter.invoke(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/animation/text/ITextAnimDef.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.animation.text; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped.DoubleProperty; 4 | 5 | public interface ITextAnimDef 6 | { 7 | void calcAnim(CharInfo[] charInfos, DoubleProperty timer, double deltaTime); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/IStylePropertyCallbackPost.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | 5 | public interface IStylePropertyCallbackPost 6 | { 7 | void invoke(Element target, Object value); 8 | String name(); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/control/EmptyBlock.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.control; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.control.Sized; 4 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 5 | 6 | @RegisterElement 7 | public class EmptyBlock extends Sized 8 | { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/shader/uniform/UniformTypeKind.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.shader.uniform; 2 | 3 | // especially for glsl 330 4 | public enum UniformTypeKind 5 | { 6 | SCALAR, 7 | VECTOR, 8 | MATRIX, 9 | ARRAY, 10 | SAMPLER, 11 | ATOMIC_COUNTER, 12 | IMAGE, 13 | UNKNOWN 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/viewmodel/IGuiExit.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.viewmodel; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.mvvm.IGuiExit") 8 | public interface IGuiExit 9 | { 10 | boolean invoke(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/shutdown/ShutdownHooks.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.shutdown; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | public final class ShutdownHooks 8 | { 9 | public static final List hooks = new ArrayList<>(); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/forgeevent/IgiGuiLifecycleRegainScreenFocusEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.forgeevent; 2 | 3 | public class IgiGuiLifecycleRegainScreenFocusEvent extends IgiGuiLifecycleEvent 4 | { 5 | public IgiGuiLifecycleRegainScreenFocusEvent(String lifecycleOwner) 6 | { 7 | super(lifecycleOwner); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/IStylePropertyCallbackPre.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | 5 | public interface IStylePropertyCallbackPre 6 | { 7 | void invoke(Element target, Object value, CallbackInfo callbackInfo); 8 | String name(); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/Types.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api; 2 | 3 | public enum Types 4 | { 5 | Int, 6 | Long, 7 | Short, 8 | Byte, 9 | Double, 10 | Float, 11 | Char, 12 | Boolean, 13 | String, 14 | Alignment, 15 | Padding, 16 | Pivot, 17 | Skewness, 18 | GhostableItem, 19 | TextAnimDef 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/wrapped/WrappedStyleProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style.wrapped; 2 | 3 | // only do one inheritance; don't do nested inheritance 4 | public abstract class WrappedStyleProperty 5 | { 6 | protected T value; 7 | public T get() { return value; } 8 | public void set(T value) { this.value = value; } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IGameFpsEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.GameFpsEventListener") 8 | public interface IGameFpsEventListener 9 | { 10 | void invoke(int arg0); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/layout/Skewness.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.layout; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.serialization.Deserializer; 4 | import com.tttsaurus.ingameinfo.common.impl.serialization.SkewnessDeserializer; 5 | 6 | @Deserializer(SkewnessDeserializer.class) 7 | public enum Skewness 8 | { 9 | NULL, 10 | LEFT, 11 | RIGHT 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/ElementProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui; 2 | 3 | @SuppressWarnings("all") 4 | public final class ElementProperty 5 | { 6 | protected final String name; 7 | protected final Object value; 8 | 9 | public ElementProperty(String name, Object value) 10 | { 11 | this.name = name; 12 | this.value = value; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/op/IRenderOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 4 | import com.tttsaurus.ingameinfo.common.core.gui.theme.ThemeConfig; 5 | 6 | public interface IRenderOp 7 | { 8 | default void readTheme(ThemeConfig theme) { } 9 | void execute(RenderContext context); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/texture/param/FilterMode.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.texture.param; 2 | 3 | import org.lwjgl.opengl.GL11; 4 | 5 | public enum FilterMode 6 | { 7 | LINEAR(GL11.GL_LINEAR), 8 | NEAREST(GL11.GL_NEAREST); 9 | 10 | public final int glValue; 11 | FilterMode(int glValue) 12 | { 13 | this.glValue = glValue; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/deprecated/VertexIndexUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.deprecated; 2 | 3 | public final class VertexIndexUtils 4 | { 5 | // is this triangle counterclockwise 6 | public static boolean isCcw(float x1, float y1, float x2, float y2, float x3, float y3) 7 | { 8 | float cross = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1); 9 | return cross > 0; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IIgiGuiFpsEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.IgiGuiFpsEventListener") 8 | public interface IIgiGuiFpsEventListener 9 | { 10 | void invoke(int arg0, int arg1); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IBloodMagicEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.BloodMagicEventListener") 8 | public interface IBloodMagicEventListener 9 | { 10 | void invoke(int arg0, int arg1); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IDeepResonanceEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.DeepResonanceEventListener") 8 | public interface IDeepResonanceEventListener 9 | { 10 | void invoke(float arg0); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IGameMemoryEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.GameMemoryEventListener") 8 | public interface IGameMemoryEventListener 9 | { 10 | void invoke(long arg0, long arg1); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/input/IKeyboard.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.input; 2 | 3 | import java.util.Set; 4 | 5 | public interface IKeyboard 6 | { 7 | void updateInput(); 8 | boolean keyPress(Key key); 9 | boolean keyLeave(Key key); 10 | boolean keyDown(Key key); 11 | Set getHeldKeys(); 12 | Set getPressedKeys(); 13 | Set getLeftKeys(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IEnterBiomeEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.EnterBiomeEventListener") 8 | public interface IEnterBiomeEventListener 9 | { 10 | void invoke(String arg0, String arg1); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IGameTpsMsptEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.GameTpsMtpsEventListener") 8 | public interface IGameTpsMsptEventListener 9 | { 10 | void invoke(int arg0, double arg1); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IToughAsNailsEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.ToughAsNailsEventListener") 8 | public interface IToughAsNailsEventListener 9 | { 10 | void invoke(int arg0, int arg1); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/ISimpleDifficultyEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.SimpleDifficultyEventListener") 8 | public interface ISimpleDifficultyEventListener 9 | { 10 | void invoke(int arg0); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/forgeevent/IgiGuiLifecycleEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.forgeevent; 2 | 3 | import net.minecraftforge.fml.common.eventhandler.Event; 4 | 5 | public class IgiGuiLifecycleEvent extends Event 6 | { 7 | public final String lifecycleOwner; 8 | 9 | public IgiGuiLifecycleEvent(String lifecycleOwner) 10 | { 11 | this.lifecycleOwner = lifecycleOwner; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IIgiGuiFboRefreshRateEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | 6 | @ZenRegister 7 | @ZenClass("mods.ingameinfo.igievent.IgiGuiFboRefreshRateEventListener") 8 | public interface IIgiGuiFboRefreshRateEventListener 9 | { 10 | void invoke(float arg0); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/IArgsGenerator.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.op.IRenderOp; 5 | 6 | public interface IArgsGenerator 7 | { 8 | Object[] genCommandArgs(RenderContext renderContext, IRenderOp renderOp); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/op/MaskEndOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderMask; 5 | 6 | public class MaskEndOp implements IRenderOp 7 | { 8 | @Override 9 | public void execute(RenderContext context) 10 | { 11 | RenderMask.endMasking(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/mixins.ingameinfo.early.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": "com.tttsaurus.ingameinfo.mixin.early", 3 | "refmap": "mixins.ingameinfo.refmap.json", 4 | "target": "@env(DEFAULT)", 5 | "minVersion": "0.8", 6 | "compatibilityLevel": "JAVA_8", 7 | "mixins": [ 8 | "ForgeHooksClientMixin" 9 | ], 10 | "client": [ 11 | "FramebufferMixin", 12 | "GlStateManagerMixin", 13 | "GuiScreenMixin", 14 | "MinecraftMixin" 15 | ], 16 | "server": [] 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/viewmodel/IViewModelStart.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.viewmodel; 2 | 3 | import com.tttsaurus.ingameinfo.plugin.crt.impl.CrtViewModel; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | 7 | @ZenRegister 8 | @ZenClass("mods.ingameinfo.mvvm.IViewModelStart") 9 | public interface IViewModelStart 10 | { 11 | void start(CrtViewModel this0); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/input/IMouse.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.input; 2 | 3 | public interface IMouse 4 | { 5 | void updateInput(); 6 | boolean isLeftDown(); 7 | boolean isLeftPress(); 8 | boolean isLeftLeave(); 9 | boolean isRightDown(); 10 | boolean isRightPress(); 11 | boolean isRightLeave(); 12 | float getPosX(); 13 | float getPosY(); 14 | float getDeltaPosX(); 15 | float getDeltaPosY(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [{ 2 | "modid": "${modid}", 3 | "name": "${modname}", 4 | "description": "Inspired by InGame-Info-XML and it's bringing more modular controls and layouts to hud and also mvvm architecture", 5 | "version": "${version}", 6 | "mcversion": "${mcversion}", 7 | "logoFile": "logo.png", 8 | "url": "https://github.com/tttsaurus/Ingame-Info-Reborn", 9 | "authorList": ["tttsaurus"], 10 | "credits": "", 11 | "dependencies": [] 12 | }] 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/shader/uniform/Variant.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.shader.uniform; 2 | 3 | public enum Variant 4 | { 5 | // float 6 | DEFAULT(""), 7 | 8 | // int 9 | I("i"), 10 | 11 | // uint 12 | U("u"); 13 | 14 | private final String prefix; 15 | Variant(String prefix) 16 | { 17 | this.prefix = prefix; 18 | } 19 | 20 | public String getPrefix() { return prefix; } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/serialization/Deserializer.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.serialization; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.TYPE) 10 | public @interface Deserializer 11 | { 12 | Class> value(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/GameFpsEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 4 | import com.tttsaurus.ingameinfo.common.core.function.IAction_1Param; 5 | 6 | public final class GameFpsEvent extends EventBase> 7 | { 8 | public void addListener(IAction_1Param listener) 9 | { 10 | addListenerInternal(listener); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/SpotifyOverlayEditEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 4 | import com.tttsaurus.ingameinfo.common.core.function.IAction; 5 | 6 | public final class SpotifyOverlayEditEvent extends EventBase 7 | { 8 | @Override 9 | public void addListener(IAction listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/forgeevent/IgiRuntimeEntryPointEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.forgeevent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.IgiRuntime; 4 | import net.minecraftforge.fml.common.eventhandler.Event; 5 | 6 | public class IgiRuntimeEntryPointEvent extends Event 7 | { 8 | public final IgiRuntime runtime; 9 | 10 | public IgiRuntimeEntryPointEvent(IgiRuntime runtime) 11 | { 12 | this.runtime = runtime; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/GameMemoryEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_2Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class GameMemoryEvent extends EventBase> 7 | { 8 | public void addListener(IAction_2Param listener) 9 | { 10 | addListenerInternal(listener); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/lerp/LerpCenter.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.lerp; 2 | 3 | public final class LerpCenter 4 | { 5 | public static Mode mode = Mode.LINEAR; 6 | 7 | public enum Mode 8 | { 9 | LINEAR 10 | } 11 | 12 | public static float lerp(float i, float j, float a) 13 | { 14 | return switch (mode) 15 | { 16 | case LINEAR -> i + a * (j - i); 17 | }; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/viewmodel/IViewModelFixedUpdate.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.viewmodel; 2 | 3 | import com.tttsaurus.ingameinfo.plugin.crt.impl.CrtViewModel; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | 7 | @ZenRegister 8 | @ZenClass("mods.ingameinfo.mvvm.IViewModelFixedUpdate") 9 | public interface IViewModelFixedUpdate 10 | { 11 | void update(CrtViewModel this0, double deltaTime); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/IgiGuiFpsEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_2Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class IgiGuiFpsEvent extends EventBase> 7 | { 8 | public void addListener(IAction_2Param listener) 9 | { 10 | addListenerInternal(listener); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/jei/JeiCompatPlugin.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.jei; 2 | 3 | import mezz.jei.api.IModPlugin; 4 | import mezz.jei.api.IModRegistry; 5 | import mezz.jei.api.JEIPlugin; 6 | import javax.annotation.Nonnull; 7 | 8 | @JEIPlugin 9 | public class JeiCompatPlugin implements IModPlugin 10 | { 11 | @Override 12 | public void register(@Nonnull IModRegistry registry) 13 | { 14 | registry.addAdvancedGuiHandlers(new JeiExclusionHandler()); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/SpotifyOverlayEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 4 | import com.tttsaurus.ingameinfo.common.core.function.IAction_1Param; 5 | 6 | public final class SpotifyOverlayEvent extends EventBase> 7 | { 8 | @Override 9 | public void addListener(IAction_1Param listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/shader/ShaderLoadingUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.shader; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.commonutils.RlReaderUtils; 4 | 5 | public final class ShaderLoadingUtils 6 | { 7 | public static Shader load(String rl, Shader.ShaderType shaderType) 8 | { 9 | String raw = RlReaderUtils.read(rl, true); 10 | if (raw.isEmpty()) return null; 11 | 12 | return new Shader(rl, raw, shaderType); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/EnterBiomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_2Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class EnterBiomeEvent extends EventBase> 7 | { 8 | @Override 9 | public void addListener(IAction_2Param listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/GameTpsMsptEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_2Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class GameTpsMsptEvent extends EventBase> 7 | { 8 | @Override 9 | public void addListener(IAction_2Param listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/IgiGuiFboRefreshRateEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_1Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class IgiGuiFboRefreshRateEvent extends EventBase> 7 | { 8 | @Override 9 | public void addListener(IAction_1Param listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IRfToolsDimEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.impl.igievent.modcompat.RfToolsDimEvent; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | 7 | @ZenRegister 8 | @ZenClass("mods.ingameinfo.igievent.RfToolsDimEventListener") 9 | public interface IRfToolsDimEventListener 10 | { 11 | void invoke(RfToolsDimEvent.RfToolsDimData arg0); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/IThaumcraftEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.impl.igievent.modcompat.ThaumcraftEvent; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | 7 | @ZenRegister 8 | @ZenClass("mods.ingameinfo.igievent.ThaumcraftEventListener") 9 | public interface IThaumcraftEventListener 10 | { 11 | void invoke(ThaumcraftEvent.ThaumcraftData arg0); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/modcompat/DeepResonanceEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent.modcompat; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_1Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class DeepResonanceEvent extends EventBase> 7 | { 8 | @Override 9 | public void addListener(IAction_1Param listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/registry/RegisterElement.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.registry; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | // register an element in order to use StyleProperty 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Target(ElementType.TYPE) 11 | public @interface RegisterElement 12 | { 13 | boolean constructable() default true; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/modcompat/SimpleDifficultyEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent.modcompat; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_1Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class SimpleDifficultyEvent extends EventBase> 7 | { 8 | @Override 9 | public void addListener(IAction_1Param listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/modcompat/BloodMagicEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent.modcompat; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_2Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class BloodMagicEvent extends EventBase> 7 | { 8 | @Override 9 | public void addListener(IAction_2Param listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/serialization/PivotDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.serialization; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Pivot; 4 | import com.tttsaurus.ingameinfo.common.core.serialization.IDeserializer; 5 | 6 | public class PivotDeserializer implements IDeserializer 7 | { 8 | @Override 9 | public Pivot deserialize(String raw) 10 | { 11 | try { return Pivot.valueOf(raw); } 12 | catch (Exception ignored) { return null; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/igievent/ISereneSeasonsEventListener.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.impl.igievent.modcompat.SereneSeasonsEvent; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | 7 | @ZenRegister 8 | @ZenClass("mods.ingameinfo.igievent.SereneSeasonsEventListener") 9 | public interface ISereneSeasonsEventListener 10 | { 11 | void invoke(SereneSeasonsEvent.SereneSeasonsData arg0); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/modcompat/ToughAsNailsEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent.modcompat; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_2Param; 4 | import com.tttsaurus.ingameinfo.common.core.igievent.EventBase; 5 | 6 | public final class ToughAsNailsEvent extends EventBase> 7 | { 8 | @Override 9 | public void addListener(IAction_2Param listener) 10 | { 11 | addListenerInternal(listener); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/serialization/SkewnessDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.serialization; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Skewness; 4 | import com.tttsaurus.ingameinfo.common.core.serialization.IDeserializer; 5 | 6 | public class SkewnessDeserializer implements IDeserializer 7 | { 8 | @Override 9 | public Skewness deserialize(String raw) 10 | { 11 | try { return Skewness.valueOf(raw); } 12 | catch (Exception ignored) { return null; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/CommonBuffers.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render; 2 | 3 | import java.nio.ByteBuffer; 4 | import java.nio.ByteOrder; 5 | import java.nio.FloatBuffer; 6 | import java.nio.IntBuffer; 7 | 8 | public final class CommonBuffers 9 | { 10 | public static final IntBuffer INT_BUFFER_16 = ByteBuffer.allocateDirect(16 << 2).order(ByteOrder.nativeOrder()).asIntBuffer(); 11 | public static final FloatBuffer FLOAT_BUFFER_16 = ByteBuffer.allocateDirect(16 << 2).order(ByteOrder.nativeOrder()).asFloatBuffer(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/serialization/AlignmentDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.serialization; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Alignment; 4 | import com.tttsaurus.ingameinfo.common.core.serialization.IDeserializer; 5 | 6 | public class AlignmentDeserializer implements IDeserializer 7 | { 8 | @Override 9 | public Alignment deserialize(String raw) 10 | { 11 | try { return Alignment.valueOf(raw); } 12 | catch (Exception ignored) { return null; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/RenderOpQueue.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.op.IRenderOp; 4 | import java.util.ArrayDeque; 5 | import java.util.Deque; 6 | 7 | public final class RenderOpQueue 8 | { 9 | private final Deque deque = new ArrayDeque<>(); 10 | 11 | public void enqueue(IRenderOp op) 12 | { 13 | deque.offerLast(op); 14 | } 15 | public IRenderOp dequeue() 16 | { 17 | return deque.pollFirst(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/lerp/LerpTarget.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.lerp; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.FIELD) 10 | public @interface LerpTarget 11 | { 12 | // field name 13 | String value() default ""; 14 | String inner0() default ""; 15 | String inner1() default ""; 16 | boolean copyIfPossible() default true; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/Reactive.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.FIELD) 10 | public @interface Reactive 11 | { 12 | String targetUid() default ""; 13 | String property() default ""; 14 | boolean passiveSync() default false; 15 | boolean initiativeSync() default false; 16 | int ordinal() default -1; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/appcommunication/spotify/TrackPlaying.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.appcommunication.spotify; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class TrackPlaying 7 | { 8 | public boolean trackExists = false; 9 | public List artists = new ArrayList<>(); 10 | public String albumImage640by640 = ""; 11 | public String albumImage300by300 = ""; 12 | public String albumImage64by64 = ""; 13 | public String trackName = ""; 14 | public int progressMs; 15 | public boolean isPlaying; 16 | public int durationMs; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/texture/param/WrapMode.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.texture.param; 2 | 3 | import org.lwjgl.opengl.GL11; 4 | import org.lwjgl.opengl.GL12; 5 | import org.lwjgl.opengl.GL13; 6 | import org.lwjgl.opengl.GL14; 7 | 8 | public enum WrapMode 9 | { 10 | REPEAT(GL11.GL_REPEAT), 11 | CLAMP(GL11.GL_CLAMP), 12 | CLAMP_TO_EDGE(GL12.GL_CLAMP_TO_EDGE), 13 | CLAMP_TO_BORDER(GL13.GL_CLAMP_TO_BORDER), 14 | MIRRORED_REPEAT(GL14.GL_MIRRORED_REPEAT); 15 | 16 | public final int glValue; 17 | WrapMode(int glValue) 18 | { 19 | this.glValue = glValue; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/proxy/ServerProxy.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.proxy; 2 | 3 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 4 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 5 | import org.apache.logging.log4j.Logger; 6 | 7 | public class ServerProxy extends CommonProxy 8 | { 9 | @Override 10 | public void preInit(FMLPreInitializationEvent event, Logger logger) 11 | { 12 | super.preInit(event, logger); 13 | } 14 | 15 | @Override 16 | public void init(FMLInitializationEvent event, Logger logger) 17 | { 18 | super.init(event, logger); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /THIRD-PARTY-LICENSES/Configurate/LICENSE_HEADER.txt: -------------------------------------------------------------------------------- 1 | Configurate 2 | Copyright (C) zml and Configurate contributors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/serialization/ItemDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.serialization; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.commonutils.GhostableItem; 4 | import com.tttsaurus.ingameinfo.common.core.serialization.IDeserializer; 5 | 6 | public class ItemDeserializer implements IDeserializer 7 | { 8 | @Override 9 | public GhostableItem deserialize(String raw) 10 | { 11 | raw = raw.trim(); 12 | if (raw.startsWith("item(") && raw.endsWith(")")) 13 | return new GhostableItem(raw.substring(5, raw.length() - 1).trim()); 14 | return null; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/CrtMvvm.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import stanhebben.zenscript.annotations.ZenClass; 5 | import stanhebben.zenscript.annotations.ZenMethod; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | @ZenRegister 10 | @ZenClass("mods.ingameinfo.mvvm.Mvvm") 11 | public final class CrtMvvm 12 | { 13 | public static List mvvms = new ArrayList<>(); 14 | public static String currentMvvm; 15 | 16 | @ZenMethod 17 | public static void define(String mvvm) 18 | { 19 | if (!mvvms.contains(mvvm)) mvvms.add(mvvm); 20 | currentMvvm = mvvm; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/texture/McTextureWrapper.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.texture; 2 | 3 | import net.minecraft.client.renderer.texture.AbstractTexture; 4 | import net.minecraft.client.resources.IResourceManager; 5 | import java.io.IOException; 6 | 7 | public class McTextureWrapper extends AbstractTexture 8 | { 9 | private final ITexture2D internal; 10 | 11 | public McTextureWrapper(ITexture2D internal) 12 | { 13 | this.internal = internal; 14 | if (internal.isGlRegistered()) glTextureId = internal.getGlTextureID(); 15 | } 16 | 17 | @Override 18 | public void loadTexture(IResourceManager resourceManager) throws IOException { } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/RenderContext.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.theme.ThemeConfig; 4 | 5 | public class RenderContext 6 | { 7 | public final ThemeConfig theme; 8 | public final float lerpAlpha; 9 | public final boolean polygonSmoothHint; 10 | public final boolean lineSmoothHint; 11 | 12 | public RenderContext(ThemeConfig theme, float lerpAlpha, boolean polygonSmoothHint, boolean lineSmoothHint) 13 | { 14 | this.theme = theme; 15 | this.lerpAlpha = lerpAlpha; 16 | this.polygonSmoothHint = polygonSmoothHint; 17 | this.lineSmoothHint = lineSmoothHint; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/api/event/IIgiRuntimeEntryPointEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.api.event; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.IgiRuntime; 4 | import crafttweaker.annotations.ZenRegister; 5 | import crafttweaker.api.event.IEventCancelable; 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | import stanhebben.zenscript.annotations.ZenGetter; 8 | 9 | @ZenRegister 10 | @ZenClass("mods.ingameinfo.event.IgiRuntimeEntryPointEvent") 11 | public interface IIgiRuntimeEntryPointEvent extends IEventCancelable 12 | { 13 | @ZenGetter("initPhase") 14 | IgiRuntime.InitPhaseEntry getInitPhase(); 15 | 16 | @ZenGetter("livePhase") 17 | IgiRuntime.LivePhaseEntry getLivePhase(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/style/StylePropertyCallback.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.style; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Methods annotated with {@link StylePropertyCallback} must be public. 10 | * Callbacks related to setting style properties must be annotated with {@link StylePropertyCallback}. 11 | * The method name of the annotated method is also important. 12 | * 13 | * @see StyleProperty 14 | */ 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target(ElementType.METHOD) 17 | public @interface StylePropertyCallback { } 18 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/context/SharedContext.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.context; 2 | 3 | import javax.annotation.Nullable; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | public class SharedContext 8 | { 9 | private final Map, Object> data = new HashMap<>(); 10 | 11 | public void put(ContextKey key, Object value) 12 | { 13 | if (!key.clazz.isInstance(value)) return; 14 | data.put(key, value); 15 | } 16 | 17 | @Nullable 18 | public T get(ContextKey key) 19 | { 20 | Object obj = data.get(key); 21 | if (obj == null) return null; 22 | return (T)obj; 23 | } 24 | 25 | public int size() 26 | { 27 | return data.size(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/animation/text/CharInfo.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.animation.text; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.property.lerp.ICopyableLerpTarget; 4 | 5 | public class CharInfo implements ICopyableLerpTarget 6 | { 7 | public float x; 8 | public float y; 9 | public float scale; 10 | public int color; 11 | public boolean shadow; 12 | 13 | public CharInfo(float x, float y, float scale, int color, boolean shadow) 14 | { 15 | this.x = x; 16 | this.y = y; 17 | this.scale = scale; 18 | this.color = color; 19 | this.shadow = shadow; 20 | } 21 | 22 | @Override 23 | public Object copy() 24 | { 25 | return new CharInfo(x, y, scale, color, shadow); 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/CrtIgiGuiManager.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.IgiRuntimeLocator;; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenMethod; 7 | 8 | @ZenRegister 9 | @ZenClass("mods.ingameinfo.gui.IgiGuiManager") 10 | public final class CrtIgiGuiManager 11 | { 12 | @ZenMethod 13 | public static void openGui(String mvvmRegistryName) 14 | { 15 | IgiRuntimeLocator.get().livePhase.openGui(mvvmRegistryName); 16 | } 17 | 18 | @ZenMethod 19 | public static void closeGui(String mvvmRegistryName) 20 | { 21 | IgiRuntimeLocator.get().livePhase.closeGui(mvvmRegistryName); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/appcommunication/spotify/Token.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.appcommunication.spotify; 2 | 3 | import java.time.LocalDateTime; 4 | 5 | public class Token 6 | { 7 | public String accessToken; 8 | public String refreshToken; 9 | 10 | public int expiresIn; 11 | public LocalDateTime start; 12 | 13 | public Token(String accessToken, String refreshToken, int expiresIn) 14 | { 15 | this.accessToken = accessToken; 16 | this.refreshToken = refreshToken; 17 | this.expiresIn = expiresIn; 18 | this.start = LocalDateTime.now(); 19 | } 20 | 21 | public Token() 22 | { 23 | accessToken = ""; 24 | refreshToken = ""; 25 | expiresIn = 0; 26 | start = LocalDateTime.now(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/shader/uniform/UniformField.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.shader.uniform; 2 | 3 | import net.minecraft.util.Tuple; 4 | 5 | public class UniformField 6 | { 7 | protected final UniformType type; 8 | protected final String rawType; 9 | protected final String fieldName; 10 | 11 | public UniformType getType() { return type; } 12 | public String getRawType() { return rawType; } 13 | public String getFieldName() { return fieldName; } 14 | 15 | public UniformField(String rawType, String fieldName) 16 | { 17 | Tuple res = UniformParseUtils.getUniformType(rawType, fieldName); 18 | this.type = res.getFirst(); 19 | this.rawType = rawType; 20 | this.fieldName = res.getSecond(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/lerp/LerpableProperty.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.lerp; 2 | 3 | public abstract class LerpableProperty 4 | { 5 | protected T prevValue = null; 6 | protected T currValue = null; 7 | 8 | public final T getCurrValue() { return currValue; } 9 | 10 | public final void setPrevValue(Object value) { prevValue = (T)value; } 11 | public final void setCurrValue(Object value) { currValue = (T)value; } 12 | 13 | /** 14 | * If lerp is being called during render update, then {@link #prevValue} and {@link #currValue} are non-null for sure. 15 | * 16 | * @param percentage The interpolation alpha. Range: [0, 1] 17 | * @return The interpolated value. 18 | */ 19 | public abstract T lerp(float percentage); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/layout/Pivot.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.layout; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.serialization.Deserializer; 4 | import com.tttsaurus.ingameinfo.common.impl.serialization.PivotDeserializer; 5 | 6 | @Deserializer(PivotDeserializer.class) 7 | public enum Pivot 8 | { 9 | TOP_LEFT(0,0), 10 | TOP_CENTER(0, 0.5f), 11 | TOP_RIGHT(0, 1), 12 | 13 | CENTER_LEFT(0.5f, 0), 14 | CENTER(0.5f, 0.5f), 15 | CENTER_RIGHT(0.5f, 1), 16 | 17 | BOTTOM_LEFT(1, 0), 18 | BOTTOM_CENTER(1, 0.5f), 19 | BOTTOM_RIGHT(1, 1); 20 | 21 | public final float horizontal; 22 | public final float vertical; 23 | Pivot(float horizontal, float vertical) 24 | { 25 | this.horizontal = horizontal; 26 | this.vertical = vertical; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/shaders/post_processing_vertex.glsl: -------------------------------------------------------------------------------- 1 | #version 330 core 2 | 3 | out vec2 TexCoords; 4 | 5 | void main() 6 | { 7 | if (gl_VertexID == 0) 8 | { 9 | // top-left corner 10 | gl_Position = vec4(-1.0, 1.0, 0.0, 1.0); 11 | TexCoords = vec2(0.0, 1.0); 12 | } 13 | else if (gl_VertexID == 1) 14 | { 15 | // top-right corner 16 | gl_Position = vec4(1.0, 1.0, 0.0, 1.0); 17 | TexCoords = vec2(1.0, 1.0); 18 | } 19 | else if (gl_VertexID == 2) 20 | { 21 | // bottom-right corner 22 | gl_Position = vec4(1.0, -1.0, 0.0, 1.0); 23 | TexCoords = vec2(1.0, 0.0); 24 | } 25 | else if (gl_VertexID == 3) 26 | { 27 | // bottom-left corner 28 | gl_Position = vec4(-1.0, -1.0, 0.0, 1.0); 29 | TexCoords = vec2(0.0, 0.0); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/layout/Alignment.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.layout; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.serialization.Deserializer; 4 | import com.tttsaurus.ingameinfo.common.impl.serialization.AlignmentDeserializer; 5 | 6 | @Deserializer(AlignmentDeserializer.class) 7 | public enum Alignment 8 | { 9 | NULL(0, 0), 10 | 11 | TOP_LEFT(0,0), 12 | TOP_CENTER(0, 0.5f), 13 | TOP_RIGHT(0, 1), 14 | 15 | CENTER_LEFT(0.5f, 0), 16 | CENTER(0.5f, 0.5f), 17 | CENTER_RIGHT(0.5f, 1), 18 | 19 | BOTTOM_LEFT(1, 0), 20 | BOTTOM_CENTER(1, 0.5f), 21 | BOTTOM_RIGHT(1, 1); 22 | 23 | public final float horizontal; 24 | public final float vertical; 25 | Alignment(float horizontal, float vertical) 26 | { 27 | this.horizontal = horizontal; 28 | this.vertical = vertical; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/deprecated/ScaledRes2NdcUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.deprecated; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.ScaledResolution; 5 | 6 | public final class ScaledRes2NdcUtils 7 | { 8 | private static final Minecraft minecraft = Minecraft.getMinecraft(); 9 | 10 | public static float toNdcX(float x) 11 | { 12 | ScaledResolution resolution = new ScaledResolution(minecraft); 13 | float resWidth = (float)resolution.getScaledWidth_double(); 14 | return ((x - resWidth / 2f) / resWidth) * 2f; 15 | } 16 | public static float toNdcY(float y) 17 | { 18 | ScaledResolution resolution = new ScaledResolution(minecraft); 19 | float resHeight = (float)resolution.getScaledHeight_double(); 20 | return (((resHeight - y) - resHeight / 2f) / resHeight) * 2f; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/EventListenerBinder.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | import com.tttsaurus.ingameinfo.common.core.gui.event.IUIEventListener; 5 | import com.tttsaurus.ingameinfo.common.core.gui.event.UIEvent; 6 | import com.tttsaurus.ingameinfo.common.core.mvvm.view.View; 7 | import java.util.List; 8 | 9 | public class EventListenerBinder 10 | { 11 | public void bind(View view, String uid, Class type, IUIEventListener listener, int ordinal) 12 | { 13 | List list = view.getElements(uid); 14 | 15 | int index = 0; 16 | for (Element item: list) 17 | { 18 | if (ordinal != -1 && ordinal != index++) continue; 19 | 20 | item.addEventListener(type, listener); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/CrtView.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.mvvm.view.View; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenMethod; 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | @ZenRegister 11 | @ZenClass("mods.ingameinfo.mvvm.View") 12 | public final class CrtView extends View 13 | { 14 | public String runtimeMvvm; 15 | 16 | // key: mvvm registry name 17 | private static final Map ixmlFileNames = new HashMap<>(); 18 | 19 | @ZenMethod 20 | public static void setIxmlFileName(String name) { ixmlFileNames.put(CrtMvvm.currentMvvm, name); } 21 | 22 | @Override 23 | public String getIxmlFileName() 24 | { 25 | return ixmlFileNames.get(runtimeMvvm); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderItem.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 4 | import net.minecraft.item.ItemStack; 5 | 6 | public class VC_RenderItem extends VisualCommand 7 | { 8 | protected VC_RenderItem() 9 | { 10 | super(params(ItemStack.class, float.class, float.class, float.class, float.class)); 11 | } 12 | 13 | @Override 14 | public void execute(Object... args) 15 | { 16 | int index = matchParams(args); 17 | if (index != -1) castArgs(index, args); 18 | switch (index) 19 | { 20 | case 0 -> 21 | { 22 | RenderUtils.renderItem((ItemStack)args[0], (float)args[1], (float)args[2], (float)args[3], (float)args[4]); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | // RetroFuturaGradle 5 | name 'GTNH Maven' 6 | url 'https://nexus.gtnewhorizons.com/repository/public/' 7 | //noinspection GroovyAssignabilityCheck 8 | mavenContent { 9 | includeGroup 'com.gtnewhorizons' 10 | includeGroup 'com.gtnewhorizons.retrofuturagradle' 11 | } 12 | } 13 | gradlePluginPortal() 14 | mavenCentral() 15 | mavenLocal() 16 | } 17 | } 18 | 19 | plugins { 20 | id 'com.diffplug.blowdryerSetup' version '1.7.0' 21 | // Automatic toolchain provisioning 22 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' 23 | } 24 | 25 | blowdryerSetup { 26 | repoSubfolder 'spotless' 27 | github 'GregTechCEu/Buildscripts', 'tag', 'v1.0.7' 28 | } 29 | 30 | rootProject.name = rootProject.projectDir.getName() 31 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/types/SkewnessWrapper.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl.types; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Skewness; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenProperty; 7 | 8 | @ZenRegister 9 | @ZenClass("mods.ingameinfo.layout.Skewness") 10 | public final class SkewnessWrapper 11 | { 12 | public final Skewness skewness; 13 | public SkewnessWrapper(Skewness skewness) 14 | { 15 | this.skewness = skewness; 16 | } 17 | 18 | @ZenProperty 19 | public static final SkewnessWrapper NULL = new SkewnessWrapper(Skewness.NULL); 20 | 21 | @ZenProperty 22 | public static final SkewnessWrapper LEFT = new SkewnessWrapper(Skewness.LEFT); 23 | 24 | @ZenProperty 25 | public static final SkewnessWrapper RIGHT = new SkewnessWrapper(Skewness.RIGHT); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/VisualBuilder.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command.IArgsGenerator; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command.VisualCommand; 5 | import net.minecraft.util.Tuple; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class VisualBuilder 10 | { 11 | protected final List> commands = new ArrayList<>(); 12 | protected boolean abortRenderOp = false; 13 | 14 | public VisualBuilder abortRenderOp() 15 | { 16 | abortRenderOp = true; 17 | return this; 18 | } 19 | 20 | public VisualBuilder command(VisualCommand command, IArgsGenerator argsMapping) 21 | { 22 | commands.add(new Tuple<>(command, argsMapping)); 23 | return this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/VisualBuilderAccessor.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command.IArgsGenerator; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command.VisualCommand; 5 | import net.minecraft.util.Tuple; 6 | import java.util.List; 7 | 8 | public class VisualBuilderAccessor 9 | { 10 | private VisualBuilder visualBuilder; 11 | 12 | protected VisualBuilderAccessor() { } 13 | 14 | public void setVisualBuilder(VisualBuilder visualBuilder) 15 | { 16 | this.visualBuilder = visualBuilder; 17 | } 18 | 19 | public boolean getAbortRenderOp() 20 | { 21 | return visualBuilder.abortRenderOp; 22 | } 23 | 24 | public List> getCommands() 25 | { 26 | return visualBuilder.commands; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src_demo/main/java/com/tttsaurus/ingameinfo/demo/DemoMvvmRegistration.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.demo; 2 | 3 | import com.tttsaurus.ingameinfo.InGameInfoReborn; 4 | import com.tttsaurus.ingameinfo.common.core.forgeevent.IgiRuntimeEntryPointEvent; 5 | import com.tttsaurus.ingameinfo.demo.eg1.Eg1ViewModel; 6 | import net.minecraftforge.fml.common.Mod; 7 | import net.minecraftforge.fml.common.eventhandler.EventPriority; 8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 9 | 10 | @Mod.EventBusSubscriber 11 | public final class DemoMvvmRegistration 12 | { 13 | @SubscribeEvent(priority = EventPriority.HIGHEST) 14 | public static void onIgiRuntimeEntryPoint(IgiRuntimeEntryPointEvent event) 15 | { 16 | // event.runtime.initPhase 17 | // .registerMvvm("eg1", Eg1ViewModel.class) 18 | // .openGuiOnStartup("eg1"); 19 | // 20 | // InGameInfoReborn.LOGGER.info("In-Game Info Reborn MVVM demos registered."); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/compose/ComposeNode.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.compose; 2 | 3 | import java.util.HashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | import java.util.concurrent.CopyOnWriteArrayList; 7 | 8 | public class ComposeNode 9 | { 10 | public final String uiElementName; 11 | public final Map styleProperties = new HashMap<>(); 12 | public final List children = new CopyOnWriteArrayList<>(); 13 | public final ComposeNode parent; 14 | 15 | public final String sysKey; 16 | public String userKey; 17 | 18 | public String getFinalKey() 19 | { 20 | return userKey == null ? sysKey : userKey; 21 | } 22 | 23 | protected ComposeNode(String name, ComposeNode parent, int sysKey) 24 | { 25 | uiElementName = name; 26 | this.parent = parent; 27 | this.sysKey = String.valueOf(sysKey); 28 | userKey = null; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src_demo/main/java/com/tttsaurus/ingameinfo/demo/eg1/Eg1Compose.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.demo.eg1; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.ElementGroup; 4 | import com.tttsaurus.ingameinfo.common.core.mvvm.compose.ComposeBlock; 5 | import com.tttsaurus.ingameinfo.common.core.mvvm.context.ContextKey; 6 | import com.tttsaurus.ingameinfo.common.core.mvvm.context.SharedContext; 7 | 8 | public class Eg1Compose extends ComposeBlock 9 | { 10 | public Eg1Compose(ElementGroup root) 11 | { 12 | super(root); 13 | } 14 | 15 | @Override 16 | public void compose(double deltaTime, SharedContext sharedContext) 17 | { 18 | ui("VerticalGroup").wrap(() -> 19 | { 20 | Object num = sharedContext.get(ContextKey.gen("num", int.class)); 21 | if (num != null) 22 | for (int i = 0; i < (int)num; i++) 23 | ui("Text").key(i).prop("text", "switched once"); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/control/Separator.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.control; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.StyleProperty; 5 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 6 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderOpQueue; 7 | import com.tttsaurus.ingameinfo.common.impl.gui.render.op.SeparatorOp; 8 | 9 | @RegisterElement 10 | public class Separator extends Element 11 | { 12 | @StyleProperty 13 | public int color; 14 | 15 | @Override 16 | public void calcWidthHeight() 17 | { 18 | rect.width = 6; 19 | rect.height = 9; 20 | } 21 | 22 | @Override 23 | public void onRenderUpdate(RenderOpQueue queue, boolean focused) 24 | { 25 | super.onRenderUpdate(queue, focused); 26 | queue.enqueue(new SeparatorOp(rect.x, rect.y, color)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/ReactiveCollectionWrapper.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.mvvm.binding.ReactiveCollection; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenMethod; 7 | 8 | @ZenRegister 9 | @ZenClass("mods.ingameinfo.mvvm.ReactiveCollection") 10 | public final class ReactiveCollectionWrapper 11 | { 12 | protected final ReactiveCollection reactiveCollection; 13 | 14 | public ReactiveCollectionWrapper(ReactiveCollection reactiveCollection) 15 | { 16 | this.reactiveCollection = reactiveCollection; 17 | } 18 | 19 | @ZenMethod 20 | public int size() 21 | { 22 | return reactiveCollection.size(); 23 | } 24 | @ZenMethod 25 | public ElementAccessorWrapper get(int index) 26 | { 27 | return new ElementAccessorWrapper(reactiveCollection.get(index)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/render/op/SeparatorOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.op.IRenderOp; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 5 | import com.tttsaurus.ingameinfo.common.core.gui.theme.ThemeConfig; 6 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 7 | 8 | public class SeparatorOp implements IRenderOp 9 | { 10 | public float x, y; 11 | public int color; 12 | 13 | public SeparatorOp(float x, float y, int color) 14 | { 15 | this.x = x; 16 | this.y = y; 17 | this.color = color; 18 | } 19 | 20 | @Override 21 | public void readTheme(ThemeConfig theme) 22 | { 23 | if (color == 0) 24 | color = 0; // todo: theme to be impl 25 | } 26 | 27 | @Override 28 | public void execute(RenderContext context) 29 | { 30 | RenderUtils.renderRect(x + 2.5f, y - 1, 1, 9, color); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VisualCommandSet.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | public final class VisualCommandSet 4 | { 5 | public static final VC_RenderFormattedText RENDER_FORMATTED_TEXT = new VC_RenderFormattedText(); 6 | public static final VC_RenderGradientRect RENDER_GRADIENT_RECT = new VC_RenderGradientRect(); 7 | public static final VC_RenderImagePrefab RENDER_IMAGE_PREFAB = new VC_RenderImagePrefab(); 8 | public static final VC_RenderItem RENDER_ITEM = new VC_RenderItem(); 9 | public static final VC_RenderRect RENDER_RECT = new VC_RenderRect(); 10 | public static final VC_RenderRectOutline RENDER_RECT_OUTLINE = new VC_RenderRectOutline(); 11 | public static final VC_RenderRoundedRect RENDER_ROUNDED_RECT = new VC_RenderRoundedRect(); 12 | public static final VC_RenderRoundedRectOutline RENDER_ROUNDED_RECT_OUTLINE = new VC_RenderRoundedRectOutline(); 13 | public static final VC_RenderText RENDER_TEXT = new VC_RenderText(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/render/op/ItemOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.op.IRenderOp; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 5 | import com.tttsaurus.ingameinfo.common.core.commonutils.GhostableItem; 6 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 7 | 8 | public class ItemOp implements IRenderOp 9 | { 10 | public GhostableItem item; 11 | public float x, y, scaleX, scaleY; 12 | 13 | public ItemOp(GhostableItem item, float x, float y, float scaleX, float scaleY) 14 | { 15 | this.item = item; 16 | this.x = x; 17 | this.y = y; 18 | this.scaleX = scaleX; 19 | this.scaleY = scaleY; 20 | } 21 | 22 | @Override 23 | public void execute(RenderContext context) 24 | { 25 | if (item == null) return; 26 | if (item.getItemStack() == null) return; 27 | 28 | RenderUtils.renderItem(item.getItemStack(), x, y, scaleX, scaleY); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/ReactiveCollection.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.ElementAccessor; 4 | import com.tttsaurus.ingameinfo.common.core.gui.layout.ElementGroup; 5 | 6 | public class ReactiveCollection 7 | { 8 | protected ElementGroup group; 9 | 10 | public int size() 11 | { 12 | if (group == null) 13 | throw new IllegalStateException("Internal object is null. The binding probably failed."); 14 | 15 | return group.elements.size(); 16 | } 17 | public ElementAccessor get(int index) 18 | { 19 | if (group == null) 20 | throw new IllegalStateException("Internal object is null. The binding probably failed."); 21 | if (index < 0 || index > group.elements.size() - 1) 22 | throw new IndexOutOfBoundsException("Index " + index + " is invalid as the length of this collection is " + group.elements.size() + "."); 23 | 24 | return new ElementAccessor(group.elements.get(index)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/input/InputFrameGenerator.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.input; 2 | 3 | public class InputFrameGenerator 4 | { 5 | private final IKeyboard keyboard; 6 | private final IMouse mouse; 7 | 8 | public InputFrameGenerator(IKeyboard keyboard, IMouse mouse) 9 | { 10 | this.keyboard = keyboard; 11 | this.mouse = mouse; 12 | } 13 | 14 | public InputState generate() 15 | { 16 | keyboard.updateInput(); 17 | mouse.updateInput(); 18 | 19 | return new InputState( 20 | keyboard.getHeldKeys(), 21 | keyboard.getPressedKeys(), 22 | keyboard.getLeftKeys(), 23 | mouse.isLeftDown(), 24 | mouse.isLeftPress(), 25 | mouse.isLeftLeave(), 26 | mouse.isRightDown(), 27 | mouse.isRightPress(), 28 | mouse.isRightLeave(), 29 | mouse.getPosX(), 30 | mouse.getPosY(), 31 | mouse.getDeltaPosX(), 32 | mouse.getDeltaPosY()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/event/McIgiRuntimeEntryPointEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl.event; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.IgiRuntime; 4 | import com.tttsaurus.ingameinfo.common.core.forgeevent.IgiRuntimeEntryPointEvent; 5 | import com.tttsaurus.ingameinfo.plugin.crt.api.event.IIgiRuntimeEntryPointEvent; 6 | 7 | public class McIgiRuntimeEntryPointEvent implements IIgiRuntimeEntryPointEvent 8 | { 9 | private final IgiRuntimeEntryPointEvent event; 10 | 11 | public McIgiRuntimeEntryPointEvent(IgiRuntimeEntryPointEvent event) 12 | { 13 | this.event = event; 14 | } 15 | 16 | @Override 17 | public boolean isCanceled() 18 | { 19 | return false; 20 | } 21 | 22 | @Override 23 | public void setCanceled(boolean canceled) { } 24 | 25 | @Override 26 | public IgiRuntime.InitPhaseEntry getInitPhase() 27 | { 28 | return event.runtime.initPhase; 29 | } 30 | 31 | @Override 32 | public IgiRuntime.LivePhaseEntry getLivePhase() 33 | { 34 | return event.runtime.livePhase; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/property/lerp/LerpTargetCopyUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.property.lerp; 2 | 3 | import java.lang.reflect.Array; 4 | 5 | @SuppressWarnings("all") 6 | public final class LerpTargetCopyUtils 7 | { 8 | public static Object copy(Object in) 9 | { 10 | Class component = in.getClass().getComponentType(); 11 | if (component == null) 12 | return copy((ICopyableLerpTarget)in, in.getClass().asSubclass(ICopyableLerpTarget.class)); 13 | else 14 | return copy((ICopyableLerpTarget[])in, component.asSubclass(ICopyableLerpTarget.class)); 15 | } 16 | 17 | private static T copy(ICopyableLerpTarget in, Class clazz) 18 | { 19 | return (T)in.copy(); 20 | } 21 | 22 | private static T[] copy(ICopyableLerpTarget[] in, Class component) 23 | { 24 | T[] out = (T[])Array.newInstance(component, in.length); 25 | for (int i = 0; i < out.length; i++) 26 | out[i] = (T)in[i].copy(); 27 | return out; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/mvvm/TemplateView.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.mvvm; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.mvvm.view.View; 4 | 5 | public class TemplateView extends View 6 | { 7 | @Override 8 | public String getDefaultIxml() 9 | { 10 | return 11 | """ 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | """; 26 | } 27 | 28 | @Override 29 | public String getIxmlFileName() 30 | { 31 | return "template"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/commonutils/MouseUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.commonutils; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.ScaledResolution; 5 | import org.lwjgl.input.Mouse; 6 | 7 | public final class MouseUtils 8 | { 9 | // under Minecraft's scaled resolution coordinate system 10 | 11 | private static final Minecraft MINECRAFT = Minecraft.getMinecraft(); 12 | 13 | public static int getMouseX() 14 | { 15 | ScaledResolution resolution = new ScaledResolution(MINECRAFT); 16 | int mouseX = Mouse.getX(); 17 | return mouseX / resolution.getScaleFactor(); 18 | } 19 | public static int getMouseY() 20 | { 21 | ScaledResolution resolution = new ScaledResolution(MINECRAFT); 22 | int mouseY = MINECRAFT.displayHeight - Mouse.getY() - 1; 23 | return mouseY / resolution.getScaleFactor(); 24 | } 25 | public static boolean isMouseDownLeft() 26 | { 27 | return Mouse.isButtonDown(0); 28 | } 29 | public static boolean isMouseDownRight() 30 | { 31 | return Mouse.isButtonDown(1); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/SlotAccessor.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.ElementGroup; 4 | import com.tttsaurus.ingameinfo.common.core.mvvm.compose.ComposeBlock; 5 | import java.lang.reflect.Constructor; 6 | 7 | public class SlotAccessor 8 | { 9 | // the slot group 10 | protected ElementGroup group; 11 | 12 | private ComposeBlock composeBlock = null; 13 | public ComposeBlock getComposeBlock() { return composeBlock; } 14 | 15 | public void initComposeBlock(Class clazz) 16 | { 17 | if (group == null) 18 | throw new IllegalStateException("Internal object is null. The binding probably failed."); 19 | 20 | try 21 | { 22 | Constructor constructor = clazz.getConstructor(ElementGroup.class); 23 | composeBlock = constructor.newInstance(group); 24 | } 25 | catch (Throwable throwable) 26 | { 27 | composeBlock = null; 28 | throw new RuntimeException("Failed to initialize the compose block.", throwable); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .nopublish 2 | 3 | ### Windows ### 4 | 5 | thumbs.db 6 | *.db 7 | 8 | ### Java ### 9 | 10 | *.class 11 | 12 | # Mobile Tools for Java (J2ME) 13 | .mtj.tmp/ 14 | 15 | # Package Files # 16 | *.war 17 | *.ear 18 | *.txt 19 | 20 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 21 | hs_err_pid* 22 | 23 | ### Eclipse ### 24 | 25 | *.pydevproject 26 | .metadata 27 | .gradle 28 | bin/ 29 | tmp/ 30 | *.tmp 31 | *.bak 32 | *.swp 33 | *~.nib 34 | local.properties 35 | .settings/ 36 | .loadpath 37 | /eclipse 38 | 39 | # Eclipse Core 40 | .project 41 | 42 | # External tool builders 43 | .externalToolBuilders/ 44 | 45 | # Locally stored "Eclipse launch configurations" 46 | *.launch 47 | 48 | # CDT-specific 49 | .cproject 50 | 51 | # JDT-specific (Eclipse Java Development Tools) 52 | .classpath 53 | 54 | # Java annotation processor (APT) 55 | .factorypath 56 | 57 | # PDT-specific 58 | .buildpath 59 | 60 | # sbteclipse plugin 61 | .target 62 | 63 | # TeXlipse plugin 64 | .texlipse 65 | 66 | ### Intellij IDEA ### 67 | 68 | *.iml 69 | *.ipr 70 | *.iws 71 | 72 | .idea/ 73 | .idea_modules/ 74 | /classes/ 75 | /out/ 76 | /build/ 77 | 78 | # Linux 79 | *~ 80 | 81 | run/ 82 | 83 | logs/ 84 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/input/DirectInput.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl.input; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.commonutils.MouseUtils; 4 | import crafttweaker.annotations.ZenRegister; 5 | import org.lwjgl.input.Keyboard; 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | import stanhebben.zenscript.annotations.ZenMethod; 8 | 9 | @ZenRegister 10 | @ZenClass("mods.ingameinfo.input.DirectInput") 11 | public final class DirectInput 12 | { 13 | @ZenMethod 14 | public static boolean isKeyDown(KeyWrapper keyWrapper) 15 | { 16 | return Keyboard.isKeyDown(keyWrapper.key.keycode); 17 | } 18 | 19 | @ZenMethod 20 | public static int getMouseX() 21 | { 22 | return MouseUtils.getMouseX(); 23 | } 24 | 25 | @ZenMethod 26 | public static int getMouseY() 27 | { 28 | return MouseUtils.getMouseY(); 29 | } 30 | 31 | @ZenMethod 32 | public static boolean isMouseDownLeft() 33 | { 34 | return MouseUtils.isMouseDownLeft(); 35 | } 36 | 37 | @ZenMethod 38 | public static boolean isMouseDownRight() 39 | { 40 | return MouseUtils.isMouseDownRight(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/context/ContextKey.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.context; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.reflection.TypeUtils; 4 | 5 | public class ContextKey 6 | { 7 | public final String key; 8 | public Class clazz; 9 | 10 | public static ContextKey gen(String key, Class clazz) 11 | { 12 | if (clazz.isPrimitive()) 13 | return new ContextKey<>(key, TypeUtils.toWrappedPrimitive(clazz)); 14 | return new ContextKey<>(key, clazz); 15 | } 16 | 17 | private ContextKey(String key, Class clazz) 18 | { 19 | this.key = key; 20 | this.clazz = clazz; 21 | } 22 | 23 | @Override 24 | public boolean equals(Object obj) 25 | { 26 | if (this == obj) return true; 27 | if (!(obj instanceof ContextKey other)) return false; 28 | return key.equals(other.key) && clazz.equals(other.clazz); 29 | } 30 | 31 | @Override 32 | public int hashCode() 33 | { 34 | return 31 * key.hashCode() + clazz.hashCode(); 35 | } 36 | 37 | @Override 38 | public String toString() 39 | { 40 | return "ContextKey[" + key + ", " + clazz.getSimpleName() + "]"; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/jei/JeiExclusionHandler.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.jei; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.IgiRuntimeLocator; 4 | import mezz.jei.api.gui.IAdvancedGuiHandler; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.gui.ScaledResolution; 7 | import net.minecraft.client.gui.inventory.GuiContainer; 8 | import javax.annotation.Nonnull; 9 | import javax.annotation.Nullable; 10 | import java.awt.*; 11 | import java.util.Collections; 12 | import java.util.List; 13 | 14 | public class JeiExclusionHandler implements IAdvancedGuiHandler 15 | { 16 | @Override 17 | public @Nonnull Class getGuiContainerClass() 18 | { 19 | return GuiContainer.class; 20 | } 21 | 22 | @Override 23 | public @Nullable List getGuiExtraAreas(@Nonnull GuiContainer guiContainer) 24 | { 25 | if (IgiRuntimeLocator.get().livePhase.isOccupyingScreen()) 26 | { 27 | ScaledResolution resolution = new ScaledResolution(Minecraft.getMinecraft()); 28 | return Collections.singletonList(new Rectangle(0, 0, resolution.getScaledWidth(), resolution.getScaledHeight())); 29 | } 30 | else 31 | return null; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderRect.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.AlphaBlendMode; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 5 | 6 | public class VC_RenderRect extends VisualCommand 7 | { 8 | protected VC_RenderRect() 9 | { 10 | super( 11 | params(float.class, float.class, float.class, float.class, int.class), 12 | params(float.class, float.class, float.class, float.class, int.class, AlphaBlendMode.class)); 13 | } 14 | 15 | @Override 16 | public void execute(Object... args) 17 | { 18 | int index = matchParams(args); 19 | if (index != -1) castArgs(index, args); 20 | switch (index) 21 | { 22 | case 0 -> 23 | { 24 | RenderUtils.renderRect((float)args[0], (float)args[1], (float)args[2], (float)args[3], (int)args[4]); 25 | } 26 | case 1 -> 27 | { 28 | RenderUtils.renderRect((float)args[0], (float)args[1], (float)args[2], (float)args[3], (int)args[4], (AlphaBlendMode)args[5]); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/control/Sized.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.control; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 5 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.CallbackInfo; 6 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.StyleProperty; 7 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.StylePropertyCallback; 8 | 9 | // for those who don't implicitly have a size 10 | @RegisterElement(constructable = false) 11 | public abstract class Sized extends Element 12 | { 13 | @StylePropertyCallback 14 | public void nonNegativeFloatValidation(float value, CallbackInfo callbackInfo) 15 | { 16 | if (value < 0) callbackInfo.cancel = true; 17 | } 18 | 19 | @StyleProperty(setterCallbackPost = "requestReCalc", setterCallbackPre = "nonNegativeFloatValidation") 20 | public float width; 21 | 22 | @StyleProperty(setterCallbackPost = "requestReCalc", setterCallbackPre = "nonNegativeFloatValidation") 23 | public float height; 24 | 25 | @Override 26 | public void calcWidthHeight() 27 | { 28 | rect.width = width; 29 | rect.height = height; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/texture/ImagePrefab.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.texture; 2 | 3 | import javax.annotation.Nonnull; 4 | 5 | public class ImagePrefab 6 | { 7 | public enum InternalType 8 | { 9 | TEXTURE_2D, 10 | TEXTURE_SLICED_2D, 11 | NINE_PATCH_BORDER 12 | } 13 | 14 | public final InternalType type; 15 | public final Texture2D texture2D; 16 | public final TextureSliced2D textureSliced2D; 17 | public final NinePatchBorder ninePatchBorder; 18 | 19 | public ImagePrefab(@Nonnull Texture2D texture2D) 20 | { 21 | type = InternalType.TEXTURE_2D; 22 | this.texture2D = texture2D; 23 | textureSliced2D = null; 24 | ninePatchBorder = null; 25 | } 26 | 27 | public ImagePrefab(@Nonnull TextureSliced2D textureSliced2D) 28 | { 29 | type = InternalType.TEXTURE_SLICED_2D; 30 | texture2D = null; 31 | this.textureSliced2D = textureSliced2D; 32 | ninePatchBorder = null; 33 | } 34 | 35 | public ImagePrefab(@Nonnull NinePatchBorder ninePatchBorder) 36 | { 37 | type = InternalType.NINE_PATCH_BORDER; 38 | texture2D = null; 39 | textureSliced2D = null; 40 | this.ninePatchBorder = ninePatchBorder; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/render/op/TextOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.op.IRenderOp; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 5 | import com.tttsaurus.ingameinfo.common.core.gui.theme.ThemeConfig; 6 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 7 | import com.tttsaurus.ingameinfo.common.core.render.text.FormattedText; 8 | 9 | public class TextOp implements IRenderOp 10 | { 11 | public FormattedText text; 12 | public float x, y, scale; 13 | public int color; 14 | public boolean shadow; 15 | 16 | public TextOp(FormattedText text, float x, float y, float scale, int color, boolean shadow) 17 | { 18 | this.text = text; 19 | this.x = x; 20 | this.y = y; 21 | this.scale = scale; 22 | this.color = color; 23 | this.shadow = shadow; 24 | } 25 | 26 | @Override 27 | public void readTheme(ThemeConfig theme) 28 | { 29 | if (color == 0) 30 | color = theme.text.parsedColor; 31 | } 32 | 33 | @Override 34 | public void execute(RenderContext context) 35 | { 36 | RenderUtils.renderFormattedText(text, x, y, scale, color, shadow); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/resources/assets/ingameinfo/shaders/post_processing_frag.glsl: -------------------------------------------------------------------------------- 1 | #if USE_MULTISAMPLE 2 | uniform sampler2DMS screenTexture; 3 | uniform int sampleNum; 4 | #else 5 | uniform sampler2D screenTexture; 6 | #endif 7 | 8 | uniform bool enableAlpha; 9 | uniform float targetAlpha; 10 | 11 | in vec2 TexCoords; 12 | out vec4 FragColor; 13 | 14 | void main() 15 | { 16 | float alpha; 17 | vec3 color; 18 | vec4 finalFragColor; 19 | 20 | #if USE_MULTISAMPLE 21 | ivec2 texelPos = ivec2(gl_FragCoord.xy); 22 | 23 | float alphas = 0f; 24 | vec3 colors = vec3(0f, 0f, 0f); 25 | 26 | for (int i = 0; i < sampleNum; i++) 27 | { 28 | alphas += texelFetch(screenTexture, texelPos, i).a; 29 | colors += texelFetch(screenTexture, texelPos, i).rgb; 30 | } 31 | 32 | alpha = alphas / float(sampleNum); 33 | color = colors / float(sampleNum); 34 | #else 35 | alpha = texture(screenTexture, TexCoords).a; 36 | color = texture(screenTexture, TexCoords).rgb; 37 | #endif 38 | 39 | finalFragColor = vec4(color, alpha); 40 | 41 | if (enableAlpha) 42 | { 43 | if (alpha == 0.0) 44 | finalFragColor = vec4(color, 0.0); 45 | else 46 | finalFragColor = vec4(color, targetAlpha * alpha); 47 | } 48 | 49 | FragColor = finalFragColor; 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/event/UIEvent.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.event; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | import com.tttsaurus.ingameinfo.common.core.gui.ElementAccessor; 5 | import com.tttsaurus.ingameinfo.common.core.input.InputState; 6 | 7 | public class UIEvent 8 | { 9 | public final InputState input; 10 | public final ElementAccessor elementAccessor; 11 | 12 | private boolean consumed = false; 13 | public boolean isConsumed() { return consumed; } 14 | public void consume() { consumed = true; } 15 | 16 | public UIEvent(InputState input, Element element) 17 | { 18 | this.input = input; 19 | elementAccessor = new ElementAccessor(element); 20 | } 21 | 22 | public static class MouseEnter extends UIEvent { public MouseEnter(InputState input, Element element) { super(input, element); } } 23 | public static class MouseLeave extends UIEvent { public MouseLeave(InputState input, Element element) { super(input, element); } } 24 | public static class MousePress extends UIEvent { public MousePress(InputState input, Element element) { super(input, element); } } 25 | public static class MouseRelease extends UIEvent { public MouseRelease(InputState input, Element element) { super(input, element); } } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderImagePrefab.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.texture.ImagePrefab; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 5 | 6 | public class VC_RenderImagePrefab extends VisualCommand 7 | { 8 | protected VC_RenderImagePrefab() 9 | { 10 | super( 11 | params(float.class, float.class, float.class, float.class, ImagePrefab.class), 12 | params(float.class, float.class, float.class, float.class, ImagePrefab.class, int.class)); 13 | } 14 | 15 | @Override 16 | public void execute(Object... args) 17 | { 18 | int index = matchParams(args); 19 | if (index != -1) castArgs(index, args); 20 | switch (index) 21 | { 22 | case 0 -> 23 | { 24 | RenderUtils.renderImagePrefab((float)args[0], (float)args[1], (float)args[2], (float)args[3], (ImagePrefab)args[4]); 25 | } 26 | case 1 -> 27 | { 28 | RenderUtils.renderImagePrefab((float)args[0], (float)args[1], (float)args[2], (float)args[3], (ImagePrefab)args[4], (int)args[5]); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/shader/ShaderParseUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.shader; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.shader.uniform.UniformField; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | public final class ShaderParseUtils 10 | { 11 | public static List getUniformFields(String shaderSource) 12 | { 13 | List fields = new ArrayList<>(); 14 | 15 | /* 16 | 17 | layout(std140) uniform MyUniformBlock { 18 | mat4 projectionMatrix; 19 | vec3 lightPosition; 20 | float time; 21 | }; 22 | 23 | doesn't support uniform block for now 24 | */ 25 | 26 | Pattern pattern = Pattern.compile("\\buniform\\s+(\\w+)\\s+(\\w+)(\\[\\d+\\])*\\s*;"); 27 | Matcher matcher = pattern.matcher(shaderSource); 28 | 29 | while (matcher.find()) 30 | { 31 | String type = matcher.group(1); 32 | String name = matcher.group(2); 33 | String arr = matcher.group(3); 34 | if (arr != null) name += arr; 35 | fields.add(new UniformField(type, name)); 36 | } 37 | 38 | return fields; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/control/Item.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.control; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.control.Sized; 4 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 5 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.CallbackInfo; 6 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.StyleProperty; 7 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.StylePropertyCallback; 8 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderOpQueue; 9 | import com.tttsaurus.ingameinfo.common.core.commonutils.GhostableItem; 10 | import com.tttsaurus.ingameinfo.common.impl.gui.render.op.ItemOp; 11 | 12 | @RegisterElement 13 | public class Item extends Sized 14 | { 15 | @StylePropertyCallback 16 | public void itemValidation(GhostableItem value, CallbackInfo callbackInfo) 17 | { 18 | if (value == null) callbackInfo.cancel = true; 19 | } 20 | @StyleProperty(setterCallbackPre = "itemValidation") 21 | public GhostableItem item; 22 | 23 | @Override 24 | public void onRenderUpdate(RenderOpQueue queue, boolean focused) 25 | { 26 | super.onRenderUpdate(queue, focused); 27 | queue.enqueue(new ItemOp(item, rect.x, rect.y, width / 16f, height / 16f)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/layout/Slot.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.layout; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 5 | 6 | @RegisterElement 7 | public final class Slot extends ElementGroup 8 | { 9 | // width and height = 0, which is just a slot 10 | 11 | @Override 12 | public void calcRenderPos(Rect contextRect) 13 | { 14 | super.calcRenderPos(contextRect); 15 | if (elements.isEmpty()) return; 16 | for (Element element: elements) 17 | { 18 | element.rect.x = rect.x + rect.width * element.alignment.vertical; 19 | element.rect.y = rect.y + rect.height * element.alignment.horizontal; 20 | if (element.pivot.vertical == 0 || element.pivot.vertical == 0.5f) element.rect.x += element.padding.left; 21 | if (element.pivot.vertical == 1 || element.pivot.vertical == 0.5f) element.rect.x -= element.padding.right; 22 | if (element.pivot.horizontal == 0 || element.pivot.horizontal == 0.5f) element.rect.y += element.padding.top; 23 | if (element.pivot.horizontal == 1 || element.pivot.horizontal == 0.5f) element.rect.y -= element.padding.bottom; 24 | element.calcRenderPos(rect); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderText.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.AlphaBlendMode; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 5 | 6 | public class VC_RenderText extends VisualCommand 7 | { 8 | protected VC_RenderText() 9 | { 10 | super( 11 | params(String.class, float.class, float.class, float.class, int.class, boolean.class), 12 | params(String.class, float.class, float.class, float.class, int.class, boolean.class, AlphaBlendMode.class)); 13 | } 14 | 15 | @Override 16 | public void execute(Object... args) 17 | { 18 | int index = matchParams(args); 19 | if (index != -1) castArgs(index, args); 20 | switch (index) 21 | { 22 | case 0 -> 23 | { 24 | RenderUtils.renderText((String)args[0], (float)args[1], (float)args[2], (float)args[3], (int)args[4], (boolean)args[5]); 25 | } 26 | case 1 -> 27 | { 28 | RenderUtils.renderText((String)args[0], (float)args[1], (float)args[2], (float)args[3], (int)args[4], (boolean)args[5], (AlphaBlendMode)args[6]); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/reflection/FieldUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.reflection; 2 | 3 | import java.lang.reflect.Field; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | public final class FieldUtils 8 | { 9 | public static Field getFieldByNameIncludingSuperclasses(Class clazz, String fieldName) throws NoSuchFieldException 10 | { 11 | List fields = getAllFieldsIncludingSuperclasses(clazz); 12 | for (Field field : fields) 13 | if (field.getName().equals(fieldName)) 14 | return field; 15 | throw new NoSuchFieldException("Cannot find " + fieldName + " from " + clazz.getName() + " including its superclasses."); 16 | } 17 | 18 | public static List getAllFieldsIncludingSuperclasses(Class clazz) 19 | { 20 | List fields = new ArrayList<>(); 21 | Class current = clazz; 22 | while (current != null && current != Object.class) 23 | { 24 | Field[] declaredFields = current.getDeclaredFields(); 25 | for (Field field : declaredFields) 26 | { 27 | field.setAccessible(true); 28 | fields.add(field); 29 | } 30 | current = current.getSuperclass(); 31 | } 32 | return fields; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/op/MaskStartOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Rect; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 5 | import com.tttsaurus.ingameinfo.common.core.render.RenderMask; 6 | 7 | public class MaskStartOp implements IRenderOp 8 | { 9 | public boolean rounded; 10 | public Rect rect; 11 | public float cornerRadius; 12 | 13 | public MaskStartOp(Rect rect) 14 | { 15 | this.rect = rect; 16 | rounded = false; 17 | } 18 | public MaskStartOp(Rect rect, float cornerRadius) 19 | { 20 | this.rect = rect; 21 | this.cornerRadius = cornerRadius; 22 | rounded = true; 23 | } 24 | 25 | @Override 26 | public void execute(RenderContext context) 27 | { 28 | RenderMask mask; 29 | if (rounded) 30 | { 31 | mask = new RenderMask(RenderMask.MaskShape.ROUNDED_RECT); 32 | mask.setRoundedRectMask(rect.x, rect.y, rect.width, rect.height, cornerRadius); 33 | } 34 | else 35 | { 36 | mask = new RenderMask(RenderMask.MaskShape.RECT); 37 | mask.setRectMask(rect.x, rect.y, rect.width, rect.height); 38 | } 39 | 40 | mask.startMasking(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 tttsaurus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------- 24 | 25 | This project includes third-party libraries: 26 | 27 | - [Configurate](https://github.com/SpongePowered/Configurate) (Apache License 2.0) 28 | See THIRD-PARTY-LICENSES/Configurate/LICENSE.txt for details. 29 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderGradientRect.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.AlphaBlendMode; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 5 | 6 | public class VC_RenderGradientRect extends VisualCommand 7 | { 8 | protected VC_RenderGradientRect() 9 | { 10 | super( 11 | params(float.class, float.class, float.class, float.class, int.class, int.class), 12 | params(float.class, float.class, float.class, float.class, int.class, int.class, AlphaBlendMode.class)); 13 | } 14 | 15 | @Override 16 | public void execute(Object... args) 17 | { 18 | int index = matchParams(args); 19 | if (index != -1) castArgs(index, args); 20 | switch (index) 21 | { 22 | case 0 -> 23 | { 24 | RenderUtils.renderGradientRect((float)args[0], (float)args[1], (float)args[2], (float)args[3], (int)args[4], (int)args[4]); 25 | } 26 | case 1 -> 27 | { 28 | RenderUtils.renderGradientRect((float)args[0], (float)args[1], (float)args[2], (float)args[3], (int)args[4], (int)args[4], (AlphaBlendMode)args[5]); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/mvvm/binding/ReactiveObject.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.mvvm.binding; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_1Param; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | public abstract class ReactiveObject 8 | { 9 | protected final List initiativeCallbacks = new ArrayList<>(); 10 | protected final List passiveCallbacks = new ArrayList<>(); 11 | 12 | private T value; 13 | public final T get() 14 | { 15 | return value; 16 | } 17 | 18 | @SuppressWarnings("all") 19 | public final void addListener(IAction_1Param action) 20 | { 21 | passiveCallbacks.add((value) -> 22 | { 23 | T v = (T)value; 24 | action.invoke(v); 25 | }); 26 | } 27 | 28 | // to view 29 | @SuppressWarnings("all") 30 | public final void set(Object value) 31 | { 32 | this.value = (T)value; 33 | for (IReactiveCallback callback: initiativeCallbacks) callback.invoke(this.value); 34 | } 35 | // from view 36 | @SuppressWarnings("all") 37 | protected final void setInternal(Object value) 38 | { 39 | this.value = (T)value; 40 | for (IReactiveCallback callback: passiveCallbacks) callback.invoke(this.value); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderRectOutline.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.AlphaBlendMode; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 5 | 6 | public class VC_RenderRectOutline extends VisualCommand 7 | { 8 | protected VC_RenderRectOutline() 9 | { 10 | super( 11 | params(float.class, float.class, float.class, float.class, float.class, int.class), 12 | params(float.class, float.class, float.class, float.class, float.class, int.class, AlphaBlendMode.class)); 13 | } 14 | 15 | @Override 16 | public void execute(Object... args) 17 | { 18 | int index = matchParams(args); 19 | if (index != -1) castArgs(index, args); 20 | switch (index) 21 | { 22 | case 0 -> 23 | { 24 | RenderUtils.renderRectOutline((float)args[0], (float)args[1], (float)args[2], (float)args[3], (float)args[4], (int)args[4]); 25 | } 26 | case 1 -> 27 | { 28 | RenderUtils.renderRectOutline((float)args[0], (float)args[1], (float)args[2], (float)args[3], (float)args[4], (int)args[4], (AlphaBlendMode)args[5]); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/serialization/PaddingDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.serialization; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Padding; 4 | import com.tttsaurus.ingameinfo.common.core.serialization.IDeserializer; 5 | import com.tttsaurus.ingameinfo.common.core.serialization.json.RawJsonUtils; 6 | 7 | public class PaddingDeserializer implements IDeserializer 8 | { 9 | @Override 10 | public Padding deserialize(String raw) 11 | { 12 | String top = RawJsonUtils.extractValue(raw, "top"); 13 | String bottom = RawJsonUtils.extractValue(raw, "bottom"); 14 | String left = RawJsonUtils.extractValue(raw, "left"); 15 | String right = RawJsonUtils.extractValue(raw, "right"); 16 | Padding padding = new Padding(0, 0, 0, 0); 17 | 18 | if (!top.isEmpty()) 19 | try { padding.top = Float.parseFloat(top); } catch (Exception ignored) { } 20 | if (!bottom.isEmpty()) 21 | try { padding.bottom = Float.parseFloat(bottom); } catch (Exception ignored) { } 22 | if (!left.isEmpty()) 23 | try { padding.left = Float.parseFloat(left); } catch (Exception ignored) { } 24 | if (!right.isEmpty()) 25 | try { padding.right = Float.parseFloat(right); } catch (Exception ignored) { } 26 | return padding; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/mixin/early/GlStateManagerMixin.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.mixin.early; 2 | 3 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 5 | import com.tttsaurus.ingameinfo.common.core.render.RenderHints; 6 | import net.minecraft.client.renderer.GlStateManager; 7 | import org.lwjgl.opengl.GL11; 8 | import org.lwjgl.opengl.GL32; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | 12 | @Mixin(GlStateManager.class) 13 | public class GlStateManagerMixin 14 | { 15 | @WrapOperation( 16 | method = "bindTexture", 17 | at = @At( 18 | value = "INVOKE", 19 | target = "Lorg/lwjgl/opengl/GL11;glBindTexture(II)V", 20 | remap = false 21 | )) 22 | private static void glBindTexture(int target, int texture, Operation original) 23 | { 24 | if (RenderHints.getHint_GlStateManager$BindTextureHint() == RenderHints.GlStateManager.BindTextureHint.TEXTURE_2D) 25 | original.call(target, texture); 26 | else if (RenderHints.getHint_GlStateManager$BindTextureHint() == RenderHints.GlStateManager.BindTextureHint.TEXTURE_2D_MULTISAMPLE) 27 | GL11.glBindTexture(GL32.GL_TEXTURE_2D_MULTISAMPLE, texture); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/op/DebugRectOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Rect; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 5 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 6 | import java.awt.*; 7 | 8 | public class DebugRectOp implements IRenderOp 9 | { 10 | public boolean isGroup; 11 | public Rect rect; 12 | public float pivotX, pivotY; 13 | 14 | public DebugRectOp(boolean isGroup, Rect rect, float pivotX, float pivotY) 15 | { 16 | this.isGroup = isGroup; 17 | this.rect = rect; 18 | this.pivotX = pivotX; 19 | this.pivotY = pivotY; 20 | } 21 | 22 | @Override 23 | public void execute(RenderContext context) 24 | { 25 | if (isGroup) 26 | { 27 | RenderUtils.renderRectOutline(rect.x, rect.y, rect.width, rect.height, 1.0f, (new Color(255, 194, 38, 77)).getRGB()); 28 | RenderUtils.renderRect(pivotX - 1, pivotY - 1, 3, 3, Color.GREEN.getRGB()); 29 | } 30 | else 31 | { 32 | RenderUtils.renderRectOutline(rect.x, rect.y, rect.width, rect.height, 1.0f, (new Color(241, 58, 30, 128)).getRGB()); 33 | RenderUtils.renderRect(pivotX - 1, pivotY - 1, 3, 3, Color.GREEN.getRGB()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/texture/Texture2D.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render.texture; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.GlResourceManager; 4 | import com.tttsaurus.ingameinfo.common.core.render.IGlDisposable; 5 | import org.lwjgl.opengl.GL11; 6 | 7 | public final class Texture2D implements ITexture2D, IGlDisposable 8 | { 9 | private int glTextureID; 10 | private final int width; 11 | private final int height; 12 | private boolean isGlRegistered; 13 | 14 | @Override 15 | public int getGlTextureID() { return glTextureID; } 16 | @Override 17 | public int getWidth() { return width; } 18 | @Override 19 | public int getHeight() { return height; } 20 | @Override 21 | public boolean isGlRegistered() { return isGlRegistered; } 22 | 23 | public Texture2D(int width, int height, int glTextureID) 24 | { 25 | this.width = width; 26 | this.height = height; 27 | this.glTextureID = glTextureID; 28 | isGlRegistered = true; 29 | } 30 | 31 | @Override 32 | public void dispose() 33 | { 34 | if (glTextureID != 0) 35 | if (GL11.glIsTexture(glTextureID)) 36 | GL11.glDeleteTextures(glTextureID); 37 | glTextureID = 0; 38 | isGlRegistered = false; 39 | GlResourceManager.removeDisposable(this); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/InGameInfoRebornCoremod.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo; 2 | 3 | import net.minecraftforge.common.ForgeVersion; 4 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 5 | import org.jetbrains.annotations.Nullable; 6 | import zone.rong.mixinbooter.IEarlyMixinLoader; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | @IFMLLoadingPlugin.Name(Tags.MODNAME + " Core") 12 | @IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion) 13 | public class InGameInfoRebornCoremod implements IFMLLoadingPlugin, IEarlyMixinLoader 14 | { 15 | @Override 16 | public String[] getASMTransformerClass() 17 | { 18 | return new String[0]; 19 | } 20 | 21 | @Override 22 | public String getModContainerClass() 23 | { 24 | return null; 25 | } 26 | 27 | @Override 28 | public @Nullable String getSetupClass() 29 | { 30 | return null; 31 | } 32 | 33 | @Override 34 | public void injectData(Map data) 35 | { 36 | 37 | } 38 | 39 | @Override 40 | public String getAccessTransformerClass() 41 | { 42 | return null; 43 | } 44 | 45 | @Override 46 | public List getMixinConfigs() 47 | { 48 | List list = new ArrayList<>(); 49 | 50 | list.add("mixins.ingameinfo.early.json"); 51 | 52 | return list; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderRoundedRect.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.AlphaBlendMode; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 5 | 6 | public class VC_RenderRoundedRect extends VisualCommand 7 | { 8 | protected VC_RenderRoundedRect() 9 | { 10 | super( 11 | params(float.class, float.class, float.class, float.class, float.class, int.class, boolean.class), 12 | params(float.class, float.class, float.class, float.class, float.class, int.class, boolean.class, AlphaBlendMode.class)); 13 | } 14 | 15 | @Override 16 | public void execute(Object... args) 17 | { 18 | int index = matchParams(args); 19 | if (index != -1) castArgs(index, args); 20 | switch (index) 21 | { 22 | case 0 -> 23 | { 24 | RenderUtils.renderRoundedRect((float)args[0], (float)args[1], (float)args[2], (float)args[3], (float)args[4], (int)args[5], (boolean)args[6]); 25 | } 26 | case 1 -> 27 | { 28 | RenderUtils.renderRoundedRect((float)args[0], (float)args[1], (float)args[2], (float)args[3], (float)args[4], (int)args[5], (boolean)args[6], (AlphaBlendMode)args[7]); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/screen/IgiDummyScreen.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.screen; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import java.io.IOException; 6 | 7 | public final class IgiDummyScreen extends GuiScreen 8 | { 9 | private IGuiScreenDrawScreen drawAction = null; 10 | private IGuiScreenKeyTyped typeAction = null; 11 | 12 | public void setDrawAction(IGuiScreenDrawScreen drawAction) { this.drawAction = drawAction; } 13 | public void setTypeAction(IGuiScreenKeyTyped typeAction) { this.typeAction = typeAction; } 14 | 15 | @Override 16 | protected void keyTyped(char typedChar, int keyCode) throws IOException 17 | { 18 | if (typeAction != null) typeAction.type(keyCode); 19 | } 20 | 21 | @Override 22 | public void initGui() 23 | { 24 | Minecraft.getMinecraft().mouseHelper.ungrabMouseCursor(); 25 | } 26 | 27 | @Override 28 | public void onGuiClosed() 29 | { 30 | Minecraft.getMinecraft().mouseHelper.grabMouseCursor(); 31 | Minecraft.getMinecraft().setIngameFocus(); 32 | } 33 | 34 | @Override 35 | public void drawScreen(int mouseX, int mouseY, float partialTicks) 36 | { 37 | if (drawAction != null) drawAction.draw(); 38 | } 39 | 40 | @Override 41 | public boolean doesGuiPauseGame() 42 | { 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/layout/Padding.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.layout; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.serialization.Deserializer; 4 | import com.tttsaurus.ingameinfo.common.impl.serialization.PaddingDeserializer; 5 | import java.util.Objects; 6 | 7 | @Deserializer(PaddingDeserializer.class) 8 | public class Padding 9 | { 10 | public float top; 11 | public float bottom; 12 | public float left; 13 | public float right; 14 | 15 | public Padding(float top, float bottom, float left, float right) 16 | { 17 | this.top = top; 18 | this.bottom = bottom; 19 | this.left = left; 20 | this.right = right; 21 | } 22 | 23 | public void set(float top, float bottom, float left, float right) 24 | { 25 | this.top = top; 26 | this.bottom = bottom; 27 | this.left = left; 28 | this.right = right; 29 | } 30 | 31 | @Override 32 | public boolean equals(Object o) 33 | { 34 | if (this == o) return true; 35 | if (!(o instanceof Padding padding)) return false; 36 | return Float.compare(top, padding.top) == 0 && Float.compare(bottom, padding.bottom) == 0 && Float.compare(left, padding.left) == 0 && Float.compare(right, padding.right) == 0; 37 | } 38 | 39 | @Override 40 | public int hashCode() 41 | { 42 | return Objects.hash(top, bottom, left, right); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/render/op/ImageOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Rect; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.op.IRenderOp; 5 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 6 | import com.tttsaurus.ingameinfo.common.core.render.RenderMask; 7 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 8 | import com.tttsaurus.ingameinfo.common.core.render.texture.ImagePrefab; 9 | 10 | public class ImageOp implements IRenderOp 11 | { 12 | public Rect rect; 13 | public ImagePrefab image; 14 | public boolean rounded; 15 | 16 | public ImageOp(Rect rect, ImagePrefab image, boolean rounded) 17 | { 18 | this.rect = rect; 19 | this.image = image; 20 | this.rounded = rounded; 21 | } 22 | 23 | @Override 24 | public void execute(RenderContext context) 25 | { 26 | if (image == null) return; 27 | 28 | if (rounded) 29 | { 30 | RenderMask mask = new RenderMask(RenderMask.MaskShape.ROUNDED_RECT); 31 | mask.setRoundedRectMask(rect.x, rect.y, rect.width, rect.height, context.theme.image.cornerRadius); 32 | mask.startMasking(); 33 | } 34 | 35 | RenderUtils.renderImagePrefab(rect.x, rect.y, rect.width, rect.height, image); 36 | 37 | if (rounded) 38 | RenderMask.endMasking(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/DefaultLifecycleHolder.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui; 2 | 3 | import com.tttsaurus.fluxloading.core.FluxLoadingAPI; 4 | import com.tttsaurus.ingameinfo.InGameInfoReborn; 5 | import com.tttsaurus.ingameinfo.common.core.gui.GuiLifecycleHolder; 6 | import com.tttsaurus.ingameinfo.common.core.input.IgiKeyboard; 7 | import com.tttsaurus.ingameinfo.common.core.input.IgiMouse; 8 | import com.tttsaurus.ingameinfo.common.core.input.InputFrameGenerator; 9 | 10 | public final class DefaultLifecycleHolder extends GuiLifecycleHolder 11 | { 12 | public static final String HOLDER_NAME = "official_igi_lifecycle_holder"; 13 | 14 | public DefaultLifecycleHolder() 15 | { 16 | super(HOLDER_NAME, new InputFrameGenerator(new IgiKeyboard(), new IgiMouse())); 17 | } 18 | 19 | private boolean init = false; 20 | 21 | @Override 22 | public void update() 23 | { 24 | if (getLifecycleProvider() == null) return; 25 | 26 | // fluxloading compat 27 | if (InGameInfoReborn.fluxloadingLoaded && FluxLoadingAPI.isActive()) 28 | { 29 | if (!init) 30 | { 31 | init = true; 32 | getLifecycleProvider().update(inputGen.generate()); 33 | } 34 | if (!FluxLoadingAPI.isDuringFadingOutPhase() && !FluxLoadingAPI.isFinishLoading()) return; 35 | } 36 | 37 | getLifecycleProvider().update(inputGen.generate()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderFormattedText.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.AlphaBlendMode; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 5 | import com.tttsaurus.ingameinfo.common.core.render.text.FormattedText; 6 | 7 | public class VC_RenderFormattedText extends VisualCommand 8 | { 9 | protected VC_RenderFormattedText() 10 | { 11 | super( 12 | params(FormattedText.class, float.class, float.class, float.class, int.class, boolean.class), 13 | params(FormattedText.class, float.class, float.class, float.class, int.class, boolean.class, AlphaBlendMode.class)); 14 | } 15 | 16 | @Override 17 | public void execute(Object... args) 18 | { 19 | int index = matchParams(args); 20 | if (index != -1) castArgs(index, args); 21 | switch (index) 22 | { 23 | case 0 -> 24 | { 25 | RenderUtils.renderFormattedText((FormattedText)args[0], (float)args[1], (float)args[2], (float)args[3], (int)args[4], (boolean)args[5]); 26 | } 27 | case 1 -> 28 | { 29 | RenderUtils.renderFormattedText((FormattedText)args[0], (float)args[1], (float)args[2], (float)args[3], (int)args[4], (boolean)args[5], (AlphaBlendMode)args[6]); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/mixin/early/ForgeHooksClientMixin.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.mixin.early; 2 | 3 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 5 | import com.tttsaurus.ingameinfo.common.core.IgiRuntimeLocator; 6 | import com.tttsaurus.ingameinfo.common.core.gui.screen.IGuiScreenDrawScreen; 7 | import net.minecraft.client.gui.GuiScreen; 8 | import net.minecraftforge.client.ForgeHooksClient; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | 12 | @Mixin(ForgeHooksClient.class) 13 | public class ForgeHooksClientMixin 14 | { 15 | @WrapOperation( 16 | method = "drawScreen", 17 | at = @At( 18 | value = "INVOKE", 19 | target = "Lnet/minecraft/client/gui/GuiScreen;drawScreen(IIF)V", 20 | remap = true 21 | ), 22 | remap = false) 23 | private static void drawScreen(GuiScreen instance, int j, int i, float mouseX, Operation original) 24 | { 25 | original.call(instance, j, i, mouseX); 26 | 27 | if (IgiRuntimeLocator.get() == null) return; 28 | if (IgiRuntimeLocator.get().livePhase.isOccupyingScreen()) 29 | { 30 | for (IGuiScreenDrawScreen delegate: IgiRuntimeLocator.get().livePhase.collectDrawScreenDelegatesIfScreenOccupied()) 31 | delegate.draw(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/render/decorator/visual/command/VC_RenderRoundedRectOutline.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.render.AlphaBlendMode; 4 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 5 | 6 | public class VC_RenderRoundedRectOutline extends VisualCommand 7 | { 8 | protected VC_RenderRoundedRectOutline() 9 | { 10 | super( 11 | params(float.class, float.class, float.class, float.class, float.class, float.class, int.class, boolean.class), 12 | params(float.class, float.class, float.class, float.class, float.class, float.class, int.class, boolean.class, AlphaBlendMode.class)); 13 | } 14 | 15 | @Override 16 | public void execute(Object... args) 17 | { 18 | int index = matchParams(args); 19 | if (index != -1) castArgs(index, args); 20 | switch (index) 21 | { 22 | case 0 -> 23 | { 24 | RenderUtils.renderRoundedRectOutline((float)args[0], (float)args[1], (float)args[2], (float)args[3], (float)args[4], (float)args[5], (int)args[6], (boolean)args[7]); 25 | } 26 | case 1 -> 27 | { 28 | RenderUtils.renderRoundedRectOutline((float)args[0], (float)args[1], (float)args[2], (float)args[3], (float)args[4], (float)args[5], (int)args[6], (boolean)args[7], (AlphaBlendMode)args[8]); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/control/ProgressBar.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.control; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.control.Sized; 4 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 5 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.CallbackInfo; 6 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.StyleProperty; 7 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderOpQueue; 8 | import com.tttsaurus.ingameinfo.common.impl.gui.render.op.ProgressBarOp; 9 | 10 | @RegisterElement 11 | public class ProgressBar extends Sized 12 | { 13 | @StyleProperty 14 | public int fillerColor; 15 | 16 | @StyleProperty 17 | public int backgroundColor; 18 | 19 | @StyleProperty 20 | public int outlineColor; 21 | 22 | public void percentageValidation(float value, CallbackInfo callbackInfo) 23 | { 24 | if (value < 0f) { percentage = 0f; callbackInfo.cancel = true; } 25 | else if (value > 1f) { percentage = 1f; callbackInfo.cancel = true; } 26 | } 27 | @StyleProperty(setterCallbackPre = "percentageValidation") 28 | public float percentage = 0f; 29 | 30 | @Override 31 | public void onRenderUpdate(RenderOpQueue queue, boolean focused) 32 | { 33 | super.onRenderUpdate(queue, focused); 34 | if (rect.width == 0 || rect.height == 0) return; 35 | queue.enqueue(new ProgressBarOp(rect, percentage, backgroundColor, fillerColor, outlineColor)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/deprecated/mesh2d/RectMesh.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.deprecated.mesh2d; 2 | 3 | import com.tttsaurus.ingameinfo.deprecated.ScaledRes2NdcUtils; 4 | import com.tttsaurus.ingameinfo.deprecated.Mesh; 5 | 6 | public class RectMesh extends Mesh 7 | { 8 | public RectMesh() 9 | { 10 | super(new float[8 * 4], new int[6]); 11 | } 12 | 13 | // under minecraft's scaled resolution coordinate system 14 | public void update(float x, float y, float width, float height) 15 | { 16 | float[] vertices = new float[] 17 | { 18 | // positions // texcoords // normals 19 | ScaledRes2NdcUtils.toNdcX(x), ScaledRes2NdcUtils.toNdcY(y), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, // bottom-left 20 | ScaledRes2NdcUtils.toNdcX(x + width), ScaledRes2NdcUtils.toNdcY(y), 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, // bottom-right 21 | ScaledRes2NdcUtils.toNdcX(x + width), ScaledRes2NdcUtils.toNdcY(y + height), 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, // top-right 22 | ScaledRes2NdcUtils.toNdcX(x), ScaledRes2NdcUtils.toNdcY(y + height), 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f // top-left 23 | }; 24 | int[] indices = new int[] 25 | { 26 | 0, 2, 1, 27 | 0, 3, 2 28 | }; 29 | 30 | updateVerticesByBufferSubData(vertices); 31 | updateIndicesByBufferSubData(indices); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/render/op/UrlImageOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Rect; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.op.IRenderOp; 5 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 6 | import com.tttsaurus.ingameinfo.common.core.render.RenderMask; 7 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 8 | import com.tttsaurus.ingameinfo.common.core.render.texture.Texture2D; 9 | 10 | public class UrlImageOp implements IRenderOp 11 | { 12 | public Rect rect; 13 | public Texture2D texture; 14 | public boolean rounded; 15 | 16 | public UrlImageOp(Rect rect, Texture2D texture, boolean rounded) 17 | { 18 | this.rect = rect; 19 | this.texture = texture; 20 | this.rounded = rounded; 21 | } 22 | 23 | @Override 24 | public void execute(RenderContext context) 25 | { 26 | if (texture == null) return; 27 | if (!texture.isGlRegistered()) return; 28 | 29 | if (rounded) 30 | { 31 | RenderMask mask = new RenderMask(RenderMask.MaskShape.ROUNDED_RECT); 32 | mask.setRoundedRectMask(rect.x, rect.y, rect.width, rect.height, context.theme.urlImage.cornerRadius); 33 | mask.startMasking(); 34 | } 35 | 36 | RenderUtils.renderTexture2D(rect.x, rect.y, rect.width, rect.height, texture.getGlTextureID()); 37 | 38 | if (rounded) 39 | RenderMask.endMasking(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/network/tps/RespondTpsMsptPacket.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.network.tps; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction_2Param; 4 | import io.netty.buffer.ByteBuf; 5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 7 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 8 | 9 | public class RespondTpsMsptPacket implements IMessage 10 | { 11 | public static IAction_2Param callback; 12 | 13 | private int tps; 14 | private double mspt; 15 | 16 | public RespondTpsMsptPacket() { } 17 | 18 | public RespondTpsMsptPacket(int tps, double mspt) 19 | { 20 | this.tps = tps; 21 | this.mspt = mspt; 22 | } 23 | 24 | @Override 25 | public void fromBytes(ByteBuf buf) 26 | { 27 | tps = buf.readInt(); 28 | mspt = buf.readDouble(); 29 | } 30 | 31 | @Override 32 | public void toBytes(ByteBuf buf) 33 | { 34 | buf.writeInt(tps); 35 | buf.writeDouble(mspt); 36 | } 37 | 38 | public static class Handler implements IMessageHandler 39 | { 40 | @Override 41 | public IMessage onMessage(RespondTpsMsptPacket message, MessageContext ctx) 42 | { 43 | if (!ctx.side.isClient()) return null; 44 | 45 | callback.invoke(message.tps, message.mspt); 46 | 47 | return null; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/types/PivotWrapper.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl.types; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Pivot; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenProperty; 7 | 8 | @ZenRegister 9 | @ZenClass("mods.ingameinfo.layout.Pivot") 10 | public final class PivotWrapper 11 | { 12 | public final Pivot pivot; 13 | public PivotWrapper(Pivot pivot) 14 | { 15 | this.pivot = pivot; 16 | } 17 | 18 | @ZenProperty 19 | public static final PivotWrapper TOP_LEFT = new PivotWrapper(Pivot.TOP_LEFT); 20 | 21 | @ZenProperty 22 | public static final PivotWrapper TOP_CENTER = new PivotWrapper(Pivot.TOP_CENTER); 23 | 24 | @ZenProperty 25 | public static final PivotWrapper TOP_RIGHT = new PivotWrapper(Pivot.TOP_RIGHT); 26 | 27 | @ZenProperty 28 | public static final PivotWrapper CENTER_LEFT = new PivotWrapper(Pivot.CENTER_LEFT); 29 | 30 | @ZenProperty 31 | public static final PivotWrapper CENTER = new PivotWrapper(Pivot.CENTER); 32 | 33 | @ZenProperty 34 | public static final PivotWrapper CENTER_RIGHT = new PivotWrapper(Pivot.CENTER_RIGHT); 35 | 36 | @ZenProperty 37 | public static final PivotWrapper BOTTOM_LEFT = new PivotWrapper(Pivot.BOTTOM_LEFT); 38 | 39 | @ZenProperty 40 | public static final PivotWrapper BOTTOM_CENTER = new PivotWrapper(Pivot.BOTTOM_CENTER); 41 | 42 | @ZenProperty 43 | public static final PivotWrapper BOTTOM_RIGHT = new PivotWrapper(Pivot.BOTTOM_RIGHT); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/gui/control/Interactable.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.gui.control; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.event.UIEvent; 4 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 5 | import com.tttsaurus.ingameinfo.common.core.input.InputState; 6 | 7 | @RegisterElement(constructable = false) 8 | public abstract class Interactable extends Sized 9 | { 10 | protected boolean hover = false; 11 | protected boolean hold = false; 12 | 13 | @Override 14 | public void onPropagateInput(InputState inputState) 15 | { 16 | super.onPropagateInput(inputState); 17 | 18 | if (rect.contains(inputState.posX, inputState.posY)) 19 | { 20 | inputState.consume(); 21 | if (!hover) 22 | { 23 | hover = true; 24 | fireEvent(new UIEvent.MouseEnter(inputState, this)); 25 | } 26 | if (inputState.leftDown) 27 | { 28 | if (!hold) 29 | { 30 | hold = true; 31 | fireEvent(new UIEvent.MousePress(inputState, this)); 32 | } 33 | } 34 | else if (hold) 35 | { 36 | hover = false; 37 | hold = false; 38 | fireEvent(new UIEvent.MouseRelease(inputState, this)); 39 | } 40 | } 41 | else if (hover) 42 | { 43 | hover = false; 44 | hold = false; 45 | fireEvent(new UIEvent.MouseLeave(inputState, this)); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/input/IgiKeyboard.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.input; 2 | 3 | import org.lwjgl.input.Keyboard; 4 | import java.util.HashSet; 5 | import java.util.Set; 6 | 7 | public class IgiKeyboard implements IKeyboard 8 | { 9 | private final Set heldKeys = new HashSet<>(); 10 | private final Set pressedKeys = new HashSet<>(); 11 | private final Set leftKeys = new HashSet<>(); 12 | 13 | @Override 14 | public Set getHeldKeys() { return heldKeys; } 15 | 16 | @Override 17 | public Set getPressedKeys() { return pressedKeys; } 18 | 19 | @Override 20 | public Set getLeftKeys() { return leftKeys; } 21 | 22 | public void updateInput() 23 | { 24 | Set copy = new HashSet<>(heldKeys); 25 | heldKeys.clear(); 26 | pressedKeys.clear(); 27 | leftKeys.clear(); 28 | for (int key = 1; key <= 223; key++) 29 | { 30 | boolean down = Keyboard.isKeyDown(key); 31 | if (down) 32 | heldKeys.add(key); 33 | if (!copy.contains(key) && down) 34 | pressedKeys.add(key); 35 | if (copy.contains(key) && !down) 36 | leftKeys.add(key); 37 | } 38 | } 39 | 40 | public boolean keyPress(Key key) 41 | { 42 | return pressedKeys.contains(key.keycode); 43 | } 44 | 45 | public boolean keyLeave(Key key) 46 | { 47 | return leftKeys.contains(key.keycode); 48 | } 49 | 50 | public boolean keyDown(Key key) 51 | { 52 | return heldKeys.contains(key.keycode); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/commonutils/RlReaderUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.commonutils; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.resources.IResource; 5 | import net.minecraft.util.ResourceLocation; 6 | import javax.annotation.Nonnull; 7 | import java.io.BufferedReader; 8 | import java.io.InputStream; 9 | import java.io.InputStreamReader; 10 | 11 | public final class RlReaderUtils 12 | { 13 | // notice: ResourceLocation only supports lower case 14 | @Nonnull 15 | public static String read(String rl, boolean keepNewLineSymbol) 16 | { 17 | return read(new ResourceLocation(rl), keepNewLineSymbol); 18 | } 19 | 20 | @Nonnull 21 | public static String read(ResourceLocation rl, boolean keepNewLineSymbol) 22 | { 23 | InputStream stream = null; 24 | try 25 | { 26 | IResource resource = Minecraft.getMinecraft().getResourceManager().getResource(rl); 27 | stream = resource.getInputStream(); 28 | } 29 | catch (Exception ignored) { return ""; } 30 | try 31 | { 32 | BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); 33 | StringBuilder builder = new StringBuilder(); 34 | String line; 35 | while ((line = reader.readLine()) != null) 36 | { 37 | builder.append(line); 38 | if (keepNewLineSymbol) 39 | builder.append("\n"); 40 | } 41 | reader.close(); 42 | return builder.toString(); 43 | } 44 | catch (Exception ignored) { return ""; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/commonutils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.commonutils; 2 | 3 | import java.io.File; 4 | import java.io.RandomAccessFile; 5 | 6 | public final class FileUtils 7 | { 8 | private static final String parentPath = "config/ingameinfo/"; 9 | 10 | private static File makeDir(String path) 11 | { 12 | File directory = new File(parentPath + path); 13 | if (!directory.exists()) directory.mkdirs(); 14 | return directory; 15 | } 16 | 17 | public static File makeDir(String... dir) 18 | { 19 | if (dir.length == 0) 20 | return makeDir(""); 21 | else 22 | return makeDir(String.join("/", dir)); 23 | } 24 | 25 | public static File makeFile(String fileName, String... dir) 26 | { 27 | makeDir(dir); 28 | 29 | String filePath; 30 | if (dir.length == 0) 31 | filePath = parentPath + fileName; 32 | else 33 | filePath = parentPath + String.join("/", dir) + "/" + fileName; 34 | 35 | try 36 | { 37 | RandomAccessFile raf; 38 | raf = new RandomAccessFile(filePath, "rw"); 39 | raf.close(); 40 | } 41 | catch (Exception ignored) { } 42 | 43 | return new File(filePath); 44 | } 45 | 46 | public static File getFile(String fileName, String... dir) 47 | { 48 | makeDir(dir); 49 | 50 | String filePath; 51 | if (dir.length == 0) 52 | filePath = parentPath + fileName; 53 | else 54 | filePath = parentPath + String.join("/", dir) + "/" + fileName; 55 | 56 | return new File(filePath); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/IgiRuntimeEntryPoint.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.forgeevent.IgiRuntimeEntryPointEvent; 4 | import com.tttsaurus.ingameinfo.common.core.mvvm.registry.MvvmRegistry; 5 | import com.tttsaurus.ingameinfo.common.impl.appcommunication.spotify.SpotifyViewModel; 6 | import com.tttsaurus.ingameinfo.common.impl.mvvm.TemplateViewModel; 7 | import com.tttsaurus.ingameinfo.config.IgiSpotifyIntegrationConfig; 8 | import com.tttsaurus.ingameinfo.plugin.crt.impl.CrtMvvm; 9 | import com.tttsaurus.ingameinfo.plugin.crt.impl.CrtViewModel; 10 | import net.minecraftforge.fml.common.eventhandler.EventPriority; 11 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 12 | 13 | public final class IgiRuntimeEntryPoint 14 | { 15 | @SubscribeEvent(priority = EventPriority.HIGHEST) 16 | public static void onIgiRuntimeEntryPoint(IgiRuntimeEntryPointEvent event) 17 | { 18 | MvvmRegistry mvvmRegistry = event.runtime.global.mvvmRegistry; 19 | for (String mvvm: CrtMvvm.mvvms) 20 | { 21 | mvvmRegistry.manualRegister(mvvm, CrtViewModel.class); 22 | CrtViewModel crtViewModel = (CrtViewModel)mvvmRegistry.newViewModel(mvvm); 23 | crtViewModel.runtimeMvvm = mvvm; 24 | mvvmRegistry.cacheIgiGuiContainer(mvvm, crtViewModel); 25 | } 26 | 27 | if (IgiSpotifyIntegrationConfig.ENABLE_SPOTIFY_INTEGRATION) 28 | event.runtime.initPhase 29 | .registerMvvm("spotify", SpotifyViewModel.class) 30 | .openGuiOnStartup("spotify"); 31 | 32 | event.runtime.initPhase.registerMvvm("template", TemplateViewModel.class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/animation/SmoothDampWrapper.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl.animation; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.animation.SmoothDamp; 4 | import crafttweaker.annotations.ZenRegister; 5 | import stanhebben.zenscript.annotations.ZenClass; 6 | import stanhebben.zenscript.annotations.ZenMethod; 7 | 8 | @ZenRegister 9 | @ZenClass("mods.ingameinfo.animation.SmoothDamp") 10 | public class SmoothDampWrapper 11 | { 12 | private final SmoothDamp smoothDamp; 13 | public SmoothDampWrapper(float from, float to, float smoothTime) 14 | { 15 | smoothDamp = new SmoothDamp(from, to, smoothTime); 16 | } 17 | public SmoothDampWrapper(float from, float to, float smoothTime, float maxSpeed) 18 | { 19 | smoothDamp = new SmoothDamp(from, to, smoothTime, maxSpeed); 20 | } 21 | 22 | @ZenMethod("new") 23 | public static SmoothDampWrapper newSmoothDamp(float from, float to, float smoothTime) 24 | { 25 | return new SmoothDampWrapper(from, to, smoothTime); 26 | } 27 | @ZenMethod("new") 28 | public static SmoothDampWrapper newSmoothDamp(float from, float to, float smoothTime, float maxSpeed) 29 | { 30 | return new SmoothDampWrapper(from, to, smoothTime, maxSpeed); 31 | } 32 | 33 | @ZenMethod 34 | public float getFrom() { return smoothDamp.getFrom(); } 35 | @ZenMethod 36 | public void setFrom(float value) { smoothDamp.setFrom(value); } 37 | @ZenMethod 38 | public float getTo() { return smoothDamp.getTo(); } 39 | @ZenMethod 40 | public void setTo(float value) { smoothDamp.setTo(value); } 41 | @ZenMethod 42 | public float evaluate(float deltaTime) { return smoothDamp.evaluate(deltaTime);} 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/layout/DraggableContainerGroup.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.layout; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.Element; 4 | import com.tttsaurus.ingameinfo.common.core.gui.layout.Rect; 5 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 6 | 7 | @RegisterElement 8 | public class DraggableContainerGroup extends SizedGroup 9 | { 10 | @Override 11 | public void calcRenderPos(Rect contextRect) 12 | { 13 | super.calcRenderPos(contextRect); 14 | for (Element element: elements) 15 | { 16 | if (element instanceof DraggableGroup draggableGroup) 17 | { 18 | element.resetRenderInfo(); 19 | if (draggableGroup.restrictiveDragging) 20 | { 21 | if (draggableGroup.overrideX < rect.x) 22 | draggableGroup.overrideX = rect.x; 23 | if (draggableGroup.overrideY < rect.y) 24 | draggableGroup.overrideY = rect.y; 25 | if (draggableGroup.overrideX + draggableGroup.rect.width > rect.x + rect.width) 26 | draggableGroup.overrideX = rect.x + rect.width - draggableGroup.rect.width; 27 | if (draggableGroup.overrideY + draggableGroup.rect.height > rect.y + rect.height) 28 | draggableGroup.overrideY = rect.y + rect.height - draggableGroup.rect.height; 29 | } 30 | element.rect.x = draggableGroup.overrideX; 31 | element.rect.y = draggableGroup.overrideY; 32 | element.calcWidthHeight(); 33 | element.calcRenderPos(rect); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/igievent/EventCenter.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.impl.igievent.modcompat.*; 4 | 5 | public final class EventCenter 6 | { 7 | // vanilla 8 | public final static IgiGuiFpsEvent igiGuiFpsEvent = new IgiGuiFpsEvent(); 9 | public final static IgiGuiFboRefreshRateEvent igiGuiFboRefreshRateEvent = new IgiGuiFboRefreshRateEvent(); 10 | public final static GameFpsEvent gameFpsEvent = new GameFpsEvent(); 11 | public final static GameMemoryEvent gameMemoryEvent = new GameMemoryEvent(); 12 | public final static GameTpsMsptEvent gameTpsMsptEvent = new GameTpsMsptEvent(); 13 | public final static EnterBiomeEvent enterBiomeEvent = new EnterBiomeEvent(); 14 | 15 | // spotify 16 | public final static SpotifyOverlayEvent spotifyOverlayEvent = new SpotifyOverlayEvent(); 17 | public final static SpotifyOverlayEditEvent spotifyOverlayEditEvent = new SpotifyOverlayEditEvent(); 18 | 19 | // 20 | public final static BloodMagicEvent bloodMagicEvent = new BloodMagicEvent(); 21 | public final static SereneSeasonsEvent sereneSeasonsEvent = new SereneSeasonsEvent(); 22 | public final static ThaumcraftEvent thaumcraftEvent = new ThaumcraftEvent(); 23 | public final static RfToolsDimEvent rftoolsdimEvent = new RfToolsDimEvent(); 24 | public final static DeepResonanceEvent deepresonanceEvent = new DeepResonanceEvent(); 25 | public final static ToughAsNailsEvent toughasnailsEvent = new ToughAsNailsEvent(); 26 | public final static SimpleDifficultyEvent simpledifficultyEvent = new SimpleDifficultyEvent(); 27 | 28 | public static void triggerModCompatEvents() 29 | { 30 | Helper.triggerModCompatEvents(); 31 | } 32 | // 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/control/Image.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.control; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.GuiResources; 4 | import com.tttsaurus.ingameinfo.common.core.gui.control.Sized; 5 | import com.tttsaurus.ingameinfo.common.core.gui.registry.RegisterElement; 6 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.CallbackInfo; 7 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.StyleProperty; 8 | import com.tttsaurus.ingameinfo.common.core.gui.property.style.StylePropertyCallback; 9 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderOpQueue; 10 | import com.tttsaurus.ingameinfo.common.core.render.texture.ImagePrefab; 11 | import com.tttsaurus.ingameinfo.common.impl.gui.render.op.ImageOp; 12 | import net.minecraft.util.ResourceLocation; 13 | 14 | @RegisterElement 15 | public class Image extends Sized 16 | { 17 | private ImagePrefab image = null; 18 | 19 | @StyleProperty 20 | public boolean rounded; 21 | 22 | @StylePropertyCallback 23 | public void rlValidation(String value, CallbackInfo callbackInfo) 24 | { 25 | if (value == null) callbackInfo.cancel = true; 26 | } 27 | @StylePropertyCallback 28 | public void setRlCallback() 29 | { 30 | if (GuiResources.exists(rl)) 31 | image = GuiResources.get(rl); 32 | else 33 | image = GuiResources.tryRegisterTexture(new ResourceLocation(rl)); 34 | } 35 | @StyleProperty(setterCallbackPost = "setRlCallback", setterCallbackPre = "rlValidation") 36 | public String rl; 37 | 38 | @Override 39 | public void onRenderUpdate(RenderOpQueue queue, boolean focused) 40 | { 41 | super.onRenderUpdate(queue, focused); 42 | queue.enqueue(new ImageOp(rect, image, rounded)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/gui/render/op/AnimTextOp.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.gui.render.op; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.animation.text.CharInfo; 4 | import com.tttsaurus.ingameinfo.common.core.gui.property.lerp.LerpableProperty; 5 | import com.tttsaurus.ingameinfo.common.core.gui.render.op.IRenderOp; 6 | import com.tttsaurus.ingameinfo.common.core.gui.render.RenderContext; 7 | import com.tttsaurus.ingameinfo.common.core.gui.theme.ThemeConfig; 8 | import com.tttsaurus.ingameinfo.common.core.render.RenderUtils; 9 | 10 | public class AnimTextOp implements IRenderOp 11 | { 12 | public String text; 13 | public float x, y; 14 | public int color; 15 | public LerpableProperty charInfos; 16 | 17 | public AnimTextOp(String text, float x, float y, int color, LerpableProperty charInfos) 18 | { 19 | this.text = text; 20 | this.x = x; 21 | this.y = y; 22 | this.color = color; 23 | this.charInfos = charInfos; 24 | } 25 | 26 | public boolean overrideColor; 27 | 28 | @Override 29 | public void readTheme(ThemeConfig theme) 30 | { 31 | if (color == 0) 32 | { 33 | color = theme.animText.parsedColor; 34 | overrideColor = true; 35 | } 36 | } 37 | 38 | @Override 39 | public void execute(RenderContext context) 40 | { 41 | CharInfo[] charInfos1 = charInfos.lerp(context.lerpAlpha); 42 | for (int i = 0; i < Math.min(charInfos1.length, text.length()); i++) 43 | { 44 | String c = String.valueOf(text.charAt(i)); 45 | CharInfo info = charInfos1[i]; 46 | RenderUtils.renderText(c, x + info.x, y + info.y, info.scale, overrideColor ? color : info.color, info.shadow); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/igievent/EventBase.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.igievent; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.function.IAction; 4 | import com.tttsaurus.ingameinfo.common.core.function.IAction_1Param; 5 | import com.tttsaurus.ingameinfo.common.core.function.IAction_2Param; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | // supports 0~2 args as input 10 | @SuppressWarnings("all") 11 | public abstract class EventBase implements IEvent 12 | { 13 | private final List listeners = new ArrayList<>(); 14 | 15 | protected void addListenerInternal(IAction action) 16 | { 17 | listeners.add(action); 18 | } 19 | protected void addListenerInternal(IAction_1Param action) 20 | { 21 | listeners.add(action); 22 | } 23 | protected void addListenerInternal(IAction_2Param action) 24 | { 25 | listeners.add(action); 26 | } 27 | 28 | public void trigger(Object... args) 29 | { 30 | for (Object listener: listeners) 31 | { 32 | Class clazz = listener.getClass(); 33 | if (IAction.class.isAssignableFrom(clazz) && args.length == 0) 34 | { 35 | IAction action = (IAction)listener; 36 | action.invoke(); 37 | } 38 | else if (IAction_1Param.class.isAssignableFrom(clazz) && args.length == 1) 39 | { 40 | IAction_1Param action = (IAction_1Param)listener; 41 | action.invoke(args[0]); 42 | } 43 | else if (IAction_2Param.class.isAssignableFrom(clazz) && args.length == 2) 44 | { 45 | IAction_2Param action = (IAction_2Param)listener; 46 | action.invoke(args[0], args[1]); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/impl/network/common/RespondNbtPacket.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.impl.network.common; 2 | 3 | import com.tttsaurus.ingameinfo.common.impl.network.IgiNetwork; 4 | import io.netty.buffer.ByteBuf; 5 | import net.minecraft.nbt.NBTTagCompound; 6 | import net.minecraftforge.fml.common.network.ByteBufUtils; 7 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 8 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 9 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 10 | 11 | public class RespondNbtPacket implements IMessage 12 | { 13 | public static final String RESPONSE_KEY_PROTOCOL = "IgiNetResponseKey"; 14 | 15 | public static void attachRespondKeyToNbt(NBTTagCompound nbt, String key) 16 | { 17 | nbt.setString(RESPONSE_KEY_PROTOCOL, key); 18 | } 19 | 20 | private NBTTagCompound nbt; 21 | 22 | public RespondNbtPacket() { } 23 | 24 | public RespondNbtPacket(NBTTagCompound nbt) 25 | { 26 | this.nbt = nbt; 27 | } 28 | 29 | @Override 30 | public void fromBytes(ByteBuf buf) 31 | { 32 | nbt = ByteBufUtils.readTag(buf); 33 | } 34 | 35 | @Override 36 | public void toBytes(ByteBuf buf) 37 | { 38 | ByteBufUtils.writeTag(buf, nbt); 39 | } 40 | 41 | public static class Handler implements IMessageHandler 42 | { 43 | @Override 44 | public IMessage onMessage(RespondNbtPacket message, MessageContext ctx) 45 | { 46 | if (!ctx.side.isClient()) return null; 47 | 48 | if (message.nbt.hasKey(RESPONSE_KEY_PROTOCOL)) 49 | IgiNetwork.pushNbtResponse(message.nbt.getString(RESPONSE_KEY_PROTOCOL), message.nbt); 50 | 51 | return null; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/plugin/crt/impl/types/GhostableItemWrapper.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.plugin.crt.impl.types; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.commonutils.GhostableItem; 4 | import crafttweaker.annotations.ZenRegister; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import net.minecraft.item.ItemStack; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenMethod; 10 | 11 | @ZenRegister 12 | @ZenClass("mods.ingameinfo.item.GhostableItem") 13 | public final class GhostableItemWrapper 14 | { 15 | public final GhostableItem ghostableItem; 16 | 17 | public GhostableItemWrapper(GhostableItem ghostableItem) 18 | { 19 | this.ghostableItem = ghostableItem; 20 | } 21 | public GhostableItemWrapper(String registryName) 22 | { 23 | this.ghostableItem = new GhostableItem(registryName); 24 | } 25 | public GhostableItemWrapper(ItemStack itemStack) 26 | { 27 | this.ghostableItem = new GhostableItem(itemStack); 28 | } 29 | 30 | @ZenMethod("new") 31 | public static GhostableItemWrapper newGhostableItem(String registryName) 32 | { 33 | return new GhostableItemWrapper(registryName); 34 | } 35 | @ZenMethod("new") 36 | public static GhostableItemWrapper newGhostableItem(IItemStack itemStack) 37 | { 38 | return new GhostableItemWrapper(CraftTweakerMC.getItemStack(itemStack)); 39 | } 40 | 41 | @ZenMethod 42 | public boolean isItemNull() 43 | { 44 | return ghostableItem.getItemStack() == null; 45 | } 46 | @ZenMethod 47 | public IItemStack getItemStack() 48 | { 49 | if (isItemNull()) return null; 50 | return CraftTweakerMC.getIItemStack(ghostableItem.getItemStack()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/tttsaurus/ingameinfo/common/core/render/GlResourceManager.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.common.core.render; 2 | 3 | import org.apache.logging.log4j.Logger; 4 | import org.lwjgl.opengl.GL11; 5 | import java.util.List; 6 | import java.util.concurrent.CopyOnWriteArrayList; 7 | 8 | public final class GlResourceManager 9 | { 10 | private static final List disposables = new CopyOnWriteArrayList<>(); 11 | 12 | public static void addDisposable(IGlDisposable disposable) 13 | { 14 | disposables.add(disposable); 15 | } 16 | public static void removeDisposable(IGlDisposable disposable) 17 | { 18 | disposables.remove(disposable); 19 | } 20 | 21 | public static void disposeAll(Logger logger) 22 | { 23 | for (IGlDisposable disposable: disposables) 24 | { 25 | logger.info("Disposing " + disposable.getClass().getSimpleName()); 26 | disposable.dispose(); 27 | checkGLError(logger); 28 | } 29 | } 30 | 31 | private static void checkGLError(Logger logger) 32 | { 33 | int error; 34 | while ((error = GL11.glGetError()) != GL11.GL_NO_ERROR) 35 | logger.warn("OpenGL Error: " + getErrorString(error)); 36 | } 37 | 38 | private static String getErrorString(int error) 39 | { 40 | return switch (error) 41 | { 42 | case GL11.GL_INVALID_ENUM -> "GL_INVALID_ENUM"; 43 | case GL11.GL_INVALID_VALUE -> "GL_INVALID_VALUE"; 44 | case GL11.GL_INVALID_OPERATION -> "GL_INVALID_OPERATION"; 45 | case GL11.GL_STACK_OVERFLOW -> "GL_STACK_OVERFLOW"; 46 | case GL11.GL_STACK_UNDERFLOW -> "GL_STACK_UNDERFLOW"; 47 | case GL11.GL_OUT_OF_MEMORY -> "GL_OUT_OF_MEMORY"; 48 | default -> "Unknown Error (code: " + error + ")"; 49 | }; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src_demo/main/java/com/tttsaurus/ingameinfo/demo/eg1/Eg1View.java: -------------------------------------------------------------------------------- 1 | package com.tttsaurus.ingameinfo.demo.eg1; 2 | 3 | import com.tttsaurus.ingameinfo.common.core.gui.render.decorator.RenderDecorator; 4 | import com.tttsaurus.ingameinfo.common.core.gui.render.decorator.RenderOpPhase; 5 | import com.tttsaurus.ingameinfo.common.core.gui.render.decorator.visual.command.VisualCommandSet; 6 | import com.tttsaurus.ingameinfo.common.core.mvvm.view.View; 7 | import com.tttsaurus.ingameinfo.common.impl.gui.render.op.ButtonOp; 8 | 9 | public class Eg1View extends View 10 | { 11 | @Override 12 | public String getIxmlFileName() 13 | { 14 | return "eg1"; 15 | } 16 | 17 | @Override 18 | public String getDefaultIxml() 19 | { 20 | return """ 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |