Skip to content

Alluysl's Origins - Power-driven overlays

Compare
Choose a tag to compare
@Alluysl Alluysl released this 05 Jun 13:38

A pre-release update that makes overlay powers data-driven. You can now create your own overlay using the alluyslorigins:overlay power type (which supports conditions), with a few parameters (some parameters may have no effect if certain values are chosen for other parameters, especially the ones dealing with blending!):

  • "r"/"g"/"b"/"a" :: float → the filter color (defaults to 1 for each)
  • "up_ticks"/"down_ticks" :: int → how many ticks it takes for the overlay to appear/disappear (up_ticks defaults to 0, down_ticks defaults to up_ticks)
  • "texture" :: ID → the texture of the overlay (defaults to textures/misc/nausea.png)
  • "style" (planning to change to "preset"): "classic"/"classic_alpha"(planning to change to "alpha") → if you want a monochrome overlay and your texture is a transparency mask, choose classic, else you may want to choose classic alpha (their only difference is what default blending and ratio influence parameters they set)
    • "start_scale"/"scale" :: float → the scale of the overlay relative to the size of the screen (can be larger), respectively when fully hidden and fully shown (scale defaults to 1, start_scale defaults to scale)
  • Custom styles are not implemented yet, if I make them, they should give you more freedom over the placement of the overlay (as of now, it's centered on screen)
  • "blend_equation" → "add"/"subtract"/"reverse_subtract"/"min"/"max"/"no_blend" (defaults to additive blending in classic (won't change) and classic alpha modes (shouldn't change), and to no blending otherwise (may change)), aliases: https://github.com/Alluysl/alluysl-origins/blob/19b7bc74419d5bb40a52b9ecff09cd6c486bc18c/src/main/java/alluysl/alluyslorigins/power/OverlayPower.java#L54
  • "source_factor"/"destination_factor"/"source_alpha_factor"/"destination_alpha_factor" → https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml (the alpha factors default to the source factors, which default to one in classic mode, and respectively source_alpha and one_minus_source_alpha in classic alpha mode), aliases: https://github.com/Alluysl/alluysl-origins/blob/19b7bc74419d5bb40a52b9ecff09cd6c486bc18c/src/main/java/alluysl/alluyslorigins/power/OverlayPower.java#L65
  • "ratio_drives_color" :: boolean → whether the progress from fully hidden to fully shown should make the filter color darker (defaults to true in classic style and false otherwise)
  • "ratio_drives_alpha" :: boolean → whether the progress from fully hidden to fully shown should make the filter color more transparent (defaults to true in classic alpha style and false otherwise)

Example shown below.


IMPORTANT

The mod REQUIRES this specific version of Origins (and the Fabric API as well) and Pehkui 2.1.0 or over to function properly.

Don't hesitate to open an issue if you find any bug!

Example with the burrow overlay (made to work with the unfixed version of Origins 0.7.3, so some default values are set explicitly) which draws a brown overlay on screen:

{
	"type": "alluyslorigins:overlay",
	"r": 0.2,
	"g": 0.1,
	"b": 0.05,
	"up_ticks": 10,
	"down_ticks": 10,
	"start_scale": 2.0,
	"scale": 1.0,
	"ratio_drives_color": true,
	"ratio_drives_alpha": false,
	"condition": {
		"type": "origins:resource",
		"resource": "alluyslorigins:burrow_on",
		"comparison": "==",
		"compare_to": 1
	},
	"hidden": true
}