From d2fcda4520e60452656e20fc16314d2ba0eb1496 Mon Sep 17 00:00:00 2001 From: Shibe Date: Mon, 3 Aug 2020 11:41:50 +0400 Subject: [PATCH] Save Manager And a couple of corrections. --- assets/locales/text.csv | 20 +++- src/saving/SaveListItem.tscn | 197 +++++++++++++++++++++++++++++++++ src/saving/SaveManagerGUI.tscn | 144 ++++++++++++++++++++++++ 3 files changed, 359 insertions(+), 2 deletions(-) create mode 100644 src/saving/SaveListItem.tscn create mode 100644 src/saving/SaveManagerGUI.tscn diff --git a/assets/locales/text.csv b/assets/locales/text.csv index f5205f3..f6c064e 100644 --- a/assets/locales/text.csv +++ b/assets/locales/text.csv @@ -1,7 +1,7 @@ ,en,ru,pl,uk 200_KPA,200 kPa,200 кПа,, AGENTS,Agents,Агенты,, -ALLOWS_FOR_THE_EVOLATION,"Allows for the evolution of more complex,","Допускает эволюцию более сложных,",, +ALLOWS_FOR_THE_EVOLUTION,"Allows for the evolution of more complex,","Допускает эволюцию более сложных,",, ALSO_TURNS,Also turns,Также включая,, AMMONIA,Ammonia,Аммиак,, AND,and,и,, @@ -21,6 +21,7 @@ BIOLUMINESCENT_VACUOLE,"Bioluminescent Vacuole","Биолюминесцентная Вакуоль",, BIOME_HERE,Biome: BIOME HERE,Биом: BIOME HERE,, +BY_LABEL,By:, ,, CALCIUM_CARBONATE,"Calcium Carbonate","Углекислый Кальций",, @@ -63,18 +64,23 @@ CILIA,Cilia,Ресничка,, CILIA_40_MP,"Cilia 40 MP","Ресничка 40 МО",, +CLEANUP_OLD_SAVES,Clean Up Old Saves,Очистить от старых сохранений,, COLOUR,Colour,Цвет,, COMPOUNDS,Compounds,Компоненты,, CONCENTRATION_OF,concentration of,концентрация от,, CONFIRM,CONFIRM,ПРИНЯТЬ,, +CREATED_AT_LABEL,Created at:,Создано:,, +CREATED_ON_PLATFORM_LABEL,Created on Platform:,Создано на платформе:,, CREDITS,Credits,Титры,, CYTOPLASM,Cytoplasm,Цитоплазма,, CYTOPLASM_22_MP,"Cytoplasm 22 MP","Цитоплазма 22 МО",, CYTOPLASM_LONG,"The gooey innards of a cell. The cytoplasm is the basic mixture of ions, proteins, and other substances dissolved in water that fill the interior of the cell. One of the functions it performs is Fermentation, the conversion of glucose into ATP energy. For cells that lack organelles to have more advanced metabolisms, this is what they rely on for energy. It is also used to store molecules in the cell and to grow the cell's size.","Липкие внутренности клетки. Цитоплазма - это основная смесь ионов, белков и других веществ, растворенных в воде, которые заполняют внутреннюю часть клетки. Одна из его функций - это ферментация, превращение глюкозы в энергию АТФ. Для клеток, которым не хватает органелл, чтобы иметь более продвинутый метаболизм, это то, на что они полагаются для получения энергии. Он также используется для хранения молекул в клетке и для увеличения размера клетки.",, +DELETE_SELECTED,Delete Selected,Удалить выбранные,, DESCRIPTION,"The most basic form of membrane, it has little protection against damage. It also needs more energy to not deform. The advantage is that it allows the cell to move and absorb nutrients swiftly.","Самая основная форма мембраны, она имеет мало защиты от повреждений. Ему также нужно больше энергии, чтобы не деформироваться. Преимущество заключается в том, что оан позволяет клетке быстро двигаться и поглощать питательные вещества.",, DESCRIPTION2,"A membrane with two layers, it has better protection against damage and takes less energy to not deform. However, it slows the cell down some and lowers the rate at which it can absorb resources.","Мембрана с двумя слоями, она имеет лучшую защиту от повреждений и занимает меньше энергии, чтобы не деформироваться. Однако это несколько замедляет клетку и снижает скорость, с которой она может поглощать ресурсы.",, +DESCRIPTION_LABEL,Description:,Описание:,, DIOXIDE,Dioxide,Диоксид,, DOT_CAN,. Can,. Может,, DOT_CAN_RELEASE,. Can release,. Может высвободить,, @@ -117,7 +123,9 @@ INTERNAL_ORGANELLES,Internal Organelles,Внутренние органеллы, INTO,into,,, IRON,Iron,Железо,, LIGHT,Light,Свет,, +LOAD,Load,Загрузить,, LOAD_GAME,Load Game,Загрузить игру,, +LOADING_PLACEHOLDER,Loading...,Загружается...,, MEMBRANE,MEMBRANE,МЕМБРАНА,, MEMBRANE_BOUND_ORGANELLES,membrane-bound organelles. Costs a lot,мембранно-связанные органеллы. Стоить много,, MEMBRANE_CALCIUM_CARBONATE_DESCRIPTION,This membrane has a strong shell made from calcium carbonate. It can easily resist damage and requires less energy to not deform. The disadvantages of having such a heavy shell is that the cell is much slower and takes a while to absorb resources.,"Эта мембрана имеет прочную оболочку из карбоната кальция. Она может легко противостоять повреждениям и требует меньше энергии, чтобы не деформироваться. Недостатки наличия такой тяжелой оболочки заключаются в том, что клетка работает гораздо медленнее и требует времени для поглощения ресурсов.",, @@ -142,6 +150,7 @@ MITOCHONDRION_LONG,"The powerhouse of the cell. The mitochondrion (plural: mitoc MOBILITY,Mobility,Мобильность,, MOVE_TO_THIS_PATCH,Move to This Patch,Двигаться по этому пути,, MUTATION_POINTS,Mutation Points,Мутационные очки,, +NAME_LABEL,Name:,Название:,, NEW,NEW,НОВЫЙ,, NEW_GAME,New Game,Новая игра,, NEXT,NEXT,ДАЛЕЕ,, @@ -202,6 +211,7 @@ RATE,Rate,,, RATE_SCALES,. Rate scales,,, RATE_SCALES_WITH,. Rate scales with,,, RATE_SCALES_WITH_CONCENTRATION_OF,. Rate scales with concentration of,. Шкала скорости с концентрацией,, +REFRESH,Refresh,Обновить,, REPORT,REPORT,СООБЩИТЬ,, RESOURCE_ABSORPTION_SPEED,Resource Absorption Speed,Скорость Поглощения Ресурсов,, RESUME,Resume,Продолжить,, @@ -213,13 +223,16 @@ RUSTICYANIN_45_MP,"Rusticyanin RUSTICYANIN_LONG,"Rusticyanin is a protein able to use gaseous carbon dioxide and oxygen to oxidize iron from one chemical state to another. This process, called Iron Respiration, releases energy which the cell can then harvest.","Рустицианин-это белок, способный использовать газообразный углекислый газ и кислород для окисления железа из одного химического состояния в другое. Этот процесс, называемый железным дыханием, высвобождает энергию, которую клетка может затем собрать.",, SAVE_GAME,Save Game,Сохранить игру,, SCALES_WITH_CONCENTRATION_OF,scales with concentration of,,, +SELECT,select,выбрать,, SELECT_A_PATCH,Select a patch to show details here,"Выберите путь, чтобы показать детали",, -SELECTED,Selected,Выбранно,, +SELECTED,Selected,Выбрано,, +SELECTED_LABEL,Selected:,Выбрано:,, SILICA,Silica,Кремнезём,, SILICA_50_MP,"Silica 50 MP","Кремнезём 50 МО",, SIZE_1,Size 1,Размер 1,, +SPACE_USED_LABEL,Space used:,Занимаемое место:,, SPECIES,Species,Виды,, SPECIES_PRESENT,Species Present,,, SPEED,Speed,Скорость,, @@ -247,18 +260,21 @@ THYLAKOIDS_LONG,"Thylakoids are clusters of proteins and photosensitive pigments TO_BE_IMPLEMENTED,To be Implemented.,Будет реализовано.,, TO_INCREASE_THE_MOVEMENT,to increase the movement,чтобы увеличить движение,, TOOLS,Tools,Инструменты,, +TOTAL_SAVES_LABEL,Total saves:,Всего сохранений:,, TOXIN_RESISTANCE,Toxin Resistance,Устойчивость К Токсинам,, TOXIN_VACUOLE,Toxin Vacuole,Вакуоль Токсина,, TOXIN_VACUOLE_70_MP,"Toxin Vacuole 70 MP",,, TOXINS_PRESSING_E,toxins by pressing E. Rate scales with,,, TURNS,Turns,Включая,, +TYPE_LABEL,Type:,Тип:,, USES,Uses,Использует,, VACUOLE,Vacuole,Вакуоль,, VACUOLE_50_MP,"Vacuole 50 MP","Вакуоль 50 МО",, VACUOLE_LONG,"The vacuole is an internal membranous organelle used for storage in the cell. They are composed of several vesicles, smaller membranous structures widely used in cells for storage, that have fused together. It is filled with water which is used to contain molecules, enzymes, solids, and other substances. Their shape is fluid and can vary between cells.","Вакуоль - это внутренние мембранные органеллы, используемые для хранения в клетке. Они состоят из нескольких пузырьков, более мелких мембранных структур, широко используемых в клетках для хранения, которые слились вместе. Он заполнен водой, которая используется для содержания молекул, ферментов, твердых веществ и других веществ. Их форма является текучей и может варьироваться между клетками.",, +VERSION_LABEL,Version:,Версия:,, WITH_CONCENTRATION_OF,with concentration of,в концентрации от,, YOU_ARE_CURRENTLY_THIS_PATCH,YOU ARE CURRENTLY IN THIS PATCH,ВЫ СЕЙЧАС НА ЭТОМ ПУТИ,, YOU_HAVE_THRIVED,YOU HAVE THRIVED!,ВЫ РАСЦВЕЛИ!,, diff --git a/src/saving/SaveListItem.tscn b/src/saving/SaveListItem.tscn new file mode 100644 index 0000000..6e6a84c --- /dev/null +++ b/src/saving/SaveListItem.tscn @@ -0,0 +1,197 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://assets/textures/gui/bevel/TrashIcon.png" type="Texture" id=1] +[ext_resource path="res://src/gui_common/thrive_theme.tres" type="Theme" id=2] +[ext_resource path="res://assets/misc/icon.png" type="Texture" id=3] +[ext_resource path="res://assets/textures/gui/bevel/trashButtonHover.png" type="Texture" id=4] +[ext_resource path="res://src/saving/SaveListItem.cs" type="Script" id=5] +[ext_resource path="res://assets/textures/gui/bevel/trashButton.png" type="Texture" id=6] + +[sub_resource type="StyleBoxEmpty" id=1] +content_margin_left = 7.0 + +[node name="SaveListItem" type="HBoxContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 2.0 +margin_top = 2.0 +margin_right = 2.0 +margin_bottom = 2.0 +size_flags_horizontal = 3 +theme = ExtResource( 2 ) +script = ExtResource( 5 ) +__meta__ = { +"_edit_use_anchors_": false +} +SaveNamePath = NodePath("VBoxContainer/HBoxContainer/SaveName") +ScreenshotPath = NodePath("Screenshot") +VersionPath = NodePath("VBoxContainer/HBoxContainer/Version") +TypePath = NodePath("VBoxContainer/HBoxContainer4/Type") +CreatedAtPath = NodePath("VBoxContainer/HBoxContainer2/CreatedAt") +CreatedByPath = NodePath("VBoxContainer/HBoxContainer2/Creator") +CreatedOnPlatformPath = NodePath("VBoxContainer/HBoxContainer4/Platform") +DescriptionPath = NodePath("VBoxContainer/HBoxContainer3/Description") +SelectedPath = NodePath("VBoxContainer/HBoxContainer/HBoxContainer/SelectBox") +LoadButtonPath = NodePath("VBoxContainer/HBoxContainer/HBoxContainer/Load") + +[node name="Screenshot" type="TextureRect" parent="."] +margin_right = 255.0 +margin_bottom = 720.0 +rect_min_size = Vector2( 128, 128 ) +size_flags_horizontal = 3 +texture = ExtResource( 3 ) +expand = true +stretch_mode = 6 + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +margin_left = 259.0 +margin_right = 1280.0 +margin_bottom = 720.0 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 4.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] +margin_right = 1021.0 +margin_bottom = 43.0 + +[node name="Label1" type="Label" parent="VBoxContainer/HBoxContainer"] +margin_top = 10.0 +margin_right = 62.0 +margin_bottom = 33.0 +text = "NAME_LABEL" + +[node name="SaveName" type="Label" parent="VBoxContainer/HBoxContainer"] +margin_left = 66.0 +margin_top = 10.0 +margin_right = 160.0 +margin_bottom = 33.0 +text = "LOADING_PLACEHOLDER" + +[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer"] +margin_left = 164.0 +margin_top = 10.0 +margin_right = 251.0 +margin_bottom = 33.0 +custom_styles/normal = SubResource( 1 ) +text = "VERSION_LABEL" + +[node name="Version" type="Label" parent="VBoxContainer/HBoxContainer"] +margin_left = 255.0 +margin_top = 10.0 +margin_right = 270.0 +margin_bottom = 33.0 +text = "..." + +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer"] +margin_left = 274.0 +margin_right = 1021.0 +margin_bottom = 43.0 +size_flags_horizontal = 3 +alignment = 2 + +[node name="SelectBox" type="CheckBox" parent="VBoxContainer/HBoxContainer/HBoxContainer"] +margin_left = 538.0 +margin_right = 628.0 +margin_bottom = 43.0 +text = "SELECT" + +[node name="Delete" type="TextureButton" parent="VBoxContainer/HBoxContainer/HBoxContainer"] +margin_left = 632.0 +margin_right = 674.0 +margin_bottom = 43.0 +texture_normal = ExtResource( 6 ) +texture_hover = ExtResource( 4 ) +texture_disabled = ExtResource( 1 ) + +[node name="Load" type="Button" parent="VBoxContainer/HBoxContainer/HBoxContainer"] +margin_left = 678.0 +margin_right = 747.0 +margin_bottom = 43.0 +text = "LOAD" + +[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"] +margin_top = 47.0 +margin_right = 1021.0 +margin_bottom = 70.0 + +[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2"] +margin_right = 109.0 +margin_bottom = 23.0 +text = "CREATED_AT_LABEL" + +[node name="CreatedAt" type="Label" parent="VBoxContainer/HBoxContainer2"] +margin_left = 113.0 +margin_right = 128.0 +margin_bottom = 23.0 +text = "..." + +[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer2"] +margin_left = 132.0 +margin_right = 169.0 +margin_bottom = 23.0 +custom_styles/normal = SubResource( 1 ) +text = "BY_LABEL" + +[node name="Creator" type="Label" parent="VBoxContainer/HBoxContainer2"] +margin_left = 173.0 +margin_right = 188.0 +margin_bottom = 23.0 +text = "..." + +[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer"] +margin_top = 74.0 +margin_right = 1021.0 +margin_bottom = 97.0 + +[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer4"] +margin_right = 54.0 +margin_bottom = 23.0 +text = "TYPE_LABEL" + +[node name="Type" type="Label" parent="VBoxContainer/HBoxContainer4"] +margin_left = 58.0 +margin_right = 73.0 +margin_bottom = 23.0 +text = "..." + +[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer4"] +margin_left = 77.0 +margin_right = 288.0 +margin_bottom = 23.0 +custom_styles/normal = SubResource( 1 ) +text = "CREATED_ON_PLATFORM_LABEL" + +[node name="Platform" type="Label" parent="VBoxContainer/HBoxContainer4"] +margin_left = 292.0 +margin_right = 307.0 +margin_bottom = 23.0 +text = "..." + +[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"] +margin_top = 101.0 +margin_right = 1021.0 +margin_bottom = 124.0 + +[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3"] +margin_right = 119.0 +margin_bottom = 23.0 +text = "DESCRIPTION_LABEL" + +[node name="Description" type="Label" parent="VBoxContainer/HBoxContainer3"] +margin_left = 123.0 +margin_right = 138.0 +margin_bottom = 23.0 +text = "..." + +[node name="DeleteConfirmDialog" type="ConfirmationDialog" parent="."] +margin_left = 1079.0 +margin_right = 1279.0 +margin_bottom = 720.0 +size_flags_horizontal = 5 +size_flags_vertical = 5 +popup_exclusive = true +window_title = "Delete this Save?" +dialog_text = "Deleting this save cannot be undone, are you sure you want to permanently delete this?" +[connection signal="toggled" from="VBoxContainer/HBoxContainer/HBoxContainer/SelectBox" to="." method="OnSelectedCheckboxChanged"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/HBoxContainer/Delete" to="." method="DeletePressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/HBoxContainer/Load" to="." method="LoadThisSave"] diff --git a/src/saving/SaveManagerGUI.tscn b/src/saving/SaveManagerGUI.tscn new file mode 100644 index 0000000..9677f06 --- /dev/null +++ b/src/saving/SaveManagerGUI.tscn @@ -0,0 +1,144 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://src/saving/SaveManagerGUI.cs" type="Script" id=1] +[ext_resource path="res://src/gui_common/thrive_theme.tres" type="Theme" id=2] +[ext_resource path="res://src/saving/SaveList.tscn" type="PackedScene" id=3] + +[sub_resource type="StyleBoxEmpty" id=1] +content_margin_left = 7.0 + +[node name="SaveManagerGUI" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = ExtResource( 2 ) +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} +SaveListPath = NodePath("CenterContainer/VBoxContainer/SaveList") +SelectedItemCountPath = NodePath("CenterContainer/VBoxContainer/BottomBox/SelectedCount") +TotalSaveCountPath = NodePath("CenterContainer/VBoxContainer/BottomBox/SaveCount") +TotalSaveSizePath = NodePath("CenterContainer/VBoxContainer/BottomBox/SavesSpaceUsed") +LoadButtonPath = NodePath("CenterContainer/VBoxContainer/TopBox/LoadButton") +DeleteSelectedButtonPath = NodePath("CenterContainer/VBoxContainer/TopBox/DeleteSelected") +DeleteOldButtonPath = NodePath("CenterContainer/VBoxContainer/TopBox/DeleteOld") + +[node name="CenterContainer" type="CenterContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +margin_left = 139.0 +margin_top = 85.0 +margin_right = 1139.0 +margin_bottom = 635.0 +rect_min_size = Vector2( 1000, 550 ) +size_flags_vertical = 3 + +[node name="TopBox" type="HBoxContainer" parent="CenterContainer/VBoxContainer"] +margin_right = 1000.0 +margin_bottom = 24.0 +alignment = 1 + +[node name="LoadButton" type="Button" parent="CenterContainer/VBoxContainer/TopBox"] +margin_left = 212.0 +margin_right = 281.0 +margin_bottom = 24.0 +disabled = true +text = "LOAD" + +[node name="VSeparator" type="VSeparator" parent="CenterContainer/VBoxContainer/TopBox"] +margin_left = 285.0 +margin_right = 289.0 +margin_bottom = 24.0 + +[node name="Refresh" type="Button" parent="CenterContainer/VBoxContainer/TopBox"] +margin_left = 293.0 +margin_right = 391.0 +margin_bottom = 24.0 +text = "REFRESH" + +[node name="DeleteSelected" type="Button" parent="CenterContainer/VBoxContainer/TopBox"] +margin_left = 395.0 +margin_right = 575.0 +margin_bottom = 24.0 +disabled = true +text = "DELETE_SELECTED" + +[node name="DeleteOld" type="Button" parent="CenterContainer/VBoxContainer/TopBox"] +margin_left = 579.0 +margin_right = 787.0 +margin_bottom = 24.0 +disabled = true +text = "CLEANUP_OLD_SAVES" + +[node name="SaveList" parent="CenterContainer/VBoxContainer" instance=ExtResource( 3 )] +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 28.0 +margin_right = 1000.0 +margin_bottom = 522.0 +size_flags_vertical = 3 +SelectableItems = true + +[node name="BottomBox" type="HBoxContainer" parent="CenterContainer/VBoxContainer"] +margin_top = 526.0 +margin_right = 1000.0 +margin_bottom = 550.0 + +[node name="Back" type="Button" parent="CenterContainer/VBoxContainer/BottomBox"] +margin_right = 67.0 +margin_bottom = 24.0 +text = "BACK" + +[node name="VSeparator2" type="VSeparator" parent="CenterContainer/VBoxContainer/BottomBox"] +margin_left = 71.0 +margin_right = 75.0 +margin_bottom = 24.0 + +[node name="Label" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"] +margin_left = 79.0 +margin_right = 200.0 +margin_bottom = 23.0 +text = "TOTAL_SAVES_LABEL" + +[node name="SaveCount" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"] +margin_left = 204.0 +margin_right = 217.0 +margin_bottom = 23.0 +text = "0" + +[node name="Label3" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"] +margin_left = 221.0 +margin_right = 354.0 +margin_bottom = 23.0 +custom_styles/normal = SubResource( 1 ) +text = "SPACE_USED_LABEL" + +[node name="SavesSpaceUsed" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"] +margin_left = 358.0 +margin_right = 371.0 +margin_bottom = 23.0 +text = "0" + +[node name="Label2" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"] +margin_left = 375.0 +margin_right = 477.0 +margin_bottom = 23.0 +custom_styles/normal = SubResource( 1 ) +text = "SELECTED_LABEL" + +[node name="SelectedCount" type="Label" parent="CenterContainer/VBoxContainer/BottomBox"] +margin_left = 481.0 +margin_right = 494.0 +margin_bottom = 23.0 +text = "0" +[connection signal="pressed" from="CenterContainer/VBoxContainer/TopBox/LoadButton" to="." method="LoadFirstSelectedSave"] +[connection signal="pressed" from="CenterContainer/VBoxContainer/TopBox/Refresh" to="." method="RefreshList"] +[connection signal="OnSelectedChanged" from="CenterContainer/VBoxContainer/SaveList" to="." method="OnSelectedChanged"] +[connection signal="pressed" from="CenterContainer/VBoxContainer/BottomBox/Back" to="." method="OnBackButton"] -- 2.47.0