diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-10-30 14:42:33 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-10-30 14:42:33 -0400 |
| commit | 754981501322727aec9e91a91008ce8f117bc728 (patch) | |
| tree | 76be57a54a17f2e58f7a9ef6b78f976a8862cef8 | |
| parent | f99d6fd7226233c1f2e47c0f5f38737a72861fc9 (diff) | |
pke: static-ui visibility disabled
| -rw-r--r-- | src/static-ui.cpp | 12 | ||||
| -rw-r--r-- | src/static-ui.hpp | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/static-ui.cpp b/src/static-ui.cpp index 25c2514..2682de1 100644 --- a/src/static-ui.cpp +++ b/src/static-ui.cpp @@ -28,6 +28,14 @@ const char *const ui_ux_mouse_left = "ui_ux_mouse_left"; const char *const ui_ux_mouse_right = "ui_ux_mouse_right"; const char *const ui_ux_mouse_middle = "ui_ux_mouse_middle"; +#ifndef PKE_UI_CLR_DISABLED_BORDER +#define PKE_UI_CLR_DISABLED_BORDER glm::vec4(0.6,0.6,0.6,1.0) +#endif + +#ifndef PKE_UI_CLR_DISABLED_BACKGROUND +#define PKE_UI_CLR_DISABLED_BACKGROUND glm::vec4(0.4,0.4,0.4,1.0) +#endif + TypeSafeInt_B(PKE_UI_BOX_TYPE); TypeSafeInt_B(PKE_UI_BOX_FLAG); TypeSafeInt_B(PKE_UI_BOX_STATE_FLAG); @@ -448,6 +456,10 @@ bool pke_ui_calc_px(pk_arr_t<pke_ui_box_instance_buffer_item> &buffer, pk_arr_t< tmp.pos_scale = glm::scale(tmp.pos_scale, scale); tmp.color_border = box->color_border; tmp.color_background = box->color_background; + if (PK_HAS_FLAG(box->flags, PKE_UI_BOX_FLAG_VISIBILITY_DISABLED)) { + tmp.color_border = PKE_UI_CLR_DISABLED_BORDER; + tmp.color_background = PKE_UI_CLR_DISABLED_BACKGROUND; + } tmp.px_scale.x = (1.0 / (float)Extent.width); tmp.px_scale.y = (1.0 / (float)Extent.height); tmp.depth = (float)box->layer; diff --git a/src/static-ui.hpp b/src/static-ui.hpp index eb26a45..ec99456 100644 --- a/src/static-ui.hpp +++ b/src/static-ui.hpp @@ -68,6 +68,8 @@ const PKE_UI_BOX_FLAG PKE_UI_BOX_FLAG_CENTER_BOTH // [07-09] visibility const PKE_UI_BOX_FLAG PKE_UI_BOX_FLAG_VISIBILITY_INVISIBLE = PKE_UI_BOX_FLAG((1 << 7)); +const PKE_UI_BOX_FLAG PKE_UI_BOX_FLAG_VISIBILITY_DISABLED + = PKE_UI_BOX_FLAG((1 << 8)); // [10-??] // PKE_UI_BOX_STATE_FLAG represent the current state THIS TICK. |
