From ee905cea9b4fe351691274509e14c0c142d82df9 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Fri, 27 Oct 2023 11:12:59 +0300 Subject: [PATCH] Adding support for @bhl_native_prefix to getters/setters --- tpl/bhl_bind_macro.twig | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tpl/bhl_bind_macro.twig b/tpl/bhl_bind_macro.twig index c2d11c0..7042489 100644 --- a/tpl/bhl_bind_macro.twig +++ b/tpl/bhl_bind_macro.twig @@ -688,7 +688,11 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack {{f.type|native_type}} nv = Script_{{o.name|norm_name}}.Get_{{f.name}}(f); {{_self.native2val(f.type, 'nv', 'v')}}; {% else %} - {{_self.native2val(f.type, 'f.' ~ f.name, 'v')}}; + {%- if has_token(f, 'bhl_native_prefix') -%} + {{_self.native2val(f.type, 'f.' ~ token(f, 'bhl_native_prefix'), 'v')}}; + {% else %} + {{_self.native2val(f.type, 'f.' ~ f.name, 'v')}}; + {%- endif ~%} {%- endif ~%} #endif } @@ -712,7 +716,11 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack {{_self.val2native(f.type, 'v', 'var nv')}}; Script_{{o.name|norm_name}}.Set_{{f.name}}(ref f, nv); {% else %} - {{_self.val2native(f.type, 'v', 'f.' ~ f.name)}}; + {%- if has_token(f, 'bhl_native_prefix') -%} + {{_self.val2native(f.type, 'v', 'f.' ~ token(f, 'bhl_native_prefix'))}}; + {% else %} + {{_self.val2native(f.type, 'v', 'f.' ~ f.name)}}; + {%- endif ~%} {%- endif ~%} {%~ if has_token(o, 'bhl_custom_rw') ~%}