Открыть боковую панель
Teknokomo
universo-godot
Коммиты
8ddda703
Коммит
8ddda703
создал
Июн 25, 2020
по автору
Artem Go
Просмотр файлов
#106
шаблоны модальных меню, новое меню выхода
владелец
e09ea561
Изменения
21
Скрыть пробелы
Построчно
Рядом
blokoj/eliro/eliro.gd
Просмотр файла @
8ddda703
extends
"res://kerno/fenestroj/tipo_c7.gd"
# наследует перетаскивание и закрытие меню при нажатии на "Х"
extends
"res://kerno/fenestroj/tipo_c1.gd"
func
_ready
():
pass
# Replace with function body.
func
_
on_no_button_pressed
()
:
$
Canvas
/
Popup
.
set_visible
(
false
)
#
скрыть
меню
func
_
drag
(
event
:
InputEvent
)
->
void
:
if
event
is
InputEventMouseMotion
and
Input
.
is_mouse_button_pressed
(
BUTTON_LEFT
):
self
.
rect_position
+=
event
.
relative
#
перенос
меню
func
_on_no_button_button_up
():
self
.
set_visible
(
false
)
func
_on_yes_button_
pressed
():
func
_on_yes_button_
button_up
():
get_tree
()
.
quit
()
#Выйти из игры
blokoj/eliro/eliro.tscn
Просмотр файла @
8ddda703
[gd_scene load_steps=3 format=2]
[ext_resource path="res://kerno/fenestroj/tipo_c
7
.tscn" type="PackedScene" id=1]
[ext_resource path="res://kerno/fenestroj/tipo_c
1
.tscn" type="PackedScene" id=1]
[ext_resource path="res://blokoj/eliro/eliro.gd" type="Script" id=2]
[node name="eliro" instance=ExtResource( 1 )]
script = ExtResource( 2 )
[node name="Popup" parent="Canvas" index="0"]
visible = false
[node name="HBox_buttons" parent="tipo_c" index="1"]
anchor_left = 0.1
anchor_top = -9.53674e-09
anchor_bottom = -9.53674e-09
[node name="Label" parent="Canvas/Popup/ColorRect" index="1"]
anchor_right = 1.0
anchor_bottom = 0.0163273
margin_left = 84.0
margin_top = 3.0
margin_right = -85.0
[node name="menuo_name" parent="tipo_c/HBox_buttons" index="0"]
margin_right = 157.0
text = "Выход"
[node name="Label2" parent="Canvas/Popup/ColorRect/ColorRect2" index="2"]
[node name="Button_x" parent="tipo_c/HBox_buttons" index="1"]
margin_left = 161.0
margin_right = 180.0
[node name="Label" type="Label" parent="tipo_c" index="2"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 7.0
margin_top = 29.0
margin_right = -8.0
margin_bottom = -61.0
text = "Вы действительно
Хотите выйти?"
[connection signal="pressed" from="Canvas/Popup/ColorRect/ColorRect2/yes_button" to="." method="_on_yes_button_pressed"]
[connection signal="pressed" from="Canvas/Popup/ColorRect/ColorRect2/no_button" to="." method="_on_no_button_pressed"]
хотите выйти? "
align = 1
valign = 1
[node name="yes_button" type="Button" parent="tipo_c" index="3"]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -57.0
margin_top = -55.0
margin_right = -21.0
margin_bottom = -32.0
text = "Да"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="no_button" type="Button" parent="tipo_c" index="4"]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = 18.0223
margin_top = -55.1198
margin_right = 54.0223
margin_bottom = -32.1198
text = "Нет"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="gui_input" from="tipo_c" to="." method="_drag"]
[connection signal="button_up" from="tipo_c/yes_button" to="." method="_on_yes_button_button_up"]
[connection signal="button_up" from="tipo_c/no_button" to="." method="_on_no_button_button_up"]
blokoj/komerco/komerco.tscn
Просмотр файла @
8ddda703
[gd_scene load_steps=
4
format=2]
[gd_scene load_steps=
6
format=2]
[ext_resource path="res://blokoj/komerco/komerco.gd" type="Script" id=1]
[ext_resource path="res://kerno/fenestroj/tipo_d1.tscn" type="PackedScene" id=2]
[ext_resource path="res://blokoj/komerco/komerco_tree.gd" type="Script" id=3]
[ext_resource path="res://kerno/wablono/estonteco/window2.png" type="Texture" id=4]
[ext_resource path="res://kerno/wablono/estonteco/window1.png" type="Texture" id=5]
[node name="komerco" instance=ExtResource( 2 )]
script = ExtResource( 1 )
[node name="VBox" parent="Canvas" index="0"]
visible = false
[node name="VBox" parent="." index="0"]
margin_left = 212.221
margin_top = 95.2276
margin_right = 1012.22
margin_bottom = 695.228
rect_min_size = Vector2( 800, 600 )
custom_constants/separation = 0
[node name="HBox_top" parent="VBox" index="0"]
margin_right = 800.0
margin_bottom = 22.0
custom_constants/separation = 0
[node name="top_texture2" parent="VBox/HBox_top" index="1"]
self_modulate = Color( 0, 0, 0, 0.294118 )
margin_left = 22.0
margin_right = 800.0
margin_bottom = 22.0
rect_min_size = Vector2( 0, 22 )
size_flags_horizontal = 3
texture = ExtResource( 4 )
stretch_mode = 1
flip_h = true
[node name="HBox_top" parent="Canvas/VBox" index="0"]
margin_right = 600.0
[node name="top_texture2" parent="Canvas/VBox/HBox_top" index="1"]
margin_right = 600.0
[node name="menuo_name" parent="Canvas/VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
margin_right = 488.0
[node name="menuo_name" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
margin_right = 759.0
text = "Торговая система"
[node name="Button_fix" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
[node name="Button_fix" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
visible = false
margin_left = 492.0
margin_right = 511.0
[node name="Button_" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
[node name="Button_" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
visible = false
margin_left = 515.0
margin_right = 534.0
[node name="Button_full" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
[node name="Button_full" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
visible = false
margin_left = 538.0
margin_right = 558.0
[node name="Button_x" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="4"]
margin_left =
562
.0
margin_right =
581
.0
[node name="Button_x" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="4"]
margin_left =
763
.0
margin_right =
782
.0
[node name="body_texture" parent="Canvas/VBox" index="1"]
margin_right = 600.0
margin_bottom = 378.0
[node name="body_texture" parent="VBox" index="1"]
self_modulate = Color( 0, 0, 0, 0.745098 )
margin_top = 22.0
margin_right = 800.0
margin_bottom = 578.0
grow_vertical = 0
size_flags_vertical = 3
texture = ExtResource( 4 )
stretch_mode = 1
flip_v = true
[node name="Tree" type="Tree" parent="
Canvas/
VBox/body_texture/HSplit" index="0"]
margin_right =
2
88.0
margin_bottom =
3
44.0
[node name="Tree" type="Tree" parent="VBox/body_texture/HSplit" index="0"]
margin_right =
3
88.0
margin_bottom =
5
44.0
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 3 )
[node name="TabContainer" type="TabContainer" parent="
Canvas/
VBox/body_texture/HSplit" index="1"]
margin_left =
3
00.0
margin_right =
5
88.0
margin_bottom =
3
44.0
[node name="TabContainer" type="TabContainer" parent="VBox/body_texture/HSplit" index="1"]
margin_left =
4
00.0
margin_right =
7
88.0
margin_bottom =
5
44.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBox_bottom" parent="Canvas/VBox" index="2"]
margin_top = 378.0
margin_right = 600.0
margin_bottom = 400.0
[node name="bottom_texture1" parent="Canvas/VBox/HBox_bottom" index="0"]
margin_right = 578.0
[node name="HBox_bottom" parent="VBox" index="2"]
margin_top = 578.0
margin_right = 800.0
margin_bottom = 600.0
custom_constants/separation = 0
[node name="bottom_texture2" parent="Canvas/VBox/HBox_bottom" index="1"]
margin_left = 578.0
margin_right = 600.0
[node name="bottom_texture1" parent="VBox/HBox_bottom" index="0"]
self_modulate = Color( 0, 0, 0, 0.745098 )
margin_right = 778.0
margin_bottom = 22.0
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource( 4 )
expand = true
[node name="bottom_texture2" parent="VBox/HBox_bottom" index="1"]
self_modulate = Color( 0, 0, 0, 0.745098 )
margin_left = 778.0
margin_right = 800.0
margin_bottom = 22.0
size_flags_horizontal = 9
texture = ExtResource( 5 )
flip_h = true
flip_v = true
blokoj/kosmo/skriptoj/menuo.gd
Просмотр файла @
8ddda703
extends
Control
onready
var
margin
=
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/
Canvas/
VBox"
onready
var
margin
=
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/VBox"
var
camera
#камера
export
var
z_away
=
100
# насколько глубоко\далеко будет точка пути от экрана
...
...
@@ -20,7 +20,7 @@ func _input(event: InputEvent) -> void:
if
Input
.
is_action_just_pressed
(
"right_click"
):
# event.pressed=true
if
event
is
InputEventMouseButton
and
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/
Canvas/
VBox"
.
visible
:
if
event
is
InputEventMouseButton
and
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/VBox"
.
visible
:
$
canvas
/
PopupMenu
.
set_item_disabled
(
2
,
true
)
# $canvas/PopupMenu.mouse_filter=2
var
x
=
$
"."
.
get_global_mouse_position
()
.
x
...
...
@@ -30,10 +30,10 @@ func _input(event: InputEvent) -> void:
$
canvas
/
PopupMenu
.
margin_top
=
y
$
canvas
/
PopupMenu
.
visible
=
true
# #если пункт меню - станция
x
=
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/
Canvas/
VBox/body_texture/ItemList"
.
get_local_mouse_position
()
.
x
y
=
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/
Canvas/
VBox/body_texture/ItemList"
.
get_local_mouse_position
()
.
y
index_pos
=
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/
Canvas/
VBox/body_texture/ItemList"
.
get_item_at_position
(
Vector2
(
x
,
y
),
true
)
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/
Canvas/
VBox/body_texture/ItemList"
.
select
(
index_pos
)
x
=
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/VBox/body_texture/ItemList"
.
get_local_mouse_position
()
.
x
y
=
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/VBox/body_texture/ItemList"
.
get_local_mouse_position
()
.
y
index_pos
=
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/VBox/body_texture/ItemList"
.
get_item_at_position
(
Vector2
(
x
,
y
),
true
)
$
"/root/Title/CanvasLayer/UI/Objektoj/Window/VBox/body_texture/ItemList"
.
select
(
index_pos
)
if
Global
.
objektoj
[
index_pos
][
'
resurso'
][
'
objId'
]
==
1
:
#объект станция Espero
#проверяем как далеко от станции и если менее 20, то разрешаем войти
var
dist
=
$
"../ship"
.
translation
.
distance_to
(
Vector3
(
...
...
blokoj/objektoj/scenoj/objekto.tscn
Просмотр файла @
8ddda703
...
...
@@ -10,26 +10,23 @@ margin_right = 704.816
margin_bottom = 263.888
script = ExtResource( 3 )
[node name="VBox" parent="Canvas" index="0"]
margin_left = 704.816
margin_top = 263.888
margin_right = 904.816
margin_bottom = 463.888
[node name="VBox" parent="." index="0"]
visible = false
[node name="menuo_name" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
[node name="menuo_name" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
margin_right = 155.0
text = "Объекты"
[node name="Button_fix" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
[node name="Button_fix" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
visible = false
[node name="Button_" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
[node name="Button_" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
visible = false
[node name="Button_full" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
[node name="Button_full" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
visible = false
[node name="ItemList" type="ItemList" parent="
Canvas/
VBox/body_texture" index="1"]
[node name="ItemList" type="ItemList" parent="VBox/body_texture" index="1"]
anchor_right = 1.0
anchor_bottom = 1.013
margin_left = 6.0
...
...
blokoj/objektoj/skriptoj/objekto.gd
Просмотр файла @
8ddda703
...
...
@@ -10,14 +10,14 @@ func _ready():
# перезагружаем список объектов
func
_reload_objekto
():
$
"
Canvas/
VBox/body_texture/ItemList"
.
clear
()
$
"VBox/body_texture/ItemList"
.
clear
()
FillItemList
()
func
FillItemList
():
# если загружен космос, то берём список из объектов космоса
if
$
"/root"
.
get_node_or_null
(
'
space'
):
var
_space
=
$
"/root"
.
get_node
(
'
space'
)
var
_items
=
get_node
(
"
Canvas/
VBox/body_texture/ItemList"
)
var
_items
=
get_node
(
"VBox/body_texture/ItemList"
)
for
ch
in
_space
.
get_children
():
if
ch
.
is_in_group
(
'
create'
)
and
(
'
objekto'
in
ch
):
_items
.
add_item
(
...
...
@@ -32,7 +32,7 @@ func FillItemList():
for
item
in
Global
.
objektoj
:
if
not
item
.
has
(
'
distance'
):
item
[
'
distance'
]
=
0
get_node
(
"
Canvas/
VBox/body_texture/ItemList"
)
.
add_item
(
get_node
(
"VBox/body_texture/ItemList"
)
.
add_item
(
'
('
+
String
(
int
(
item
[
'
distance'
]))
+
'
) '
+
item
[
'
nomo'
][
'
enhavo'
],
null
,
true
...
...
@@ -44,7 +44,7 @@ func distance_to(trans):
for
obj
in
Global
.
objektoj
:
obj
[
'
distance'
]
=
trans
.
distance_to
(
Vector3
(
obj
[
'
koordinatoX'
],
obj
[
'
koordinatoY'
],
obj
[
'
koordinatoZ'
]))
$
'
Canvas/
VBox/body_texture/ItemList'
.
clear
()
$
'
VBox/body_texture/ItemList'
.
clear
()
FillItemList
()
blokoj/taskoj/scenoj/taskoj.tscn
Просмотр файла @
8ddda703
...
...
@@ -12,40 +12,47 @@ margin_right = 121.901
margin_bottom = 278.253
script = ExtResource( 1 )
[node name="VBox" parent="Canvas" index="0"]
margin_left = 169.202
margin_top = 318.369
margin_right = 382.202
margin_bottom = 533.369
[node name="VBox" parent="." index="0"]
visible = false
margin_left = -90.4413
margin_top = -244.192
margin_right = 122.559
margin_bottom = -29.1916
[node name="HBox_top" parent="
Canvas/
VBox" index="0"]
[node name="HBox_top" parent="VBox" index="0"]
margin_right = 213.0
[node name="top_texture2" parent="
Canvas/
VBox/HBox_top" index="1"]
[node name="top_texture2" parent="VBox/HBox_top" index="1"]
margin_right = 213.0
[node name="menuo_name" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
[node name="menuo_name" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
margin_right = 168.0
text = "Задачи"
[node name="Button_fix" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
[node name="Button_fix" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
visible = false
margin_left = 102.0
margin_right = 121.0
[node name="Button_" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
[node name="Button_" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
visible = false
margin_left = 125.0
margin_right = 144.0
[node name="Button_full" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
[node name="Button_full" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
visible = false
margin_left = 148.0
margin_right = 168.0
[node name="Button_x" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="4"]
[node name="Button_x" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="4"]
margin_left = 172.0
margin_right = 191.0
[node name="body_texture" parent="
Canvas/
VBox" index="1"]
[node name="body_texture" parent="VBox" index="1"]
margin_right = 213.0
margin_bottom = 193.0
[node name="ItemList" type="ItemList" parent="
Canvas/
VBox/body_texture" index="1"]
[node name="ItemList" type="ItemList" parent="VBox/body_texture" index="1"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 6.0
...
...
@@ -55,15 +62,15 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="HBox_bottom" parent="
Canvas/
VBox" index="2"]
[node name="HBox_bottom" parent="VBox" index="2"]
margin_top = 193.0
margin_right = 213.0
margin_bottom = 215.0
[node name="bottom_texture1" parent="
Canvas/
VBox/HBox_bottom" index="0"]
[node name="bottom_texture1" parent="VBox/HBox_bottom" index="0"]
margin_right = 191.0
[node name="bottom_texture2" parent="
Canvas/
VBox/HBox_bottom" index="1"]
[node name="bottom_texture2" parent="VBox/HBox_bottom" index="1"]
margin_left = 191.0
margin_right = 213.0
...
...
@@ -72,6 +79,6 @@ script = ExtResource( 4 )
[node name="HTTPTaskojRequestFind" type="HTTPRequest" parent="." index="2"]
script = ExtResource( 3 )
[connection signal="item_selected" from="
Canvas/
VBox/body_texture/ItemList" to="." method="_on_ItemList_item_selected"]
[connection signal="item_selected" from="VBox/body_texture/ItemList" to="." method="_on_ItemList_item_selected"]
[connection signal="request_completed" from="HTTPProjektoRequestFind" to="HTTPProjektoRequestFind" method="_on_HTTPProjektoRequestFind_request_completed"]
[connection signal="request_completed" from="HTTPTaskojRequestFind" to="HTTPTaskojRequestFind" method="_on_HTTPTaskojRequestFind_request_completed"]
blokoj/taskoj/skriptoj/http_request.gd
Просмотр файла @
8ddda703
...
...
@@ -12,7 +12,7 @@ func _on_HTTPProjektoRequestFind_request_completed(result, response_code, header
var
simpled_data
=
parsed_resp
[
'
data'
][
'
universoProjekto'
][
'
edges'
]
$
'
../'
.
ItemListContent
.
clear
()
$
'
../
Canvas/
VBox/body_texture/ItemList'
.
clear
()
$
'
../VBox/body_texture/ItemList'
.
clear
()
# $'../MarginContainer/VBoxContainer/'.get_node("DetailLabel").set_text("")
for
item
in
simpled_data
:
...
...
blokoj/taskoj/skriptoj/taskoj.gd
Просмотр файла @
8ddda703
...
...
@@ -11,13 +11,13 @@ func _ready():
# перезагружаем список объектов
func
_reload_taskoj
():
$
"
Canvas/
VBox/body_texture/ItemList"
.
clear
()
$
"VBox/body_texture/ItemList"
.
clear
()
FillItemList
()
func
FillItemList
():
# Заполняет список найдеными продуктами
for
Item
in
ItemListContent
:
get_node
(
"
Canvas/
VBox/body_texture/ItemList"
)
.
add_item
(
Item
,
null
,
true
)
get_node
(
"VBox/body_texture/ItemList"
)
.
add_item
(
Item
,
null
,
true
)
...
...
@@ -26,7 +26,7 @@ func FillItemList():
func
_on_ItemList_item_selected
(
index
):
var
q
=
QueryObject
.
new
()
$
HTTPTaskojRequestFind
.
request
(
q
.
URL
,
Global
.
backend_headers
,
true
,
2
,
q
.
taskoj_query
())
$
Canvas
/
VBox
/
HBox_top
/
top_texture2
/
HBox_buttons
/
menuo_name
.
text
=
"Задачи"
$
VBox
/
HBox_top
/
top_texture2
/
HBox_buttons
/
menuo_name
.
text
=
"Задачи"
# Вызывается перед появлением окна
...
...
kerno/fenestroj/tipo_a1.gd
Просмотр файла @
8ddda703
...
...
@@ -3,7 +3,7 @@ extends "res://kerno/wablono/estonteco/fenestroj.gd"
#
func
_on_Button_x_button_up
():
$
Canvas
/
VBox
.
set_visible
(
false
)
$
VBox
.
set_visible
(
false
)
func
_on_Button_full_button_up
():
# развернуть меню на весь экран
...
...
@@ -20,11 +20,11 @@ func _on_Button_fix_button_up():
func
_drag
(
event
:
InputEvent
)
->
void
:
if
event
is
InputEventMouseMotion
and
Input
.
is_mouse_button_pressed
(
BUTTON_LEFT
):
$
Canvas
/
VBox
.
rect_position
+=
event
.
relative
$
VBox
.
rect_position
+=
event
.
relative
#перетаскивание меню
func
_on_resize_
(
event
:
InputEvent
)
->
void
:
if
event
is
InputEventMouseMotion
and
Input
.
is_mouse_button_pressed
(
BUTTON_LEFT
):
$
Canvas
/
VBox
.
rect_size
+=
event
.
relative
$
VBox
.
rect_size
+=
event
.
relative
#изменение размера окна меню
kerno/fenestroj/tipo_a1.tscn
Просмотр файла @
8ddda703
...
...
@@ -6,14 +6,13 @@
[node name="tipo_a1" instance=ExtResource( 1 )]
script = ExtResource( 2 )
[node name="VBox" parent="Canvas" index="0"]
visible = false
[node name="VBox" parent="." index="0"]
mouse_default_cursor_shape = 6
[node name="top_texture2" parent="
Canvas/
VBox/HBox_top" index="1"]
[node name="top_texture2" parent="VBox/HBox_top" index="1"]
show_behind_parent = true
[node name="HBox_buttons" type="HBoxContainer" parent="
Canvas/
VBox/HBox_top/top_texture2" index="0"]
[node name="HBox_buttons" type="HBoxContainer" parent="VBox/HBox_top/top_texture2" index="0"]
anchor_top = 0.523
anchor_right = 1.00562
anchor_bottom = 0.523
...
...
@@ -26,7 +25,7 @@ __meta__ = {
"_edit_use_anchors_": true
}
[node name="menuo_name" type="Label" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
[node name="menuo_name" type="Label" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
margin_top = 3.0
margin_right = 85.0
margin_bottom = 20.0
...
...
@@ -35,7 +34,7 @@ text = "tipo_a1"
align = 1
clip_text = true
[node name="Button_fix" type="Button" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
[node name="Button_fix" type="Button" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
margin_left = 89.0
margin_right = 108.0
margin_bottom = 23.0
...
...
@@ -46,7 +45,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Button_" type="Button" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
[node name="Button_" type="Button" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
margin_left = 112.0
margin_right = 131.0
margin_bottom = 23.0
...
...
@@ -57,7 +56,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Button_full" type="Button" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
[node name="Button_full" type="Button" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
margin_left = 135.0
margin_right = 155.0
margin_bottom = 23.0
...
...
@@ -68,7 +67,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Button_x" type="Button" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="4"]
[node name="Button_x" type="Button" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="4"]
margin_left = 159.0
margin_right = 178.0
margin_bottom = 23.0
...
...
@@ -79,7 +78,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="resize_control" type="Control" parent="
Canvas/
VBox/body_texture" index="0"]
[node name="resize_control" type="Control" parent="VBox/body_texture" index="0"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -4.0
...
...
@@ -90,9 +89,9 @@ mouse_default_cursor_shape = 12
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="gui_input" from="
Canvas/
VBox" to="." method="_drag"]
[connection signal="button_up" from="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons/Button_fix" to="." method="_on_Button_fix_button_up"]
[connection signal="button_up" from="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons/Button_" to="." method="_on_Button__button_up"]
[connection signal="button_up" from="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons/Button_full" to="." method="_on_Button_full_button_up"]
[connection signal="button_up" from="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons/Button_x" to="." method="_on_Button_x_button_up"]
[connection signal="gui_input" from="
Canvas/
VBox/body_texture/resize_control" to="." method="_on_resize_"]
[connection signal="gui_input" from="VBox" to="." method="_drag"]
[connection signal="button_up" from="VBox/HBox_top/top_texture2/HBox_buttons/Button_fix" to="." method="_on_Button_fix_button_up"]
[connection signal="button_up" from="VBox/HBox_top/top_texture2/HBox_buttons/Button_" to="." method="_on_Button__button_up"]
[connection signal="button_up" from="VBox/HBox_top/top_texture2/HBox_buttons/Button_full" to="." method="_on_Button_full_button_up"]
[connection signal="button_up" from="VBox/HBox_top/top_texture2/HBox_buttons/Button_x" to="." method="_on_Button_x_button_up"]
[connection signal="gui_input" from="VBox/body_texture/resize_control" to="." method="_on_resize_"]
kerno/fenestroj/tipo_c.gd
0 → 100644
Просмотр файла @
8ddda703
extends
"res://kerno/wablono/estonteco/fenestroj.gd"
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func
_ready
():
pass
# Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
kerno/fenestroj/tipo_c.tscn
0 → 100644
Просмотр файла @
8ddda703
[gd_scene load_steps=3 format=2]
[ext_resource path="res://kerno/wablono/estonteco/fenestroj.tscn" type="PackedScene" id=1]
[ext_resource path="res://kerno/fenestroj/tipo_c.gd" type="Script" id=2]
[node name="tipo_c" instance=ExtResource( 1 )]
margin_right = 200.0
margin_bottom = 200.0
rect_min_size = Vector2( 200, 200 )
script = ExtResource( 2 )
[node name="VBox" parent="." index="0"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = -6.00002
margin_bottom = -5.99998
alignment = 2
kerno/fenestroj/tipo_c1.gd
0 → 100644
Просмотр файла @
8ddda703
extends
Popup
func
_on_Button_x_button_up
():
self
.
set_visible
(
false
)
pass
# Replace with function body.
kerno/fenestroj/tipo_c1.tscn
0 → 100644
Просмотр файла @
8ddda703
[gd_scene load_steps=3 format=2]
[ext_resource path="res://kerno/fenestroj/tipo_c.tscn" type="PackedScene" id=1]
[ext_resource path="res://kerno/fenestroj/tipo_c1.gd" type="Script" id=2]
[node name="tipo_c1" type="Popup"]
margin_right = 200.0
margin_bottom = 200.0
rect_min_size = Vector2( 200, 200 )
mouse_default_cursor_shape = 6
popup_exclusive = true
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="tipo_c" parent="." instance=ExtResource( 1 )]
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = 0.0
margin_bottom = 0.0
[node name="HBox_buttons" type="HBoxContainer" parent="tipo_c"]
anchor_right = 1.0
margin_right = 1.52588e-05
margin_bottom = 23.0
__meta__ = {
"_edit_use_anchors_": true
}
[node name="menuo_name" type="Label" parent="tipo_c/HBox_buttons"]
margin_top = 3.0
margin_right = 177.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "tipo_c1"
align = 1
clip_text = true
[node name="Button_x" type="Button" parent="tipo_c/HBox_buttons"]
margin_left = 181.0
margin_right = 200.0
margin_bottom = 23.0
rect_min_size = Vector2( 19, 23 )
size_flags_horizontal = 8
text = "x"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="button_up" from="tipo_c/HBox_buttons/Button_x" to="." method="_on_Button_x_button_up"]
kerno/fenestroj/tipo_d1.tscn
Просмотр файла @
8ddda703
...
...
@@ -6,51 +6,51 @@
[node name="tipo_d1" instance=ExtResource( 2 )]
script = ExtResource( 1 )
[node name="VBox" parent="
Canvas
" index="0"]
[node name="VBox" parent="
.
" index="0"]
margin_right = 300.0
margin_bottom =
297
.0
margin_bottom =
300
.0
rect_min_size = Vector2( 300, 300 )
[node name="HBox_top" parent="
Canvas/
VBox" index="0"]
[node name="HBox_top" parent="VBox" index="0"]
margin_right = 300.0
[node name="top_texture2" parent="
Canvas/
VBox/HBox_top" index="1"]
[node name="top_texture2" parent="VBox/HBox_top" index="1"]
margin_right = 300.0
[node name="HBox_buttons" parent="
Canvas/
VBox/HBox_top/top_texture2" index="0"]
[node name="HBox_buttons" parent="VBox/HBox_top/top_texture2" index="0"]
anchor_right = 1.00719
[node name="menuo_name" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
[node name="menuo_name" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
margin_right = 185.0
text = "tipo_d1"
[node name="Button_fix" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
[node name="Button_fix" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
margin_left = 189.0
margin_right = 208.0
[node name="Button_" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
[node name="Button_" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
margin_left = 212.0
margin_right = 231.0
[node name="Button_full" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
[node name="Button_full" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
margin_left = 235.0
margin_right = 255.0
[node name="Button_x" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="4"]
[node name="Button_x" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="4"]
margin_left = 259.0
margin_right = 278.0
[node name="body_texture" parent="
Canvas/
VBox" index="1"]
[node name="body_texture" parent="VBox" index="1"]
margin_right = 300.0
margin_bottom = 278.0
[node name="resize_control" parent="
Canvas/
VBox/body_texture" index="0"]
[node name="resize_control" parent="VBox/body_texture" index="0"]
anchor_left = -0.00430553
anchor_top = -0.0102563
anchor_right = 0.995694
anchor_bottom = 0.989744
[node name="HSplit" type="HSplitContainer" parent="
Canvas/
VBox/body_texture" index="1"]
[node name="HSplit" type="HSplitContainer" parent="VBox/body_texture" index="1"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 6.0
...
...
@@ -61,14 +61,14 @@ __meta__ = {
"_edit_use_anchors_": true
}
[node name="HBox_bottom" parent="
Canvas/
VBox" index="2"]
[node name="HBox_bottom" parent="VBox" index="2"]
margin_top = 278.0
margin_right = 300.0
margin_bottom = 300.0
[node name="bottom_texture1" parent="
Canvas/
VBox/HBox_bottom" index="0"]
[node name="bottom_texture1" parent="VBox/HBox_bottom" index="0"]
margin_right = 278.0
[node name="bottom_texture2" parent="
Canvas/
VBox/HBox_bottom" index="1"]
[node name="bottom_texture2" parent="VBox/HBox_bottom" index="1"]
margin_left = 278.0
margin_right = 300.0
kerno/menuo/menuo.gd
Просмотр файла @
8ddda703
...
...
@@ -116,7 +116,7 @@ func _on_Resurso_Center_pressed():
func
_on_Objektoj_pressed
():
$
CanvasLayer
/
UI
/
Objektoj
/
Window
/
Canvas
/
VBox
.
set_visible
(
true
)
$
CanvasLayer
/
UI
/
Objektoj
/
Window
/
VBox
.
set_visible
(
true
)
func
set_visible
(
visible
:
bool
):
...
...
@@ -124,13 +124,13 @@ func set_visible(visible: bool):
func
_on_Taskoj_pressed
():
$
CanvasLayer
/
UI
/
Taskoj
/
Window
/
Canvas
/
VBox
.
set_visible
(
true
)
$
CanvasLayer
/
UI
/
Taskoj
/
Window
/
VBox
.
set_visible
(
true
)
func
CloseWindow
():
$
CanvasLayer
/
UI
/
Taskoj
/
Window
/
Canvas
/
VBox
.
set_visible
(
false
)
$
CanvasLayer
/
UI
/
Objektoj
/
Window
/
Canvas
/
VBox
.
set_visible
(
false
)
$
CanvasLayer
/
UI
/
Taskoj
/
Window
/
VBox
.
set_visible
(
false
)
$
CanvasLayer
/
UI
/
Objektoj
/
Window
/
VBox
.
set_visible
(
false
)
$
CanvasLayer
/
UI
/
b_itinero
/
itinero
/
canvas
/
MarginContainer
.
set_visible
(
false
)
$
CanvasLayer
/
UI
/
interago
/
interago
/
Canvas
/
VBox
.
set_visible
(
false
)
$
CanvasLayer
/
UI
/
interago
/
interago
/
VBox
.
set_visible
(
false
)
func
reloadWindow
():
...
...
@@ -277,15 +277,14 @@ func _on_ad_pressed():
func
_on_interago_pressed
():
if
$
CanvasLayer
/
UI
/
interago
/
interago
/
Canvas
/
VBox
.
visible
:
$
CanvasLayer
/
UI
/
interago
/
interago
/
Canvas
/
VBox
.
set_visible
(
false
)
if
$
CanvasLayer
/
UI
/
interago
/
interago
/
VBox
.
visible
:
$
CanvasLayer
/
UI
/
interago
/
interago
/
VBox
.
set_visible
(
false
)
else
:
$
CanvasLayer
/
UI
/
interago
/
interago
.
print_button
()
$
CanvasLayer
/
UI
/
interago
/
interago
/
Canvas
/
VBox
.
set_visible
(
true
)
$
CanvasLayer
/
UI
/
interago
/
interago
/
VBox
.
set_visible
(
true
)
func
_on_eliro_button_up
():
$
CanvasLayer
/
UI
/
eliro
/
eliro
/
Canvas
/
Popup
.
popup
()
$
CanvasLayer
/
UI
/
eliro
/
eliro
/
Canvas
/
Popup
.
popup_centered
()
$
CanvasLayer
/
UI
/
eliro
/
eliro
.
popup_centered
()
# запрашиваем объекты
func
load_objektoj
(
after
=
""
):
...
...
@@ -297,7 +296,10 @@ func load_objektoj(after=""):
func
_on_komerco_button_up
():
$
CanvasLayer
/
UI
/
komerco
/
komerco
/
Canvas
/
VBox
.
set_visible
(
true
)
$
CanvasLayer
/
UI
/
komerco
/
komerco
/
VBox
.
set_visible
(
true
)
kerno/menuo/menuo.tscn
Просмотр файла @
8ddda703
...
...
@@ -66,7 +66,7 @@ margin_top = -19.0
margin_right = 221.0
margin_bottom = -4.0
custom_fonts/font = SubResource( 1 )
text = " Universo version 0.
6
.0
alfo"
text = " Universo version 0.
8
.0
-
alfo"
__meta__ = {
"_edit_use_anchors_": true
}
...
...
@@ -487,6 +487,10 @@ __meta__ = {
}
[node name="komerco" parent="CanvasLayer/UI/komerco" instance=ExtResource( 39 )]
margin_left = 3.00006
margin_top = -356.005
margin_right = 3.00006
margin_bottom = -356.005
[node name="Profilo" parent="CanvasLayer/UI" instance=ExtResource( 3 )]
margin_left = -6.0
...
...
@@ -534,6 +538,10 @@ flat = true
expand_icon = false
[node name="Window" parent="CanvasLayer/UI/Taskoj" instance=ExtResource( 1 )]
margin_left = 151.83
margin_top = 48.3463
margin_right = 151.83
margin_bottom = 48.3463
[node name="RCentro" parent="CanvasLayer/UI" instance=ExtResource( 8 )]
margin_left = -5.63028
...
...
@@ -564,6 +572,10 @@ icon = ExtResource( 32 )
flat = true
[node name="Window" parent="CanvasLayer/UI/Objektoj" instance=ExtResource( 11 )]
margin_left = 378.321
margin_top = 140.092
margin_right = 378.321
margin_bottom = 140.092
[node name="b_itinero" type="Button" parent="CanvasLayer/UI"]
margin_left = -6.21405
...
...
@@ -598,10 +610,10 @@ anchor_left = 17.176
anchor_top = -5.634
anchor_right = 17.176
anchor_bottom = -5.634
margin_left = -
1614.
5
margin_top =
493.71
margin_right = -
1614.
5
margin_bottom =
493.71
margin_left = -
883.53
5
margin_top =
69.6377
margin_right = -
883.53
5
margin_bottom =
69.6377
[node name="eliro" type="Button" parent="CanvasLayer/UI"]
margin_left = -6.38464
...
...
@@ -617,10 +629,6 @@ __meta__ = {
}
[node name="eliro" parent="CanvasLayer/UI/eliro" instance=ExtResource( 37 )]
margin_left = 9.04407
margin_top = -354.225
margin_right = 9.04407
margin_bottom = -354.225
[node name="request" type="HTTPRequest" parent="."]
[connection signal="pressed" from="CanvasLayer/UI/real" to="." method="_on_real_pressed"]
...
...
kerno/menuo/scenoj/interago.tscn
Просмотр файла @
8ddda703
...
...
@@ -10,31 +10,32 @@ margin_left = -1024.0
margin_right = -1024.0
script = ExtResource( 1 )
[node name="VBox" parent="Canvas" index="0"]
[node name="VBox" parent="." index="0"]
visible = false
margin_left = 71.2508
margin_top = 57.0006
margin_right = 271.251
margin_bottom = 257.001
[node name="menuo_name" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
[node name="menuo_name" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="0"]
margin_right = 155.0
text = "Центр взаимодействия"
[node name="Button_fix" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
[node name="Button_fix" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="1"]
visible = false
[node name="Button_" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
[node name="Button_" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="2"]
visible = false
[node name="Button_full" parent="
Canvas/
VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
[node name="Button_full" parent="VBox/HBox_top/top_texture2/HBox_buttons" index="3"]
visible = false
[node name="kosmo" type="Button" parent="
Canvas/
VBox" index="1"]
[node name="kosmo" type="Button" parent="VBox" index="1"]
margin_top = 22.0
margin_right = 200.0
margin_bottom = 45.0
text = "Выйти в космос"
[node name="body_texture" parent="
Canvas/
VBox" index="2"]
[node name="body_texture" parent="VBox" index="2"]
margin_top = 45.0
[connection signal="pressed" from="
Canvas/
VBox/kosmo" to="." method="_on_kosmo_pressed"]
[connection signal="pressed" from="VBox/kosmo" to="." method="_on_kosmo_pressed"]
kerno/skriptoj/interago.gd
Просмотр файла @
8ddda703
extends
"res://kerno/fenestroj/tipo_a1.gd"
onready
var
_button
=
$
Canvas
/
VBox
/
kosmo
onready
var
_label
=
$
Canvas
/
VBox
/
HBox_top
/
top_texture2
/
HBox_buttons
/
menuo_name
onready
var
_button
=
$
VBox
/
kosmo
onready
var
_label
=
$
VBox
/
HBox_top
/
top_texture2
/
HBox_buttons
/
menuo_name
const
QueryObject
=
preload
(
"res://kerno/menuo/skriptoj/queries.gd"
)
...
...
@@ -38,7 +38,7 @@ func _on_kosmo_pressed():
go_kosmostacioj
()
else
:
go_kosmo
()
$
Canvas
/
VBox
.
set_visible
(
false
)
$
VBox
.
set_visible
(
false
)
# вход в ближайшую станцию (задача - вычислить её в списке объектов)
func
go_kosmostacioj
():
...
...
Пред
1
2
След
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать