Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Normand Erwan
VVVVVV_level_merger
Commits
a6e12c1a
Commit
a6e12c1a
authored
Jun 01, 2015
by
Orbmancer
Browse files
loaded contents
parent
8eb2d849
Changes
3
Hide whitespace changes
Inline
Side-by-side
index.html
View file @
a6e12c1a
...
...
@@ -85,13 +85,34 @@
</div>
<div
class=
"form-group"
>
<div
class=
"col-lg-10 col-lg-offset-2"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Merg
e the awesome !
</button>
<button
type=
"submit"
class=
"btn btn-primary"
>
Sav
e the awesome !
</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<table
class=
"table table-striped table-hover"
>
<thead>
<tr>
<th>
TD
</th>
<th>
Level name
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
1
</td>
<td>
Column content
</td>
</tr>
<tr>
<td>
2
</td>
<td>
Column content
</td>
</tr>
</table>
</div>
</div>
</div>
<!-- Script section -->
...
...
merge.php
View file @
a6e12c1a
...
...
@@ -19,4 +19,5 @@ var_dump($td);
Data
::
saveXML
(
$data
,
$name
,
$x
,
$y
,
$td
);
echo
'<br/>'
;
var_dump
(
Data
::
loadXML
(
$td
));
\ No newline at end of file
var_dump
(
Data
::
loadXML
(
$td
));
model/Contents.class.php
View file @
a6e12c1a
...
...
@@ -27,6 +27,20 @@ class Contents
$this
->
contentsRaw
=
$xml
->
Data
->
contents
->
__toString
();
$contents
=
explode
(
','
,
$this
->
contentsRaw
);
$line
=
array
();
$prev_y
=
1
;
for
(
$i
=
0
;
$i
<
count
(
$contents
);
++
$i
){
$tab_x
=
(
int
)
floor
(
$i
/
$this
->
$tabWidth
);
$tab_y
=
(
int
)
floor
(
$i
/
(
$this
->
$tabwidth
*
$this
->
$tabHeight
*
$this
->
mapwidth
));
$line
[]
=
$contents
[
$i
];
if
(
$prev_y
!=
$tab_y
){
$this
->
contents
[
$tab_x
][
$tab_y
]
=
$line
;
$line
=
array
();
}
}
}
public
function
setContents
(
$contents
)
{
...
...
@@ -38,6 +52,6 @@ class Contents
}
public
function
getTab
(
$x
,
$y
)
{
}
}
\ No newline at end of file
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