Открыть боковую панель
Левадный Владимир Юрьевич
universo-godot
Коммиты
9721a442
Коммит
9721a442
создал
Янв 03, 2020
по автору
Max Bondarev
Просмотр файлов
Merge branch 'dron5' into 'develop'
Dron5 See merge request tehnokom/universo!13
владельцы
eae6c56f
2fa39dbc
Изменения
14
Скрыть пробелы
Построчно
Рядом
blokoj/rajtigo/.directory
0 → 100644
Просмотр файла @
9721a442
[Dolphin]
Timestamp=2020,1,2,16,4,43
Version=3
blokoj/rajtigo/Button.gd
0 → 100644
Просмотр файла @
9721a442
extends
Button
func
_pressed
():
var
URL
=
"https://tehnokom.su/api/v1.1/registrado/"
#var URL = "https://t34.tehnokom.su/api/v1.1/registrado/"
var
headers
=
[
"Content-Type: application/json"
]
var
password
=
$
'
../your_password'
.
text
var
login
=
$
'
../your_login'
.
text
var
my_password
=
'
"'
+
password
+
'
"'
var
my_login
=
'
"'
+
login
+
'
"'
var
json_query
=
{
"query"
:
"mutation { ensaluti(login:"
+
my_login
+
", password: "
+
my_password
+
"){status, token, message,csrfToken} }"
}
var
post_request
=
JSON
.
print
(
json_query
)
$
HTTPRequest
.
request
(
URL
,
headers
,
false
,
2
,
post_request
)
\ Нет новой строки в конце файла
blokoj/rajtigo/HTTPRequest.gd
0 → 100644
Просмотр файла @
9721a442
extends
HTTPRequest
func
_on_HTTPRequest_request_completed
(
result
,
response_code
,
headers
,
body
):
var
resp
=
body
.
get_string_from_utf8
()
var
parsed_resp
=
parse_json
(
resp
)
#Global.set_token(parsed_resp['data']['ensaluti']['token'])
#Global.set_csrftoken(parsed_resp['data']['ensaluti']['csrfToken'])
#Global.set_status(parsed_resp['data']['ensaluti']['status'])
Global
.
token
=
parsed_resp
[
'
data'
][
'
ensaluti'
][
'
token'
]
Global
.
csrfToken
=
parsed_resp
[
'
data'
][
'
ensaluti'
][
'
csrfToken'
]
Global
.
status
=
parsed_resp
[
'
data'
][
'
ensaluti'
][
'
status'
]
$
'
../../message'
.
set_mytext
(
parsed_resp
[
'
data'
][
'
ensaluti'
][
'
message'
])
if
Global
.
status
:
Global
.
scene
(
'
root'
)
\ Нет новой строки в конце файла
blokoj/rajtigo/OpenSans-Regular.ttf
0 → 100644
Просмотр файла @
9721a442
Файл добавлен
blokoj/rajtigo/Spatial.gd
0 → 100644
Просмотр файла @
9721a442
extends
Spatial
func
_ready
():
if
not
Global
.
status
:
Global
.
scene
(
'
auth_menu'
)
\ Нет новой строки в конце файла
blokoj/rajtigo/auth_menu.tscn
0 → 100644
Просмотр файла @
9721a442
[gd_scene load_steps=5 format=2]
[ext_resource path="res://cyrTheme.tres" type="Theme" id=1]
[ext_resource path="res://message.gd" type="Script" id=2]
[ext_resource path="res://Button.gd" type="Script" id=3]
[ext_resource path="res://HTTPRequest.gd" type="Script" id=4]
[node name="auth_menu" type="Node2D"]
position = Vector2( 1.05264, 15.7895 )
[node name="login" type="Label" parent="."]
margin_left = 248.708
margin_top = 230.384
margin_right = 305.708
margin_bottom = 258.384
text = "login"
align = 1
valign = 1
uppercase = true
[node name="password" type="Label" parent="."]
margin_left = 251.754
margin_top = 274.63
margin_right = 335.754
margin_bottom = 304.63
text = "password"
align = 1
valign = 1
uppercase = true
[node name="your_login" type="LineEdit" parent="."]
margin_left = 380.0
margin_top = 225.0
margin_right = 630.0
margin_bottom = 255.0
[node name="your_password" type="LineEdit" parent="."]
margin_left = 380.0
margin_top = 275.0
margin_right = 630.0
margin_bottom = 305.0
[node name="message" type="Label" parent="."]
margin_left = 385.0
margin_top = 185.0
margin_right = 625.0
margin_bottom = 218.0
theme = ExtResource( 1 )
align = 1
valign = 1
script = ExtResource( 2 )
[node name="Button" type="Button" parent="."]
margin_left = 450.0
margin_top = 330.0
margin_right = 570.0
margin_bottom = 363.0
text = "LogIn"
script = ExtResource( 3 )
[node name="HTTPRequest" type="HTTPRequest" parent="Button"]
script = ExtResource( 4 )
[connection signal="request_completed" from="Button/HTTPRequest" to="Button/HTTPRequest" method="_on_HTTPRequest_request_completed"]
blokoj/rajtigo/cyrTheme.tres
0 → 100644
Просмотр файла @
9721a442
[gd_resource type="Theme" load_steps=3 format=2]
[ext_resource path="res://OpenSans-Regular.ttf" type="DynamicFontData" id=1]
[sub_resource type="DynamicFont" id=1]
font_data = ExtResource( 1 )
[resource]
default_font = SubResource( 1 )
blokoj/rajtigo/default_env.tres
0 → 100644
Просмотр файла @
9721a442
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )
blokoj/rajtigo/global.gd
0 → 100644
Просмотр файла @
9721a442
extends
Node
var
status
=
false
var
token
=
'
'
var
csrfToken
=
'
'
func
scene
(
name
):
get_tree
()
.
change_scene
(
'
res://'
+
name
+
'
.tscn'
)
\ Нет новой строки в конце файла
blokoj/rajtigo/icon.png
0 → 100644
Просмотр файла @
9721a442
3,4 КБ
blokoj/rajtigo/icon.png.import
0 → 100644
Просмотр файла @
9721a442
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
blokoj/rajtigo/message.gd
0 → 100644
Просмотр файла @
9721a442
extends
Label
func
set_mytext
(
my_text
):
set_text
(
my_text
)
\ Нет новой строки в конце файла
blokoj/rajtigo/project.godot
0 → 100644
Просмотр файла @
9721a442
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ ]
_global_script_class_icons={
}
[application]
config/name="auth"
run/main_scene="res://root.tscn"
config/icon="res://icon.png"
[autoload]
Global="*res://global.gd"
[rendering]
environment/default_environment="res://default_env.tres"
blokoj/rajtigo/root.tscn
0 → 100644
Просмотр файла @
9721a442
[gd_scene load_steps=4 format=2]
[ext_resource path="res://Spatial.gd" type="Script" id=1]
[sub_resource type="SpatialMaterial" id=1]
albedo_color = Color( 0.12549, 0.443137, 0.00784314, 1 )
[sub_resource type="PlaneMesh" id=2]
[node name="Node" type="Node"]
[node name="Spatial" type="Spatial" parent="."]
script = ExtResource( 1 )
[node name="floor" type="MeshInstance" parent="Spatial"]
transform = Transform( 20, 0, 0, 0, 1, 0, 0, 0, 20, 0, 0.196687, 0 )
material_override = SubResource( 1 )
mesh = SubResource( 2 )
material/0 = null
[node name="Camera" type="Camera" parent="Spatial"]
transform = Transform( 1, 0, 0, 0, 0.980939, 0.194315, 0, -0.194315, 0.980939, 0, 1.07392, 8.01514 )
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать