Skip to content

Commit a6022af

Browse files
committed
On the "Project_Zomboid" module, I have greatly improved how survivors and cities are defined.
Now there is a folder for all survivors, including the deceased. And each survivor contains the city they live in in their new survivor file. I have also added each survivor's details to the new "Details" dictionary, such as gender, age, and date of birth. I added the new method "Update_The_Dictionaries", to update the city and survivor dictionaries. It sorts lists of cities and survivors alphabetically, ignoring casing. This method utilizes the second new method called "Update_Dictionary" to update the dictionaries and files for each city and survivor. The cited method removes the "Folders" keys to make the dictionaries more beautiful and compact. Now each city dictionary contains the "Locality" key to define the locality in all languages the Python programs support. The city locality is the city next to the state and country, separated by dashes, like this: "West Point - Kentucky - United States" In its sub-class "Create_Survival_Diary_File", I made the following changes: Now the user must select only the survivor, not the city and then a survivor of that city. The sub-class now also uses the new "Update_Dictionary" method to update the survivor's dictionary and file. Now it shows the survivor before its current city. And it also shows the city with its total locality, including state and country.
1 parent 420f0ab commit a6022af

File tree

89 files changed

+1714
-1169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1714
-1169
lines changed

Configurações.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"Language": "pt",
23
"Idioma": "pt"
34
}

MS.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,33 @@ def Define_Basic_Variables(self):
4949

5050
self.Input = Input()
5151
self.JSON = JSON()
52+
5253
self.Language = self.JSON.Language
5354

5455
self.languages = self.Language.languages
5556
self.user_language = self.Language.user_language
5657

5758
def Define_Texts(self):
59+
# Define the "Texts" dictionary
5860
self.texts = self.JSON.To_Python(self.folders["apps"]["module_files"][self.module["key"]]["texts"])
5961

62+
# Define the "Language texts" dictionary
6063
self.language_texts = self.Language.Item(self.texts)
6164

62-
self.large_bar = "-----"
63-
self.dash_space = "-"
65+
# Define the "Separators" dictionary
66+
self.separators = {}
67+
68+
# Create separators from one to ten characters
69+
for number in range(1, 11):
70+
# Define the empty string
71+
string = ""
72+
73+
# Add separators to it
74+
while len(string) != number:
75+
string += "-"
76+
77+
# Add the string to the Separators dictionary
78+
self.separators[str(number)] = string
6479

6580
def Define_Parser(self):
6681
# Import the "argparse" module

Module Files/Food_Time/Times.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"Will be hungry": 3
1111
},
1212
"Ate": {
13-
"Object": "2024-04-12 23:59:28-03:00",
13+
"Object": "2024-04-16 00:55:16-03:00",
1414
"Time": 0,
15-
"Time text": "23:59",
15+
"Time text": "00:55",
1616
"Unit": {
1717
"en": "hours",
1818
"pt": "horas"
@@ -23,9 +23,9 @@
2323
}
2424
},
2525
"Can drink water": {
26-
"Object": "2024-04-13 00:39:28-03:00",
26+
"Object": "2024-04-16 01:35:16-03:00",
2727
"Time": 40,
28-
"Time text": "00:39",
28+
"Time text": "01:35",
2929
"Unit": {
3030
"en": "minutes",
3131
"pt": "minutos"
@@ -36,9 +36,9 @@
3636
}
3737
},
3838
"Will be hungry": {
39-
"Object": "2024-04-13 02:59:28-03:00",
39+
"Object": "2024-04-16 03:55:16-03:00",
4040
"Time": 3,
41-
"Time text": "02:59",
41+
"Time text": "03:55",
4242
"Unit": {
4343
"en": "hours",
4444
"pt": "horas"

Module Files/Project_Zomboid/Texts.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@
77
"en": "Select a {} city to use",
88
"pt": "Selecione uma cidade de {} para usar"
99
},
10-
"select_a_survivor_from_{}_to_survive_as_them": {
11-
"en": "Select a survivor from [{}] to survive as them",
12-
"pt": "Selecione um sobrevivente de [{}] para sobreviver como ele"
10+
"select_a_survivor_to_survive_as_them": {
11+
"en": "Select a survivor to survive as them",
12+
"pt": "Selecione um sobrevivente para sobreviver como ele"
1313
},
14-
"the_class_used_predefined_city_and_survivor": {
15-
"en": "The class used a predefined city and survivor",
16-
"pt": "A classe utilizou uma cidade e sobrevivente pré-definidos"
14+
"the_class_a_survivor": {
15+
"en": "The class used a predefined survivor",
16+
"pt": "A classe utilizou um sobrevivente pré-definido"
1717
},
1818
"this_survival_diary_file_was_created": {
1919
"en": "This survivor diary file was created",
2020
"pt": "Este arquivo de diário de sobrevivente foi criado"
21+
},
22+
"kentucky_united_states": {
23+
"pt": "Kentucky, Estados Unidos",
24+
"en": "Kentucky, United States"
2125
}
2226
}

Module Files/Utility/Language/Texts.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
"pt": "idioma completo",
3131
"en": "full language"
3232
},
33+
"text_language": {
34+
"pt": "Idioma de texto",
35+
"en": "Text language"
36+
},
3337
"original_title": {
3438
"en": "Original title",
3539
"pt": "Título original"
@@ -96,6 +100,14 @@
96100
"pt": "Diário Slim",
97101
"en": "Diary Slim"
98102
},
103+
"header, title()": {
104+
"pt": "Cabeçalho",
105+
"en": "Header"
106+
},
107+
"data, title()": {
108+
"pt": "Dados",
109+
"en": "Data"
110+
},
99111
"data_networks": {
100112
"pt": "Redes de Dados",
101113
"en": "Data Networks"
@@ -175,6 +187,10 @@
175187
"en": "List",
176188
"pt": "Lista"
177189
},
190+
"original_list": {
191+
"en": "Original list",
192+
"pt": "Lista original"
193+
},
178194
"current, title()": {
179195
"en": "Current",
180196
"pt": "Atual"
@@ -773,6 +789,14 @@
773789
"pt": "Aniversários",
774790
"en": "Birthdays"
775791
},
792+
"date_of_birth": {
793+
"pt": "Data de nascimento",
794+
"en": "Date of birth"
795+
},
796+
"date_of_birth, type: plural": {
797+
"pt": "Datas de nascimento",
798+
"en": "Dates of birth"
799+
},
776800
"height, title()": {
777801
"pt": "Altura",
778802
"en": "Height"
@@ -789,6 +813,14 @@
789813
"pt": "Cidades natais",
790814
"en": "Hometowns"
791815
},
816+
"locality, title()": {
817+
"pt": "Localidade",
818+
"en": "Locality"
819+
},
820+
"united_states": {
821+
"pt": "Estados Unidos",
822+
"en": "United States"
823+
},
792824
"residence_place": {
793825
"pt": "Local de residência",
794826
"en": "Residence place"
@@ -1978,6 +2010,10 @@
19782010
"en": "Survivors",
19792011
"pt": "Sobreviventes"
19802012
},
2013+
"deceased, title()": {
2014+
"en": "Deceased",
2015+
"pt": "Falecidos"
2016+
},
19812017
"it_is": {
19822018
"en": "it is",
19832019
"pt": "é"

Modules/Block_Websites/Block_Websites/__init__.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def Define_Basic_Variables(self):
5252
# Create a list of the modules that will not be imported
5353
remove_list = [
5454
"Define_Folders",
55-
"Language"
55+
"Language",
56+
"JSON"
5657
]
5758

5859
# Iterate through the Utility modules
@@ -98,12 +99,26 @@ def Define_Basic_Variables(self):
9899
self.date = self.Date.date
99100

100101
def Define_Texts(self):
101-
self.large_bar = "-----"
102-
self.dash_space = "-"
102+
# Define the "Separators" dictionary
103+
self.separators = {}
103104

105+
# Create separators from one to ten characters
106+
for number in range(1, 11):
107+
# Define the empty string
108+
string = ""
109+
110+
# Add separators to it
111+
while len(string) != number:
112+
string += "-"
113+
114+
# Add the string to the Separators dictionary
115+
self.separators[str(number)] = string
116+
117+
# Define the "Texts" dictionary
104118
self.texts = self.JSON.To_Python(self.folders["apps"]["module_files"][self.module["key"]]["texts"])
105119

106-
self.language_texts = self.JSON.Language.Item(self.texts)
120+
# Define the "Language texts" dictionary
121+
self.language_texts = self.Language.Item(self.texts)
107122

108123
self.texts["redirect_ip"] = "127.0.0.1"
109124
self.texts["redirect_ip_space"] = self.texts["redirect_ip"] + " "

Modules/Block_Websites/Unblock/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def Create_Websites_List(self):
114114
while dictionary["option"] != "[" + self.language_texts["finish_selection"] + "]":
115115
if website_to_unlock != []:
116116
print()
117-
print(self.JSON.Language.language_texts["list, title()"] + ":")
117+
print(self.Language.language_texts["list, title()"] + ":")
118118

119119
self.JSON.Show(website_to_unlock)
120120

Modules/Block_Websites/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ def __init__(self):
3030
for class_ in self.classes:
3131
class_description = self.descriptions[class_]
3232

33-
self.class_descriptions.append(self.JSON.Language.Item(class_description))
33+
self.class_descriptions.append(self.Language.Item(class_description))
3434

35-
self.language_texts = self.JSON.Language.Item(self.descriptions)
35+
self.language_texts = self.Language.Item(self.descriptions)
3636

37-
option = self.Input.Select(self.classes, language_options = self.class_descriptions, show_text = self.language_texts["show_text"], select_text = self.JSON.Language.language_texts["select_one_class_to_execute"])["option"]
37+
option = self.Input.Select(self.classes, language_options = self.class_descriptions, show_text = self.language_texts["show_text"], select_text = self.Language.language_texts["select_one_class_to_execute"])["option"]
3838

3939
module = importlib.import_module("." + option, self.__module__)
4040
sub_class = getattr(module, option)()

Modules/Christmas/Christmas/__init__.py

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,26 @@ def Define_Basic_Variables(self):
8888
self.date = self.Date.date
8989

9090
def Define_Texts(self):
91-
self.large_bar = "-----"
92-
self.dash_space = "-"
91+
# Define the "Separators" dictionary
92+
self.separators = {}
9393

94+
# Create separators from one to ten characters
95+
for number in range(1, 11):
96+
# Define the empty string
97+
string = ""
98+
99+
# Add separators to it
100+
while len(string) != number:
101+
string += "-"
102+
103+
# Add the string to the Separators dictionary
104+
self.separators[str(number)] = string
105+
106+
# Define the "Texts" dictionary
94107
self.texts = self.JSON.To_Python(self.folders["apps"]["module_files"][self.module["key"]]["texts"])
95108

96-
self.language_texts = self.JSON.Language.Item(self.texts)
109+
# Define the "Language texts" dictionary
110+
self.language_texts = self.Language.Item(self.texts)
97111

98112
def Import_Classes(self):
99113
# Define the classes to be imported
@@ -160,7 +174,7 @@ def Define_Lists_And_Dictionaries(self):
160174
"Year pictures": self.current_year["Folders"]["Image"]["Christmas"]["Pictures"]["root"],
161175
},
162176
"Files": {
163-
"Christmas theme": self.folders["Image"]["Christmas"]["Theme"]["root"] + self.JSON.Language.language_texts["christmas, title()"] + ".lnk",
177+
"Christmas theme": self.folders["Image"]["Christmas"]["Theme"]["root"] + self.Language.language_texts["christmas, title()"] + ".lnk",
164178
"Texts": self.current_year["Folders"]["Christmas"]["Merry Christmas"]["Texts"]
165179
},
166180
"Programs": {
@@ -260,12 +274,12 @@ def Open_Social_Networks(self, parameter):
260274
print()
261275

262276
# Show the "Social Networks" and the "[Current number]/[Total number]" texts
263-
print(self.JSON.Language.language_texts["social_networks"] + ":")
277+
print(self.Language.language_texts["social_networks"] + ":")
264278
print("\t" + text)
265279
print()
266280

267281
# Show the "Social Network" text and the Social Network name
268-
print(self.JSON.Language.language_texts["social_network"] + ":")
282+
print(self.Language.language_texts["social_network"] + ":")
269283
print("\t" + social_network)
270284

271285
self.social_networks["List"] = [
@@ -310,12 +324,12 @@ def Open_Social_Networks(self, parameter):
310324
print()
311325

312326
# Show the "Social Networks" and the "[Current number]/[Total number]" texts
313-
print(self.JSON.Language.language_texts["social_networks"] + ":")
327+
print(self.Language.language_texts["social_networks"] + ":")
314328
print("\t" + text)
315329
print()
316330

317331
# Show the "Social Network" text and the Social Network name
318-
print(self.JSON.Language.language_texts["social_network"] + ":")
332+
print(self.Language.language_texts["social_network"] + ":")
319333
print("\t" + social_network)
320334

321335
# Define the text template
@@ -324,7 +338,7 @@ def Open_Social_Networks(self, parameter):
324338
# Define the text template items
325339
items = [
326340
social_network,
327-
self.JSON.Language.language_texts["profile, title()"]
341+
self.Language.language_texts["profile, title()"]
328342
]
329343

330344
# Format the text template with the items
@@ -347,7 +361,7 @@ def Open_Social_Networks(self, parameter):
347361
i += 1
348362

349363
def Open_Module(self, module):
350-
self.press_enter_text = self.JSON.Language.language_texts["press_enter_when_you"] + " {}"
364+
self.press_enter_text = self.Language.language_texts["press_enter_when_you"] + " {}"
351365

352366
texts = {
353367
"Watch_History": self.language_texts["press_enter_when_you_finish_watching_all_of_the_christmas_episodes"],
@@ -380,15 +394,15 @@ def Open_Module(self, module):
380394
lines = self.File.Contents(file)["lines"]
381395

382396
# Define the file information text
383-
text = self.JSON.Language.language_texts[key.lower() + ", title()"].lower()
397+
text = self.Language.language_texts[key.lower() + ", title()"].lower()
384398

385399
print()
386-
print(self.JSON.Language.language_texts["to, title()"] + " " + text + ":")
400+
print(self.Language.language_texts["to, title()"] + " " + text + ":")
387401

388402
tab = "\t"
389403

390404
if lines == []:
391-
print(tab + "[" + self.JSON.Language.language_texts["nothing, title()"] + "]")
405+
print(tab + "[" + self.Language.language_texts["nothing, title()"] + "]")
392406

393407
i = 1
394408
for line in lines:

Modules/Christmas/Start_Christmas/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self):
3535

3636
# Show a separator
3737
print()
38-
print(self.large_bar)
38+
print(self.separators["5"])
3939
print()
4040

4141
# Define today as "24 of December" for testing purposes
@@ -58,7 +58,7 @@ def __init__(self):
5858
self.christmas["States"]["Today is Christmas"] = True
5959

6060
# Show the current date text
61-
print(self.JSON.Language.language_texts["today_is"] + ":")
61+
print(self.Language.language_texts["today_is"] + ":")
6262

6363
date_text = date["Formats"]["[Day name], [Day] [Month name] [Year]"][self.user_language]
6464

@@ -129,7 +129,7 @@ def __init__(self):
129129

130130
def Execute_Christmas_Steps(self):
131131
# Show the "Starting Christmas" information text
132-
print(self.language_texts["starting_{}_of_{}..."].format(self.JSON.Language.language_texts["christmas, title()"], self.date["Units"]["Year"]))
132+
print(self.language_texts["starting_{}_of_{}..."].format(self.Language.language_texts["christmas, title()"], self.date["Units"]["Year"]))
133133
print()
134134
print("-")
135135
print()
@@ -193,7 +193,7 @@ def Execute_Christmas_Steps(self):
193193
# If the program needs to ask for user input before continuing to the next step
194194
if ask_for_input == True:
195195
# Define the type text for easier typing
196-
type_text = self.JSON.Language.language_texts["continue, title()"]
196+
type_text = self.Language.language_texts["continue, title()"]
197197

198198
# Define the first space variable
199199
first_space = False

0 commit comments

Comments
 (0)