Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ivmi-Builder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Damien Marchal
Ivmi-Builder
Commits
69600822
Commit
69600822
authored
1 year ago
by
Florent Berthaut
Browse files
Options
Downloads
Patches
Plain Diff
Added variable property size mechanism
parent
a6aed180
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/IvmiNode.gd
+2
-11
2 additions, 11 deletions
core/IvmiNode.gd
core/IvmiProperty.gd
+22
-5
22 additions, 5 deletions
core/IvmiProperty.gd
with
24 additions
and
16 deletions
core/IvmiNode.gd
+
2
−
11
View file @
69600822
...
...
@@ -46,18 +46,9 @@ func declare() :
func
_allow_send_data
(
value
:
bool
):
_send_data
=
value
func
_add_property
(
prop
,
values
)
:
func
_add_property
(
prop
,
values
)
->
void
:
_properties
[
prop
]
=
load
(
"res://addons/ivmi-builder/core/IvmiProperty.gd"
)
.
new
()
_properties
[
prop
]
.
set_values
(
values
)
var
tags
=
""
for
v
in
values
:
if
v
is
float
:
tags
+=
"f"
elif
v
is
int
:
tags
+=
"f"
elif
v
is
String
:
tags
+=
"s"
_properties
[
prop
]
.
set_tags
(
tags
)
_properties
[
prop
]
.
init_values
(
values
)
_properties
[
prop
]
.
set_ivmi_node
(
self
)
_properties
[
prop
]
.
set_name
(
prop
)
...
...
This diff is collapsed.
Click to expand it.
core/IvmiProperty.gd
+
22
−
5
View file @
69600822
...
...
@@ -11,16 +11,33 @@ var _tags = ""
var
_immediate
=
false
var
_ivmi_node
=
null
func
set_values
(
vals
)
:
for
v
in
range
(
0
,
min
(
_values
.
size
(),
vals
.
size
()))
:
if
vals
[
v
]
!=
_values
[
v
]
:
_changed
=
true
_values
.
assign
(
vals
)
func
set_values
(
vals
:
Array
)
:
if
vals
.
size
()
==
_values
.
size
()
:
for
v
in
range
(
0
,
min
(
_values
.
size
(),
vals
.
size
()))
:
if
vals
[
v
]
!=
_values
[
v
]
:
_changed
=
true
_values
.
assign
(
vals
)
else
:
init_values
(
vals
)
if
_immediate
and
_listen
:
_changed
=
false
_ivmi_node
.
send_prop
(
_name
)
func
init_values
(
vals
:
Array
)
:
var
tags
=
""
for
v
in
vals
:
if
v
is
float
:
tags
+=
"f"
elif
v
is
int
:
tags
+=
"f"
elif
v
is
String
:
tags
+=
"s"
set_tags
(
tags
)
_values
.
assign
(
vals
)
_changed
=
true
func
set_tags
(
t
):
_tags
=
t
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment