Refactor code structure for improved readability and maintainability; removed redundant code blocks and optimized existing functions.
This commit is contained in:
+15
-15
@@ -10,15 +10,6 @@ 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"
|
||||||
|
|
||||||
@@ -43,15 +34,15 @@ func get_description(item_id: String, items: Array = []) -> String:
|
|||||||
return description
|
return description
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
OwniverseEntities = _read_from_csv("res://Autoload/owniverse_entitites.csv")
|
|
||||||
OwniverseItems = _read_from_csv("res://Autoload/owniverse_items.csv")
|
|
||||||
|
|
||||||
Locales["en"] = _read_from_csv("res://Autoload/locale.en.csv")
|
OwniverseEntities = _read_from_csv("res://autoload/owniverse_entitites.txt")
|
||||||
Locales["ru"] = _read_from_csv("res://Autoload/locale.ru.csv")
|
OwniverseItems = _read_from_csv("res://autoload/owniverse_items.txt")
|
||||||
|
|
||||||
Templates["en"] = _read_from_csv("res://Autoload/templates.en.csv")
|
Locales["en"] = _read_from_csv("res://autoload/locale.en.txt")
|
||||||
|
Locales["ru"] = _read_from_csv("res://autoload/locale.ru.txt")
|
||||||
|
|
||||||
|
Templates["en"] = _read_from_csv("res://autoload/templates.en.txt")
|
||||||
|
|
||||||
|
|
||||||
func _read_from_csv(file_path: String) -> Dictionary:
|
func _read_from_csv(file_path: String) -> Dictionary:
|
||||||
@@ -97,6 +88,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,6 +1,6 @@
|
|||||||
id|is_visible|unlock|cost|bind|mass|space|lifespan|auto|gamma|blast|life_product|voids|output|destroy_level|degradation|planets|count_as|group_as|event_group|space_bonus|civ_bonus|claim
|
id|is_visible|unlock|cost|bind|mass|space|lifespan|auto|gamma|blast|life_product|voids|output|destroy_level|degradation|planets|count_as|group_as|event_group|space_bonus|civ_bonus|claim
|
||||||
S|1|start|||||||||||||||||S|||
|
S|1|prime|||||||||||||||||S|||
|
||||||
H|1|start|||||||||||||||||H|||
|
H|1|prime|||||||||||||||||H|||
|
||||||
He|1|He:1||||||||||||||||||||
|
He|1|He:1||||||||||||||||||||
|
||||||
Met|1|Met:1||||||||||||||||||||
|
Met|1|Met:1||||||||||||||||||||
|
||||||
BD|1|BD:1||||||||||||||||||||
|
BD|1|BD:1||||||||||||||||||||
|
||||||
@@ -131,23 +131,23 @@ C4.2|1|C4.2:1|||||||||||||||C4|||||
|
|||||||
C4.3|1|C4.3:1|||||||||||||||C4|||||
|
C4.3|1|C4.3:1|||||||||||||||C4|||||
|
||||||
C4.4|1|C4.4:1|||||||||||||||C4|||||
|
C4.4|1|C4.4:1|||||||||||||||C4|||||
|
||||||
Ct|0|||||||||||||||||||||
|
Ct|0|||||||||||||||||||||
|
||||||
FHYD|1|FHYD:1||||||||||||||||||||
|
fsho|1|fsho:1||||||||||||||||||||
|
||||||
FTEM|1|FTEM:1||||||||||||||||||||
|
finf|1|finf:1||||||||||||||||||||
|
||||||
FITE|1|FITE:1||||||||||||||||||||
|
ftem|1|ftem:1||||||||||||||||||||
|
||||||
FSIN|1|FSIN:1||||||||||||||||||||
|
fcol|1|fcol:1||||||||||||||||||||
|
||||||
FPRI|1|FPRI:1||||||||||||||||||||
|
fpri|1|fpri:1||||||||||||||||||||
|
||||||
FSTE|1|FSTE:1||||||||||||||||||||
|
fsin|1|fsin:1||||||||||||||||||||
|
||||||
FREN|1|FREN:1||||||||||||||||||||
|
fren|1|fren:1||||||||||||||||||||
|
||||||
FINF|1|FINF:1||||||||||||||||||||
|
finf|1|finf:1||||||||||||||||||||
|
||||||
FFRO|1|FFRO:1||||||||||||||||||||
|
ffro|1|ffro:1||||||||||||||||||||
|
||||||
FDES|1|FDES:1||||||||||||||||||||
|
fdes|1|fdes:1||||||||||||||||||||
|
||||||
FROC|1|FROC:1||||||||||||||||||||
|
froc|1|froc:1||||||||||||||||||||
|
||||||
FPAN|1|FPAN:1||||||||||||||||||||
|
fpan|1|fpan:1||||||||||||||||||||
|
||||||
FGAI|1|FGAI:1||||||||||||||||||||
|
fgai|1|fgai:1||||||||||||||||||||
|
||||||
FDAR|1|FDAR:1||||||||||||||||||||
|
fdar|1|fdar:1||||||||||||||||||||
|
||||||
FEDE|1|FEDE:1||||||||||||||||||||
|
fede|1|fede:1||||||||||||||||||||
|
||||||
FPAC|1|FPAC:1||||||||||||||||||||
|
fpac|1|fpac:1||||||||||||||||||||
|
||||||
FENR|1|FENR:1||||||||||||||||||||
|
fenr|1|fenr:1||||||||||||||||||||
|
||||||
FMOR|1|FMOR:1||||||||||||||||||||
|
fmor|1|fmor:1||||||||||||||||||||
|
||||||
FDIS|1|FDIS:1||||||||||||||||||||
|
fdis|1|fdis:1||||||||||||||||||||
|
||||||
FREP|1|FREP:1||||||||||||||||||||
|
frep|1|frep:1||||||||||||||||||||
|
||||||
@@ -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|
|
|
||||||
|
@@ -0,0 +1,125 @@
|
|||||||
|
id|name|image|page|row|col|sub_page
|
||||||
|
fsho|Shovelin|ui/0-forces/|0|0|0|
|
||||||
|
finf|Inflatin|ui/0-forces/|0|0|1|
|
||||||
|
ftem|Temporite|ui/0-forces/|0|0|2|
|
||||||
|
fcol|Collisite|ui/0-forces/|0|0|3|
|
||||||
|
fpri|Primex|ui/0-forces/|0|0|4|
|
||||||
|
fsin|Singularite|ui/0-forces/|0|1|0|
|
||||||
|
fren|Renewin|ui/0-forces/|0|1|1|
|
||||||
|
finf|Infusite|ui/0-forces/|0|1|2|
|
||||||
|
ffro|Frostin|ui/0-forces/|0|1|3|
|
||||||
|
fdes|Destellarite|ui/0-forces/|0|1|4|
|
||||||
|
froc|Rockex|ui/0-forces/|0|2|0|
|
||||||
|
fpan|Panspermin|ui/0-forces/|0|2|1|
|
||||||
|
fgai|Gaianite|ui/0-forces/|0|2|2|
|
||||||
|
fdar|Darwinite|ui/0-forces/|0|2|3|
|
||||||
|
fede|Edenex|ui/0-forces/|0|2|4|
|
||||||
|
fpac|Pacifin|ui/0-forces/|0|3|0|
|
||||||
|
fenr|Enragein|ui/0-forces/|0|3|1|
|
||||||
|
fmor|Moralite|ui/0-forces/|0|3|2|
|
||||||
|
fdis|Discriminite|ui/0-forces/|0|3|3|
|
||||||
|
frep|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|
|
||||||
+59
-30
@@ -1,14 +1,15 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
const ITEM_BUTTON = preload("uid://d3xjfxwe3w16v")
|
signal produce_items(item_id: String, amount: int)
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
@@ -65,23 +66,44 @@ var g_counters: Dictionary[String, Counter] = {
|
|||||||
"swipe": Counter.new(),
|
"swipe": Counter.new(),
|
||||||
}
|
}
|
||||||
|
|
||||||
var ActiveItems: Dictionary = {}
|
var g_active_items: Dictionary = {}
|
||||||
|
|
||||||
|
var owniverse:Owniverse = Owniverse.new()
|
||||||
|
var owniverse_items: Dictionary[String, OwniverseItem] = {}
|
||||||
|
var locked_items:Dictionary = {}
|
||||||
|
|
||||||
|
var item_list_to_update: Dictionary = {}
|
||||||
|
|
||||||
var owniverse = Owniverse.new()
|
|
||||||
|
|
||||||
func set_datetime(value: String):
|
func set_datetime(value: String):
|
||||||
date_time.text = value
|
date_time.text = value
|
||||||
|
|
||||||
|
#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:
|
||||||
|
var item:OwniverseItem = owniverse_items[item_id]
|
||||||
|
item.description.text = str(roundi(owniverse.items_to_update[item_id]))
|
||||||
|
owniverse.items_to_update = {}
|
||||||
|
|
||||||
|
|
||||||
|
func unlock_owniverse_item() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
#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 item_selected(item: OwniverseItem) -> void:
|
|
||||||
_control_page(item)
|
|
||||||
_set_item_description(item)
|
|
||||||
|
|
||||||
|
|
||||||
func _set_item_description(item: OwniverseItem) -> void:
|
func _set_item_description(item: OwniverseItem) -> void:
|
||||||
var description: String = "[b]" \
|
var description: String = "[b]" \
|
||||||
+ Global.get_localized_item_description(item.item_name, "label") \
|
+ Global.get_localized_item_description(item.item_name, "label") \
|
||||||
@@ -100,14 +122,15 @@ func _set_description(item_name: String, page: int) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _control_page(item: OwniverseItem) -> void:
|
func _control_page(item: OwniverseItem) -> void:
|
||||||
if !ActiveItems.has(item.item_page):
|
# TODO переписать это ↓
|
||||||
ActiveItems[item.item_page] = null
|
if !g_active_items.has(item.item_page):
|
||||||
|
g_active_items[item.item_page] = null
|
||||||
|
|
||||||
var current_item: OwniverseItem = ActiveItems[item.item_page]
|
var current_item: OwniverseItem = g_active_items[item.item_page]
|
||||||
if current_item == item:
|
if current_item == item:
|
||||||
return
|
return
|
||||||
|
|
||||||
ActiveItems[item.item_page] = item
|
g_active_items[item.item_page] = item
|
||||||
|
|
||||||
if current_item != null and current_item.item_page == item.item_page:
|
if current_item != null and current_item.item_page == item.item_page:
|
||||||
current_item.set_selection(false)
|
current_item.set_selection(false)
|
||||||
@@ -125,22 +148,36 @@ func _control_page(item: OwniverseItem) -> void:
|
|||||||
item_pages[current_item.item_sub_page].visible = false
|
item_pages[current_item.item_sub_page].visible = false
|
||||||
|
|
||||||
|
|
||||||
func _init_items() -> bool:
|
func _init_owniverse_items() -> bool:
|
||||||
|
owniverse_items = {}
|
||||||
for item_id in Global.OwniverseItems:
|
for item_id in Global.OwniverseItems:
|
||||||
var item_props: Dictionary = Global.OwniverseItems[item_id]
|
var item_props: Dictionary = Global.OwniverseItems[item_id]
|
||||||
var item: OwniverseItem = ITEM_BUTTON.instantiate()
|
var item: OwniverseItem = OWNIVERSE_ITEM.instantiate()
|
||||||
if !item_props.has("page"):
|
if !item_props.has("page"):
|
||||||
printerr("Item `", item_id, "` has no `page` key.")
|
printerr("Item `", item_id, "` has no `page` key.")
|
||||||
return false
|
return false
|
||||||
var page: int = int(item_props.page)
|
var page: int = int(item_props.page)
|
||||||
item_pages[page].add_child(item)
|
item_pages[page].add_child(item)
|
||||||
item.init_button(item_props)
|
item.init_button(item_props)
|
||||||
item.item_activated.connect(item_selected)
|
item.item_activated.connect(item_activated)
|
||||||
|
|
||||||
|
if owniverse.entities.has(item_id):
|
||||||
|
item.visible = owniverse.entities[item_id].is_unlocked
|
||||||
|
|
||||||
|
owniverse_items[item_id] = item
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
||||||
|
func item_activated(item: OwniverseItem) -> void:
|
||||||
|
_control_page(item)
|
||||||
|
_set_item_description(item)
|
||||||
|
|
||||||
|
print(item.item_id)
|
||||||
|
if item.item_id == "S" or item.item_id == "H":
|
||||||
|
owniverse.produce(item.item_id, 1)
|
||||||
|
|
||||||
|
|
||||||
func _check_counters(delta: float) -> Array:
|
func _check_counters(delta: float) -> Array:
|
||||||
var actions: Array = []
|
var actions: Array = []
|
||||||
for k in g_counters:
|
for k in g_counters:
|
||||||
@@ -165,8 +202,6 @@ func _do_actions(actions: Array) -> void:
|
|||||||
|
|
||||||
|
|
||||||
#region Swipe
|
#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
|
||||||
|
|
||||||
@@ -198,7 +233,9 @@ func _input(event: InputEvent) -> void:
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
owniverse.init_enitities()
|
owniverse.init_enitities()
|
||||||
_init_items()
|
_init_owniverse_items()
|
||||||
|
|
||||||
|
g_counters.swipe.sec = 0.2
|
||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
@@ -210,15 +247,6 @@ func _process(delta: float) -> void:
|
|||||||
_do_actions(actions)
|
_do_actions(actions)
|
||||||
|
|
||||||
|
|
||||||
func _on_burger_button_pressed() -> void:
|
|
||||||
print("b")
|
|
||||||
pass # Replace with function body.
|
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
@@ -238,5 +266,6 @@ func _change_speed(delta: int) -> void:
|
|||||||
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)
|
||||||
|
|||||||
@@ -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,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")
|
||||||
|
|||||||
@@ -11,10 +11,12 @@ const ENTITY_HEIGHT = 256
|
|||||||
@onready var description: Label = $Description
|
@onready var description: Label = $Description
|
||||||
@onready var selection: TextureRect = $Selection
|
@onready var selection: TextureRect = $Selection
|
||||||
|
|
||||||
|
|
||||||
var item_id: String = ""
|
var item_id: String = ""
|
||||||
var item_name: String = ""
|
var item_name: String = ""
|
||||||
var item_page: int = -1
|
var item_page: int = -1
|
||||||
var item_sub_page: int = -1
|
var item_sub_page: int = -1
|
||||||
|
var item_type = ""
|
||||||
|
|
||||||
|
|
||||||
func set_selection(flag: bool) -> void:
|
func set_selection(flag: bool) -> void:
|
||||||
@@ -30,7 +32,6 @@ func init_button(properties: Dictionary):
|
|||||||
item_page = int(properties.page)
|
item_page = int(properties.page)
|
||||||
item_sub_page = int(properties.sub_page)
|
item_sub_page = int(properties.sub_page)
|
||||||
name = properties.id
|
name = properties.id
|
||||||
set_selection(false)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_button_up() -> void:
|
func _on_button_up() -> void:
|
||||||
@@ -1,15 +1,25 @@
|
|||||||
[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_e6ro1"]
|
||||||
[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_eurq3"]
|
||||||
|
|
||||||
[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
|
||||||
|
mouse_filter = 1
|
||||||
script = ExtResource("1_e6ro1")
|
script = ExtResource("1_e6ro1")
|
||||||
|
|
||||||
|
[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_eurq3")
|
||||||
|
|
||||||
[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)
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
@@ -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"]
|
|
||||||
@@ -2,4 +2,4 @@ extends Node
|
|||||||
|
|
||||||
func print_smth(smth: String):
|
func print_smth(smth: String):
|
||||||
pass
|
pass
|
||||||
#print(smth)
|
print(smth)
|
||||||
|
|||||||
+5
-5
@@ -8,7 +8,7 @@ custom_features=""
|
|||||||
export_filter="all_resources"
|
export_filter="all_resources"
|
||||||
include_filter=""
|
include_filter=""
|
||||||
exclude_filter=""
|
exclude_filter=""
|
||||||
export_path="../../Documents/Owad/Owniverse.I/Builds/owniverse.0.6.7.exe"
|
export_path="../../Documents/Owad/Owniverse.I/Builds/owniverse.0.6.9-125.exe"
|
||||||
patches=PackedStringArray()
|
patches=PackedStringArray()
|
||||||
patch_delta_encoding=false
|
patch_delta_encoding=false
|
||||||
patch_delta_compression_level_zstd=19
|
patch_delta_compression_level_zstd=19
|
||||||
@@ -74,13 +74,13 @@ Remove-Item -Recurse -Force '{temp_dir}'"
|
|||||||
|
|
||||||
name="Android"
|
name="Android"
|
||||||
platform="Android"
|
platform="Android"
|
||||||
runnable=false
|
runnable=true
|
||||||
dedicated_server=false
|
dedicated_server=false
|
||||||
custom_features=""
|
custom_features=""
|
||||||
export_filter="all_resources"
|
export_filter="all_resources"
|
||||||
include_filter=""
|
include_filter="res://autoload/*.*, *.gd, *.tscn, *.tres, *.json, *.txt, *.png, res://autoload/entitites.txt"
|
||||||
exclude_filter=""
|
exclude_filter=""
|
||||||
export_path="../../Documents/Owad/Owniverse.I/Builds/owniverse.0.6.8-124.aab"
|
export_path="../../Documents/Owad/Owniverse.I/Builds/owniverse.0.6.9-125.aab"
|
||||||
patches=PackedStringArray()
|
patches=PackedStringArray()
|
||||||
patch_delta_encoding=false
|
patch_delta_encoding=false
|
||||||
patch_delta_compression_level_zstd=19
|
patch_delta_compression_level_zstd=19
|
||||||
@@ -110,7 +110,7 @@ architectures/armeabi-v7a=false
|
|||||||
architectures/arm64-v8a=true
|
architectures/arm64-v8a=true
|
||||||
architectures/x86=false
|
architectures/x86=false
|
||||||
architectures/x86_64=false
|
architectures/x86_64=false
|
||||||
version/code=123
|
version/code=126
|
||||||
version/name=""
|
version/name=""
|
||||||
package/unique_name="com.KIDGameProduction.Owniverse"
|
package/unique_name="com.KIDGameProduction.Owniverse"
|
||||||
package/name="Owniverse"
|
package/name="Owniverse"
|
||||||
|
|||||||
+6
-4
@@ -15,15 +15,17 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Owniverse"
|
config/name="Owniverse"
|
||||||
config/version="0.6.7"
|
config/version="0.6.10"
|
||||||
run/main_scene="uid://bv384dpmvjv8o"
|
run/main_scene="uid://bv384dpmvjv8o"
|
||||||
config/features=PackedStringArray("4.6", "Mobile")
|
config/features=PackedStringArray("4.6", "Mobile")
|
||||||
config/icon="res://icon.svg"
|
boot_splash/show_image=false
|
||||||
|
boot_splash/stretch_mode=0
|
||||||
|
config/icon="uid://do5teb1i7uiuw"
|
||||||
|
|
||||||
[autoload]
|
[autoload]
|
||||||
|
|
||||||
Global="*res://Autoload/Global.gd"
|
Global="*uid://5xb12usvrifm"
|
||||||
SaveManager="*res://Autoload/SaveManager.gd"
|
SaveManager="*uid://ul0srjc4gcgg"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
+44
-37
@@ -1,47 +1,47 @@
|
|||||||
[gd_scene format=3 uid="uid://bv384dpmvjv8o"]
|
[gd_scene format=3 uid="uid://bv384dpmvjv8o"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://d2wrwichuoncd" path="res://World/Background/background.gd" id="1_fj7yv"]
|
[ext_resource type="Script" uid="uid://d2wrwichuoncd" path="res://world/Background/background.gd" id="1_fj7yv"]
|
||||||
[ext_resource type="PackedScene" uid="uid://icbk3la71t7h" path="res://World/Background/starry_sky_layer.tscn" id="3_aqk2v"]
|
[ext_resource type="PackedScene" uid="uid://icbk3la71t7h" path="res://world/Background/starry_sky_layer.tscn" id="3_aqk2v"]
|
||||||
[ext_resource type="Script" uid="uid://iiva6x8uo0f2" path="res://Stage/stage.gd" id="3_bh8nc"]
|
[ext_resource type="Script" uid="uid://iiva6x8uo0f2" path="res://stage/stage.gd" id="3_bh8nc"]
|
||||||
[ext_resource type="Texture2D" uid="uid://5f80g4i46ycl" path="res://UI/TopMenu/Buttons/button.burger.normal.png" id="4_2u3nc"]
|
[ext_resource type="Texture2D" uid="uid://5f80g4i46ycl" path="res://ui/topmenu/buttons/button.burger.normal.png" id="4_2u3nc"]
|
||||||
[ext_resource type="Texture2D" uid="uid://caia36a08wlqs" path="res://UI/TopMenu/Buttons/button.burger.pressed.png" id="5_2u3nc"]
|
[ext_resource type="Texture2D" uid="uid://caia36a08wlqs" path="res://ui/topmenu/buttons/button.burger.pressed.png" id="5_2u3nc"]
|
||||||
[ext_resource type="Script" uid="uid://xte4iwvipeve" path="res://command_processor.gd" id="5_036b0"]
|
[ext_resource type="Script" uid="uid://xte4iwvipeve" path="res://command_processor.gd" id="5_036b0"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cjcchycx7biyl" path="res://UI/TopMenu/Time&Speed/TimeX.png" id="6_ikiii"]
|
[ext_resource type="Texture2D" uid="uid://cjcchycx7biyl" path="res://ui/topmenu/time&speed/time_x.png" id="6_ikiii"]
|
||||||
[ext_resource type="FontFile" uid="uid://d3k1ddvv0rmhs" path="res://fonts/Roboto_Condensed/RobotoCondensed-Light.ttf" id="6_wse8f"]
|
[ext_resource type="FontFile" uid="uid://d3k1ddvv0rmhs" path="res://fonts/Roboto_Condensed/RobotoCondensed-Light.ttf" id="6_wse8f"]
|
||||||
[ext_resource type="FontFile" uid="uid://dtyi81a0phumr" path="res://fonts/Roboto_Condensed/RobotoCondensed-Bold.ttf" id="7_ic0uy"]
|
[ext_resource type="FontFile" uid="uid://dtyi81a0phumr" path="res://fonts/Roboto_Condensed/RobotoCondensed-Bold.ttf" id="7_ic0uy"]
|
||||||
[ext_resource type="Texture2D" uid="uid://davmv5mwt3mo1" path="res://UI/TopMenu/Time&Speed/speed.png" id="8_2u3nc"]
|
[ext_resource type="Texture2D" uid="uid://davmv5mwt3mo1" path="res://ui/topmenu/time&speed/speed.png" id="8_2u3nc"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cnjtnggw5ccq3" path="res://UI/TopMenu/Time&Speed/Time1.png" id="8_cbp6q"]
|
[ext_resource type="Texture2D" uid="uid://cnjtnggw5ccq3" path="res://ui/topmenu/time&speed/time1.png" id="8_cbp6q"]
|
||||||
[ext_resource type="FontFile" uid="uid://8s0fv3gfj317" path="res://fonts/Roboto_Condensed/RobotoCondensed-BoldItalic.ttf" id="8_k3n1d"]
|
[ext_resource type="FontFile" uid="uid://8s0fv3gfj317" path="res://fonts/Roboto_Condensed/RobotoCondensed-BoldItalic.ttf" id="8_k3n1d"]
|
||||||
[ext_resource type="FontFile" uid="uid://derqj4pbwtae6" path="res://fonts/Roboto_Condensed/RobotoCondensed-Italic.ttf" id="9_2o6r5"]
|
[ext_resource type="FontFile" uid="uid://derqj4pbwtae6" path="res://fonts/Roboto_Condensed/RobotoCondensed-Italic.ttf" id="9_2o6r5"]
|
||||||
[ext_resource type="Texture2D" uid="uid://rmdsdkck0vst" path="res://UI/TopMenu/Buttons/buton.report.normal.png" id="9_26xuy"]
|
[ext_resource type="Texture2D" uid="uid://rmdsdkck0vst" path="res://ui/topmenu/buttons/buton.report.normal.png" id="9_26xuy"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dbhkuw2jshyoh" path="res://UI/TopMenu/Buttons/buton.report.pressed.png" id="10_bc84e"]
|
[ext_resource type="Texture2D" uid="uid://dbhkuw2jshyoh" path="res://ui/topmenu/buttons/buton.report.pressed.png" id="10_bc84e"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dgkmobpfbbffa" path="res://UI/Pages/Forces.en.png" id="13_il2jm"]
|
[ext_resource type="Texture2D" uid="uid://dgkmobpfbbffa" path="res://ui/pages/forces.en.png" id="13_il2jm"]
|
||||||
[ext_resource type="Texture2D" uid="uid://i43jaaejvh5f" path="res://UI/Indicators/Energy/Energy.png" id="16_udxuc"]
|
[ext_resource type="Texture2D" uid="uid://i43jaaejvh5f" path="res://ui/indicators/energy/energy.png" id="16_udxuc"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cvc1stj3hoax5" path="res://UI/Indicators/Density/Density.png" id="17_ikiii"]
|
[ext_resource type="Texture2D" uid="uid://cvc1stj3hoax5" path="res://ui/indicators/density/density.png" id="17_ikiii"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bef36h52n7lxb" path="res://UI/Indicators/Energy/border-energy.png" id="18_mc2jv"]
|
[ext_resource type="Texture2D" uid="uid://bef36h52n7lxb" path="res://ui/indicators/energy/border-energy.png" id="18_mc2jv"]
|
||||||
[ext_resource type="Texture2D" uid="uid://blq0anccuu387" path="res://UI/Pages/Resources.en.png" id="18_wjb0r"]
|
[ext_resource type="Texture2D" uid="uid://blq0anccuu387" path="res://ui/pages/resources.en.png" id="18_wjb0r"]
|
||||||
[ext_resource type="Texture2D" uid="uid://38fl8ovnubh8" path="res://UI/Pages/Stars.en.png" id="20_mc2jv"]
|
[ext_resource type="Texture2D" uid="uid://38fl8ovnubh8" path="res://ui/pages/stars.en.png" id="20_mc2jv"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bm8ae1ffv7xq5" path="res://UI/Indicators/Density/DensityPointer.png" id="20_wjb0r"]
|
[ext_resource type="Texture2D" uid="uid://bm8ae1ffv7xq5" path="res://ui/indicators/density/density_pointer.png" id="20_wjb0r"]
|
||||||
[ext_resource type="Texture2D" uid="uid://df2nus1pmcc67" path="res://UI/Indicators/Density/DensityCrunch.png" id="21_4h6ng"]
|
[ext_resource type="Texture2D" uid="uid://df2nus1pmcc67" path="res://ui/indicators/density/density_crunch.png" id="21_4h6ng"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cbi24bwo70nk" path="res://UI/Pages/Structures.en.png" id="21_bo7i5"]
|
[ext_resource type="Texture2D" uid="uid://cbi24bwo70nk" path="res://ui/pages/structures.en.png" id="21_bo7i5"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bpff5o5oa4wag" path="res://UI/Pages/Planets.en.png" id="22_4h6ng"]
|
[ext_resource type="Texture2D" uid="uid://bpff5o5oa4wag" path="res://ui/pages/planets.en.png" id="22_4h6ng"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bbk74pjqgxe32" path="res://UI/Indicators/Density/DensityRip.png" id="22_o3ebs"]
|
[ext_resource type="Texture2D" uid="uid://bbk74pjqgxe32" path="res://ui/indicators/density/density_rip.png" id="22_o3ebs"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ysbavtgmq7me" path="res://UI/Indicators/Explosiveness/Explosiveness.png" id="24_qktwf"]
|
[ext_resource type="Texture2D" uid="uid://ysbavtgmq7me" path="res://ui/indicators/explosiveness/explosiveness.png" id="24_qktwf"]
|
||||||
[ext_resource type="Texture2D" uid="uid://sry5js57vds4" path="res://UI/Indicators/Burnability/BurnabilityPointer.png" id="25_bh8nc"]
|
[ext_resource type="Texture2D" uid="uid://sry5js57vds4" path="res://ui/indicators/burnability/burnability_pointer.png" id="25_bh8nc"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dbcmaot2c3tg5" path="res://UI/Indicators/Burnability/Burnability.png" id="27_jjr1n"]
|
[ext_resource type="Texture2D" uid="uid://dbcmaot2c3tg5" path="res://ui/indicators/burnability/burnability.png" id="27_jjr1n"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bbint5cvwtrou" path="res://UI/Indicators/Explosiveness/ExplosivenessPointer.png" id="27_qktwf"]
|
[ext_resource type="Texture2D" uid="uid://bbint5cvwtrou" path="res://ui/indicators/explosiveness/explosivenessPointer.png" id="27_qktwf"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dg15dpxiepicb" path="res://UI/Border/border.tscn" id="28_o3ebs"]
|
[ext_resource type="PackedScene" uid="uid://dg15dpxiepicb" path="res://ui/border/border.tscn" id="28_o3ebs"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cfttpatxe6k2u" path="res://UI/Indicators/Aggression/Aggression.png" id="30_gggvi"]
|
[ext_resource type="Texture2D" uid="uid://cfttpatxe6k2u" path="res://ui/indicators/aggression/aggression.png" id="30_gggvi"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dm87u2ku8wec8" path="res://UI/Indicators/Aggression/AggressionPointer.png" id="31_w44yn"]
|
[ext_resource type="Texture2D" uid="uid://dm87u2ku8wec8" path="res://ui/indicators/aggression/aggression_pointer.png" id="31_w44yn"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bgjcnwl61nu5i" path="res://UI/Indicators/Trends/TrendBar1.png" id="33_w44yn"]
|
[ext_resource type="Texture2D" uid="uid://bgjcnwl61nu5i" path="res://ui/indicators/trends/trend_bar1.png" id="33_w44yn"]
|
||||||
[ext_resource type="Texture2D" uid="uid://caiyhk6vv53iu" path="res://UI/Indicators/Trends/TrendBar2.png" id="34_g1i3r"]
|
[ext_resource type="Texture2D" uid="uid://caiyhk6vv53iu" path="res://ui/indicators/trends/trend_bar2.png" id="34_g1i3r"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dspjxpbpwq52k" path="res://UI/Indicators/Trends/TrendIcon2.png" id="35_my276"]
|
[ext_resource type="Texture2D" uid="uid://dspjxpbpwq52k" path="res://ui/indicators/trends/trend_icon_2.png" id="35_my276"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dxutg6k0ck226" path="res://UI/Indicators/Trends/TrendBar3.png" id="36_jas3d"]
|
[ext_resource type="Texture2D" uid="uid://dxutg6k0ck226" path="res://ui/indicators/trends/trend_bar3.png" id="36_jas3d"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bp72c0myjnl61" path="res://UI/Indicators/Trends/TrendIcon3.png" id="37_7htu6"]
|
[ext_resource type="Texture2D" uid="uid://bp72c0myjnl61" path="res://ui/indicators/trends/trend_icon_3.png" id="37_7htu6"]
|
||||||
[ext_resource type="Texture2D" uid="uid://qrjhpvw8ou3o" path="res://UI/Indicators/Trends/TrendBar4.png" id="38_7qk3m"]
|
[ext_resource type="Texture2D" uid="uid://qrjhpvw8ou3o" path="res://ui/indicators/trends/trend_bar4.png" id="38_7qk3m"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bwqmmmg6w7dho" path="res://UI/Indicators/Trends/TrendIcon4.png" id="39_xpnt2"]
|
[ext_resource type="Texture2D" uid="uid://bwqmmmg6w7dho" path="res://ui/indicators/trends/trend_icon_4.png" id="39_xpnt2"]
|
||||||
[ext_resource type="Texture2D" uid="uid://4tpbmpe6tbk0" path="res://UI/Indicators/Trends/TrendBar5.png" id="40_ruyqm"]
|
[ext_resource type="Texture2D" uid="uid://4tpbmpe6tbk0" path="res://ui/indicators/trends/trend_bar5.png" id="40_ruyqm"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cnf3ml5gj2cvl" path="res://UI/Indicators/Trends/TrendIcon5.png" id="41_fnoqa"]
|
[ext_resource type="Texture2D" uid="uid://cnf3ml5gj2cvl" path="res://ui/indicators/trends/trend_icon_5.png" id="41_fnoqa"]
|
||||||
|
|
||||||
[node name="World" type="Node2D" unique_id=1392592456]
|
[node name="World" type="Node2D" unique_id=1392592456]
|
||||||
|
|
||||||
@@ -237,6 +237,7 @@ layout_mode = 2
|
|||||||
[node name="Forces" type="Control" parent="Stage/StageRows/PageScroller/HBoxContainer/ForcePage" unique_id=2057408842]
|
[node name="Forces" type="Control" parent="Stage/StageRows/PageScroller/HBoxContainer/ForcePage" unique_id=2057408842]
|
||||||
custom_minimum_size = Vector2(1080, 1024)
|
custom_minimum_size = Vector2(1080, 1024)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
mouse_filter = 1
|
||||||
|
|
||||||
[node name="ResourcePage" type="VBoxContainer" parent="Stage/StageRows/PageScroller/HBoxContainer" unique_id=1417647206]
|
[node name="ResourcePage" type="VBoxContainer" parent="Stage/StageRows/PageScroller/HBoxContainer" unique_id=1417647206]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -375,6 +376,7 @@ layout_mode = 2
|
|||||||
[node name="Resources" type="Control" parent="Stage/StageRows/PageScroller/HBoxContainer/ResourcePage/HBoxContainer" unique_id=1538364728]
|
[node name="Resources" type="Control" parent="Stage/StageRows/PageScroller/HBoxContainer/ResourcePage/HBoxContainer" unique_id=1538364728]
|
||||||
custom_minimum_size = Vector2(256, 1024)
|
custom_minimum_size = Vector2(256, 1024)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
mouse_filter = 2
|
||||||
|
|
||||||
[node name="RichTextLabel" type="RichTextLabel" parent="Stage/StageRows/PageScroller/HBoxContainer/ResourcePage/HBoxContainer" unique_id=420150583]
|
[node name="RichTextLabel" type="RichTextLabel" parent="Stage/StageRows/PageScroller/HBoxContainer/ResourcePage/HBoxContainer" unique_id=420150583]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -820,6 +822,10 @@ offset_top = 512.0
|
|||||||
offset_right = 1080.0
|
offset_right = 1080.0
|
||||||
offset_bottom = 1024.0
|
offset_bottom = 1024.0
|
||||||
|
|
||||||
|
[node name="ItemAmountUpdate" type="Timer" parent="Stage" unique_id=1953928024]
|
||||||
|
wait_time = 0.2
|
||||||
|
autostart = true
|
||||||
|
|
||||||
[node name="CommandProcessor" type="Node" parent="." unique_id=2069361293]
|
[node name="CommandProcessor" type="Node" parent="." unique_id=2069361293]
|
||||||
script = ExtResource("5_036b0")
|
script = ExtResource("5_036b0")
|
||||||
|
|
||||||
@@ -835,3 +841,4 @@ script = ExtResource("5_036b0")
|
|||||||
[connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/StructurePage/StructureHeader/DensityIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Density", 3]]
|
[connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/StructurePage/StructureHeader/DensityIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Density", 3]]
|
||||||
[connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/LifePage/LifeHeader/AggressionIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Aggression", 4]]
|
[connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/LifePage/LifeHeader/AggressionIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Aggression", 4]]
|
||||||
[connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/LifePage/LifeHeader/TrendIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Trends", 4]]
|
[connection signal="pressed" from="Stage/StageRows/PageScroller/HBoxContainer/LifePage/LifeHeader/TrendIndicator" to="Stage" method="_on_indicator_pressed" binds= ["Trends", 4]]
|
||||||
|
[connection signal="timeout" from="Stage/ItemAmountUpdate" to="Stage" method="set_owniverse_item_value"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://icbk3la71t7h"]
|
[gd_scene format=3 uid="uid://icbk3la71t7h"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bq7xkdvq4iejn" path="res://World/Background/starry_sky_layer.gd" id="1_st4ay"]
|
[ext_resource type="Script" uid="uid://bq7xkdvq4iejn" path="res://world/Background/starry_sky_layer.gd" id="1_st4ay"]
|
||||||
|
|
||||||
[node name="StarrySkyLayer" type="Parallax2D"]
|
[node name="StarrySkyLayer" type="Parallax2D"]
|
||||||
scroll_offset = Vector2(1080, 1920)
|
scroll_offset = Vector2(1080, 1920)
|
||||||
|
|||||||
+6
-40
@@ -4,6 +4,7 @@ class_name OwniverseEntity
|
|||||||
var id: String
|
var id: String
|
||||||
var is_visible: bool = false
|
var is_visible: bool = false
|
||||||
var unlock: Dictionary = {}
|
var unlock: Dictionary = {}
|
||||||
|
var is_unlocked: bool = false
|
||||||
var cost: Dictionary = {}
|
var cost: Dictionary = {}
|
||||||
var bind: Dictionary = {}
|
var bind: Dictionary = {}
|
||||||
var mass: float
|
var mass: float
|
||||||
@@ -18,15 +19,7 @@ var output_or: Dictionary = {}
|
|||||||
var output_and: Dictionary = {}
|
var output_and: Dictionary = {}
|
||||||
var destroy_level: int
|
var destroy_level: int
|
||||||
var degradation: Dictionary = {}
|
var degradation: Dictionary = {}
|
||||||
#deg_mass: "",
|
|
||||||
#deg_h: "",
|
|
||||||
#He": "",
|
|
||||||
#Met": "",
|
|
||||||
var planets: Dictionary = {}
|
var planets: Dictionary = {}
|
||||||
#var habitable: "",
|
|
||||||
#var rocky: "",
|
|
||||||
#var gas giant: "",
|
|
||||||
#var asteroids: "",
|
|
||||||
var count_as: String
|
var count_as: String
|
||||||
var group_as: String
|
var group_as: String
|
||||||
var event_group: String
|
var event_group: String
|
||||||
@@ -34,43 +27,15 @@ var space_bonus: float
|
|||||||
var civ_bonus: float
|
var civ_bonus: float
|
||||||
var claim: String
|
var claim: String
|
||||||
|
|
||||||
var SCD: Dictionary = {
|
var amount: float = 0.0
|
||||||
"id": "SCD",
|
|
||||||
"is_visible": "1",
|
|
||||||
"unlock": "Star:300",
|
|
||||||
"cost": "",
|
|
||||||
"bind": "Star:1000",
|
|
||||||
"mass": "",
|
|
||||||
"space": "",
|
|
||||||
"lifespan": "10000000",
|
|
||||||
"auto": "", "gamma": "",
|
|
||||||
"blast": "",
|
|
||||||
"life_product": "",
|
|
||||||
"voids": "",
|
|
||||||
"output": "",
|
|
||||||
"destroy_level": "",
|
|
||||||
"deg_mass": "",
|
|
||||||
"H": "",
|
|
||||||
"He": "",
|
|
||||||
"Met": "",
|
|
||||||
"planets": "",
|
|
||||||
"habitable": "",
|
|
||||||
"rocky": "",
|
|
||||||
"gas giant": "",
|
|
||||||
"asteroids": "",
|
|
||||||
"count_as": "",
|
|
||||||
"group_as": "SC",
|
|
||||||
"event_group": "SC",
|
|
||||||
"space_bonus": "0.1",
|
|
||||||
"civ_bonus": "4",
|
|
||||||
"claim": "C2.3"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func init_entity(values: Dictionary) -> bool:
|
func init_entity(values: Dictionary) -> bool:
|
||||||
id = values.id
|
id = values.id
|
||||||
is_visible = values.is_visible == "1"
|
is_visible = values.is_visible == "1"
|
||||||
unlock = _parse_and_string(values.unlock)
|
unlock = _parse_and_string(values.unlock)
|
||||||
|
if "prime" == values.unlock:
|
||||||
|
is_unlocked = true
|
||||||
cost = _parse_and_string(values.cost)
|
cost = _parse_and_string(values.cost)
|
||||||
bind = _parse_and_string(values.bind)
|
bind = _parse_and_string(values.bind)
|
||||||
mass = float(values.mass)
|
mass = float(values.mass)
|
||||||
@@ -111,10 +76,11 @@ func _parse_or_string(source_line: String) -> Dictionary:
|
|||||||
|
|
||||||
func _parse_and_string(source_line: String) -> Dictionary:
|
func _parse_and_string(source_line: String) -> Dictionary:
|
||||||
var result = {}
|
var result = {}
|
||||||
if source_line.contains("&"):
|
|
||||||
var first_split = source_line.split("&")
|
var first_split = source_line.split("&")
|
||||||
|
|
||||||
for elem in first_split:
|
for elem in first_split:
|
||||||
var second_split = elem.split(":")
|
var second_split = elem.split(":")
|
||||||
|
if len(second_split) == 2:
|
||||||
result[second_split[0]] = float(second_split[1])
|
result[second_split[0]] = float(second_split[1])
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
+36
-6
@@ -5,13 +5,46 @@ var g_datetime: float = 0
|
|||||||
var g_speed: int = 1
|
var g_speed: int = 1
|
||||||
var g_speed_in_years = 1
|
var g_speed_in_years = 1
|
||||||
|
|
||||||
var g_entities: Dictionary[String, OwniverseEntity] = {}
|
var entities: Dictionary[String, OwniverseEntity] = {}
|
||||||
|
|
||||||
|
var items_to_update: Dictionary[String, float] = {}
|
||||||
|
|
||||||
|
var cumulative_amount: Dictionary[String, float] = {}
|
||||||
|
|
||||||
|
#region Production
|
||||||
|
|
||||||
|
func produce(item_id: String, amount: int) -> void:
|
||||||
|
if item_id == "S" or item_id == 'H':
|
||||||
|
entities[item_id].amount += 1
|
||||||
|
|
||||||
|
_process_enitity(item_id, amount)
|
||||||
|
|
||||||
|
|
||||||
|
func automated_production() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
# add to all lists
|
||||||
|
func _process_enitity(item_id: String, amount: int) -> void:
|
||||||
|
items_to_update[item_id] = entities[item_id].amount
|
||||||
|
|
||||||
|
|
||||||
|
func _count_cumulative(item_id: String, amount: int) -> void:
|
||||||
|
if cumulative_amount.has(item_id):
|
||||||
|
cumulative_amount[item_id] += amount
|
||||||
|
else:
|
||||||
|
cumulative_amount[item_id] = amount
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
func init_enitities() -> void:
|
func init_enitities() -> void:
|
||||||
for entity_id in Global.OwniverseEntities:
|
for entity_id in Global.OwniverseEntities:
|
||||||
var entity = OwniverseEntity.new()
|
var entity = OwniverseEntity.new()
|
||||||
entity.init_entity(Global.OwniverseEntities[entity_id])
|
entity.init_entity(Global.OwniverseEntities[entity_id])
|
||||||
g_entities[entity_id] = entity
|
entities[entity_id] = entity
|
||||||
|
|
||||||
|
|
||||||
func add_time_delta(delta) -> float:
|
func add_time_delta(delta) -> float:
|
||||||
var year_delta:float = delta * g_speed_in_years
|
var year_delta:float = delta * g_speed_in_years
|
||||||
@@ -21,11 +54,8 @@ func add_time_delta(delta) -> float:
|
|||||||
g_datetime += year_delta
|
g_datetime += year_delta
|
||||||
return g_datetime
|
return g_datetime
|
||||||
|
|
||||||
|
|
||||||
func change_speed(delta: int) -> int:
|
func change_speed(delta: int) -> int:
|
||||||
g_speed = clamp(g_speed + delta, 1, Global.SPEED_LIMIT)
|
g_speed = clamp(g_speed + delta, 1, Global.SPEED_LIMIT)
|
||||||
g_speed_in_years = pow(10, g_speed-1)
|
g_speed_in_years = pow(10, g_speed-1)
|
||||||
return g_speed
|
return g_speed
|
||||||
|
|
||||||
|
|
||||||
func hello():
|
|
||||||
print("ello")
|
|
||||||
|
|||||||
BIN
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user