Skip to content

Commit 3d94fcc

Browse files
authored
Merge pull request #215 from easycoder/dev
Refine vfx editor
2 parents 53a747b + 3bec93b commit 3d94fcc

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

iwsy/resources/ecs/vfx.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
script VFX
44

5-
import div Panel and variable Presentation
5+
import div Container and variable Presentation
66

7+
div Panel
78
div Editor
89
div Title
910
div Table
@@ -56,9 +57,11 @@ Restart:
5657
put property `vfx` of Presentation into Items
5758
if Items is empty set Items to array
5859

59-
clear Panel
60+
clear Container
61+
create Panel in Container
62+
set the style of Panel to `width:100%;height:100%;display:flex;flex-direction:column`
6063
create Row in Panel
61-
set the style of Row to `display:flex`
64+
set the style of Row to `height:2em;display:flex`
6265
create Title in Row
6366
set the style of Title to
6467
`flex:1;font-size:110%;font-weight:bold;background:lightgray;text-align:center;margin-bottom:0.5em`
@@ -69,6 +72,7 @@ Restart:
6972
create AddItem in Link
7073
set the style of AddItem to `width:1em;margin-top:0.1em`
7174
set attribute `src` of AddItem to `/resources/icon/plus.png`
75+
set attribute `title` of AddItem to `Add VFX item`
7276
on click AddItem
7377
begin
7478
set Item to object
@@ -98,7 +102,7 @@ Restart:
98102
set the elements of EndYOffsetInput to NumItems
99103
end
100104
create Table in Panel
101-
set the style of Table to `width:100%`
105+
set the style of Table to `flex:1;width:100%;overflow-y:scroll`
102106
put 0 into N
103107
while N is less than NumItems
104108
begin
@@ -114,7 +118,7 @@ Restart:
114118
create Cell in Row
115119
set the style of Cell to `width:100%;display:flex`
116120
create EditButton in Cell
117-
set the style of EditButton to `flex:1`
121+
set the style of EditButton to `height:2em;flex:1`
118122
set the text of EditButton to ItemName
119123
if N is 0
120124
begin
@@ -133,7 +137,7 @@ Restart:
133137
set the style of DeleteItem to `width:1em;margin:0.2em 0 0 0.2em`
134138
set attribute `src` of DeleteItem to `/resources/icon/stop.png`
135139
create Editor in Row
136-
set the style of Editor to `margin:0.5em;border:1px solid black;padding:0.2em;display:none`
140+
set the style of Editor to `margin:0.5em;border:1px solid black;padding:0.2em;display:none;flex-direction:column`
137141
add 1 to N
138142
end
139143
on click EditButton
@@ -169,7 +173,7 @@ Restart:
169173
index Editor to SelectedItem
170174
if style `display` of Editor is `none`
171175
begin
172-
set style `display` of Editor to `block`
176+
set style `display` of Editor to `flex`
173177
set style `background-color` of EditButton to `lightgray`
174178
put element SelectedItem of Items into Item
175179
ReloadEditor:
@@ -229,7 +233,6 @@ ReloadEditor:
229233
create DurationInput in Row
230234
set the style of DurationInput to `flex:1`
231235
put property `duration` of Item into Value
232-
! if Value is empty put 1 into Value
233236
set the text of DurationInput to Value
234237

235238
create Row in Editor
@@ -263,7 +266,7 @@ ReloadEditor:
263266
set the text of EndYOffsetInput to Value
264267
end
265268
create Row in Editor
266-
set the style of Row to `display:flex;margin-top:0.5em`
269+
set the style of Row to `height:2em;display:flex;margin-top:0.5em`
267270
create SaveButton in Row
268271
set the style of SaveButton to `flex:1;margin-right:0.2em`
269272
set the text of SaveButton to `Save`

0 commit comments

Comments
 (0)