Compare commits
39 Commits
41977692a5
...
v0.6.14
| Author | SHA1 | Date | |
|---|---|---|---|
| 2459d15fc0 | |||
| 3552a5e51d | |||
| 38b05eb4ef | |||
| 735ab3774d | |||
| 43aaa6e28f | |||
| 544f5c466e | |||
| 0b80d2cdf6 | |||
| b82fe0f3d7 | |||
| 860168e4eb | |||
| 84c29ed064 | |||
| 14e4450679 | |||
| 15a4a2e953 | |||
| 201284f3c2 | |||
| 708740d757 | |||
| f82ccbedd9 | |||
| 0db2fa0f96 | |||
| 41de04c2e2 | |||
| 5bb566351d | |||
| 88bcf77aa9 | |||
| 4de9027d1e | |||
| 044d193f8d | |||
| d9cae38a11 | |||
| 9d917e95ab | |||
| 8e565e5ac0 | |||
| 6d846ec813 | |||
| d8a4019ce1 | |||
| f4524a7acc | |||
| a81359c1e6 | |||
| 2a64274322 | |||
| 5820bbc7b2 | |||
| 45cfc8c8ee | |||
| b41ccdb659 | |||
| 2d2979a1cf | |||
| 934d890887 | |||
| c21048add3 | |||
| edb5ec9dfa | |||
| 3bab036cc4 | |||
| df563bf1b1 | |||
| fc86261a9d |
@@ -0,0 +1,5 @@
|
|||||||
|
.godot/
|
||||||
|
export/
|
||||||
|
*.tscn
|
||||||
|
*.import
|
||||||
|
addons/
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: Godot 4.4 Core Rules
|
||||||
|
priority: high
|
||||||
|
---
|
||||||
|
|
||||||
|
Ты — senior Godot 4.4 GDScript разработчик.
|
||||||
|
|
||||||
|
- Всегда используй Godot 4.4+ API.
|
||||||
|
- Пиши строго типизированный код (`var health: int = 100`, `: Array[Node]` и т.д.).
|
||||||
|
- Предпочитай Signals вместо проверки в _process.
|
||||||
|
- Используй @export, @export_range, @export_enum, @onready.
|
||||||
|
- Composition over deep inheritance.
|
||||||
|
- Менеджеры и автолоады выноси в отдельные singleton'ы.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
name: Project Architecture
|
||||||
|
---
|
||||||
|
|
||||||
|
В этом проекте используется следующая архитектура:
|
||||||
|
- StateMachine на основе Node + signals
|
||||||
|
- Inventory использует ItemStack и SignalBus
|
||||||
|
- Все данные сохраняются через SaveManager (autoload)
|
||||||
|
- UI строится через Control + custom themes
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
name: Android
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
android:
|
||||||
|
runs-on: godot
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Godot version
|
||||||
|
run: godot --version
|
||||||
|
|
||||||
|
- name: Build APK
|
||||||
|
run: |
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
godot \
|
||||||
|
--headless \
|
||||||
|
--path . \
|
||||||
|
--export-release "Android" \
|
||||||
|
build/app.apk
|
||||||
|
|
||||||
|
- name: Verify APK
|
||||||
|
run: |
|
||||||
|
test -f build/app.apk
|
||||||
|
ls -lh build/app.apk
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
curl -f \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
"https://gt.owad.ru/api/v1/repos/K/owniverse/releases" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"${GITHUB_REF_NAME}\",
|
||||||
|
\"name\": \"${GITHUB_REF_NAME}\",
|
||||||
|
\"body\": \"Android build ${GITHUB_REF_NAME}\"
|
||||||
|
}"
|
||||||
|
|
||||||
|
- name: Upload APK to Release
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
RELEASE_ID=$(curl -fsS \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
"https://gt.owad.ru/api/v1/repos/K/owniverse/releases/tags/${GITHUB_REF_NAME}" \
|
||||||
|
| python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
|
||||||
|
|
||||||
|
curl -f \
|
||||||
|
-X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-F "attachment=@build/app.apk" \
|
||||||
|
"https://gt.owad.ru/api/v1/repos/K/owniverse/releases/${RELEASE_ID}/assets?name=owniverse-${GITHUB_REF_NAME}.apk"
|
||||||
@@ -6,3 +6,5 @@
|
|||||||
|
|
||||||
# MacOS specific ignores
|
# MacOS specific ignores
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.kilo/agent-manager.json
|
||||||
|
.kilo/kilo.jsonc
|
||||||
|
|||||||
+37
-23
@@ -1,6 +1,6 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
const SPEED_LIMIT = 4
|
const SPEED_LIMIT: int = 4
|
||||||
|
|
||||||
var Settings: Dictionary = {
|
var Settings: Dictionary = {
|
||||||
"filename": "save-0001",
|
"filename": "save-0001",
|
||||||
@@ -10,47 +10,52 @@ var Settings: Dictionary = {
|
|||||||
|
|
||||||
# TODO getter setter for locale
|
# TODO getter setter for locale
|
||||||
|
|
||||||
var Owniverse: Dictionary = {
|
|
||||||
"datetime": {},
|
|
||||||
"sector": "",
|
|
||||||
"location": "",
|
|
||||||
"charsheet": {},
|
|
||||||
"fleet": {},
|
|
||||||
"inventory": {},
|
|
||||||
}
|
|
||||||
|
|
||||||
var Locales: Dictionary = {}
|
var Locales: Dictionary = {}
|
||||||
var Locale = "en"
|
var Locale = "en"
|
||||||
|
|
||||||
var Entities: Dictionary = {}
|
var OwniverseEntities: Dictionary = {}
|
||||||
|
var OwniverseItems: Dictionary = {}
|
||||||
var Templates: Dictionary = {}
|
var Templates: Dictionary = {}
|
||||||
|
|
||||||
|
var batch_count: float = 40.0 # must be even not odd
|
||||||
|
|
||||||
func get_localized_item_description(entity_id: String, item: String) -> String:
|
|
||||||
if Locales[Locale].has(entity_id):
|
func get_localized_item_description(item_id: String, item: String) -> String:
|
||||||
return Locales[Locale][entity_id][item]
|
if Locales[Locale].has(item_id):
|
||||||
|
return Locales[Locale][item_id][item]
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
func get_description(item_id: String, values: Array = []) -> String:
|
func get_description(item_id: String, items: Array = []) -> String:
|
||||||
if !Templates[Locale].has(item_id):
|
if !Templates[Locale].has(item_id):
|
||||||
return ""
|
return ""
|
||||||
#print(Templates[Locale])
|
|
||||||
var description: String = Templates[Locale][item_id]["text"]
|
var description: String = Templates[Locale][item_id]["text"]
|
||||||
var value = 0
|
var value = 0
|
||||||
for item in values:
|
for item in items:
|
||||||
description.replace("value"+str(value), str(item))
|
description.replace("value" + str(value), str(item))
|
||||||
return description
|
return description
|
||||||
|
|
||||||
|
|
||||||
|
func format_number(value: float, digits: int = 0) -> String:
|
||||||
|
if value == 0: return ""
|
||||||
|
if value < 10_000:
|
||||||
|
return "%.*f" % [digits, value]
|
||||||
|
|
||||||
|
var exp_value = int(floor(log(abs(value)) / log(10.0)))
|
||||||
|
var mantissa = value / pow(10.0, exp_value)
|
||||||
|
|
||||||
|
return "%.*f" % [digits, mantissa] + "E%+d" % exp_value
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
Entities = _read_from_csv("res://Autoload/entities.csv")
|
OwniverseEntities = _read_from_csv("res://data/owniverse_entitites.txt")
|
||||||
|
OwniverseItems = _read_from_csv("res://data/owniverse_items.txt")
|
||||||
|
|
||||||
Locales["en"] = _read_from_csv("res://Autoload/locale.en.csv")
|
Locales["en"] = _read_from_csv("res://data/locale.en.txt")
|
||||||
Locales["ru"] = _read_from_csv("res://Autoload/locale.ru.csv")
|
Locales["ru"] = _read_from_csv("res://data/locale.ru.txt")
|
||||||
|
|
||||||
|
Templates["en"] = _read_from_csv("res://data/templates.en.txt")
|
||||||
|
|
||||||
Templates["en"] = _read_from_csv("res://Autoload/templates.en.csv")
|
|
||||||
|
|
||||||
func _read_from_csv(file_path: String) -> Dictionary:
|
func _read_from_csv(file_path: String) -> Dictionary:
|
||||||
if not FileAccess.file_exists(file_path):
|
if not FileAccess.file_exists(file_path):
|
||||||
@@ -72,7 +77,7 @@ func _read_from_csv(file_path: String) -> Dictionary:
|
|||||||
|
|
||||||
while not file.eof_reached():
|
while not file.eof_reached():
|
||||||
var raw_row = file.get_csv_line("|")
|
var raw_row = file.get_csv_line("|")
|
||||||
if raw_row.is_empty(): # пропускаем пустые строки
|
if raw_row.is_empty(): # пропускаем пустые строки
|
||||||
continue
|
continue
|
||||||
|
|
||||||
var trimmed_row: PackedStringArray = []
|
var trimmed_row: PackedStringArray = []
|
||||||
@@ -95,6 +100,15 @@ func _read_from_csv(file_path: String) -> Dictionary:
|
|||||||
|
|
||||||
return dict_data
|
return dict_data
|
||||||
|
|
||||||
|
|
||||||
|
func _read_folder_list(folder_name: String) -> void:
|
||||||
|
var dir := DirAccess.open(folder_name)
|
||||||
|
if dir == null: printerr("Could not open folder: ", folder_name); return
|
||||||
|
dir.list_dir_begin()
|
||||||
|
for file: String in dir.get_files():
|
||||||
|
print(" → ", file)
|
||||||
|
|
||||||
|
|
||||||
func _print_dict(dict_to_print: Dictionary):
|
func _print_dict(dict_to_print: Dictionary):
|
||||||
for d in dict_to_print:
|
for d in dict_to_print:
|
||||||
print(d, " → ", dict_to_print[d])
|
print(d, " → ", dict_to_print[d])
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
uid://5xb12usvrifm
|
uid://dy0hrqie4ritn
|
||||||
|
|||||||
@@ -1,132 +0,0 @@
|
|||||||
Пространство|S|Resource|||||||||||||1|S||||||||
|
|
||||||
Водород|H|Resource|||||||||||||1|H||||||||
|
|
||||||
Гелий|He|Resource||||||||||||||||||||||
|
|
||||||
Металлы|Met|Resource||||||||||||||||||||||
|
|
||||||
Бурый карлик|BD|Planet|||||||||||BD:1|||||||||||
|
|
||||||
Горячий бурый карлик|HBD|Star phase 1|BD|0.1|5.00E+09|H:0.1|||S:0.5|||CBD:1|||||||||1|||
|
|
||||||
Красный карлик|RD|Star phase 1||1|4.00E+10|H:1||1|S:40|||TWD:1&H:0.13&He:0.05&Met:0.01|H:1|Star||DwStar|1x0.01|1x0.21|2x0.08|3x0.4|1|||
|
|
||||||
Оранжевый карлик|OD|Star phase 1||8|1.80E+10|H:8||1|S:36|||SRG:1|RD:1|Star||DwStar|1x0.03|2x0.34|3x0.13|3x0.4|1|||
|
|
||||||
Жёлтый карлик|YD|Star phase 1||10|9.00E+09|H:10||1|S:27|||NRG:1|OD:1|Star||DwStar|2x0.1|3x0.55|4x0.21|3x0.4|1|||
|
|
||||||
Бело-жёлтый карлик|WYD|Star phase 1||16|1.80E+09|H:16||1|S:18|||MRG:1|YD:1|Star||DwStar|3x0.3|5x0.89|5x0.34|3x0.4|1|||
|
|
||||||
Жёлтый гигант|YG|Star phase 1||50|4.50E+08|H:50||1|S:9|||LRG:1|H:15|Star||GiStar|||||2|||
|
|
||||||
Голубой гигант|BG|Star phase 1||100|9.00E+07|H:100||1|S:9|||HRG:1|H:30&YG:1|Star||GiStar|||||2|||
|
|
||||||
Сверхгигант|SG|Star phase 1||300|9.00E+06|H:300||1|S:9|||RSG:1|H:100&BG:1|Star||GiStar|||||2|||
|
|
||||||
Гипергигант|HG|Star phase 1||1000|9.00E+05|H:1000||1|S:9|||RHG:1|H:300&SG:1|Star||GiStar|||||2|||
|
|
||||||
Красный гигант|RG|Star phase 2|||||||||||RG:1|||||||||||
|
|
||||||
Малый красный гигант|SRG|Star phase 2|RG|8|2.00E+09||||S:80|||SWD:1&H:2.32&He:0.64&Met:0.08&S:12.4||Star|||||||1|||
|
|
||||||
Обычный Красный гигант|NRG|Star phase 2|RG|10|1.00E+09||||S:120.|||NWD:1&H:3.2&He:1.3&Met:0.2&S:14.3||Star|||||||1|||
|
|
||||||
Средний красный гигант|MRG|Star phase 2|RG|16|2.00E+08||||S:200|||LWD:1&H:4.96&He:3.36&Met:0.48&S:20.2||Star|||||||1|||
|
|
||||||
Большой красный гигант|LRG|Star phase 2|RG|50|5.00E+07||||S:300|||DSN^SGRB%.1||Star|||||||2|||
|
|
||||||
Огромный красный гигант|HRG|Star phase 2|RG|100|1.00E+07||||S:400.|||SN^GRB%1||Star|||||||2|||
|
|
||||||
Красный сверхгигант|RSG|Star phase 2|RG|300|1.00E+06||||S:500|||BSN^LGRB%3||Star|||||||2|||
|
|
||||||
Красный гипергигант|RHG|Star phase 2|RG|1000|1.00E+05||||S:600|||HN^HGRB%10||Star|||||||2|||
|
|
||||||
Тусклая сверхновая|DSN|Star phase 3|||1||||S:59.1|||SNS:1&H:6.5&He:13.5&Met:11&blast:2||||SNGRBB|||||2|||
|
|
||||||
Сверхновая|SN|Star phase 3|||1||||S:99.1|||LNS:1&H:8&He:50&Met:11&blast:9||||SNGRBB|||||2|||
|
|
||||||
Яркая сверхновая|BSN|Star phase 3|||1||||S:309.1|||MGT:1&H:15&He:186&Met:15&blast:305||||SNGRBB|||||2|||
|
|
||||||
Гиперновая|HN|Star phase 3|||1||||S:939.1|||BH40:1&H:30&He:560&Met:30&blast:9990||||SNGRBB|||||2|||
|
|
||||||
Малый гамма-всплеск|SGRB|Star phase 3|||1||||S:149.1|||BH25:1&H:0.5&He:10&Met:4&blast:31||||SNGRBB|||||2|||
|
|
||||||
Гамма-всплеск|GRB|Star phase 3|||1||||S:239.1|||BH30:1&H:19&He:12&Met:5&blast:136||||SNGRBB|||||2|||
|
|
||||||
Большой гамма-всплеск|LGRB|Star phase 3|||1||||S:669.1|||BH40:1&H:68&He:18&Met:9&blast:3446||||SNGRBB|||||2|||
|
|
||||||
Гипер гамма-всплеск|HGRB|Star phase 3|||1||||S:1939.1|||BH60:1&H:0&He:40&Met:10&blast:97342||||SNGRBB|||||2|||
|
|
||||||
Холодный бурый карлик|CBD|Star phase 4|BD|0.1||||||||||||||||||||
|
|
||||||
Белый карлик|WD|Star phase 4|||||||||||WD:1|||||||||||
|
|
||||||
Крошечный белый карлик|TWD|Star phase 4|WD|0.8||||||||||Star||Degen||||||||
|
|
||||||
Малый белый карлик|SWD|Star phase 4|WD|4.8||||||||||Star||Degen||||||||
|
|
||||||
Обычный белый карлик|NWD|Star phase 4|WD|5||||||||||Star||Degen||||||||
|
|
||||||
Большой белый карлик|LWD|Star phase 4|WD|6.4||||||||||Star||Degen||||||||
|
|
||||||
Нейтронная звезда|NS|Star phase 4|||||||||||NS:1|||||||||||
|
|
||||||
Малая нейтронная звезда|SNS|Star phase 4|NS|15||||||||||Star||Degen||||||||
|
|
||||||
Большая нейтронная звезда|LNS|Star phase 4|NS|18||||||||||Star||Degen||||||||
|
|
||||||
Магнетар|MGT|Star phase 4||21|||||||||MGT:1|Star||Degen||||||||
|
|
||||||
Чёрная дыра|BH|Star phase 4|||||||||||BH:1|||||||||||
|
|
||||||
Чёрная дыра 25|BH25|Star phase 4|BH|25||||||||||BH||BH||||||||
|
|
||||||
Чёрная дыра 30|BH30|Star phase 4|BH|30||||||||||BH||BH||||||||
|
|
||||||
Чёрная дыра 40|BH40|Star phase 4|BH|40||||||||||BH||BH||||||||
|
|
||||||
Чёрная дыра 60|BH60|Star phase 4|BH|60||||||||||BH||BH||||||||
|
|
||||||
СМЧД|SMBH|Star phase 4|||||||||||BH:1|||SMBH||||||||
|
|
||||||
Туманность|N|Cloud||1|1.00E+07|H:1||10|H:10|||H:1&S:10|S:1|CL||CL||||||||
|
|
||||||
Глобула|G|Cloud||11|3.00E+07|H:10&N:1||10|H:150|||H:11&S:20|N:1|CL||CL||||||||
|
|
||||||
Звёздная колыбель|STN|Cloud||211|3.00E+07|H:200&G:1||300|H:3000|0.50||H:211&S:320|G:1|CL||CL||||||||
|
|
||||||
Молекулярное облако|MC|Cloud||2011|3.00E+08|H:2000&G:1||4000|H:90000.|||H:2011&S:4020|G:1&S:1300|CL||CL||||||||
|
|
||||||
Активная звёздная колыбель|ASTN|Cloud||202011|1.00E+08|H:200000&MC:1||200000|H:2000000|0.65||H:202011&S:204020|MC:1&S:60000|CL||CL||||||||
|
|
||||||
Рассеянное звёздное скопление|SCD|Cluster|||1.00E+07||Star:1000||||||Star:300|SC||SC||||||0.10|4|C2.3
|
|
||||||
Малое звёздное скопление|SCS|Cluster|||1.00E+09||Star:10000&BH:10||||||SCD:1&Star:2000|SC||SC||||||0.20|3.6|C2.4
|
|
||||||
Среднее звёздное скопление|SCM|Cluster|||3.00E+09||Star:100000&BH:100||||||SCS:1&Star:20000|SC||SC||||||0.30|3.4|C2.5
|
|
||||||
Большое звёздное скопление|SCL|Cluster|||1.00E+10||Star:1000000&BH:1000||||||SCM:1&Star:200000|SC||SC||||||0.50|3.2|C2.6
|
|
||||||
Гигантское звёздное скопление|SCG|Cluster|||3.00E+10||Star:10000000&BH:10000||||||SCL:1&Star:2000000|SC||SC||||||0.80|3|C2.7
|
|
||||||
Карликовая эллиптическая галактика|GED|GalaxyElliptical|||1.20E+10|SMBH:10000|Star:1000000000&BH:1000000&SC:100||||||SMBH:1&SC:1|GAL||GALE||||||1.00|1.9|C2.9
|
|
||||||
Малая эллиптическая галактика|GES|GalaxyElliptical|||1.30E+10|SMBH:100000|Star:10000000000&BH:10000000&SC:1000||||||GED:1&Star:2000000000|GAL||GALE||||||1.50|1.8|C3.0
|
|
||||||
Средняя эллиптическая галактика|GEM|GalaxyElliptical|||1.50E+10|SMBH:1000000|Star:100000000000&BH:100000000&SC:10000||||||GES:1&Star:20000000000|GAL||GALE||||||2.00|1.7|C3.1
|
|
||||||
Большая эллиптическая галактика|GEL|GalaxyElliptical|||1.70E+10|SMBH:10000000|Star:1000000000000&BH:1000000000&SC:100000||||||GEM:1&Star:200000000000|GAL||GALE||||||3.00|1.6|C3.2
|
|
||||||
Гигантская эллиптическая галактика|GEG|GalaxyElliptical|||2.00E+10|SMBH:100000000|Star:10000000000000&BH:10000000000&SC:1000000||||||GEL:1&Star:2000000000000|GAL||GALE||||||4.50|1.5|C3.3
|
|
||||||
Карликовая спиральная галактика|GSD|GalaxySpiral|||2.00E+09|STN:10000&ASTN:10|GED:1|-5240200|H:2400000000|0.80||H:4112110|GED:1|GAL||GALS|||||||2.5|C2.9
|
|
||||||
Малая спиральная галактика|GSS|GalaxySpiral|||3.00E+09|STN:100000&ASTN:100|GES:1|-52402000|H:36000000000|0.80||H:41121100|GES:1|GAL||GALS|||||||2.3|C3.0
|
|
||||||
Средняя спиральная галактика|GSM|GalaxySpiral|||4.00E+09|STN:1000000&ASTN:1000|GEM:1|-524020000|H:480000000000|0.80||H:411211000|GEM:1|GAL||GALS|||||||2.2|C3.1
|
|
||||||
Большая спиральная галактика|GSL|GalaxySpiral|||6.00E+09|STN:10000000&ASTN:10000|GEL:1|-5240200000|H:7200000000000|0.80||H:4112110000|GEL:1|GAL||GALS|||||||2.1|C3.2
|
|
||||||
Гигантская спиральная галактика|GSG|GalaxySpiral|||9.00E+09|STN:100000000&ASTN:100000|GEG:1|-52402000000|H:108000000000000|0.80||H:41121100000|GEG:1|GAL||GALS|||||||2|C3.3
|
|
||||||
Группа галактик|LGG|Structures|||1.00E+10||GAL:50||||||GAL:20|LS||LS|||||||1.5|C3.4
|
|
||||||
Сверхскопление|LSC|Structures|||2.00E+10||LGG:200||||||LGG:1&GAL:100|LS||LS|||||||1.4|C3.6
|
|
||||||
Галактическая нить|LGF|Structures|||3.00E+10||LSC:100||||5||LSC:1&LGG:400|LS||LS|||||||1.3|C3.8
|
|
||||||
Великая стена|LGW|Structures|||6.00E+10||LGF:1000||||1.00E+04||LGF:1&LSC:200|LS||LS|||||||1.2|C4.1
|
|
||||||
Вселенский пузырь|LUB|Structures|||1.00E+11||LGW:1000||||1.00E+09||LGW:1&LGF:2000|LS||LS|||||||1.1|C4.4
|
|
||||||
Газовый гигант|GG|Planet|||||||||||GG:1|Planet||BPlanet||||||||
|
|
||||||
Астероиды|AB|Planet|||||||||||AB:1|Planet||BPlanet||||||||
|
|
||||||
Каменистая|RP|Planet|||||||||||RP:1|Planet||BPlanet||||||||
|
|
||||||
Обитаемая|HP|Planet|||||||||||HP:1|Planet||LPlanet||||||||
|
|
||||||
Живая|LP|Planet|||||||||||LP:1|Planet||LPlanet||||||||
|
|
||||||
Эон 1: Архей|EON1|Planet|LP||||||||||EON1:1|Planet||LPlanet||||||||
|
|
||||||
Эон 2: Протерозой|EON2|Planet|LP||||||||||EON2:1|Planet||LPlanet||||||||
|
|
||||||
Эон 3: Палеозой|EON3|Planet|LP||||||||||EON3:1|Planet||LPlanet||||||||
|
|
||||||
Эон 4: Мезозой|EON4|Planet|LP||||||||||EON4:1|Planet||LPlanet||||||||
|
|
||||||
Эон 5: Кайнозой|EON5|Planet|LP||||||||||EON5:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация типа 0|C0|Civilization|||||||||||C0:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.0|C0.0|Civilization|C0||||||||||C0.0:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.1|C0.1|Civilization|C0||||||||||C0.1:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.2|C0.2|Civilization|C0||||||||||C0.2:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.3|C0.3|Civilization|C0||||||||||C0.3:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.4|C0.4|Civilization|C0||||||||||C0.4:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.5|C0.5|Civilization|C0||||||||||C0.5:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.6|C0.6|Civilization|C0||||||||||C0.6:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.7|C0.7|Civilization|C0||||||||||C0.7:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.8|C0.8|Civilization|C0||||||||||C0.8:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 0.9|C0.9|Civilization|C0||||||||||C0.9:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация типа 1|C1|Civilization|||||||||||C1:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.0|C1.0|Civilization|C1||||||||||C1.0:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.1|C1.1|Civilization|C1||||||||||C1.1:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.2|C1.2|Civilization|C1||||||||||C1.2:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.3|C1.3|Civilization|C1||||||||||C1.3:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.4|C1.4|Civilization|C1||||||||||C1.4:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.5|C1.5|Civilization|C1||||||||||C1.5:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.6|C1.6|Civilization|C1||||||||||C1.6:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.7|C1.7|Civilization|C1||||||||||C1.7:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.8|C1.8|Civilization|C1||||||||||C1.8:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация 1.9|C1.9|Civilization|C1||||||||||C1.9:1|Planet||LPlanet||||||||
|
|
||||||
Цивилизация типа 2|C2|Civilization|||||||||||C2:1|||||||||||
|
|
||||||
Цивилизация 2.0|C2.0|Civilization|C2||||||||||C2.0:1|||||||||||
|
|
||||||
Цивилизация 2.1|C2.1|Civilization|C2||||||||||C2.1:1|||||||||||
|
|
||||||
Цивилизация 2.2|C2.2|Civilization|C2||||||||||C2.2:1|||||||||||
|
|
||||||
Цивилизация 2.3|C2.3|Civilization|C2||||||||||C2.3:1|||||||||||
|
|
||||||
Цивилизация 2.4|C2.4|Civilization|C2||||||||||C2.4:1|||||||||||
|
|
||||||
Цивилизация 2.5|C2.5|Civilization|C2||||||||||C2.5:1|||||||||||
|
|
||||||
Цивилизация 2.6|C2.6|Civilization|C2||||||||||C2.6:1|||||||||||
|
|
||||||
Цивилизация 2.7|C2.7|Civilization|C2||||||||||C2.7:1|||||||||||
|
|
||||||
Цивилизация 2.8|C2.8|Civilization|C2||||||||||C2.8:1|||||||||||
|
|
||||||
Цивилизация 2.9|C2.9|Civilization|C2||||||||||C2.9:1|||||||||||
|
|
||||||
Цивилизация типа 3|C3|Civilization|||||||||||C3:1|||||||||||
|
|
||||||
Цивилизация 3.0|C3.0|Civilization|C3||||||||||C3.0:1|||||||||||
|
|
||||||
Цивилизация 3.1|C3.1|Civilization|C3||||||||||C3.1:1|||||||||||
|
|
||||||
Цивилизация 3.2|C3.2|Civilization|C3||||||||||C3.2:1|||||||||||
|
|
||||||
Цивилизация 3.3|C3.3|Civilization|C3||||||||||C3.3:1|||||||||||
|
|
||||||
Цивилизация 3.4|C3.4|Civilization|C3||||||||||C3.4:1|||||||||||
|
|
||||||
Цивилизация 3.5|C3.5|Civilization|C3||||||||||C3.5:1|||||||||||
|
|
||||||
Цивилизация 3.6|C3.6|Civilization|C3||||||||||C3.6:1|||||||||||
|
|
||||||
Цивилизация 3.7|C3.7|Civilization|C3||||||||||C3.7:1|||||||||||
|
|
||||||
Цивилизация 3.8|C3.8|Civilization|C3||||||||||C3.8:1|||||||||||
|
|
||||||
Цивилизация 3.9|C3.9|Civilization|C3||||||||||C3.9:1|||||||||||
|
|
||||||
Цивилизация типа 4|C4|Civilization|||||||||||C4:1|||||||||||
|
|
||||||
Цивилизация 4.0|C4.0|Civilization|C4||||||||||C4.0:1|||||||||||
|
|
||||||
Цивилизация 4.1|C4.1|Civilization|C4||||||||||C4.1:1|||||||||||
|
|
||||||
Цивилизация 4.2|C4.2|Civilization|C4||||||||||C4.2:1|||||||||||
|
|
||||||
Цивилизация 4.3|C4.3|Civilization|C4||||||||||C4.3:1|||||||||||
|
|
||||||
Цивилизация 4.4|C4.4|Civilization|C4||||||||||C4.4:1|||||||||||
|
|
||||||
Трансцендентная цивилизация|Ct|Civilization||||||||||||||||||||||
|
|
||||||
|
@@ -1,125 +0,0 @@
|
|||||||
id|name|image|page|row|col|sub_page
|
|
||||||
Shovelin|Shovelin|UI/0-Forces/|0|0|0|
|
|
||||||
Inflatin|Inflatin|UI/0-Forces/|0|0|1|
|
|
||||||
Temporite|Temporite|UI/0-Forces/|0|0|2|
|
|
||||||
Collisite|Collisite|UI/0-Forces/|0|0|3|
|
|
||||||
Primex|Primex|UI/0-Forces/|0|0|4|
|
|
||||||
Singularite|Singularite|UI/0-Forces/|0|1|0|
|
|
||||||
Renewin|Renewin|UI/0-Forces/|0|1|1|
|
|
||||||
Infusite|Infusite|UI/0-Forces/|0|1|2|
|
|
||||||
Frostin|Frostin|UI/0-Forces/|0|1|3|
|
|
||||||
Destellarite|Destellarite|UI/0-Forces/|0|1|4|
|
|
||||||
Rockex|Rockex|UI/0-Forces/|0|2|0|
|
|
||||||
Panspermin|Panspermin|UI/0-Forces/|0|2|1|
|
|
||||||
Gaianite|Gaianite|UI/0-Forces/|0|2|2|
|
|
||||||
Darwinite|Darwinite|UI/0-Forces/|0|2|3|
|
|
||||||
Edenex|Edenex|UI/0-Forces/|0|2|4|
|
|
||||||
Pacifin|Pacifin|UI/0-Forces/|0|3|0|
|
|
||||||
Enragein|Enragein|UI/0-Forces/|0|3|1|
|
|
||||||
Moralite|Moralite|UI/0-Forces/|0|3|2|
|
|
||||||
Discriminite|Discriminite|UI/0-Forces/|0|3|3|
|
|
||||||
Reprex|Reprex|UI/0-Forces/|0|3|4|
|
|
||||||
S|Space|UI/1-Resources/|1|0|0|
|
|
||||||
H|Hydrogen|UI/1-Resources/|1|1|0|
|
|
||||||
He|Helium|UI/1-Resources/|1|2|0|
|
|
||||||
Met|Metal|UI/1-Resources/|1|3|0|
|
|
||||||
N|Nebula|UI/2-Stars/|2|0|0|
|
|
||||||
G|Globula|UI/2-Stars/|2|0|1|
|
|
||||||
STN|StarNursery|UI/2-Stars/|2|0|2|
|
|
||||||
MC|MolecularCloud|UI/2-Stars/|2|0|3|
|
|
||||||
ASTN|ActiveStarNursery|UI/2-Stars/|2|0|4|
|
|
||||||
BD|BrownDwarf|UI/2-Stars/|2|1|0|
|
|
||||||
RD|RedDwarf|UI/2-Stars/|2|1|1|
|
|
||||||
OD|OrangeDwarf|UI/2-Stars/|2|1|2|
|
|
||||||
YD|YellowDwarf|UI/2-Stars/|2|1|3|
|
|
||||||
WYD|WhiteYellowDwarf|UI/2-Stars/|2|1|4|
|
|
||||||
RG|RedGiant|UI/2-Stars/|2|2|0|
|
|
||||||
WS|WhiteStar|UI/2-Stars/|2|2|1|
|
|
||||||
BG|BlueGiant|UI/2-Stars/|2|2|2|
|
|
||||||
SG|Supergiant|UI/2-Stars/|2|2|3|
|
|
||||||
HG|Hypergiant|UI/2-Stars/|2|2|4|
|
|
||||||
WD|WhiteDwarf|UI/2-Stars/|2|3|0|
|
|
||||||
NS|NeutronStar|UI/2-Stars/|2|3|1|
|
|
||||||
MGT|Magnetar|UI/2-Stars/|2|3|2|
|
|
||||||
BH|BlackHole|UI/2-Stars/|2|3|3|
|
|
||||||
SMBH|SupermassiveBlackHole|UI/2-Stars/|2|3|4|
|
|
||||||
SCD|StarClusterScattered|UI/3-Structures/|3|0|0|
|
|
||||||
SCS|StarClusterSmall|UI/3-Structures/|3|0|1|
|
|
||||||
SCM|StarClusterMedium|UI/3-Structures/|3|0|2|
|
|
||||||
SCL|StarClusterLarge|UI/3-Structures/|3|0|3|
|
|
||||||
SCG|StarClusterGiant|UI/3-Structures/|3|0|4|
|
|
||||||
GED|GalaxyEllipticalDwarf|UI/3-Structures/|3|1|0|
|
|
||||||
GES|GalaxyEllipticalSmall|UI/3-Structures/|3|1|1|
|
|
||||||
GEM|GalaxyEllipticalMedium|UI/3-Structures/|3|1|2|
|
|
||||||
GEL|GalaxyEllipticalLarge|UI/3-Structures/|3|1|3|
|
|
||||||
GEG|GalaxyEllipticalGiant|UI/3-Structures/|3|1|4|
|
|
||||||
GSD|GalaxySpiralDwarf|UI/3-Structures/|3|2|0|
|
|
||||||
GSS|GalaxySpiralSmall|UI/3-Structures/|3|2|1|
|
|
||||||
GSM|GalaxySpiralMedium|UI/3-Structures/|3|2|2|
|
|
||||||
GSL|GalaxySpiralLarge|UI/3-Structures/|3|2|3|
|
|
||||||
GSG|GalaxySpiralGiant|UI/3-Structures/|3|2|4|
|
|
||||||
LGG|GalacticGroup|UI/3-Structures/|3|3|0|
|
|
||||||
LSC|GalacticSupercluster|UI/3-Structures/|3|3|1|
|
|
||||||
LGF|GalacticFilament|UI/3-Structures/|3|3|2|
|
|
||||||
LGW|GalacticWall|UI/3-Structures/|3|3|3|
|
|
||||||
LUB|UniverseBubble|UI/3-Structures/|3|3|4|
|
|
||||||
GG|GasGiant|UI/4-Life/|4|0|0|
|
|
||||||
AB|AsteroidBelt|UI/4-Life/|4|0|1|
|
|
||||||
RP|RockyPlanet|UI/4-Life/|4|0|2|
|
|
||||||
HP|HabitablePlanet|UI/4-Life/|4|0|3|
|
|
||||||
LP|LivingPlanet|UI/4-Life/|4|0|4|5
|
|
||||||
C0|Civ0|UI/4-Life/|4|1|0|6
|
|
||||||
C1|Civ1|UI/4-Life/|4|1|1|7
|
|
||||||
C2|Civ2|UI/4-Life/|4|1|2|8
|
|
||||||
C3|Civ3|UI/4-Life/|4|1|3|9
|
|
||||||
C4|Civ4|UI/4-Life/|4|1|4|10
|
|
||||||
EON1|Archean|UI/4-Life/Living/|5|0|0|
|
|
||||||
EON2|Proterozoic|UI/4-Life/Living/|5|0|1|
|
|
||||||
EON3|Paleozoic|UI/4-Life/Living/|5|0|2|
|
|
||||||
EON4|Mezozoic|UI/4-Life/Living/|5|0|3|
|
|
||||||
EON5|Cenozoic|UI/4-Life/Living/|5|0|4|
|
|
||||||
C0.0|Civ0.0|UI/4-Life/Civ0/|6|0|0|
|
|
||||||
C0.1|Civ0.1|UI/4-Life/Civ0/|6|0|1|
|
|
||||||
C0.2|Civ0.2|UI/4-Life/Civ0/|6|0|2|
|
|
||||||
C0.3|Civ0.3|UI/4-Life/Civ0/|6|0|3|
|
|
||||||
C0.4|Civ0.4|UI/4-Life/Civ0/|6|0|4|
|
|
||||||
C0.5|Civ0.5|UI/4-Life/Civ0/|6|1|0|
|
|
||||||
C0.6|Civ0.6|UI/4-Life/Civ0/|6|1|1|
|
|
||||||
C0.7|Civ0.7|UI/4-Life/Civ0/|6|1|2|
|
|
||||||
C0.8|Civ0.8|UI/4-Life/Civ0/|6|1|3|
|
|
||||||
C0.9|Civ0.9|UI/4-Life/Civ0/|6|1|4|
|
|
||||||
C1.0|Civ1.0|UI/4-Life/Civ1/|7|0|0|
|
|
||||||
C1.1|Civ1.1|UI/4-Life/Civ1/|7|0|1|
|
|
||||||
C1.2|Civ1.2|UI/4-Life/Civ1/|7|0|2|
|
|
||||||
C1.3|Civ1.3|UI/4-Life/Civ1/|7|0|3|
|
|
||||||
C1.4|Civ1.4|UI/4-Life/Civ1/|7|0|4|
|
|
||||||
C1.5|Civ1.5|UI/4-Life/Civ1/|7|1|0|
|
|
||||||
C1.6|Civ1.6|UI/4-Life/Civ1/|7|1|1|
|
|
||||||
C1.7|Civ1.7|UI/4-Life/Civ1/|7|1|2|
|
|
||||||
C1.8|Civ1.8|UI/4-Life/Civ1/|7|1|3|
|
|
||||||
C1.9|Civ1.9|UI/4-Life/Civ1/|7|1|4|
|
|
||||||
C2.0|Civ2.0|UI/4-Life/Civ2/|8|0|0|
|
|
||||||
C2.1|Civ2.1|UI/4-Life/Civ2/|8|0|1|
|
|
||||||
C2.2|Civ2.2|UI/4-Life/Civ2/|8|0|2|
|
|
||||||
C2.3|Civ2.3|UI/4-Life/Civ2/|8|0|3|
|
|
||||||
C2.4|Civ2.4|UI/4-Life/Civ2/|8|0|4|
|
|
||||||
C2.5|Civ2.5|UI/4-Life/Civ2/|8|1|0|
|
|
||||||
C2.6|Civ2.6|UI/4-Life/Civ2/|8|1|1|
|
|
||||||
C2.7|Civ2.7|UI/4-Life/Civ2/|8|1|2|
|
|
||||||
C2.8|Civ2.8|UI/4-Life/Civ2/|8|1|3|
|
|
||||||
C2.9|Civ2.9|UI/4-Life/Civ2/|8|1|4|
|
|
||||||
C3.0|Civ3.0|UI/4-Life/Civ3/|9|0|0|
|
|
||||||
C3.1|Civ3.1|UI/4-Life/Civ3/|9|0|1|
|
|
||||||
C3.2|Civ3.2|UI/4-Life/Civ3/|9|0|2|
|
|
||||||
C3.3|Civ3.3|UI/4-Life/Civ3/|9|0|3|
|
|
||||||
C3.4|Civ3.4|UI/4-Life/Civ3/|9|0|4|
|
|
||||||
C3.5|Civ3.5|UI/4-Life/Civ3/|9|1|0|
|
|
||||||
C3.6|Civ3.6|UI/4-Life/Civ3/|9|1|1|
|
|
||||||
C3.7|Civ3.7|UI/4-Life/Civ3/|9|1|2|
|
|
||||||
C3.8|Civ3.8|UI/4-Life/Civ3/|9|1|3|
|
|
||||||
C3.9|Civ3.9|UI/4-Life/Civ3/|9|1|4|
|
|
||||||
C4.0|Civ4.0|UI/4-Life/Civ4/|10|0|0|
|
|
||||||
C4.1|Civ4.1|UI/4-Life/Civ4/|10|0|1|
|
|
||||||
C4.2|Civ4.2|UI/4-Life/Civ4/|10|0|2|
|
|
||||||
C4.3|Civ4.3|UI/4-Life/Civ4/|10|0|3|
|
|
||||||
C4.4|Civ4.4|UI/4-Life/Civ4/|10|0|4|
|
|
||||||
|
@@ -5,25 +5,14 @@ extends Node
|
|||||||
const SETTING_SECTION := "Settings"
|
const SETTING_SECTION := "Settings"
|
||||||
const SAVE_PATH = "user://settings.cfg"
|
const SAVE_PATH = "user://settings.cfg"
|
||||||
|
|
||||||
|
#region Save Load routines
|
||||||
func ch():
|
|
||||||
pass
|
|
||||||
#print(Global.Owniverse)
|
|
||||||
#print('h')
|
|
||||||
#save_data('ow1', 'test', Global.Owniverse)
|
|
||||||
#var d1: Dictionary = load_data('ow1', 'test1')
|
|
||||||
#print("d1: ", d1)
|
|
||||||
#var d2: Dictionary = load_data('ow1', 'test')
|
|
||||||
#print("d2: ", d2)
|
|
||||||
#print('d')
|
|
||||||
#print(Global.Owniverse.datetime.WEEKDAYS)
|
|
||||||
|
|
||||||
|
|
||||||
func save_data(filename: String, password: String, data: Dictionary) -> void:
|
func save_data(filename: String, password: String, data: Dictionary) -> void:
|
||||||
filename = "user://" + filename + ".adventure"
|
filename = "user://" + filename + ".adventure"
|
||||||
var file := FileAccess.open_encrypted_with_pass(filename, FileAccess.WRITE, password)
|
var file := FileAccess.open_encrypted_with_pass(filename, FileAccess.WRITE, password)
|
||||||
if file == null:
|
if file == null:
|
||||||
push_error("Не удалось открыть файл для шифрованной записи")
|
push_error("Can't write to the file: ", filename)
|
||||||
return
|
return
|
||||||
|
|
||||||
file.store_var(data) # бинарно + быстрее + сериализация
|
file.store_var(data) # бинарно + быстрее + сериализация
|
||||||
@@ -37,17 +26,15 @@ func load_data(filename: String, password: String) -> Dictionary:
|
|||||||
|
|
||||||
var file := FileAccess.open_encrypted_with_pass(filename, FileAccess.READ, password)
|
var file := FileAccess.open_encrypted_with_pass(filename, FileAccess.READ, password)
|
||||||
if file == null:
|
if file == null:
|
||||||
push_error("Неверный пароль или повреждённый файл")
|
push_error(filename, " couldn't be decrypted.")
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
var data:Variant = file.get_var()
|
var data: Variant = file.get_var()
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
#print("data")
|
|
||||||
#print(data)
|
|
||||||
|
|
||||||
return data if data is Dictionary else {}
|
return data if data is Dictionary else {}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region Settings
|
#region Settings
|
||||||
+127
-61
@@ -1,14 +1,13 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
const ITEM_BUTTON = preload("uid://d3xjfxwe3w16v")
|
const OWNIVERSE_ITEM = preload("uid://d3xjfxwe3w16v")
|
||||||
|
|
||||||
const SPEED_TEXTURE_NAME_TEMPLATE = "res://UI/TopMenu/Time&Speed/Time%s.png"
|
const SPEED_TEXTURE_NAME_TEMPLATE = "res://ui/topmenu/time&speed/time%s.png"
|
||||||
|
|
||||||
const PAGE_COUNT = 5
|
const PAGE_COUNT = 5
|
||||||
const PAGE_WIDTH = 1080
|
const PAGE_WIDTH = 1080
|
||||||
const DRAG_TOLERANCE = 360
|
const DRAG_TOLERANCE = 360
|
||||||
const SWIPE_DURATION: float = 2
|
const SWIPE_DURATION: float = 0.4
|
||||||
const SWIPE_DELAY = 2000 # msec
|
|
||||||
|
|
||||||
@onready var stage_page_scroller: ScrollContainer = $StageRows/PageScroller
|
@onready var stage_page_scroller: ScrollContainer = $StageRows/PageScroller
|
||||||
|
|
||||||
@@ -26,7 +25,12 @@ const SWIPE_DELAY = 2000 # msec
|
|||||||
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/Civ4
|
$StageRows/PageScroller/HBoxContainer/LifePage/Planets/Civ4
|
||||||
]
|
]
|
||||||
|
|
||||||
@onready var g_entity_descriptions: Array = [
|
@onready var page_actions: Dictionary[int, OwniverseAction] = {
|
||||||
|
2: $StageRows/PageScroller/HBoxContainer/StarPage/Actions,
|
||||||
|
3: $StageRows/PageScroller/HBoxContainer/StructurePage/Actions,
|
||||||
|
}
|
||||||
|
|
||||||
|
@onready var g_item_descriptions: Array = [
|
||||||
$StageRows/PageScroller/HBoxContainer/ForcePage/Description,
|
$StageRows/PageScroller/HBoxContainer/ForcePage/Description,
|
||||||
$StageRows/PageScroller/HBoxContainer/ResourcePage/Description,
|
$StageRows/PageScroller/HBoxContainer/ResourcePage/Description,
|
||||||
$StageRows/PageScroller/HBoxContainer/StarPage/Description,
|
$StageRows/PageScroller/HBoxContainer/StarPage/Description,
|
||||||
@@ -54,7 +58,7 @@ const SWIPE_DELAY = 2000 # msec
|
|||||||
var g_tween: Tween = null
|
var g_tween: Tween = null
|
||||||
var g_dragged_start: Vector2 = Vector2.ZERO
|
var g_dragged_start: Vector2 = Vector2.ZERO
|
||||||
var g_scroll_start: int = 0
|
var g_scroll_start: int = 0
|
||||||
var g_current_page: int = 0
|
#var g_current_page: int = 0
|
||||||
|
|
||||||
var g_last_scroll_updated: int = 0
|
var g_last_scroll_updated: int = 0
|
||||||
|
|
||||||
@@ -65,80 +69,111 @@ var g_counters: Dictionary[String, Counter] = {
|
|||||||
"swipe": Counter.new(),
|
"swipe": Counter.new(),
|
||||||
}
|
}
|
||||||
|
|
||||||
var ActiveEntities: Dictionary = {}
|
var g_active_items: Dictionary = {}
|
||||||
|
|
||||||
var owniverse = Owniverse.new()
|
var owniverse:Owniverse = Owniverse.new()
|
||||||
|
var owniverse_items: Dictionary[String, OwniverseItem] = {}
|
||||||
|
|
||||||
func set_datetime(value: String):
|
var item_list_to_update: Dictionary = {}
|
||||||
date_time.text = value
|
|
||||||
|
|
||||||
|
func set_datetime(value: float):
|
||||||
|
date_time.text = str(snapped(value, 0.1))
|
||||||
|
|
||||||
|
#region Item manipulations: update and visibility
|
||||||
|
|
||||||
|
|
||||||
|
func add_to_update_list(item_id: String, amount: int) -> void:
|
||||||
|
if item_list_to_update.has(item_id):
|
||||||
|
item_list_to_update[item_id] += amount
|
||||||
|
else:
|
||||||
|
item_list_to_update[item_id] = amount
|
||||||
|
|
||||||
|
|
||||||
|
func set_owniverse_item_value() -> void:
|
||||||
|
for item_id in owniverse.items_to_update:
|
||||||
|
if owniverse_items.has(item_id):
|
||||||
|
owniverse_items[item_id].set_label(owniverse.items_to_update[item_id])
|
||||||
|
owniverse.items_to_update = {}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
func _on_indicator_pressed(indicator_name: String, page: int = 0):
|
func _on_indicator_pressed(indicator_name: String, page: int = 0):
|
||||||
_set_description(indicator_name, page)
|
_set_description(indicator_name, page)
|
||||||
|
|
||||||
|
|
||||||
func entity_activated(entity: OwniverseEntity) -> void:
|
func _set_item_description(item: OwniverseItem) -> void:
|
||||||
_control_page(entity)
|
|
||||||
_set_entity_description(entity)
|
|
||||||
|
|
||||||
|
|
||||||
func _set_entity_description(entity: OwniverseEntity) -> void:
|
|
||||||
var description: String = "[b]" \
|
var description: String = "[b]" \
|
||||||
+ Global.get_localized_item_description(entity.entity_name, "label") \
|
+ Global.get_localized_item_description(item.item_name, "label") \
|
||||||
+"[/b]" \
|
+"[/b]" \
|
||||||
+"\n" \
|
+"\n" \
|
||||||
+ Global.get_localized_item_description(entity.entity_name, "description")
|
+ Global.get_localized_item_description(item.item_name, "description")
|
||||||
var desc_page = clamp(entity.entity_page, 0, 4)
|
var desc_page = clamp(item.item_page, 0, 4)
|
||||||
g_entity_descriptions[desc_page].text = description
|
g_item_descriptions[desc_page].text = description
|
||||||
|
|
||||||
|
|
||||||
func _set_description(item_name: String, page: int) -> void:
|
func _set_description(item_name: String, page: int) -> void:
|
||||||
var description = Global.get_description(item_name + ".Name")
|
var description = Global.get_description(item_name + ".Name")
|
||||||
description += "\n"
|
description += "\n"
|
||||||
description += Global.get_description(item_name + ".Description")
|
description += Global.get_description(item_name + ".Description")
|
||||||
g_entity_descriptions[page].text = description
|
g_item_descriptions[page].text = description
|
||||||
|
|
||||||
|
|
||||||
func _control_page(entity: OwniverseEntity) -> void:
|
func _control_page(item: OwniverseItem) -> void:
|
||||||
if !ActiveEntities.has(entity.entity_page):
|
# TODO переписать это ↓
|
||||||
ActiveEntities[entity.entity_page] = null
|
if !g_active_items.has(item.item_page):
|
||||||
|
g_active_items[item.item_page] = null
|
||||||
|
|
||||||
var current_entity: OwniverseEntity = ActiveEntities[entity.entity_page]
|
var current_item: OwniverseItem = g_active_items[item.item_page]
|
||||||
if current_entity == entity:
|
if current_item == item:
|
||||||
return
|
return
|
||||||
|
|
||||||
ActiveEntities[entity.entity_page] = entity
|
g_active_items[item.item_page] = item
|
||||||
|
|
||||||
if current_entity != null and current_entity.entity_page == entity.entity_page:
|
if current_item != null and current_item.item_page == item.item_page:
|
||||||
current_entity.set_selection(false)
|
current_item.set_selection(false)
|
||||||
|
|
||||||
entity.set_selection(true)
|
item.set_selection(true)
|
||||||
|
|
||||||
# subpages
|
# subpages
|
||||||
if entity.sub_page != -1:
|
if item.item_sub_page != -1:
|
||||||
item_pages[entity.sub_page].visible = true
|
item_pages[item.item_sub_page].visible = true
|
||||||
|
|
||||||
if current_entity == null \
|
if current_item == null \
|
||||||
or current_entity.sub_page == -1 \
|
or current_item.item_sub_page == -1 \
|
||||||
or current_entity.sub_page == entity.sub_page:
|
or current_item.item_sub_page == item.item_sub_page:
|
||||||
return
|
return
|
||||||
item_pages[current_entity.sub_page].visible = false
|
item_pages[current_item.item_sub_page].visible = false
|
||||||
|
|
||||||
|
|
||||||
func _init_entities() -> bool:
|
func _init_owniverse_items() -> bool:
|
||||||
for e_id in Global.Entities:
|
owniverse_items = {}
|
||||||
var entity_properties: Dictionary = Global.Entities[e_id]
|
for item_id in Global.OwniverseItems:
|
||||||
var entity: OwniverseEntity = ITEM_BUTTON.instantiate()
|
var item_props: Dictionary = Global.OwniverseItems[item_id]
|
||||||
if !entity_properties.has("page"):
|
var item: OwniverseItem = OWNIVERSE_ITEM.instantiate()
|
||||||
printerr("Entity `", e_id, "` has no `page` key.")
|
if !item_props.has("page"):
|
||||||
|
printerr("Item `", item_id, "` has no `page` key.")
|
||||||
return false
|
return false
|
||||||
var page: int = int(entity_properties.page)
|
var page: int = int(item_props.page)
|
||||||
item_pages[page].add_child(entity)
|
item_pages[page].add_child(item)
|
||||||
entity.init_button(entity_properties)
|
item.init_button(item_props)
|
||||||
entity.entity_activated.connect(entity_activated)
|
item.item_activated.connect(item_activated)
|
||||||
|
|
||||||
|
owniverse_items[item_id] = item
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
||||||
|
func item_activated(item: OwniverseItem) -> void:
|
||||||
|
_control_page(item)
|
||||||
|
_set_item_description(item)
|
||||||
|
|
||||||
|
if item.item_id == "S" or item.item_id == "H":
|
||||||
|
owniverse.produce(item.item_id, 100_000)
|
||||||
|
|
||||||
|
func _unlock_item(item_id: String):
|
||||||
|
owniverse_items[item_id].set_visible(true)
|
||||||
|
|
||||||
|
|
||||||
func _check_counters(delta: float) -> Array:
|
func _check_counters(delta: float) -> Array:
|
||||||
var actions: Array = []
|
var actions: Array = []
|
||||||
@@ -156,6 +191,8 @@ func _check_counters(delta: float) -> Array:
|
|||||||
return actions
|
return actions
|
||||||
|
|
||||||
|
|
||||||
|
#region Swipe
|
||||||
|
|
||||||
func _do_actions(actions: Array) -> void:
|
func _do_actions(actions: Array) -> void:
|
||||||
for action: String in actions:
|
for action: String in actions:
|
||||||
match action:
|
match action:
|
||||||
@@ -163,9 +200,6 @@ func _do_actions(actions: Array) -> void:
|
|||||||
_swipe_to_nearest_page()
|
_swipe_to_nearest_page()
|
||||||
|
|
||||||
|
|
||||||
#region Swipe
|
|
||||||
|
|
||||||
|
|
||||||
func _swipe_to_nearest_page() -> void:
|
func _swipe_to_nearest_page() -> void:
|
||||||
if stage_page_scroller.scroll_horizontal % PAGE_WIDTH == 0: return
|
if stage_page_scroller.scroll_horizontal % PAGE_WIDTH == 0: return
|
||||||
|
|
||||||
@@ -196,27 +230,49 @@ func _input(event: InputEvent) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_init_entities()
|
owniverse.init_enitities()
|
||||||
|
owniverse.load_data()
|
||||||
|
_init_owniverse_items()
|
||||||
|
|
||||||
|
owniverse.unlock_item.connect(_unlock_item)
|
||||||
|
g_counters.swipe.sec = 0.2
|
||||||
|
|
||||||
|
for pa in page_actions:
|
||||||
|
page_actions[pa].action_pressed.connect(_page_action_pressed)
|
||||||
|
page_actions[pa].page_id = pa
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
# Update date
|
|
||||||
var sdt: String = str(snapped(owniverse.add_time_delta(delta), 0.1))
|
var year_delta: float = owniverse.add_time_delta(delta)
|
||||||
set_datetime(sdt)
|
set_datetime(year_delta)
|
||||||
|
owniverse.cycle(year_delta)
|
||||||
|
|
||||||
var actions = _check_counters(delta)
|
var actions = _check_counters(delta)
|
||||||
_do_actions(actions)
|
_do_actions(actions)
|
||||||
|
|
||||||
|
_set_active_page_actions()
|
||||||
|
|
||||||
|
func _set_active_page_actions() -> void:
|
||||||
|
for pa in page_actions:
|
||||||
|
if !g_active_items.has(pa): continue
|
||||||
|
|
||||||
|
var item_id: String = g_active_items[pa].item_id
|
||||||
|
var amount = owniverse.get_available_to_produce(item_id)
|
||||||
|
page_actions[pa].set_actions(item_id, amount)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_burger_button_pressed() -> void:
|
func _page_action_pressed(page_id: int, action_amount: float) -> void:
|
||||||
print("b")
|
if !g_active_items.has(page_id):
|
||||||
pass # Replace with function body.
|
return
|
||||||
|
|
||||||
|
var item_id: String = g_active_items[page_id].item_id
|
||||||
|
|
||||||
|
if action_amount > 0:
|
||||||
|
owniverse.produce(item_id, action_amount)
|
||||||
|
|
||||||
|
|
||||||
func _on_report_button_pressed() -> void:
|
|
||||||
print("r")
|
|
||||||
pass # Replace with function body.
|
|
||||||
|
|
||||||
func _change_speed(delta: int) -> void:
|
func _change_speed(delta: int) -> void:
|
||||||
var speed: int = owniverse.change_speed(delta)
|
var speed: int = owniverse.change_speed(delta)
|
||||||
var ind: int = 1
|
var ind: int = 1
|
||||||
@@ -235,6 +291,16 @@ func _change_speed(delta: int) -> void:
|
|||||||
else:
|
else:
|
||||||
g_time_minus.texture_normal = load(SPEED_TEXTURE_NAME_TEMPLATE % str(speed - 1))
|
g_time_minus.texture_normal = load(SPEED_TEXTURE_NAME_TEMPLATE % str(speed - 1))
|
||||||
g_time_plus.texture_normal = load(SPEED_TEXTURE_NAME_TEMPLATE % str(speed + 1))
|
g_time_plus.texture_normal = load(SPEED_TEXTURE_NAME_TEMPLATE % str(speed + 1))
|
||||||
|
|
||||||
|
|
||||||
func _on_topmenu_button_pressed(ButtonName) -> void:
|
func _on_topmenu_button_pressed(ButtonName) -> void:
|
||||||
print(ButtonName)
|
print(ButtonName)
|
||||||
|
#var s: float = 1E15
|
||||||
|
#var z = 1.0
|
||||||
|
#for i in range(30):
|
||||||
|
#print(i, " | ", z, " | ", " | ", s - z)
|
||||||
|
#z *= 10
|
||||||
|
|
||||||
|
|
||||||
|
func _on_save_data() -> void:
|
||||||
|
owniverse.save_data()
|
||||||
|
|||||||
@@ -2,15 +2,9 @@ class_name Counter extends RefCounted
|
|||||||
|
|
||||||
var is_active: bool = false
|
var is_active: bool = false
|
||||||
|
|
||||||
|
|
||||||
var sec: float = 1
|
var sec: float = 1
|
||||||
var value: float = 0
|
var value: float = 0
|
||||||
|
|
||||||
#func set_inactive() -> void:
|
|
||||||
#is_active = false
|
|
||||||
#
|
|
||||||
#func set_active() -> void:
|
|
||||||
#is_active = true
|
|
||||||
|
|
||||||
func is_reached() -> bool:
|
func is_reached() -> bool:
|
||||||
if value >= sec:
|
if value >= sec:
|
||||||
@@ -24,6 +18,3 @@ func add_delta(delta: float) -> void:
|
|||||||
|
|
||||||
func debug() -> void:
|
func debug() -> void:
|
||||||
print(is_active, " | ", value, " of ", sec)
|
print(is_active, " | ", value, " of ", sec)
|
||||||
|
|
||||||
#func _init():
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
uid://dnshr5nb2v60a
|
uid://b3vs2tjw60yu2
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://dg15dpxiepicb"]
|
[gd_scene format=3 uid="uid://dg15dpxiepicb"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://chxxghyul1im7" path="res://UI/Border/border-2px.png" id="1_6kaf8"]
|
[ext_resource type="Texture2D" uid="uid://chxxghyul1im7" path="res://ui/border/border-2px.png" id="1_6kaf8"]
|
||||||
|
|
||||||
[node name="Border" type="TextureRect"]
|
[node name="Border" type="TextureRect"]
|
||||||
texture = ExtResource("1_6kaf8")
|
texture = ExtResource("1_6kaf8")
|
||||||
|
|||||||
Binary file not shown.
@@ -0,0 +1,46 @@
|
|||||||
|
extends HBoxContainer
|
||||||
|
class_name OwniverseAction
|
||||||
|
|
||||||
|
signal action_pressed(page_id, amount: float)
|
||||||
|
|
||||||
|
@onready var action_labels: Array = [
|
||||||
|
$ActionControl0/Label,
|
||||||
|
$ActionControl1/Label,
|
||||||
|
$ActionControl2/Label,
|
||||||
|
$ActionControl3/Label,
|
||||||
|
$ActionControl4/Label,
|
||||||
|
]
|
||||||
|
|
||||||
|
var page_id: int = -1
|
||||||
|
var current_item_id = ""
|
||||||
|
|
||||||
|
var action_values: Dictionary = {
|
||||||
|
0: 0,
|
||||||
|
1: 0,
|
||||||
|
2: 0,
|
||||||
|
3: 0,
|
||||||
|
4: 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func set_actions(item_id: String, value: float) -> void:
|
||||||
|
current_item_id = item_id
|
||||||
|
_set_action_values(_get_distribution(value))
|
||||||
|
|
||||||
|
func _get_distribution(value: float) -> Array:
|
||||||
|
var distribution: Array = [value, 0, 0, 0, 0]
|
||||||
|
|
||||||
|
var exp_value = int(floor(log(abs(value)) / log(10.0)))
|
||||||
|
var floor_value = max(exp_value - 4, -1)
|
||||||
|
for ev in range(exp_value, floor_value, -1):
|
||||||
|
distribution.push_front(pow(10.0, ev))
|
||||||
|
return distribution
|
||||||
|
|
||||||
|
func _set_action_values(values: Array) -> void:
|
||||||
|
for ind in range(0, 5):
|
||||||
|
action_values[ind] = values[ind]
|
||||||
|
action_labels[ind].text = Global.format_number(values[ind]) if values[ind] > 0 else ""
|
||||||
|
|
||||||
|
|
||||||
|
func _on_action_button_pressed(button_id: int) -> void:
|
||||||
|
action_pressed.emit(page_id, action_values[button_id])
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://c2ech05mh56y8
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
[gd_scene format=3 uid="uid://dwneq2qq5p8ek"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://c2ech05mh56y8" path="res://ui/actions/actions.gd" id="1_cjivn"]
|
||||||
|
[ext_resource type="FontFile" uid="uid://d3k1ddvv0rmhs" path="res://fonts/Roboto_Condensed/RobotoCondensed-Light.ttf" id="1_lgdyb"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://gsclv7fr1rbr" path="res://ui/actions/action_button.png" id="2_cjivn"]
|
||||||
|
|
||||||
|
[node name="Actions" type="HBoxContainer" unique_id=503388208]
|
||||||
|
custom_minimum_size = Vector2(0, 216)
|
||||||
|
theme_override_constants/separation = 0
|
||||||
|
script = ExtResource("1_cjivn")
|
||||||
|
|
||||||
|
[node name="ActionControl0" type="Control" parent="." unique_id=1275614326]
|
||||||
|
custom_minimum_size = Vector2(216, 216)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="ActionControl0" unique_id=1639484784]
|
||||||
|
custom_minimum_size = Vector2(216, 32)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
theme_override_fonts/font = ExtResource("1_lgdyb")
|
||||||
|
theme_override_font_sizes/font_size = 32
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="TextureButton" type="TextureButton" parent="ActionControl0" unique_id=1122042557]
|
||||||
|
custom_minimum_size = Vector2(216, 184)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_top = 32.0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 216.0
|
||||||
|
texture_normal = ExtResource("2_cjivn")
|
||||||
|
|
||||||
|
[node name="ActionControl1" type="Control" parent="." unique_id=428212496]
|
||||||
|
custom_minimum_size = Vector2(216, 216)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="ActionControl1" unique_id=382714464]
|
||||||
|
custom_minimum_size = Vector2(216, 32)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
theme_override_fonts/font = ExtResource("1_lgdyb")
|
||||||
|
theme_override_font_sizes/font_size = 32
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="TextureButton" type="TextureButton" parent="ActionControl1" unique_id=1538851090]
|
||||||
|
custom_minimum_size = Vector2(216, 184)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_top = 32.0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 216.0
|
||||||
|
texture_normal = ExtResource("2_cjivn")
|
||||||
|
|
||||||
|
[node name="ActionControl2" type="Control" parent="." unique_id=1758592847]
|
||||||
|
custom_minimum_size = Vector2(216, 216)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="ActionControl2" unique_id=1162569223]
|
||||||
|
custom_minimum_size = Vector2(216, 32)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
theme_override_fonts/font = ExtResource("1_lgdyb")
|
||||||
|
theme_override_font_sizes/font_size = 32
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="TextureButton" type="TextureButton" parent="ActionControl2" unique_id=1137903803]
|
||||||
|
custom_minimum_size = Vector2(216, 184)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_top = 32.0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 216.0
|
||||||
|
texture_normal = ExtResource("2_cjivn")
|
||||||
|
|
||||||
|
[node name="ActionControl3" type="Control" parent="." unique_id=615206748]
|
||||||
|
custom_minimum_size = Vector2(216, 216)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="ActionControl3" unique_id=580732513]
|
||||||
|
custom_minimum_size = Vector2(216, 32)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
theme_override_fonts/font = ExtResource("1_lgdyb")
|
||||||
|
theme_override_font_sizes/font_size = 32
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="TextureButton" type="TextureButton" parent="ActionControl3" unique_id=1783481629]
|
||||||
|
custom_minimum_size = Vector2(216, 184)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_top = 32.0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 216.0
|
||||||
|
texture_normal = ExtResource("2_cjivn")
|
||||||
|
|
||||||
|
[node name="ActionControl4" type="Control" parent="." unique_id=473471606]
|
||||||
|
custom_minimum_size = Vector2(216, 216)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="ActionControl4" unique_id=1862337838]
|
||||||
|
custom_minimum_size = Vector2(216, 32)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 40.0
|
||||||
|
theme_override_fonts/font = ExtResource("1_lgdyb")
|
||||||
|
theme_override_font_sizes/font_size = 32
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="TextureButton" type="TextureButton" parent="ActionControl4" unique_id=1477690280]
|
||||||
|
custom_minimum_size = Vector2(216, 184)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_top = 32.0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 216.0
|
||||||
|
texture_normal = ExtResource("2_cjivn")
|
||||||
|
|
||||||
|
[connection signal="pressed" from="ActionControl0/TextureButton" to="." method="_on_action_button_pressed" binds= [0]]
|
||||||
|
[connection signal="pressed" from="ActionControl1/TextureButton" to="." method="_on_action_button_pressed" binds= [1]]
|
||||||
|
[connection signal="pressed" from="ActionControl2/TextureButton" to="." method="_on_action_button_pressed" binds= [2]]
|
||||||
|
[connection signal="pressed" from="ActionControl3/TextureButton" to="." method="_on_action_button_pressed" binds= [3]]
|
||||||
|
[connection signal="pressed" from="ActionControl4/TextureButton" to="." method="_on_action_button_pressed" binds= [4]]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
extends Control
|
extends Control
|
||||||
class_name OwniverseEntity
|
class_name OwniverseItem
|
||||||
|
|
||||||
signal entity_activated(entity)
|
signal item_activated(item)
|
||||||
|
|
||||||
const ENTITY_WIDTH = 216
|
const ENTITY_WIDTH = 216
|
||||||
const ENTITY_HEIGHT = 256
|
const ENTITY_HEIGHT = 256
|
||||||
@@ -11,10 +11,17 @@ const ENTITY_HEIGHT = 256
|
|||||||
@onready var description: Label = $Description
|
@onready var description: Label = $Description
|
||||||
@onready var selection: TextureRect = $Selection
|
@onready var selection: TextureRect = $Selection
|
||||||
|
|
||||||
@export var entity_name: String = ""
|
|
||||||
@export var entity_id: String = ""
|
var item_id: String = ""
|
||||||
@export var entity_page: int = -1
|
var item_name: String = ""
|
||||||
@export var sub_page: int = -1
|
var item_page: int = -1
|
||||||
|
var item_sub_page: int = -1
|
||||||
|
var item_type = ""
|
||||||
|
|
||||||
|
|
||||||
|
func set_label(value: float) -> void:
|
||||||
|
description.text = Global.format_number(value)
|
||||||
|
#description.text = str(value)
|
||||||
|
|
||||||
|
|
||||||
func set_selection(flag: bool) -> void:
|
func set_selection(flag: bool) -> void:
|
||||||
@@ -25,16 +32,13 @@ func init_button(properties: Dictionary):
|
|||||||
var image_path = "res://" + properties.image + properties.name + ".png"
|
var image_path = "res://" + properties.image + properties.name + ".png"
|
||||||
texture_button.texture_normal = load(image_path)
|
texture_button.texture_normal = load(image_path)
|
||||||
position = Vector2i(int(properties.col) * ENTITY_WIDTH, int(properties.row) * ENTITY_HEIGHT)
|
position = Vector2i(int(properties.col) * ENTITY_WIDTH, int(properties.row) * ENTITY_HEIGHT)
|
||||||
entity_id = properties.id
|
item_id = properties.id
|
||||||
entity_name = properties.name
|
item_name = properties.name
|
||||||
entity_page = int(properties.page)
|
item_page = int(properties.page)
|
||||||
sub_page = int(properties.sub_page)
|
item_sub_page = int(properties.sub_page)
|
||||||
name = properties.id
|
name = properties.id
|
||||||
set_selection(false)
|
|
||||||
#print(properties)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_button_up() -> void:
|
func _on_button_up() -> void:
|
||||||
set_selection(true)
|
set_selection(true)
|
||||||
entity_activated.emit(self)
|
item_activated.emit(self)
|
||||||
#Texture_button.texture_normal = load("res://UI/0-Forces/Inflatin.png")
|
|
||||||
@@ -1,14 +1,24 @@
|
|||||||
[gd_scene format=3 uid="uid://d3xjfxwe3w16v"]
|
[gd_scene format=3 uid="uid://d3xjfxwe3w16v"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://UI/ItemButton/item_button.gd" id="1_e6ro1"]
|
[ext_resource type="Script" uid="uid://bxxllddlgurus" path="res://ui/owniverse_item/owniverse_item.gd" id="1_d5xam"]
|
||||||
[ext_resource type="Texture2D" uid="uid://56w57w6iu3np" path="res://UI/ItemButton/Selected.png" id="2_eurq3"]
|
[ext_resource type="Texture2D" uid="uid://56w57w6iu3np" path="res://ui/owniverse_item/selected.png" id="2_pbv1j"]
|
||||||
|
|
||||||
[node name="Button" type="Control" unique_id=667620208]
|
[node name="Button" type="Control" unique_id=667620208]
|
||||||
|
visible = false
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
offset_right = 216.0
|
offset_right = 216.0
|
||||||
offset_bottom = 260.0
|
offset_bottom = 260.0
|
||||||
script = ExtResource("1_e6ro1")
|
mouse_filter = 1
|
||||||
|
script = ExtResource("1_d5xam")
|
||||||
|
|
||||||
|
[node name="Selection" type="TextureRect" parent="." unique_id=674793134]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 0
|
||||||
|
offset_right = 216.0
|
||||||
|
offset_bottom = 216.0
|
||||||
|
mouse_filter = 2
|
||||||
|
texture = ExtResource("2_pbv1j")
|
||||||
|
|
||||||
[node name="TextureButton" type="TextureButton" parent="." unique_id=1377839155]
|
[node name="TextureButton" type="TextureButton" parent="." unique_id=1377839155]
|
||||||
custom_minimum_size = Vector2(216, 216)
|
custom_minimum_size = Vector2(216, 216)
|
||||||
@@ -22,11 +32,7 @@ layout_mode = 0
|
|||||||
offset_top = 220.0
|
offset_top = 220.0
|
||||||
offset_right = 216.0
|
offset_right = 216.0
|
||||||
offset_bottom = 260.0
|
offset_bottom = 260.0
|
||||||
|
theme_override_font_sizes/font_size = 31
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="Selection" type="TextureRect" parent="." unique_id=674793134]
|
[connection signal="pressed" from="TextureButton" to="." method="_on_button_up"]
|
||||||
layout_mode = 0
|
|
||||||
offset_right = 40.0
|
|
||||||
offset_bottom = 40.0
|
|
||||||
texture = ExtResource("2_eurq3")
|
|
||||||
|
|
||||||
[connection signal="button_up" from="TextureButton" to="." method="_on_button_up"]
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
extends Node
|
|
||||||
|
|
||||||
func print_smth(smth: String):
|
|
||||||
pass
|
|
||||||
#print(smth)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://xte4iwvipeve
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
Version|Content:en|Content:ru
|
Version|Content:en|Content:ru
|
||||||
0.5.1.|Minor fixes|Незначительные правки
|
0.6.12.128|Unlock|Раблокироровка
|
||||||
|
0.5.1|Minor fixes|Незначительные правки
|
||||||
0.5.0|WooHoo! Public release|Ура! Публичный релиз
|
0.5.0|WooHoo! Public release|Ура! Публичный релиз
|
||||||
0.4.8|Ads double forces|Реклама удваивает силы
|
0.4.8|Ads double forces|Реклама удваивает силы
|
||||||
0.4.7|Forces rebalanced|Силы перебалансированы
|
0.4.7|Forces rebalanced|Силы перебалансированы
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user