fix menu rendering regression
authorhgn <hgodden00@gmail.com>
Fri, 6 Oct 2023 08:31:21 +0000 (09:31 +0100)
committerhgn <hgodden00@gmail.com>
Fri, 6 Oct 2023 08:31:21 +0000 (09:31 +0100)
blender_export.py
entity.h
menu.h
models_src/rs_menu.mdl

index 239bfd03afa2f394f50694b2336aec4d8fa6c6de..db6e97c517e6af71cd57ae2354e1c70fd507df13 100644 (file)
@@ -1328,7 +1328,7 @@ def sr_compile_menus( collection ):
                sr_compile_mesh_internal( obj )
       #}
 
-      if item.type == 1 or item.type == 2:#{
+      if item.type == 1 or item.type == 2 or item.type == 7:#{
          item_button = item._anonymous_union.button
          item_button.pstr = sr_compile_string( obj_data.string )
          item_button.stack_behaviour = int( obj_data.stack_behaviour )
@@ -3174,7 +3174,8 @@ class SR_OBJECT_ENT_MENU_ITEM(bpy.types.PropertyGroup):
                                         ('3','toggle', ''),
                                         ('4','slider',''),
                                         ('5','page',''),
-                                        ('6','binding','')])
+                                        ('6','binding',''),
+                                        ('7','visual(no colourize)','')])
 
    @staticmethod
    def sr_inspector( layout, data ):
@@ -3183,7 +3184,7 @@ class SR_OBJECT_ENT_MENU_ITEM(bpy.types.PropertyGroup):
       box = layout.box()
       box.prop( data, 'tipo' )
 
-      if data.tipo == '0':#{
+      if data.tipo == '0' or data.tipo == '7':#{
          box.prop( data, 'string', text='Name' )
          return
       #}
index 103e1a20635e1f32a91f7f0a4f8cc719350fff4d..40464526c982c2c157fd7810d18784b3f3283324 100644 (file)
--- a/entity.h
+++ b/entity.h
@@ -300,6 +300,7 @@ enum ent_menuitem_type{
    k_ent_menuitem_type_slider       = 4,
    k_ent_menuitem_type_page         = 5,
    k_ent_menuitem_type_binding      = 6,
+   k_ent_menuitem_type_visual_nocol = 7,
    k_ent_menuitem_type_disabled     = 90
 };
 
diff --git a/menu.h b/menu.h
index 098570608e53248d174e42a745da54ba30bc41db..86f573620f5fa10ecabe789d0a8d09b5590bc3c3 100644 (file)
--- a/menu.h
+++ b/menu.h
@@ -430,7 +430,8 @@ static void menu_update(void){
          ent_menuitem *item = mdl_arritm( &menu.items, i );
 
          if( item->type == k_ent_menuitem_type_page ) continue;
-         if( item->type == k_ent_menuitem_type_visual ) continue;
+         if( (item->type == k_ent_menuitem_type_visual) ||
+             (item->type == k_ent_menuitem_type_visual_nocol) ) continue;
          if( item->type == k_ent_menuitem_type_binding ) continue;
          if( !(item->groups & (0x1<<menu.page)) ) continue;
 
@@ -489,6 +490,7 @@ static void menu_update(void){
             
             if( (item->type != k_ent_menuitem_type_page) &&
                 (item->type != k_ent_menuitem_type_visual) &&
+                (item->type != k_ent_menuitem_type_visual_nocol) &&
                 (item->groups & (0x1<<menu.page)) ){
                menu.loc = item;
             }
@@ -560,15 +562,15 @@ static void menu_update(void){
    menu_setitem_type( menu.ctr_steam, k_ent_menuitem_type_disabled );
 
    if( vg_input.display_input_method == k_input_method_kbm )
-      menu_setitem_type( menu.ctr_kbm, k_ent_menuitem_type_visual );
+      menu_setitem_type( menu.ctr_kbm, k_ent_menuitem_type_visual_nocol );
    else{
       if( vg_input.display_input_type == SDL_CONTROLLER_TYPE_PS3 ||
           vg_input.display_input_type == SDL_CONTROLLER_TYPE_PS4 ||
           vg_input.display_input_type == SDL_CONTROLLER_TYPE_PS5 ){
-         menu_setitem_type( menu.ctr_ps, k_ent_menuitem_type_visual );
+         menu_setitem_type( menu.ctr_ps, k_ent_menuitem_type_visual_nocol );
       }
       else {
-         menu_setitem_type( menu.ctr_xbox, k_ent_menuitem_type_visual );
+         menu_setitem_type( menu.ctr_xbox, k_ent_menuitem_type_visual_nocol );
       }
       /* FIXME: Steam/Deck controller detection? */
    }
@@ -707,7 +709,7 @@ static void menu_render(void){
          }
       }
 
-      if( item->type == k_ent_menuitem_type_visual ){
+      if( item->type == k_ent_menuitem_type_visual_nocol ){
          shader_model_menu_uColour( (v4f){1.0f,1.0f,1.0f,1.0f} );
       }
       else{
index 9a91088cda66d7abb1cfc8c48b5cc71f26fc5d8c..eb04eb092b8b909295dbecd5c5e1885849e6c764 100644 (file)
Binary files a/models_src/rs_menu.mdl and b/models_src/rs_menu.mdl differ