Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
38787e70
Commit
38787e70
authored
Jun 16, 2023
by
Roque
Committed by
Kazuhiko Shiozaki
Jul 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_drone_simulator: fullscreen feature
parent
b0575af9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
...hTemplateItem/web_page_module/drone_simulator_logic_js.js
+22
-8
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
...TemplateItem/web_page_module/drone_simulator_logic_js.xml
+3
-3
No files found.
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.js
View file @
38787e70
...
@@ -513,6 +513,8 @@ var GameManager = /** @class */ (function () {
...
@@ -513,6 +513,8 @@ var GameManager = /** @class */ (function () {
function
GameManager
(
canvas
,
game_parameters_json
)
{
function
GameManager
(
canvas
,
game_parameters_json
)
{
var
drone
,
header_list
;
var
drone
,
header_list
;
this
.
_canvas
=
canvas
;
this
.
_canvas
=
canvas
;
this
.
_canvas_width
=
canvas
.
width
;
this
.
_canvas_height
=
canvas
.
height
;
this
.
_scene
=
null
;
this
.
_scene
=
null
;
this
.
_engine
=
null
;
this
.
_engine
=
null
;
this
.
_droneList
=
[];
this
.
_droneList
=
[];
...
@@ -575,7 +577,7 @@ var GameManager = /** @class */ (function () {
...
@@ -575,7 +577,7 @@ var GameManager = /** @class */ (function () {
});
});
};
};
GameManager
.
prototype
.
update
=
function
()
{
GameManager
.
prototype
.
update
=
function
(
fullscreen
)
{
// time delta means that drone are updated every virtual second
// time delta means that drone are updated every virtual second
// This is fixed and must not be modified
// This is fixed and must not be modified
// otherwise, it will lead to different scenario results
// otherwise, it will lead to different scenario results
...
@@ -587,10 +589,8 @@ var GameManager = /** @class */ (function () {
...
@@ -587,10 +589,8 @@ var GameManager = /** @class */ (function () {
function
triggerUpdateIfPossible
()
{
function
triggerUpdateIfPossible
()
{
if
((
_this
.
_canUpdate
)
&&
(
_this
.
ongoing_update_promise
===
null
)
&&
if
((
_this
.
_canUpdate
)
&&
(
_this
.
ongoing_update_promise
===
null
)
&&
(
0
<
_this
.
waiting_update_count
))
{
(
0
<
_this
.
waiting_update_count
))
{
_this
.
ongoing_update_promise
=
_this
.
_update
(
_this
.
ongoing_update_promise
=
_this
.
_update
(
TIME_DELTA
,
fullscreen
)
TIME_DELTA
,
.
push
(
function
()
{
(
_this
.
waiting_update_count
===
1
)
).
push
(
function
()
{
_this
.
waiting_update_count
-=
1
;
_this
.
waiting_update_count
-=
1
;
_this
.
ongoing_update_promise
=
null
;
_this
.
ongoing_update_promise
=
null
;
triggerUpdateIfPossible
();
triggerUpdateIfPossible
();
...
@@ -626,7 +626,7 @@ var GameManager = /** @class */ (function () {
...
@@ -626,7 +626,7 @@ var GameManager = /** @class */ (function () {
return
false
;
return
false
;
};
};
GameManager
.
prototype
.
_update
=
function
(
delta_time
)
{
GameManager
.
prototype
.
_update
=
function
(
delta_time
,
fullscreen
)
{
var
_this
=
this
,
var
_this
=
this
,
queue
=
new
RSVP
.
Queue
(),
queue
=
new
RSVP
.
Queue
(),
i
;
i
;
...
@@ -642,6 +642,20 @@ var GameManager = /** @class */ (function () {
...
@@ -642,6 +642,20 @@ var GameManager = /** @class */ (function () {
}
}
}
}
if
(
fullscreen
)
{
//Only resize if size changes
if
(
this
.
_canvas
.
width
!==
this
.
_canvas_width
*
2
)
{
this
.
_canvas
.
width
=
this
.
_canvas_width
*
2
;
this
.
_canvas
.
height
=
this
.
_canvas_height
*
2
;
}
}
else
{
if
(
this
.
_canvas
.
width
!==
this
.
_canvas_width
)
{
this
.
_canvas
.
width
=
this
.
_canvas_width
;
this
.
_canvas
.
height
=
this
.
_canvas_height
;
this
.
_engine
.
resize
(
true
);
}
}
this
.
_droneList
.
forEach
(
function
(
drone
)
{
this
.
_droneList
.
forEach
(
function
(
drone
)
{
queue
.
push
(
function
()
{
queue
.
push
(
function
()
{
drone
.
_tick
+=
1
;
drone
.
_tick
+=
1
;
...
@@ -1043,9 +1057,9 @@ var runGame, updateGame;
...
@@ -1043,9 +1057,9 @@ var runGame, updateGame;
return
game_manager_instance
.
run
();
return
game_manager_instance
.
run
();
};
};
updateGame
=
function
()
{
updateGame
=
function
(
fullscreen
)
{
if
(
game_manager_instance
)
{
if
(
game_manager_instance
)
{
return
game_manager_instance
.
update
();
return
game_manager_instance
.
update
(
fullscreen
);
}
}
};
};
...
...
bt5/erp5_officejs_drone_simulator/PathTemplateItem/web_page_module/drone_simulator_logic_js.xml
View file @
38787e70
...
@@ -226,7 +226,7 @@
...
@@ -226,7 +226,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<
string>
zope
</string
>
</value>
<value>
<
unicode>
zope
</unicode
>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
6.43905.28804.11980
</string>
</value>
<value>
<string>
100
9.7343.39937.16861
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -260,7 +260,7 @@
...
@@ -260,7 +260,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
16
77600104.1
1
</float>
<float>
16
86857368.6
1
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
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