Открыть боковую панель
Левадный Владимир Юрьевич
universo-godot
Коммиты
0e701b2f
Коммит
0e701b2f
создал
Апр 23, 2020
по автору
magcourier
Просмотр файлов
Стартовая страница и переработка списка объектов
владелец
586b867a
Изменения
22
Скрыть пробелы
Построчно
Рядом
blokoj/kosmo/scenoj/ship.tscn
Просмотр файла @
0e701b2f
...
@@ -27,7 +27,3 @@ material/4 = null
...
@@ -27,7 +27,3 @@ material/4 = null
[node name="base_spaceship" parent="CollisionShape" instance=ExtResource( 3 )]
[node name="base_spaceship" parent="CollisionShape" instance=ExtResource( 3 )]
transform = Transform( -0.0034731, 0, 0.999994, 0, 1, 0, -0.999994, 0, -0.0034731, -4.98877, -3.8979, 6.84284 )
transform = Transform( -0.0034731, 0, 0.999994, 0, 1, 0, -0.999994, 0, -0.0034731, -4.98877, -3.8979, 6.84284 )
[node name="timer" type="Timer" parent="."]
wait_time = 10.0
[connection signal="timeout" from="timer" to="." method="_on_timer_timeout"]
blokoj/kosmo/scenoj/space.tscn
Просмотр файла @
0e701b2f
[gd_scene load_steps=1
7
format=2]
[gd_scene load_steps=1
6
format=2]
[ext_resource path="res://blokoj/kosmo/scenoj/waypoint.tscn" type="PackedScene" id=1]
[ext_resource path="res://blokoj/kosmo/scenoj/waypoint.tscn" type="PackedScene" id=1]
[ext_resource path="res://blokoj/kosmo/scenoj/ship.tscn" type="PackedScene" id=2]
[ext_resource path="res://blokoj/kosmo/scenoj/ship.tscn" type="PackedScene" id=2]
[ext_resource path="res://blokoj/kosmo/scenoj/space_object.tscn" type="PackedScene" id=3]
[ext_resource path="res://blokoj/kosmo/scenoj/space_object.tscn" type="PackedScene" id=3]
[ext_resource path="res://blokoj/kosmo/scenoj/main_camera.tscn" type="PackedScene" id=4]
[ext_resource path="res://blokoj/kosmo/scenoj/main_camera.tscn" type="PackedScene" id=4]
[ext_resource path="res://blokoj/kosmo/scenoj/star.tscn" type="PackedScene" id=5]
[ext_resource path="res://blokoj/kosmo/scenoj/star.tscn" type="PackedScene" id=5]
[ext_resource path="res://blokoj/kosmo/skriptoj/http_space_query.gd" type="Script" id=6]
[ext_resource path="res://blokoj/kosmo/skriptoj/http_mutate.gd" type="Script" id=7]
[ext_resource path="res://blokoj/kosmo/skriptoj/http_mutate.gd" type="Script" id=7]
[ext_resource path="res://blokoj/kosmo/skriptoj/space.gd" type="Script" id=8]
[ext_resource path="res://blokoj/kosmo/skriptoj/space.gd" type="Script" id=8]
[ext_resource path="res://blokoj/kosmo/scenoj/menuo.tscn" type="PackedScene" id=9]
[ext_resource path="res://blokoj/kosmo/scenoj/menuo.tscn" type="PackedScene" id=9]
...
@@ -36,9 +35,6 @@ font_data = ExtResource( 10 )
...
@@ -36,9 +35,6 @@ font_data = ExtResource( 10 )
[node name="space" type="Spatial"]
[node name="space" type="Spatial"]
script = ExtResource( 8 )
script = ExtResource( 8 )
[node name="http_space_query" type="HTTPRequest" parent="."]
script = ExtResource( 6 )
[node name="http_mutate" type="HTTPRequest" parent="."]
[node name="http_mutate" type="HTTPRequest" parent="."]
script = ExtResource( 7 )
script = ExtResource( 7 )
...
@@ -52,7 +48,7 @@ script = ExtResource( 7 )
...
@@ -52,7 +48,7 @@ script = ExtResource( 7 )
[node name="http_finado" type="HTTPRequest" parent="."]
[node name="http_finado" type="HTTPRequest" parent="."]
[node name="ship" parent="." instance=ExtResource( 2 )]
[node name="ship
1
" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 129.985 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 129.985 )
visible = false
visible = false
...
@@ -100,7 +96,7 @@ material/0 = SubResource( 4 )
...
@@ -100,7 +96,7 @@ material/0 = SubResource( 4 )
z_away = 4000
z_away = 4000
colision_radius = 1.0
colision_radius = 1.0
[node name="space_object" parent="." instance=ExtResource( 3 )]
[node name="space_object
1
" parent="." instance=ExtResource( 3 )]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, -163.333, 10.0102, 3.27841 )
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, -163.333, 10.0102, 3.27841 )
visible = false
visible = false
...
@@ -126,8 +122,11 @@ __meta__ = {
...
@@ -126,8 +122,11 @@ __meta__ = {
}
}
[node name="itinero" parent="b_itinero" instance=ExtResource( 11 )]
[node name="itinero" parent="b_itinero" instance=ExtResource( 11 )]
[connection signal="ready" from="." to="." method="_on_space_ready"]
[connection signal="request_completed" from="http_space_query" to="http_space_query" method="_on_http_space_query_request_completed"]
[node name="timer" type="Timer" parent="."]
wait_time = 10.0
[connection signal="load_objektoj" from="." to="." method="_on_space_load_objektoj"]
[connection signal="tree_exiting" from="." to="." method="_on_space_tree_exiting"]
[connection signal="request_completed" from="http_mutate" to="http_mutate" method="_on_http_mutate_request_completed"]
[connection signal="request_completed" from="http_mutate" to="http_mutate" method="_on_http_mutate_request_completed"]
[connection signal="request_completed" from="http_projekto" to="." method="_on_http_projekto_request_completed"]
[connection signal="request_completed" from="http_projekto" to="." method="_on_http_projekto_request_completed"]
[connection signal="request_completed" from="http_taskoj" to="." method="_on_http_taskoj_request_completed"]
[connection signal="request_completed" from="http_taskoj" to="." method="_on_http_taskoj_request_completed"]
...
@@ -135,3 +134,4 @@ __meta__ = {
...
@@ -135,3 +134,4 @@ __meta__ = {
[connection signal="request_completed" from="http_posedanto" to="." method="_on_http_posedanto_request_completed"]
[connection signal="request_completed" from="http_posedanto" to="." method="_on_http_posedanto_request_completed"]
[connection signal="request_completed" from="http_finado" to="." method="_on_http_finado_request_completed"]
[connection signal="request_completed" from="http_finado" to="." method="_on_http_finado_request_completed"]
[connection signal="pressed" from="b_itinero" to="." method="_on_Button_pressed"]
[connection signal="pressed" from="b_itinero" to="." method="_on_Button_pressed"]
[connection signal="timeout" from="timer" to="." method="_on_Timer_timeout"]
blokoj/kosmo/skriptoj/http_space_query.gd
удалено
100644 → 0
Просмотр файла @
586b867a
extends
HTTPRequest
const
ship
=
preload
(
"res://blokoj/kosmo/scenoj/ships.tscn"
)
func
_on_http_space_query_request_completed
(
result
,
response_code
,
headers
,
body
):
var
resp
=
body
.
get_string_from_utf8
()
var
parsed_resp
=
parse_json
(
resp
)
var
simpled_data
=
parsed_resp
[
'
data'
][
'
universoObjekto'
][
'
edges'
]
for
item
in
simpled_data
:
if
item
[
'
node'
][
'
resurso'
][
'
tipo'
][
'
objId'
]
==
3
:
#объект станция, на сегодня одна только
$
"../space_object"
.
translation
=
Vector3
(
item
[
'
node'
][
'
koordinatoX'
],
item
[
'
node'
][
'
koordinatoY'
],
item
[
'
node'
][
'
koordinatoZ'
])
$
"../space_object"
.
visible
=
true
if
item
[
'
node'
][
'
resurso'
][
'
tipo'
][
'
objId'
]
==
2
:
#если корабль игрока
if
item
[
'
node'
][
'
posedantoId'
]
==
Global
.
id
:
$
"../ship"
.
translation
=
Vector3
(
item
[
'
node'
][
'
koordinatoX'
],
item
[
'
node'
][
'
koordinatoY'
],
item
[
'
node'
][
'
koordinatoZ'
])
$
"../ship"
.
rotation
=
Vector3
(
item
[
'
node'
][
'
rotaciaX'
],
item
[
'
node'
][
'
rotaciaY'
],
item
[
'
node'
][
'
rotaciaZ'
])
$
"../main_camera"
.
translation
=
Vector3
(
item
[
'
node'
][
'
koordinatoX'
],
item
[
'
node'
][
'
koordinatoY'
],
item
[
'
node'
][
'
koordinatoZ'
]
+
22
)
$
"../ship"
.
visible
=
true
$
"../ship"
.
uuid
=
item
[
'
node'
][
'
uuid'
]
# и теперь по uuid нужно найти проект и задачу
var
projektoj
=
item
[
'
node'
][
'
projekto'
][
'
edges'
]
if
len
(
projektoj
)
>
1
:
pass
#нужно обнулить все проекты!!!
if
len
(
projektoj
)
>
0
:
if
len
(
projektoj
[
0
][
'
node'
][
'
tasko'
][
'
edges'
])
==
0
:
pass
# нужно закрыть проект!!!
else
:
$
"../ship"
.
projekto_uuid
=
projektoj
[
0
][
'
node'
][
'
uuid'
]
#заполняем маршрут
$
"../b_itinero/itinero"
.
itineroj
.
clear
()
for
tasko
in
projektoj
[
0
][
'
node'
][
'
tasko'
][
'
edges'
]:
if
tasko
[
'
node'
][
'
statuso'
][
'
objId'
]
==
2
:
#задачу, которая "В работе" ставим первой
$
"../b_itinero/itinero"
.
itineroj
.
append
({
'
uuid_tasko'
:
tasko
[
'
node'
][
'
uuid'
],
'
nomo'
:
'
координаты в космосе'
,
'
koordinatoX'
:
tasko
[
'
node'
][
'
finKoordinatoX'
],
'
koordinatoY'
:
tasko
[
'
node'
][
'
finKoordinatoY'
],
'
koordinatoZ'
:
tasko
[
'
node'
][
'
finKoordinatoZ'
]
})
break
;
for
tasko
in
projektoj
[
0
][
'
node'
][
'
tasko'
][
'
edges'
]:
if
tasko
[
'
node'
][
'
statuso'
][
'
objId'
]
==
1
:
# добавляем остальные задачи
$
"../b_itinero/itinero"
.
itineroj
.
append
({
'
uuid_tasko'
:
tasko
[
'
node'
][
'
uuid'
],
'
nomo'
:
'
координаты в космосе'
,
'
koordinatoX'
:
tasko
[
'
node'
][
'
finKoordinatoX'
],
'
koordinatoY'
:
tasko
[
'
node'
][
'
finKoordinatoY'
],
'
koordinatoZ'
:
tasko
[
'
node'
][
'
finKoordinatoZ'
]
})
print
(
'
ship4'
)
if
len
(
$
"../b_itinero/itinero"
.
itineroj
)
==
0
:
$
"../ship"
.
projekto_uuid
=
'
'
#задач на полёт нет, проект надо бы закрыть
else
:
#отправляем корабль по координатам
var
position
=
Vector3
(
$
"../b_itinero/itinero"
.
itineroj
[
0
][
'
koordinatoX'
],
$
"../b_itinero/itinero"
.
itineroj
[
0
][
'
koordinatoY'
],
$
"../b_itinero/itinero"
.
itineroj
[
0
][
'
koordinatoZ'
])
$
"../b_itinero/itinero"
.
FillItemList
()
$
"../ship"
.
set_way_point
(
position
,
null
)
$
"../way_point"
.
set_way_point
(
position
)
$
"../ship/timer"
.
start
()
$
"../b_itinero/itinero/canvas/MarginContainer/VBoxContainer/HBoxContainer/kom_itinero"
.
disabled
=
true
$
"../b_itinero/itinero/canvas/MarginContainer/VBoxContainer/HBoxContainer/itinero_next"
.
disabled
=
false
$
"../b_itinero/itinero/canvas/MarginContainer/VBoxContainer/HBoxContainer/itinero_fin"
.
disabled
=
false
$
"../b_itinero/itinero/canvas/MarginContainer/VBoxContainer/HBoxContainer/itinero_clear"
.
disabled
=
false
else
:
$
"../ship"
.
projekto_uuid
=
'
'
else
:
var
s
=
ship
.
instance
()
s
.
translation
=
Vector3
(
item
[
'
node'
][
'
koordinatoX'
],
item
[
'
node'
][
'
koordinatoY'
],
item
[
'
node'
][
'
koordinatoZ'
])
# s.rotation=Vector3(item['node']['rotaciaX'],
# item['node']['rotaciaY'], item['node']['rotaciaZ'])
$
"../"
.
add_child
(
s
)
Title
.
get_node
(
"CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
)
.
distance_to
(
$
"../ship"
.
translation
)
blokoj/kosmo/skriptoj/itinero.gd
Просмотр файла @
0e701b2f
...
@@ -9,6 +9,7 @@ var itineroj = []
...
@@ -9,6 +9,7 @@ var itineroj = []
# 'koordinatoX':
# 'koordinatoX':
# 'koordinatoY':
# 'koordinatoY':
# 'koordinatoZ':
# 'koordinatoZ':
# расстояние до цели полёта - distance
func
_on_Close_button_pressed
():
func
_on_Close_button_pressed
():
$
"canvas/MarginContainer"
.
set_visible
(
false
)
$
"canvas/MarginContainer"
.
set_visible
(
false
)
...
@@ -28,7 +29,17 @@ func FillItemList():
...
@@ -28,7 +29,17 @@ func FillItemList():
$
"canvas/MarginContainer/VBoxContainer/ItemList"
.
clear
()
$
"canvas/MarginContainer/VBoxContainer/ItemList"
.
clear
()
# Заполняет список найдеными продуктами
# Заполняет список найдеными продуктами
for
Item
in
itineroj
:
for
Item
in
itineroj
:
get_node
(
"canvas/MarginContainer/VBoxContainer/ItemList"
)
.
add_item
(
Item
[
'
nomo'
],
null
,
true
)
get_node
(
"canvas/MarginContainer/VBoxContainer/ItemList"
)
.
add_item
(
'
('
+
String
(
int
(
Item
[
'
distance'
]))
+
'
) '
+
Item
[
'
nomo'
],
null
,
true
)
#пересчет дистанции до объектов в списке
func
distance_to
(
trans
):
for
obj
in
itineroj
:
obj
[
'
distance'
]
=
trans
.
distance_to
(
Vector3
(
obj
[
'
koordinatoX'
],
obj
[
'
koordinatoY'
],
obj
[
'
koordinatoZ'
]))
$
'
canvas/MarginContainer/VBoxContainer/ItemList'
.
clear
()
# $'canvas/MarginContainer/VBoxContainer/scroll/ItemList'.clear()
FillItemList
()
#отправляем корабль в полёт
#отправляем корабль в полёт
func
go_ship
():
func
go_ship
():
...
@@ -41,7 +52,7 @@ func go_ship():
...
@@ -41,7 +52,7 @@ func go_ship():
func
_on_kom_itinero_pressed
():
func
_on_kom_itinero_pressed
():
#остановить текущие задачи
#остановить текущие задачи
# останавливаем таймер передачи данных на сервер
# останавливаем таймер передачи данных на сервер
$
"../../
ship/
timer"
.
stop
()
$
"../../timer"
.
stop
()
#отправка последних координат и закрытие зачачи с проектом
#отправка последних координат и закрытие зачачи с проектом
$
"../../ship"
.
finofara_flugo
()
$
"../../ship"
.
finofara_flugo
()
#создать проект
#создать проект
...
@@ -51,17 +62,18 @@ func _on_kom_itinero_pressed():
...
@@ -51,17 +62,18 @@ func _on_kom_itinero_pressed():
# отправляем в полёт
# отправляем в полёт
go_ship
()
go_ship
()
#запускаем таймер
#запускаем таймер
$
"../../
ship/
timer"
.
start
()
$
"../../timer"
.
start
()
$
canvas
/
MarginContainer
/
VBoxContainer
/
HBoxContainer
/
kom_itinero
.
disabled
=
true
$
canvas
/
MarginContainer
/
VBoxContainer
/
HBoxContainer
/
kom_itinero
.
disabled
=
true
func
add_itinero
(
uuid
,
nomo
,
koordX
,
koordY
,
koordZ
):
func
add_itinero
(
uuid
,
nomo
,
koordX
,
koordY
,
koordZ
,
distance
):
itineroj
.
append
({
itineroj
.
append
({
'
uuid'
:
uuid
,
'
uuid'
:
uuid
,
'
nomo'
:
nomo
,
'
nomo'
:
nomo
,
'
koordinatoX'
:
koordX
,
'
koordinatoX'
:
koordX
,
'
koordinatoY'
:
koordY
,
'
koordinatoY'
:
koordY
,
'
koordinatoZ'
:
koordZ
,
'
koordinatoZ'
:
koordZ
,
'
distance'
:
distance
,
})
})
FillItemList
()
FillItemList
()
...
@@ -94,7 +106,7 @@ func _on_itinero_clear_pressed():
...
@@ -94,7 +106,7 @@ func _on_itinero_clear_pressed():
#закрываем текущую задачу и проект автоматически закрывается
#закрываем текущую задачу и проект автоматически закрывается
$
"../../ship"
.
clear_way_point
()
$
"../../ship"
.
clear_way_point
()
$
"../../way_point"
.
set_active
(
false
)
$
"../../way_point"
.
set_active
(
false
)
$
"../../
ship/
timer"
.
stop
()
$
"../../timer"
.
stop
()
$
"../../ship"
.
finofara_flugo
()
$
"../../ship"
.
finofara_flugo
()
# itineroj.clear()
# itineroj.clear()
# $canvas/MarginContainer/VBoxContainer/ItemList.clear()
# $canvas/MarginContainer/VBoxContainer/ItemList.clear()
...
@@ -107,5 +119,8 @@ func _on_itinero_clear_pressed():
...
@@ -107,5 +119,8 @@ func _on_itinero_clear_pressed():
# пропустить текущую цель и лететь к следующей
# пропустить текущую цель и лететь к следующей
func
_on_itinero_next_pressed
():
func
_on_itinero_next_pressed
():
$
"../../ship"
.
clear_way_point
()
$
"../../way_point"
.
set_active
(
false
)
$
"../../timer"
.
stop
()
$
"../../ship"
.
finofara_flugo
()
$
"../../ship"
.
finofara_flugo
()
pass
# Replace with function body.
pass
# Replace with function body.
blokoj/kosmo/skriptoj/main_camera.gd
Просмотр файла @
0e701b2f
...
@@ -40,7 +40,7 @@ const ROTATION_MULTIPLIER = 500
...
@@ -40,7 +40,7 @@ const ROTATION_MULTIPLIER = 500
func
_ready
():
func
_ready
():
Input
.
set_mouse_mode
(
Input
.
MOUSE_MODE_CONFINED
)
Input
.
set_mouse_mode
(
Input
.
MOUSE_MODE_CONFINED
)
func
_input
(
event
):
func
_unhandled
_input
(
event
):
if
freelook
:
if
freelook
:
if
Input
.
get_action_strength
(
"right_click"
):
if
Input
.
get_action_strength
(
"right_click"
):
Input
.
set_mouse_mode
(
Input
.
MOUSE_MODE_CAPTURED
)
Input
.
set_mouse_mode
(
Input
.
MOUSE_MODE_CAPTURED
)
...
@@ -48,6 +48,8 @@ func _input(event):
...
@@ -48,6 +48,8 @@ func _input(event):
_mouse_offset
=
event
.
relative
_mouse_offset
=
event
.
relative
else
:
else
:
Input
.
set_mouse_mode
(
Input
.
MOUSE_MODE_VISIBLE
)
Input
.
set_mouse_mode
(
Input
.
MOUSE_MODE_VISIBLE
)
func
_input
(
event
):
if
privot
:
if
privot
:
if
event
.
is_action_pressed
(
"wheel_down"
):
if
event
.
is_action_pressed
(
"wheel_down"
):
distance
-=
distance_step
distance
-=
distance_step
...
...
blokoj/kosmo/skriptoj/menuo.gd
Просмотр файла @
0e701b2f
...
@@ -18,25 +18,27 @@ func _input(event: InputEvent) -> void:
...
@@ -18,25 +18,27 @@ func _input(event: InputEvent) -> void:
const
translacio
=
20
const
translacio
=
20
func
_on_PopupMenu_index_pressed
(
index
):
func
_on_PopupMenu_index_pressed
(
index
):
var
index_obj
=
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window/canvas/MarginContainer/VBoxContainer/ItemList"
.
get_selected_items
()
var
index_obj
=
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window/canvas/MarginContainer/VBoxContainer/
scroll/
ItemList"
.
get_selected_items
()
if
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
uuid'
]
==$
"../ship"
.
uuid
:
#если свой корабль
if
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
uuid'
]
==$
"../ship"
.
uuid
:
#если свой корабль
return
null
return
null
var
koordX
=
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
koordinatoX'
]
+
translacio
var
koordX
=
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
koordinatoX'
]
+
translacio
var
koordY
=
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
koordinatoY'
]
+
translacio
var
koordY
=
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
koordinatoY'
]
+
translacio
var
koordZ
=
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
koordinatoZ'
]
+
translacio
var
koordZ
=
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
koordinatoZ'
]
+
translacio
var
distance_to
=
$
"../ship"
.
translation
.
distance_to
(
Vector3
(
koordX
,
koordY
,
koordZ
))
$
"../b_itinero/itinero"
.
itineroj
.
append
({
'
uuid'
:
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
uuid'
],
'
nomo'
:
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
nomo'
],
'
koordinatoX'
:
koordX
,
'
koordinatoY'
:
koordY
,
'
koordinatoZ'
:
koordZ
,
'
distance'
:
distance_to
,
})
$
"../b_itinero/itinero"
.
FillItemList
()
if
index
==
0
:
if
index
==
0
:
$
"../"
.
set_way_point
(
Vector3
(
koordX
,
koordY
,
koordZ
),
null
)
# $"../".set_way_point(Vector3(koordX,koordY,koordZ),null)
elif
index
==
1
:
$
"../b_itinero/itinero"
.
_on_kom_itinero_pressed
()
var
distance_to
=
$
"../ship"
.
translation
.
distance_to
(
Vector3
(
koordX
,
koordY
,
koordZ
))
# elif index==1:
$
"../b_itinero/itinero"
.
itineroj
.
append
({
'
uuid'
:
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
uuid'
],
'
nomo'
:
$
"/root/Title/CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
.
ItemListContent
[
index_obj
[
0
]][
'
nomo'
]
+
'
('
+
String
(
distance_to
)
+
'
)'
,
'
koordinatoX'
:
koordX
,
'
koordinatoY'
:
koordY
,
'
koordinatoZ'
:
koordZ
,
})
$
"../b_itinero/itinero"
.
FillItemList
()
func
_on_PopupMenu_draw
():
func
_on_PopupMenu_draw
():
...
...
blokoj/kosmo/skriptoj/queries.gd
Просмотр файла @
0e701b2f
...
@@ -13,11 +13,13 @@ func objecto_query(kuboId, statusoId, kategorioId, tipo_id):
...
@@ -13,11 +13,13 @@ func objecto_query(kuboId, statusoId, kategorioId, tipo_id):
"{ universoObjekto (realeco_Id:$realecoId, kubo_Id: $kuboId, koordinatoX_Gt:-5000000, "
+
"{ universoObjekto (realeco_Id:$realecoId, kubo_Id: $kuboId, koordinatoX_Gt:-5000000, "
+
" koordinatoY_Gt:-5000000, koordinatoZ_Gt:-5000000) { edges { node { uuid posedantoId "
+
" koordinatoY_Gt:-5000000, koordinatoZ_Gt:-5000000) { edges { node { uuid posedantoId "
+
" projekto (statuso_Id: $statusoId, tipo_Id: $tipoId){ "
+
" projekto (statuso_Id: $statusoId, tipo_Id: $tipoId){ "
+
" edges { node { uuid "
+
" edges { node { uuid "
+
" tasko (kategorio_Id:$kategorioId){ edges {node { "
+
" tasko (kategorio_Id:$kategorioId){ edges {node { "
+
" uuid finKoordinatoX finKoordinatoY finKoordinatoZ statuso {objId} } } } } } } "
+
" uuid finKoordinatoX finKoordinatoY finKoordinatoZ statuso {objId} } } } } } } "
+
" inCosmo nomo { enhavo } priskribo { enhavo } resurso { nomo { enhavo } priskribo { enhavo } "
+
" inCosmo nomo { enhavo } priskribo { enhavo } "
+
" tipo { objId nomo { enhavo } } } koordinatoX koordinatoY koordinatoZ "
+
" resurso { nomo { enhavo } priskribo { enhavo } "
+
" tipo { objId nomo { enhavo } } } "
+
" koordinatoX koordinatoY koordinatoZ "
+
" rotaciaX rotaciaY rotaciaZ } } } }"
,
" rotaciaX rotaciaY rotaciaZ } } } }"
,
'
variables'
:
{
"kuboId"
:
kuboId
,
"statusoId"
:
statusoId
,
'
variables'
:
{
"kuboId"
:
kuboId
,
"statusoId"
:
statusoId
,
"kategorioId"
:
kategorioId
,
"tipoId"
:
tipo_id
,
"kategorioId"
:
kategorioId
,
"tipoId"
:
tipo_id
,
...
...
blokoj/kosmo/skriptoj/ship.gd
Просмотр файла @
0e701b2f
...
@@ -38,7 +38,7 @@ func _physics_process(delta):
...
@@ -38,7 +38,7 @@ func _physics_process(delta):
clear_way_point
()
clear_way_point
()
print
(
"doexali"
)
print
(
"doexali"
)
# останавливаем таймер передачи данных на сервер
# останавливаем таймер передачи данных на сервер
$
timer
.
stop
()
$
"../
timer
"
.
stop
()
#отправка последних координат и закрытие задачи с проектом
#отправка последних координат и закрытие задачи с проектом
finofara_flugo
()
finofara_flugo
()
return
return
...
@@ -47,6 +47,8 @@ func _physics_process(delta):
...
@@ -47,6 +47,8 @@ func _physics_process(delta):
if
docking_rotation
!=
null
:
if
docking_rotation
!=
null
:
transform
.
basis
=
Basis
(
Quat
(
transform
.
basis
)
.
slerp
(
docking_rotation
,
speed_rotation
*
1.5
))
#поворачиваем в дефолтное состояние, чтобы сесть
transform
.
basis
=
Basis
(
Quat
(
transform
.
basis
)
.
slerp
(
docking_rotation
,
speed_rotation
*
1.5
))
#поворачиваем в дефолтное состояние, чтобы сесть
move_and_slide
(
target_dir
*
delta
*
current_speed
)
#Двигаемся к цели
move_and_slide
(
target_dir
*
delta
*
current_speed
)
#Двигаемся к цели
Title
.
get_node
(
"CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
)
.
distance_to
(
translation
)
$
"../b_itinero/itinero"
.
distance_to
(
translation
)
func
set_way_point
(
position
,
dock
):
func
set_way_point
(
position
,
dock
):
...
@@ -156,5 +158,5 @@ func finofara_flugo():
...
@@ -156,5 +158,5 @@ func finofara_flugo():
$
"../ship"
.
set_way_point
(
position
,
null
)
$
"../ship"
.
set_way_point
(
position
,
null
)
$
"../way_point"
.
set_way_point
(
position
)
$
"../way_point"
.
set_way_point
(
position
)
#запускаем таймер
#запускаем таймер
$
"../
ship/
timer"
.
start
()
$
"../timer"
.
start
()
pass
pass
blokoj/kosmo/skriptoj/space.gd
Просмотр файла @
0e701b2f
...
@@ -2,6 +2,8 @@ extends Spatial
...
@@ -2,6 +2,8 @@ extends Spatial
var
choose
=
false
var
choose
=
false
signal
load_objektoj
func
_ready
():
func
_ready
():
for
i
in
get_children
():
for
i
in
get_children
():
if
has_signal
(
i
,
"new_way_point"
):
if
has_signal
(
i
,
"new_way_point"
):
...
@@ -16,15 +18,15 @@ func _input(event):
...
@@ -16,15 +18,15 @@ func _input(event):
$
main_camera
.
set_privot
(
null
)
$
main_camera
.
set_privot
(
null
)
func
set_way_point
(
position
,
dock
):
func
set_way_point
(
position
,
dock
):
$
ship
.
add_itinero
()
get_node
(
"
ship
"
)
.
add_itinero
()
#останавливаем таймер
#останавливаем таймер
$
"ship/
timer
"
.
stop
()
$
timer
.
stop
()
$
ship
.
set_way_point
(
position
,
dock
)
$
ship
.
set_way_point
(
position
,
dock
)
$
way_point
.
set_way_point
(
position
)
$
way_point
.
set_way_point
(
position
)
#передаём текущие координаты
#передаём текущие координаты
$
ship
.
vojkomenco
()
#начинаем движение
$
ship
.
vojkomenco
()
#начинаем движение
#запускаем таймер
#запускаем таймер
$
"ship/
timer
"
.
start
()
$
timer
.
start
()
func
has_signal
(
node
,
sgnl
):
func
has_signal
(
node
,
sgnl
):
if
node
==
null
:
if
node
==
null
:
...
@@ -41,15 +43,6 @@ func has_signal(node, sgnl):
...
@@ -41,15 +43,6 @@ func has_signal(node, sgnl):
const
QueryObject
=
preload
(
"queries.gd"
)
const
QueryObject
=
preload
(
"queries.gd"
)
func
_on_space_ready
():
#космос сформирован
var
q
=
QueryObject
.
new
()
# Делаем запрос к бэкэнду
$
http_space_query
.
request
(
q
.
URL
,
Global
.
backend_headers
,
true
,
2
,
q
.
objecto_query
(
1
,
2
,
3
,
2
))
# записав проект в базу, получили его uuid
# записав проект в базу, получили его uuid
func
_on_http_projekto_request_completed
(
result
,
response_code
,
headers
,
body
):
func
_on_http_projekto_request_completed
(
result
,
response_code
,
headers
,
body
):
var
resp
=
body
.
get_string_from_utf8
()
var
resp
=
body
.
get_string_from_utf8
()
...
@@ -106,3 +99,111 @@ func _on_http_taskoj_request_completed(result, response_code, headers, body):
...
@@ -106,3 +99,111 @@ func _on_http_taskoj_request_completed(result, response_code, headers, body):
$
"b_itinero/itinero"
.
itineroj
[
i
][
'
uuid_tasko'
]
=
tasko
[
'
uuid'
]
$
"b_itinero/itinero"
.
itineroj
[
i
][
'
uuid_tasko'
]
=
tasko
[
'
uuid'
]
i
+=
1
i
+=
1
const
ships
=
preload
(
"res://blokoj/kosmo/scenoj/ships.tscn"
)
const
space_object
=
preload
(
"res://blokoj/kosmo/scenoj/space_object.tscn"
)
const
ship_gem
=
preload
(
"res://blokoj/kosmo/scenoj/ship.tscn"
)
func
_on_space_load_objektoj
():
for
item
in
Global
.
objektoj
:
if
item
[
'
resurso'
][
'
tipo'
][
'
objId'
]
==
3
:
#объект станция, на сегодня одна только
var
state
=
space_object
.
instance
()
state
.
translation
=
Vector3
(
item
[
'
koordinatoX'
],
item
[
'
koordinatoY'
],
item
[
'
koordinatoZ'
])
add_child
(
state
)
state
.
add_to_group
(
'
state'
)
state
.
add_to_group
(
'
create'
)
if
(
item
[
'
resurso'
][
'
tipo'
][
'
objId'
]
==
2
)
and
(
item
[
'
koordinatoX'
]):
#если корабль игрока
if
item
[
'
posedantoId'
]
==
Global
.
id
:
var
ship
=
ship_gem
.
instance
()
ship
.
translation
=
Vector3
(
item
[
'
koordinatoX'
],
item
[
'
koordinatoY'
],
item
[
'
koordinatoZ'
])
ship
.
rotation
=
Vector3
(
item
[
'
rotaciaX'
],
item
[
'
rotaciaY'
],
item
[
'
rotaciaZ'
])
$
main_camera
.
translation
=
Vector3
(
item
[
'
koordinatoX'
],
item
[
'
koordinatoY'
],
item
[
'
koordinatoZ'
]
+
22
)
ship
.
visible
=
true
ship
.
uuid
=
item
[
'
uuid'
]
add_child
(
ship
,
true
)
ship
.
add_to_group
(
'
create'
)
Title
.
get_node
(
"CanvasLayer/UI/Lbar/L_VBox/Objektoj/Window"
)
.
distance_to
(
ship
.
translation
)
# и теперь по uuid нужно найти проект и задачу
var
projektoj
=
item
[
'
projekto'
][
'
edges'
]
if
len
(
projektoj
)
>
1
:
pass
#нужно обнулить все проекты!!!
if
len
(
projektoj
)
>
0
:
if
len
(
projektoj
[
0
][
'
node'
][
'
tasko'
][
'
edges'
])
==
0
:
pass
# нужно закрыть проект!!!
else
:
ship
.
projekto_uuid
=
projektoj
[
0
][
'
node'
][
'
uuid'
]
#заполняем маршрут
$
"b_itinero/itinero"
.
itineroj
.
clear
()
for
tasko
in
projektoj
[
0
][
'
node'
][
'
tasko'
][
'
edges'
]:
if
tasko
[
'
node'
][
'
statuso'
][
'
objId'
]
==
2
:
#задачу, которая "В работе" ставим первой
$
"b_itinero/itinero"
.
itineroj
.
append
({
'
uuid_tasko'
:
tasko
[
'
node'
][
'
uuid'
],
'
nomo'
:
'
координаты в космосе'
,
'
koordinatoX'
:
tasko
[
'
node'
][
'
finKoordinatoX'
],
'
koordinatoY'
:
tasko
[
'
node'
][
'
finKoordinatoY'
],
'
koordinatoZ'
:
tasko
[
'
node'
][
'
finKoordinatoZ'
]
})
break
;
for
tasko
in
projektoj
[
0
][
'
node'
][
'
tasko'
][
'
edges'
]:
if
tasko
[
'
node'
][
'
statuso'
][
'
objId'
]
==
1
:
# добавляем остальные задачи
$
"b_itinero/itinero"
.
itineroj
.
append
({
'
uuid_tasko'
:
tasko
[
'
node'
][
'
uuid'
],
'
nomo'
:
'
координаты в космосе'
,
'
koordinatoX'
:
tasko
[
'
node'
][
'
finKoordinatoX'
],
'
koordinatoY'
:
tasko
[
'
node'
][
'
finKoordinatoY'
],
'
koordinatoZ'
:
tasko
[
'
node'
][
'
finKoordinatoZ'
]
})
if
len
(
$
"b_itinero/itinero"
.
itineroj
)
==
0
:
ship
.
projekto_uuid
=
'
'
#задач на полёт нет, проект надо бы закрыть
else
:
#отправляем корабль по координатам
var
position
=
Vector3
(
$
"b_itinero/itinero"
.
itineroj
[
0
][
'
koordinatoX'
],
$
"b_itinero/itinero"
.
itineroj
[
0
][
'
koordinatoY'
],
$
"b_itinero/itinero"
.
itineroj
[
0
][
'
koordinatoZ'
])
$
"b_itinero/itinero"
.
FillItemList
()
ship
.
set_way_point
(
position
,
null
)
$
"way_point"
.
set_way_point
(
position
)
$
timer
.
start
()
$
"b_itinero/itinero/canvas/MarginContainer/VBoxContainer/HBoxContainer/kom_itinero"
.
disabled
=
true
$
"b_itinero/itinero/canvas/MarginContainer/VBoxContainer/HBoxContainer/itinero_next"
.
disabled
=
false
$
"b_itinero/itinero/canvas/MarginContainer/VBoxContainer/HBoxContainer/itinero_fin"
.
disabled
=
false
$
"b_itinero/itinero/canvas/MarginContainer/VBoxContainer/HBoxContainer/itinero_clear"
.
disabled
=
false
else
:
ship
.
projekto_uuid
=
'
'
else
:
if
(
item
[
'
koordinatoX'
]):
var
s
=
ships
.
instance
()
s
.
translation
=
Vector3
(
item
[
'
koordinatoX'
],
item
[
'
koordinatoY'
],
item
[
'
koordinatoZ'
])
# s.rotation=Vector3(item['rotaciaX'],
# item['rotaciaY'], item['rotaciaZ'])
add_child
(
s
)
s
.
add_to_group
(
'
create'
)
s
.
add_to_group
(
'
enemies'
)
pass
# Replace with function body.
func
_on_Timer_timeout
():
var
q
=
QueryObject
.
new
()
# Делаем запрос к бэкэнду
$
http_mutate
.
request
(
q
.
URL
,
Global
.
backend_headers
,
true
,
2
,
q
.
objecto_mutation
(
$
ship
.
uuid
,
$
ship
.
translation
.
x
,
$
ship
.
translation
.
y
,
$
ship
.
translation
.
z
,
$
ship
.
rotation
.
x
,
$
ship
.
rotation
.
y
,
$
ship
.
rotation
.
z
)
)
func
_on_space_tree_exiting
():
#разрушаем все созданные объекты в этом мире
for
ch
in
get_children
():
if
ch
.
is_in_group
(
'
create'
):
ch
.
free
()
blokoj/objektoj/scenoj/objekto.tscn
Просмотр файла @
0e701b2f
...
@@ -68,7 +68,7 @@ __meta__ = {
...
@@ -68,7 +68,7 @@ __meta__ = {
}
}
[node name="Label" type="Label" parent="canvas/MarginContainer/VBoxContainer"]
[node name="Label" type="Label" parent="canvas/MarginContainer/VBoxContainer"]
margin_right = 31
7
.0
margin_right = 31
6
.0
margin_bottom = 21.0
margin_bottom = 21.0
custom_fonts/font = SubResource( 1 )
custom_fonts/font = SubResource( 1 )
text = "Объекты"
text = "Объекты"
...
@@ -103,6 +103,7 @@ __meta__ = {
...
@@ -103,6 +103,7 @@ __meta__ = {
}
}
[node name="check" type="CheckBox" parent="canvas/MarginContainer/VBoxContainer/Label"]
[node name="check" type="CheckBox" parent="canvas/MarginContainer/VBoxContainer/Label"]
visible = false
margin_right = 24.0
margin_right = 24.0
margin_bottom = 24.0
margin_bottom = 24.0
pressed = true
pressed = true
...
@@ -112,15 +113,15 @@ __meta__ = {
...
@@ -112,15 +113,15 @@ __meta__ = {
[node name="scroll" type="ScrollContainer" parent="canvas/MarginContainer/VBoxContainer"]
[node name="scroll" type="ScrollContainer" parent="canvas/MarginContainer/VBoxContainer"]
margin_top = 25.0
margin_top = 25.0
margin_right = 31
7
.0
margin_right = 31
6
.0
margin_bottom = 21
4
.0
margin_bottom = 21
5
.0
size_flags_horizontal = 3
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_vertical = 3
[node name="ItemList" type="ItemList" parent="canvas/MarginContainer/VBoxContainer/scroll"]
[node name="ItemList" type="ItemList" parent="canvas/MarginContainer/VBoxContainer/scroll"]
self_modulate = Color( 1, 1, 1, 0.784314 )
self_modulate = Color( 1, 1, 1, 0.784314 )
margin_right = 31
7
.0
margin_right = 31
6
.0
margin_bottom = 1
8
9.0
margin_bottom = 19
0
.0
size_flags_horizontal = 3
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_vertical = 3
custom_fonts/font = SubResource( 2 )
custom_fonts/font = SubResource( 2 )
...
...
blokoj/objektoj/skriptoj/http_objecto_request.gd
Просмотр файла @
0e701b2f
...
@@ -10,8 +10,9 @@ func _on_HTTPRequestFind_request_completed(result, response_code, headers, body)
...
@@ -10,8 +10,9 @@ func _on_HTTPRequestFind_request_completed(result, response_code, headers, body)
$
'
../'
.
ItemListContent
.
clear
()
$
'
../'
.
ItemListContent
.
clear
()
$
'
../canvas/MarginContainer/VBoxContainer/scroll/ItemList'
.
clear
()
$
'
../canvas/MarginContainer/VBoxContainer/scroll/ItemList'
.
clear
()
# $'../MarginContainer/VBoxContainer/'.get_node("DetailLabel").set_text("")
# $'../MarginContainer/VBoxContainer/'.get_node("DetailLabel").set_text("")
Global
.
objektoj
.
clear
()
for
item
in
simpled_data
:
for
item
in
simpled_data
:
Global
.
objektoj
.
append
(
item
[
'
node'
])
var
itemj
=
{
var
itemj
=
{
'
nomo'
:
item
[
'
node'
][
'
nomo'
][
'
enhavo'
],
'
nomo'
:
item
[
'
node'
][
'
nomo'
][
'
enhavo'
],
'
priskribo'
:
item
[
'
node'
][
'
priskribo'
][
'
enhavo'
],
'
priskribo'
:
item
[
'
node'
][
'
priskribo'
][
'
enhavo'
],
...
@@ -19,10 +20,12 @@ func _on_HTTPRequestFind_request_completed(result, response_code, headers, body)
...
@@ -19,10 +20,12 @@ func _on_HTTPRequestFind_request_completed(result, response_code, headers, body)
'
koordinatoX'
:
item
[
'
node'
][
'
koordinatoX'
],
'
koordinatoX'
:
item
[
'
node'
][
'
koordinatoX'
],
'
koordinatoY'
:
item
[
'
node'
][
'
koordinatoY'
],
'
koordinatoY'
:
item
[
'
node'
][
'
koordinatoY'
],
'
koordinatoZ'
:
item
[
'
node'
][
'
koordinatoZ'
],
'
koordinatoZ'
:
item
[
'
node'
][
'
koordinatoZ'
],
'
posedantoId'
:
item
[
'
node'
][
'
posedantoId'
],
'
posedantoObjekto'
:
item
[
'
node'
][
'
posedantoObjekto'
],
'
posedantoObjekto'
:
item
[
'
node'
][
'
posedantoObjekto'
],
'
inCosmo'
:
item
[
'
node'
][
'
inCosmo'
],
'
inCosmo'
:
item
[
'
node'
][
'
inCosmo'
],
'
distance'
:
0
,
'
distance'
:
0
,
}
}
$
'
../'
.
ItemListContent
.
append
(
itemj
)
$
'
../'
.
ItemListContent
.
append
(
itemj
)
# print('=====',$'../'.ItemListContent)
$
'
../'
.
FillItemList
()
$
'
../'
.
FillItemList
()
if
$
"/root"
.
get_node_or_null
(
'
space'
):
$
"/root"
.
get_node
(
'
space'
)
.
emit_signal
(
"load_objektoj"
)
blokoj/objektoj/skriptoj/objekto_menou.gd
Просмотр файла @
0e701b2f
...
@@ -12,21 +12,12 @@ var ItemListContent = []
...
@@ -12,21 +12,12 @@ var ItemListContent = []
# 'koordinatoY':
# 'koordinatoY':
# 'koordinatoZ':
# 'koordinatoZ':
# distance
# distance
# posedantoId
#_to = $"../ship".translation.distance_to(Vector3(koordX,koordY,koordZ))
#_to = $"../ship".translation.distance_to(Vector3(koordX,koordY,koordZ))
func
_on_Close_button_pressed
():
func
_on_Close_button_pressed
():
$
"canvas/MarginContainer"
.
set_visible
(
false
)
$
"canvas/MarginContainer"
.
set_visible
(
false
)
#func _input(event):
# if Input.is_action_just_pressed("right_click"):
# if event is InputEventMouseButton and $"canvas/MarginContainer".visible:
# var x = $".".get_global_mouse_position().x
# var y = $".".get_global_mouse_position().y
# if($"canvas/MarginContainer/VBoxContainer/ItemList".margin_left<x) and (x<$"canvas/MarginContainer/VBoxContainer/ItemList".margin_right):
# $"canvas/MarginContainer/VBoxContainer/ItemList".select(1,true)
# print('margin_left=',$"canvas/MarginContainer/VBoxContainer/ItemList".margin_left,' x=',x,' margin_right=',$"canvas/MarginContainer/VBoxContainer/ItemList".margin_right)
func
_resize
(
event
:
InputEvent
)
->
void
:
func
_resize
(
event
:
InputEvent
)
->
void
:
...
@@ -44,7 +35,9 @@ func FillItemList():
...
@@ -44,7 +35,9 @@ func FillItemList():
var
ls
=
ItemListContent
var
ls
=
ItemListContent
ItemListContent
=
[]
ItemListContent
=
[]
for
Item
in
ls
:
for
Item
in
ls
:
if
Item
[
'
inCosmo'
]:
# если в космосе и нет объекта-владельца, то добавляем в список
#если корабль игрока, то его не добавляем в список
if
Item
[
'
inCosmo'
]
and
(
not
Item
[
'
posedantoObjekto'
])
and
Item
[
'
posedantoId'
]
!=
Global
.
id
:
ItemListContent
.
append
(
Item
)
ItemListContent
.
append
(
Item
)
PrintList
()
PrintList
()
...
@@ -62,15 +55,14 @@ func distance_to(trans):
...
@@ -62,15 +55,14 @@ func distance_to(trans):
obj
[
'
koordinatoY'
],
obj
[
'
koordinatoZ'
]))
obj
[
'
koordinatoY'
],
obj
[
'
koordinatoZ'
]))
$
'
canvas/MarginContainer/VBoxContainer/scroll/ItemList'
.
clear
()
$
'
canvas/MarginContainer/VBoxContainer/scroll/ItemList'
.
clear
()
PrintList
()
PrintList
()
pass
# Вызывается перед созданием окна
# Вызывается перед созданием окна
func
_on_Objekto_draw
():
func
_on_Objekto_draw
():
var
q
=
QueryObject
.
new
()
var
q
=
QueryObject
.
new
()
# Делаем запрос к бэкэнду
# Делаем запрос к бэкэнду
$
HTTPObjectoRequestFind
.
request
(
q
.
URL
,
Global
.
backend_headers
,
true
,
2
,
q
.
objecto_query
())
$
HTTPObjectoRequestFind
.
request
(
q
.
URL
,
Global
.
backend_headers
,
true
,
2
,
q
.
objecto_query
(
2
,
3
,
2
,
1
))
func
_on_reload_pressed
():
func
_on_reload_pressed
():
...
@@ -87,3 +79,5 @@ func _on_ItemList_item_selected(index):
...
@@ -87,3 +79,5 @@ func _on_ItemList_item_selected(index):
func
_on_check_pressed
():
func
_on_check_pressed
():
_on_Objekto_draw
()
_on_Objekto_draw
()
pass
# Replace with function body.
pass
# Replace with function body.
blokoj/objektoj/skriptoj/queries.gd
Просмотр файла @
0e701b2f
...
@@ -7,11 +7,33 @@ const URL = "https://t34.tehnokom.su/api/v1.1/"
...
@@ -7,11 +7,33 @@ const URL = "https://t34.tehnokom.su/api/v1.1/"
# Запрос к API
# Запрос к API
func
objecto_query
(
kuboId
=
1
):
func
objecto_query
(
statusoId
,
kategorioId
,
tipoId
,
kuboId
=
1
):
return
JSON
.
print
({
'
query'
:
'
query ($kuboId:Float, $realecoId:Float ) { '
+
# return JSON.print({ 'query': 'query ($kuboId:Float, $realecoId:Float ) { '+
'
universoObjekto (kubo_Id:$kuboId, realeco_Id:$realecoId) { edges { node { '
+
# 'universoObjekto (kubo_Id:$kuboId, realeco_Id:$realecoId) { edges { node { '+
'
uuid nomo { enhavo } priskribo { enhavo } '
+
# ' uuid nomo { enhavo } priskribo { enhavo } '+
'
koordinatoX koordinatoY koordinatoZ posedantoObjekto '
+
# ' koordinatoX koordinatoY koordinatoZ ' +
'
{ uuid } inCosmo } } } }'
,
# ' posedantoObjekto '+
"variables"
:
{
"kuboId"
:
kuboId
,
# ' { uuid } '+
# ' inCosmo } } } }',
# "variables": {"kuboId":kuboId,
# "realecoId":Global.realeco} })
# func objecto_query(kuboId, statusoId, kategorioId, tipo_id):
return
JSON
.
print
({
"query"
:
"query ($kuboId:Float, $statusoId:Float, "
+
" $realecoId:Float, $kategorioId:Float, $tipoId:Float) "
+
"{ universoObjekto (realeco_Id:$realecoId, kubo_Id: $kuboId, "
+
" ) { edges { node { uuid posedantoId "
+
" projekto (statuso_Id: $statusoId, tipo_Id: $tipoId){ "
+
" edges { node { uuid "
+
" tasko (kategorio_Id:$kategorioId){ edges {node { "
+
" uuid finKoordinatoX finKoordinatoY finKoordinatoZ statuso {objId} } } } } } } "
+
" inCosmo nomo { enhavo } priskribo { enhavo } "
+
" resurso { nomo { enhavo } priskribo { enhavo } "
+
" tipo { objId nomo { enhavo } } } "
+
" koordinatoX koordinatoY koordinatoZ "
+
'
posedantoObjekto '
+
'
{ uuid } '
+
" rotaciaX rotaciaY rotaciaZ } } } }"
,
'
variables'
:
{
"kuboId"
:
kuboId
,
"statusoId"
:
statusoId
,
"kategorioId"
:
kategorioId
,
"tipoId"
:
tipoId
,
"realecoId"
:
Global
.
realeco
}
})
"realecoId"
:
Global
.
realeco
}
})
blokoj/rajtigo/rajtigo.gd
Просмотр файла @
0e701b2f
extends
Node2D
extends
Control
# Вызывается при открытии сцены
# Вызывается при открытии сцены
...
...
blokoj/rajtigo/rajtigo.tscn
Просмотр файла @
0e701b2f
[gd_scene load_steps=18 format=2]
[gd_scene load_steps=10 format=2]
[ext_resource path="res://blokoj/rajtigo/rajtigo.gd" type="Script" id=1]
[ext_resource path="res://kerno/menuo/resursoj/fonts/button_style.tres" type="StyleBox" id=3]
[ext_resource path="res://kerno/menuo/resursoj/fonts/Buttons_stylel.tres" type="StyleBox" id=2]
[ext_resource path="res://kerno/menuo/resursoj/fonts/Buttons_hover.tres" type="StyleBox" id=4]
[ext_resource path="res://kerno/menuo/resursoj/fonts/new_dynamicfont.tres" type="DynamicFont" id=3]
[ext_resource path="res://blokoj/rajtigo/skriptoj/login_button.gd" type="Script" id=5]
[ext_resource path="res://kerno/menuo/resursoj/fonts/18957.otf" type="DynamicFontData" id=4]
[ext_resource path="res://resursoj/stelamapo_8k.jpg" type="Texture" id=6]
[ext_resource path="res://blokoj/rajtigo/skriptoj/message.gd" type="Script" id=5]
[ext_resource path="res://blokoj/rajtigo/rajtigo.gd" type="Script" id=7]
[ext_resource path="res://kerno/menuo/resursoj/fonts/Buttons_hover.tres" type="StyleBox" id=6]
[ext_resource path="res://blokoj/rajtigo/skriptoj/message.gd" type="Script" id=9]
[ext_resource path="res://blokoj/rajtigo/skriptoj/login_button.gd" type="Script" id=7]
[ext_resource path="res://blokoj/rajtigo/skriptoj/ru.gd" type="Script" id=10]
[ext_resource path="res://blokoj/rajtigo/skriptoj/ru.gd" type="Script" id=8]
[ext_resource path="res://blokoj/rajtigo/skriptoj/en.gd" type="Script" id=11]
[ext_resource path="res://blokoj/rajtigo/skriptoj/en.gd" type="Script" id=9]
[ext_resource path="res://blokoj/rajtigo/skriptoj/eo.gd" type="Script" id=12]
[ext_resource path="res://blokoj/rajtigo/skriptoj/eo.gd" type="Script" id=10]
[ext_resource path="res://resursoj/stelamapo_8k.jpg" type="Texture" id=11]
[node name="auth_menu" type="Control"]
anchor_right = 1.0
[sub_resource type="DynamicFont" id=1]
anchor_bottom = 1.0
font_data = ExtResource( 4 )
margin_left = 0.773926
margin_right = 0.773926
[sub_resource type="DynamicFont" id=2]
size_flags_horizontal = 4
font_data = ExtResource( 4 )
size_flags_vertical = 4
script = ExtResource( 7 )
[sub_resource type="DynamicFont" id=3]
__meta__ = {
font_data = ExtResource( 4 )
"_edit_use_anchors_": false
}
[sub_resource type="DynamicFont" id=4]
font_data = ExtResource( 4 )
[sub_resource type="DynamicFont" id=5]
font_data = ExtResource( 4 )
[sub_resource type="DynamicFont" id=6]
font_data = ExtResource( 4 )
[node name="auth_menu" type="Node2D"]
[node name="Control" type="Control" parent="."]
script = ExtResource( 1 )
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -250.0
margin_top = -125.0
margin_right = 250.0
margin_bottom = 125.0
__meta__ = {
__meta__ = {
"_edit_group_": true
"_edit_lock_": true,
"_edit_use_anchors_": true
}
}
[node name="
l
ogin" type="
Label
" parent="
.
"]
[node name="
L
ogin
Button
" type="
Button
" parent="
Control
"]
margin_left =
280
.0
margin_left =
345
.0
margin_top = 2
3
0.0
margin_top = 2
0
0.0
margin_right =
366
.0
margin_right =
465
.0
margin_bottom = 2
60
.0
margin_bottom = 2
33
.0
custom_styles/
normal
= ExtResource(
2
)
custom_styles/
hover
= ExtResource(
4
)
custom_
font
s/fo
nt
= ExtResource( 3 )
custom_
style
s/fo
cus
= ExtResource( 3 )
text = "Log
i
n"
text = "Log
I
n"
align = 1
flat = true
valign = 1
script = ExtResource( 5 )
__meta__ = {
__meta__ = {
"_edit_use_anchors_": false
"_edit_lock_": true,
"_edit_use_anchors_": true
}
}
[node name="
password
" type="Label" parent="
.
"]
[node name="
message
" type="Label" parent="
Control
"]
margin_left = 280.0
visible = false
margin_
top = 274.63
margin_
left = 15.0
margin_
right = 367
.0
margin_
top = 25
.0
margin_
bottom = 304.63
margin_
right = 485.0
custom_styles/normal = ExtResource( 2 )
margin_bottom = 60.0
custom_
fonts/font = Sub
Resource(
1
)
custom_
styles/normal = Ext
Resource(
3
)
text = "Password"
custom_colors/font_color = Color( 0.968627, 0.0431373, 0.0431373, 1 )
align = 1
align = 1
valign = 1
valign = 1
script = ExtResource( 9 )
[node name="Control" type="Control" parent="."]
__meta__ = {
margin_right = 40.0
"_edit_lock_": true,
margin_bottom = 40.0
"_edit_use_anchors_": true
}
[node name="your_login" type="LineEdit" parent="Control"]
[node name="your_login" type="LineEdit" parent="Control"]
margin_left = 380.0
margin_left = 235.0
margin_top = 230.0
margin_top = 80.0
margin_right = 630.0
margin_right = 485.0
margin_bottom = 260.0
margin_bottom = 110.0
custom_colors/font_color_selected = Color( 0, 0, 0, 1 )
max_length = 24
caret_blink = true
caret_blink_speed = 0.5
__meta__ = {
__meta__ = {
"_edit_use_anchors_": false
"_edit_lock_": true,
"_edit_use_anchors_": true
}
}
[node name="your_password" type="LineEdit" parent="Control"]
[node name="your_password" type="LineEdit" parent="Control"]
margin_left = 380.0
margin_left = 235.0
margin_top = 275.0
margin_top = 140.0
margin_right = 630.0
margin_right = 485.0
margin_bottom = 305.0
margin_bottom = 170.0
max_length = 24
secret = true
caret_blink = true
caret_blink_speed = 0.5
__meta__ = {
__meta__ = {
"_edit_use_anchors_": false
"_edit_lock_": true,
"_edit_use_anchors_": true
}
}
[node name="message" type="Label" parent="."]
[node name="login" type="Label" parent="Control"]
margin_left = 385.0
margin_left = 15.0
margin_top = 185.0
margin_top = 82.0
margin_right = 625.0
margin_right = 235.0
margin_bottom = 218.0
margin_bottom = 108.0
custom_styles/normal = ExtResource( 2 )
custom_styles/normal = ExtResource( 3 )
custom_fonts/font = SubResource( 2 )
text = "LogIn"
custom_colors/font_color = Color( 0.968627, 0.0431373, 0.0431373, 1 )
align = 1
align = 1
valign = 1
valign = 1
script = ExtResource( 5 )
__meta__ = {
__meta__ = {
"_edit_use_anchors_": false
"_edit_lock_": true,
"_edit_use_anchors_": true
}
}
[node name="LoginButton" type="Button" parent="."]
[node name="password" type="Label" parent="Control"]
margin_left = 450.0
margin_left = 15.0
margin_top = 330.0
margin_top = 142.0
margin_right = 570.0
margin_right = 235.0
margin_bottom = 363.0
margin_bottom = 168.0
custom_styles/hover = ExtResource( 6 )
custom_styles/normal = ExtResource( 3 )
custom_styles/focus = ExtResource( 2 )
text = "Password"
custom_fonts/font = SubResource( 3 )
align = 1
text = "LogIn"
valign = 1
flat = true
script = ExtResource( 7 )
__meta__ = {
__meta__ = {
"_edit_use_anchors_": false
"_edit_lock_": true,
"_edit_use_anchors_": true
}
}
[node name="ru" type="Button" parent="."]
[node name="ru" type="Button" parent="."]
margin_left = 950.0
anchor_left = 0.971
margin_top = 3.0
anchor_right = 1.0
margin_right = 985.0
anchor_bottom = 0.023
margin_bottom = 26.0
margin_left = -44.3201
custom_styles/hover = ExtResource( 6 )
margin_top = 25.0
custom_styles/focus = ExtResource( 2 )
margin_right = -55.9998
custom_fonts/font = SubResource( 4 )
margin_bottom = 24.16
custom_styles/hover = ExtResource( 4 )
custom_styles/focus = ExtResource( 3 )
text = "ru"
text = "ru"
flat = true
flat = true
script = ExtResource(
8
)
script = ExtResource(
10
)
__meta__ = {
__meta__ = {
"_edit_use_anchors_": false
"_edit_lock_": true,
"_edit_use_anchors_": true
}
}
[node name="en" type="Button" parent="."]
margin_left = 850.0
margin_top = 3.0
margin_right = 885.0
margin_bottom = 26.0
custom_styles/hover = ExtResource( 6 )
custom_styles/focus = ExtResource( 2 )
custom_fonts/font = SubResource( 5 )
text = "en"
flat = true
script = ExtResource( 9 )
[node name="eo" type="Button" parent="."]
[node name="eo" type="Button" parent="."]
margin_left = 900.0
anchor_left = 0.971
margin_top = 3.0
anchor_right = 1.0
margin_right = 935.0
anchor_bottom = 0.023
margin_bottom = 26.0
margin_left = -94.3201
custom_styles/hover = ExtResource( 6 )
margin_top = 25.0
custom_styles/focus = ExtResource( 2 )
margin_right = -106.0
custom_fonts/font = SubResource( 6 )
margin_bottom = 24.16
custom_styles/hover = ExtResource( 4 )
custom_styles/focus = ExtResource( 3 )
text = "eo"
text = "eo"
flat = true
flat = true
script = ExtResource( 1
0
)
script = ExtResource( 1
2
)
__meta__ = {
__meta__ = {
"_edit_use_anchors_": false
"_edit_lock_": true,
"_edit_use_anchors_": true
}
[node name="en" type="Button" parent="."]
anchor_left = 0.971
anchor_right = 1.0
anchor_bottom = 0.023
margin_left = -144.32
margin_top = 25.0
margin_right = -156.0
margin_bottom = 24.16
custom_styles/hover = ExtResource( 4 )
custom_styles/focus = ExtResource( 3 )
text = "en"
flat = true
script = ExtResource( 11 )
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": true
}
}
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
...
@@ -162,8 +184,12 @@ __meta__ = {
...
@@ -162,8 +184,12 @@ __meta__ = {
[node name="TextureRect" type="TextureRect" parent="ParallaxBackground/ParallaxBackground"]
[node name="TextureRect" type="TextureRect" parent="ParallaxBackground/ParallaxBackground"]
anchor_right = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
anchor_bottom = 1.0
texture = ExtResource( 11 )
margin_top = -100.0
margin_right = 0.00012207
margin_bottom = 120.0
texture = ExtResource( 6 )
expand = true
expand = true
__meta__ = {
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false
"_edit_use_anchors_": false
}
}
blokoj/rajtigo/skriptoj/login_button.gd
Просмотр файла @
0e701b2f
...
@@ -24,7 +24,8 @@ func login_request_complete(result, response_code, headers, body):
...
@@ -24,7 +24,8 @@ func login_request_complete(result, response_code, headers, body):
# Если не авторизован, выводим сообщение, которое вернул бэкэнд
# Если не авторизован, выводим сообщение, которое вернул бэкэнд
if
!
Global
.
status
:
if
!
Global
.
status
:
message
=
tr
(
"Wrong login or password"
)
message
=
tr
(
"Wrong login or password"
)
$
'
../message'
.
set_mytext
(
message
)
$
"/root/auth_menu/Control/message"
.
set_visible
(
true
)
$
"/root/auth_menu/Control/message"
.
set_mytext
(
message
)
# Если авторизован
# Если авторизован
else
:
else
:
# Сюда сложим куки, которые прислал сервер в заголовках ответа
# Сюда сложим куки, которые прислал сервер в заголовках ответа
...
@@ -95,8 +96,8 @@ func get_nickname_request_complete(result, response_code, headers, body):
...
@@ -95,8 +96,8 @@ func get_nickname_request_complete(result, response_code, headers, body):
# Вызывается при нажатии кнопки login
# Вызывается при нажатии кнопки login
func
_pressed
():
func
_pressed
():
var
password
=
$
'
..
/Control/your_password
'
.
text
var
password
=
$
"/root/auth_menu
/Control/your_password
"
.
text
var
login
=
$
'
..
/Control/your_login
'
.
text
var
login
=
$
"/root/auth_menu
/Control/your_login
"
.
text
# Создаём объект HTTP запроса
# Создаём объект HTTP запроса
request
=
HTTPRequest
.
new
()
request
=
HTTPRequest
.
new
()
...
...
kerno/menuo/menuo.gd
Просмотр файла @
0e701b2f
...
@@ -44,6 +44,8 @@ func _on_cap_pressed():
...
@@ -44,6 +44,8 @@ func _on_cap_pressed():
# при переключении миров закрываем окна ресурсов, объектов, т.к. они расчитаны на конкретный мир
# при переключении миров закрываем окна ресурсов, объектов, т.к. они расчитаны на конкретный мир
CloseWindow
()
CloseWindow
()
get_tree
()
.
change_scene
(
'
res://blokoj/kosmo/scenoj/space.tscn'
)
get_tree
()
.
change_scene
(
'
res://blokoj/kosmo/scenoj/space.tscn'
)
# for sc in $"/root".get_children():
# print(' - scena = = ',sc.name)
if
reload
:
if
reload
:
reloadWindow
()
reloadWindow
()
# get_tree().change_scene('res://blokoj/kosmostacio/CapKosmostacio.tscn')
# get_tree().change_scene('res://blokoj/kosmostacio/CapKosmostacio.tscn')
...
@@ -74,6 +76,4 @@ func _on_real_pressed():
...
@@ -74,6 +76,4 @@ func _on_real_pressed():
reloadWindow
()
reloadWindow
()
func
_on_Objecto_pressed
():
# $CanvasLayer/UI/Lbar/L_VBox/itinero/itinero/canvas/MarginContainer.set_visible(true)
pass
kerno/menuo/resursoj/fonts/button_style.tres
0 → 100644
Просмотр файла @
0e701b2f
[gd_resource type="StyleBoxFlat" format=2]
[resource]
bg_color = Color( 1, 1, 1, 1 )
draw_center = false
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color( 0.972549, 0.0235294, 0.027451, 1 )
border_blend = true
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
shadow_size = 5
kerno/menuo/resursoj/fonts/mob200.otf
0 → 100644
Просмотр файла @
0e701b2f
Файл добавлен
kerno/menuo/resursoj/fonts/new_dynamicfont.tres
Просмотр файла @
0e701b2f
[gd_resource type="DynamicFont" load_steps=2 format=2]
[gd_resource type="DynamicFont" load_steps=3 format=2]
[ext_resource path="res://kerno/menuo/resursoj/fonts/18957.otf" type="DynamicFontData" id=1]
[ext_resource path="res://kerno/menuo/resursoj/fonts/mob200.otf" type="DynamicFontData" id=1]
[ext_resource path="res://kerno/menuo/resursoj/fonts/tenotune.ttf" type="DynamicFontData" id=2]
[resource]
[resource]
font_data = ExtResource( 1 )
size = 14
use_filter = true
extra_spacing_char = 2
font_data = ExtResource( 2 )
fallback/0 = ExtResource( 1 )
Пред
1
2
След
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать