Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
f53cca10
Commit
f53cca10
authored
Jan 11, 2024
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix move up/down tasks
parent
81137029
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
role.ts
src/app/class/role/role.ts
+24
-16
No files found.
src/app/class/role/role.ts
View file @
f53cca10
...
...
@@ -69,10 +69,10 @@ export class Role {
if
(
this
.
tasks
[
i
][
j
]?.
type
==
'final'
||
this
.
tasks
[
i
][
j
]?.
type
==
'repeat'
)
{
this
.
tasks
[
i
][
j
]
=
this
.
tasks
[
i
-
1
][
this
.
getLastTaskIndex
(
i
-
1
)];
this
.
tasks
[
i
-
1
][
this
.
getLastTaskIndex
(
i
-
1
)]
=
tmp
;
}
else
if
(
this
.
thereIsSpace
(
i
-
1
,
this
.
get
RealIndex
(
i
-
1
,
j
),
this
.
tasks
[
i
][
j
]
as
Task
))
{
this
.
tasks
[
i
-
1
][
this
.
getRealIndex
(
i
-
1
,
j
)]
=
tmp
;
}
else
if
(
this
.
thereIsSpace
(
i
-
1
,
this
.
get
DestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
-
1
),
this
.
tasks
[
i
][
j
]
as
Task
))
{
this
.
tasks
[
i
-
1
][
this
.
getDestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
-
1
)]
=
tmp
;
this
.
tasks
[
i
][
j
]
=
null
;
this
.
tasks
[
i
-
1
].
splice
(
this
.
get
RealIndex
(
i
-
1
,
j
)
+
1
,
tmp
?
.
duration
-
1
);
this
.
tasks
[
i
-
1
].
splice
(
this
.
get
DestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
-
1
)
+
1
,
tmp
.
duration
-
1
);
for
(
let
index
=
1
;
index
<
tmp
.
duration
;
index
++
)
{
this
.
tasks
[
i
].
splice
(
j
+
index
,
0
,
null
);
}
...
...
@@ -82,10 +82,10 @@ export class Role {
this
.
tasks
[
i
-
1
][
this
.
getLastTaskIndex
(
i
-
1
)
+
1
]
=
deplace
;
this
.
tasks
[
i
][
j
]
=
null
;
}
}
else
if
(
this
.
thereIsSpace
(
i
-
1
,
this
.
getRealIndex
(
i
-
1
,
j
),
this
.
tasks
[
i
][
j
]
as
Task
))
{
this
.
tasks
[
i
-
1
][
this
.
getRealIndex
(
i
-
1
,
j
)]
=
tmp
;
}
else
if
(
this
.
thereIsSpace
(
i
-
1
,
this
.
getDestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
-
1
),
this
.
tasks
[
i
][
j
]
as
Task
))
{
this
.
tasks
[
i
-
1
][
this
.
getDestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
-
1
)]
=
tmp
;
this
.
tasks
[
i
][
j
]
=
null
;
this
.
tasks
[
i
-
1
].
splice
(
this
.
get
RealIndex
(
i
-
1
,
j
)
+
1
,
tmp
.
duration
-
1
);
this
.
tasks
[
i
-
1
].
splice
(
this
.
get
DestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
-
1
)
+
1
,
tmp
.
duration
-
1
);
for
(
let
index
=
1
;
index
<
tmp
.
duration
;
index
++
)
{
this
.
tasks
[
i
].
splice
(
j
+
index
,
0
,
null
);
}
...
...
@@ -107,10 +107,10 @@ export class Role {
if
(
this
.
tasks
[
i
][
j
]?.
type
==
'final'
||
this
.
tasks
[
i
][
j
]?.
type
==
'repeat'
)
{
this
.
tasks
[
i
][
j
]
=
this
.
tasks
[
i
+
1
][
this
.
getLastTaskIndex
(
i
+
1
)];
this
.
tasks
[
i
+
1
][
this
.
getLastTaskIndex
(
i
+
1
)]
=
tmp
;
}
else
if
(
this
.
thereIsSpace
(
i
+
1
,
this
.
get
RealIndex
(
i
+
1
,
j
),
this
.
tasks
[
i
][
j
]
as
Task
))
{
this
.
tasks
[
i
+
1
][
this
.
getRealIndex
(
i
+
1
,
j
)]
=
tmp
;
}
else
if
(
this
.
thereIsSpace
(
i
+
1
,
this
.
get
DestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
+
1
),
this
.
tasks
[
i
][
j
]
as
Task
))
{
this
.
tasks
[
i
+
1
][
this
.
getDestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
+
1
)]
=
tmp
;
this
.
tasks
[
i
][
j
]
=
null
;
this
.
tasks
[
i
+
1
].
splice
(
this
.
get
RealIndex
(
i
+
1
,
j
)
+
1
,
tmp
?
.
duration
-
1
);
this
.
tasks
[
i
+
1
].
splice
(
this
.
get
DestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
+
1
)
+
1
,
tmp
.
duration
-
1
);
for
(
let
index
=
1
;
index
<
tmp
.
duration
;
index
++
)
{
this
.
tasks
[
i
].
splice
(
j
+
index
,
0
,
null
);
}
...
...
@@ -120,13 +120,13 @@ export class Role {
this
.
tasks
[
i
+
1
][
this
.
getLastTaskIndex
(
i
+
1
)
+
1
]
=
deplace
;
this
.
tasks
[
i
][
j
]
=
null
;
}
}
else
if
(
this
.
thereIsSpace
(
i
+
1
,
this
.
get
RealIndex
(
i
+
1
,
j
),
this
.
tasks
[
i
][
j
]
as
Task
))
{
this
.
tasks
[
i
+
1
][
this
.
getRealIndex
(
i
+
1
,
j
)]
=
tmp
;
this
.
tasks
[
i
][
j
]
=
null
;
this
.
tasks
[
i
+
1
].
splice
(
this
.
getRealIndex
(
i
+
1
,
j
)
+
1
,
tmp
.
duration
-
1
);
for
(
let
index
=
1
;
index
<
tmp
.
duration
;
index
++
)
{
this
.
tasks
[
i
].
splice
(
j
+
index
,
0
,
null
);
}
}
else
if
(
this
.
thereIsSpace
(
i
+
1
,
this
.
get
DestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
+
1
),
this
.
tasks
[
i
][
j
]
as
Task
))
{
this
.
tasks
[
i
+
1
][
this
.
getDestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
+
1
)]
=
tmp
;
this
.
tasks
[
i
][
j
]
=
null
;
this
.
tasks
[
i
+
1
].
splice
(
this
.
getDestinationIndexFromRealIndex
(
this
.
getRealIndex
(
i
,
j
),
i
+
1
)
+
1
,
tmp
.
duration
-
1
);
for
(
let
index
=
1
;
index
<
tmp
.
duration
;
index
++
)
{
this
.
tasks
[
i
].
splice
(
j
+
index
,
0
,
null
);
}
}
else
{
this
.
tasks
[
i
+
1
][
this
.
getLastTaskIndex
(
i
+
1
)
+
1
]
=
tmp
;
this
.
tasks
[
i
][
j
]
=
null
;
...
...
@@ -175,6 +175,14 @@ export class Role {
return
realj
;
}
getDestinationIndexFromRealIndex
(
realindex
:
number
,
iDest
:
number
):
number
{
let
index
:
number
=
0
;
while
(
this
.
getRealIndex
(
iDest
,
index
)
<
realindex
)
{
index
++
;
}
return
index
;
}
public
moveStep
(
i
:
number
,
direction
:
string
):
void
{
let
tmp
:
Step
|
null
=
this
.
chronologie
[
i
];
if
(
direction
==
'left'
)
{
...
...
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