Skip to content

Conversation

@JXSnack
Copy link
Member

@JXSnack JXSnack commented Jun 23, 2025

The next Vera update. This update will contain various breaking changes. The reason we do not go to v2 is because I'd want to have a full rewrite for that as I'm not 100% happy with how Vera works at the moment, but I don't have the time to make it as I like it

Required

  • Reworked and more modular event system
  • New abstraction layer under VWidget
  • Styling system
  • Move all widgets to new styling system
  • Animation system
  • Layout system
  • Layout alignments
  • App hierarchy
  • Reworked dragging
  • Generalise events to Events class
  • Render cutoffs
  • Layout limits
  • Render quads
  • VRect with custom vertex positions VAbstractQuad, VColorQuad and VTextureQuad as quad with custom vertex positions and textures/colors, as a testing stone for the reworked rendering in a future update
  • New Logo

Everything strikethrough has been postponed to a later version, unless you want to implement it yourself. I'll be happy to accept your PRs
Potential:
- [ ] Render polygons
- [ ] Polygon hitboxes
- [ ] Render circles
- [ ] Circle hitboxes

Current Progress

  • Generic
    • Added a new logo
    • Added a Vera.renderCacheId to cache internal frame calculation
    • Removed Vera.forHoveredWidget and Vera.forHoveredWidgetIfEmpty
    • Added Vera.forVisibleAndAllowedApps to run code for all visible apps, unless they're in a hierarchy and not the top app
    • Added Vera.firstOf method to get the first element of an array that follows the rules of a predicate
    • New testing sytem
      • Now works through a client-side /vera command
      • /vera clear-tests -> resets all tests
      • /vera test <test>
        • generic -> the basic testing of all widgets
        • layout -> testing of basic layout
        • styles -> testing of styles & (mainly) animation system
    • Added a README.md
    • Added Geometry QOL class
      • isInBox to check whether a position is inside of a box
    • Added Once<T> QOL class
    • Reworked rendering to layers and no longer the FabricAPI HudRenderCallback
      • BELOW_VIGNETTE (lowest)
      • BELOW_OVERLAYS (renders below everything, even spyglass)
      • BELOW_HUD
      • HUD (renders on the same level as the HUD)
      • ABOVE_HUD (renders over the HUD and under the normal GUI)
      • GUI (renders on the same layer as the GUI, except if there is no app running that requires a mouse or a vanilla Screen is visible)
      • ABOVE_GUI
      • SCREEN (default)
      • TOP (highest, should only be used to 100% override something)
    • Added the Registrar, which will handle all "static" Vera registries (e.g. standard styles for widgets)
    • Reworked file dropping
    • MCVeraRenderer no longer has a getInstance method, now only accessible through Vera.renderer
    • The draw context is now gathered when the draw context itself initializes, not every frame
    • Added rgb(VColor) to the ColorModifier
    • Added all(int) to the ColorModifier
    • Added QOL VMouseButton enum
    • Added VeraApp#getWidgetsReversed
    • Added VeraApp#setSize
    • Renamed & removed methods to make more sense (in VeraApp)
      • getHoveredWidgets -> getTopWidgetAt
      • isMouseOverWidget -> isPointOverWidget
      • isMouseOverApp -> isPointOverThis
      • Removed getHoveredWidgets
    • Moved V4Int and V4Color into their own separate v4 package
    • VAlignmentFlag -> VHAlignmentFlag
  • Styling System
    • Removed all old methods relating to styling and replaced them with the new, more modular, styling system
    • Added StyleValueType
      • Types
        • STRING
        • IDENTIFIER
        • INT
        • V4INT
        • FLOAT
        • COLOR
        • V4COLOR
        • FONT
        • CURSOR
      • Easy converting of any object into an SVT including an optional bias
      • Added EaseContexts per SVT for modular easing support and general QOL
    • Added StyleState
      • 21 states with fallbacks and identifiers
        • DEFAULT
        • HOVERED
        • Click (Generic, Left, Middle, Right)
        • Dragging
          • LMB (Generic, Top, Bottom, Left, Right)
          • MMB (Generic, Top, Bottom, Left, Right)
          • RMB (Generic, Top, Bottom, Left, Right)
    • Added VStyleContainer
      • Handle maps of style parts (e.g. widgets/classes)
      • For each style part it handles individual style names
      • For each style name it handles its state and gets potential fallbacks
    • Added VStyleSheet
      • Manages 3 kinds of style containers
        • Widget-specific styles (like HTML IDs)
        • Classes (like CSS .classes)
        • Standard styles (like HTML <tags/>)
      • Performant getters and setters for all kinds of style-related things
      • Automatic unpacking of arrays[] to ease V4Color and V4Int
      • QOL modifyX methods
      • Merging sheets together
    • Added standard style handlers (+ handlers for each widget)
  • Animation System
    • Composites & Pipeline
      • Base abstract composite
        • Basic uniform generation
        • Style application context
        • Per-widget application
        • Per-style application
        • Composite cache ID
      • AnimationComposite
        • Calculates and applies animation styles
      • WindingComposite
        • Applies basic unwinding to styles
        • Applies basic rewinding to styles
        • Takes abstract unwind-rewind concepts into account
      • VeraPipeline
        • Per-app composite handling pipeline
        • Handles composite caching
        • Ensures correct composite order
    • Easings
      • Collection of all Vera default easings in Easings
      • Base abstract easing class
      • Linear Easing
      • Added ease method to VColor
    • Animation itself
      • VKeyframe (per-animation)
        • Ease-in easing
        • Transition time
        • Stay time
        • Keyframe builder
        • Correct style evaluation
      • VAnimation (per-app)
        • Unwind time
        • Automatic unwinding at end setting
        • Custom unwinding easing
        • Loop mode setting
        • Target setting in case of writing final style to element
        • Calculation of style affections for agressive caching
        • Calculation of the style itself for a given point in time with the option for a monotone end
        • Animation builder with easy functional-driven keyframe additions
      • VAnimationEngine (per-widget, accessible through VWidget#animations)
        • Activity memory
        • Unwind/rewind memory
        • Calculation of unwind/rewind offsets
        • Automatic looping/killing animations
        • Activation, unwind and rewind methods
        • QOL activateOrRewind method
        • animateStyle method to apply composites to calculated styles
    • The registrar handles standard styles
    • Events
      • Added VAnimationBeginEvent
      • Added VAnimationFinishEvent
      • Added VAnimationRewindEvent
      • Added VAnimationUnwindEvent
  • App Hierarchy
    • Added Vera.getTopHierarchyApp
    • Added Vera.isTopHierarchy
    • Added MCVeraData#asTopHierarchy to execute a method as the top hierarchy app (returns false if there is no top app)
    • Added MCVeraData#getTopHierarchy to get the top hierarchy app without an NPE
    • Added VeraApp#setRequiresHierarchy
    • Added VeraApp#isRequiresHierarchy
    • Added VeraApp#moveToHierarchyTop
  • Widget changes
    • Added new layer under VWidget: VElement
    • Events are now handled by the per-widget EventHandler
      • has a preprocessor (linked to VElement handleBuiltinEvent)
      • has a postprocessor (linked to VElement afterBuiltinEvent)
      • Events class now contains all events for quick access
    • Added afterBuiltinEvent method to VElement
    • Added getEffectiveWidth and getEffectiveHeight to VElement
    • Added VModifier interface to be the base for all other modifiers (adds getApp(), since they can't access the public app field)
    • Added HasFont interface for easy modifyFont methods with new styling system
    • Added HasPlaceholderFont for the same thing but with a placeholder font (used in VLineInput)
    • VPaddingWidget is now deprecated for removal
    • Significant changes to how all widgets work internally due to the new styling system
    • Significant changes to how all widgets render due to the new layout system
  • Shortcut changes
    • app is now public
    • transformOSX is now public
    • Shortcuts no longer require .alsoAdd to be added to an app
  • Layouts
    • Added basic VLayout abstract class
    • Alignments through VLayout#alignment and VLayoutAlignmentFlag
    • Added VHLayout horizontal layout class
    • Added VVLayout vertical layout class
  • Bugfixes
    • Fixed cursor staying the same shape after entering and leaving an element quickly
    • Fixed dragging stopping when moving the mouse too fast by reworking it entirely and confining it to the DragHandler
    • Fixed adding the same widget twice to an app

@JXSnack JXSnack self-assigned this Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants