Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Khanat code
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tycho Brahe
Khanat code
Commits
3d270b7a
Commit
3d270b7a
authored
Jan 11, 2017
by
ulukyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed: Scenographic Editor lua issues
parent
169ab7d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
21 deletions
+35
-21
code/ryzom/client/data/gamedev/interfaces_v3/sceneedit.lua
code/ryzom/client/data/gamedev/interfaces_v3/sceneedit.lua
+35
-21
No files found.
code/ryzom/client/data/gamedev/interfaces_v3/sceneedit.lua
View file @
3d270b7a
...
...
@@ -32,13 +32,15 @@ function SceneEditor:init(scene_id, form_url, translations, icons_url)
self
.
T
=
translations
end
function
SceneEditor
:
reset
()
function
SceneEditor
:
reset
(
no_get_html
)
self
.
Shapes
=
{}
self
.
Groups
=
{}
self
.
LastEditedGroup
=
nil
self
.
HaveUpdate
=
nil
runAH
(
nil
,
"remove_shapes"
,
""
)
self
:
get_html
(
"Reseted"
)
if
no_get_html
==
true
then
self
:
get_html
(
"Reseted"
)
end
end
function
SceneEditor
:
show_menu
()
...
...
@@ -364,24 +366,24 @@ end
function
SceneEditor
:
editGroup
(
group
)
if
self
.
LastEditedGroup
then
self
:
removeGroup
(
self
.
LastEditedGroup
)
self
:
removeGroup
(
self
.
LastEditedGroup
,
true
)
self
:
addGroup
(
self
.
LastEditedGroup
,
0
,
true
,
false
)
end
self
:
removeGroup
(
group
);
self
:
removeGroup
(
group
,
true
);
self
:
addGroup
(
group
,
0
,
true
,
true
)
self
.
LastEditedGroup
=
group
end
function
SceneEditor
:
addFromDb
(
group
,
db_id
,
json_shape
)
function
SceneEditor
:
addFromDb
(
group
,
db_id
,
json_shape
,
edit
)
shape
=
Json
.
decode
(
json_shape
)
shape
.
db_id
=
db_id
shape
.
group
=
group
shape
.
modified
=
""
if
hide
then
shape_id
=
addShape
(
shape
.
file
,
shape
.
pos
[
1
],
shape
.
pos
[
2
],
shape
.
pos
[
3
],
"user"
,
1
,
false
,
""
,
""
)
else
if
edit
then
shape_id
=
addShape
(
shape
.
file
,
shape
.
pos
[
1
],
shape
.
pos
[
2
],
shape
.
pos
[
3
],
"user"
,
1
,
true
,
""
,
"SceneEditor:show_menu()"
)
else
shape_id
=
addShape
(
shape
.
file
,
shape
.
pos
[
1
],
shape
.
pos
[
2
],
shape
.
pos
[
3
],
"user"
,
1
,
true
,
""
,
""
)
end
rotateShape
(
shape_id
,
tostring
(
shape
.
rot
[
1
]),
tostring
(
shape
.
rot
[
2
]),
tostring
(
shape
.
rot
[
3
]))
setupShape
(
shape_id
,
shape
.
setup
)
...
...
@@ -393,7 +395,7 @@ function SceneEditor:addFromDb(group, db_id, json_shape)
end
function
SceneEditor
:
removeGroup
(
group
)
function
SceneEditor
:
removeGroup
(
group
,
no_get_html
)
if
self
.
Groups
[
group
]
==
nil
then
return
end
...
...
@@ -404,6 +406,7 @@ function SceneEditor:removeGroup(group)
deleteShape
(
shape_id
)
end
end
self
.
Groups
[
group
]
=
nil
if
self
.
LastEditedGroup
==
group
then
self
.
LastEditedGroup
=
nil
...
...
@@ -412,7 +415,9 @@ function SceneEditor:removeGroup(group)
ui
.
active
=
false
end
end
self
:
get_html
(
"Group Removed"
)
if
no_get_html
==
nil
then
self
:
get_html
(
"Group Removed"
)
end
end
function
SceneEditor
:
enc64
(
data
)
...
...
@@ -479,12 +484,28 @@ function SceneEditor:show_shape_list()
end
end
function
SceneEditor
:
getShapesByGroups
()
local
groups
=
{}
for
shape_id
,
shape
in
pairs
(
self
.
Shapes
)
do
if
shape
.
group
==
nil
then
shape
.
group
=
""
end
if
groups
[
shape
.
group
]
==
nil
then
groups
[
shape
.
group
]
=
{}
end
table.insert
(
groups
[
shape
.
group
],
shape_id
)
end
return
groups
end
function
SceneEditor
:
get_html_section
(
message
,
color
)
return
'<table width="100%" cellspacing="0" cellpadding="0"><tr bgcolor="'
..
color
..
'"><td align="center" valign="middle"><font color="#FFFFFF" size="12">'
..
message
..
'</font></td></tr></table>'
end
function
SceneEditor
:
get_html
(
message
,
message_bg
)
debug
(
"get_html :"
..
message
)
local
new_group
=
' <a class="ryzom-ui-button" href="'
..
self
.
baseUrl
..
'_AddGroup&add_new_group=1&scene_id='
..
self
.
sceneId
..
'"><img src="'
..
self
.
iconsUrl
..
'/32/chart_organisation_add.png" alt="'
..
self
.
T
[
"add_new_group"
]
..
'" /></a>'
local
show_hide_cols
=
' <a class="ryzom-ui-button" href="ah:ark_pacs_borders"><img src="'
..
self
.
iconsUrl
..
'/32/show_hide_cols.png" alt="'
..
self
.
T
[
"show_hide_cols"
]
..
'" /></a>'
local
reset_scene
=
'</td><td align="center" bgcolor="#502020" width="40px"><a class="ryzom-ui-button" href="'
..
self
.
baseUrl
..
'_SaveShapes&reset_scene=1&scene_id='
..
self
.
sceneId
..
'"><img src="'
..
self
.
iconsUrl
..
'/32/bin.png" alt="'
..
self
.
T
[
"reset_scene"
]
..
'" /></a>'
...
...
@@ -493,24 +514,17 @@ function SceneEditor:get_html(message, message_bg)
html
=
html
..
'<form action="'
..
self
.
baseUrl
..
'_SaveShapes" method="POST"><input type="hidden" name="group" value="'
..
(
self
.
LastEditedGroup
or
""
)
..
'" /><input type="hidden" name="scene_id" value="'
..
self
.
sceneId
..
'" />\
<table width="100%" cellspacing="0" cellpadding="0">'
local
groups
=
{}
for
shape_id
,
shape
in
pairs
(
self
.
Shapes
)
do
if
shape
.
group
==
nil
then
shape
.
group
=
""
end
if
groups
[
shape
.
group
]
==
nil
then
groups
[
shape
.
group
]
=
{}
end
table.insert
(
groups
[
shape
.
group
],
shape_id
)
end
local
groups
=
self
:
getShapesByGroups
()
for
group
,
shapes
in
pairsByKeys
(
self
.
Groups
)
do
debug
(
"Group : "
..
group
)
local
groupname
=
group
html
=
html
..
'<tr bgcolor="#444444"><td height="20px"><table width="100%"><tr><td> '
..
groupname
..
' ('
..
(
self
.
Groups
[
group
].
props
.
count
or
'0'
)
..
') </td><td align="right"><input type="hidden" name="shape[]", value="#"/>'
if
self
.
Groups
[
group
].
props
.
show
then
debug
(
"Group : show"
)
if
self
.
Groups
[
group
].
props
.
edit
then
html
=
html
..
'<a href="ah:lua:SceneEditor:show_shape_list()"><img src="'
..
self
.
iconsUrl
..
'/16/box_add.png" alt="'
..
self
.
T
[
"add_shape"
]
..
'"/></a></td><td align="right">'
if
self
.
HaveUpdate
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment