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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
bbdc9fdf
Commit
bbdc9fdf
authored
Jun 16, 2023
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_drone_simulator: fullscreen feature
parent
b8cbf53d
Changes
2
Hide 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 @
bbdc9fdf
...
...
@@ -513,6 +513,8 @@ var GameManager = /** @class */ (function () {
function
GameManager
(
canvas
,
game_parameters_json
)
{
var
drone
,
header_list
;
this
.
_canvas
=
canvas
;
this
.
_canvas_width
=
canvas
.
width
;
this
.
_canvas_height
=
canvas
.
height
;
this
.
_scene
=
null
;
this
.
_engine
=
null
;
this
.
_droneList
=
[];
...
...
@@ -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
// This is fixed and must not be modified
// otherwise, it will lead to different scenario results
...
...
@@ -587,10 +589,8 @@ var GameManager = /** @class */ (function () {
function
triggerUpdateIfPossible
()
{
if
((
_this
.
_canUpdate
)
&&
(
_this
.
ongoing_update_promise
===
null
)
&&
(
0
<
_this
.
waiting_update_count
))
{
_this
.
ongoing_update_promise
=
_this
.
_update
(
TIME_DELTA
,
(
_this
.
waiting_update_count
===
1
)
).
push
(
function
()
{
_this
.
ongoing_update_promise
=
_this
.
_update
(
TIME_DELTA
,
fullscreen
)
.
push
(
function
()
{
_this
.
waiting_update_count
-=
1
;
_this
.
ongoing_update_promise
=
null
;
triggerUpdateIfPossible
();
...
...
@@ -626,7 +626,7 @@ var GameManager = /** @class */ (function () {
return
false
;
};
GameManager
.
prototype
.
_update
=
function
(
delta_time
)
{
GameManager
.
prototype
.
_update
=
function
(
delta_time
,
fullscreen
)
{
var
_this
=
this
,
queue
=
new
RSVP
.
Queue
(),
i
;
...
...
@@ -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
)
{
queue
.
push
(
function
()
{
drone
.
_tick
+=
1
;
...
...
@@ -1043,9 +1057,9 @@ var runGame, updateGame;
return
game_manager_instance
.
run
();
};
updateGame
=
function
()
{
updateGame
=
function
(
fullscreen
)
{
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 @
bbdc9fdf
...
...
@@ -226,7 +226,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<
string>
zope
</string
>
</value>
<value>
<
unicode>
zope
</unicode
>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>
16
77600104.1
1
</float>
<float>
16
86857368.6
1
</float>
<string>
UTC
</string>
</tuple>
</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