-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from JP-Carr/development
Development
- Loading branch information
Showing
7 changed files
with
830 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,4 @@ dmypy.json | |
*.pkl | ||
log.txt | ||
error_log.txt | ||
/campaigns |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
import PySimpleGUI as sg | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Default"] = {"BACKGROUND": "#c73032", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("black", "#ffffff"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Artificer"] = {"BACKGROUND": "#a8a0a0", | ||
"TEXT": "#000000", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#a16d37"), | ||
"PROGRESS": ("#01826B", "#d59139"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Barbarian"] = {"BACKGROUND": "#3b3638", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#e7623e"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Bard"] = {"BACKGROUND": "#ab6dac", | ||
"TEXT": "#000000", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#113685"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Cleric"] = {"BACKGROUND": "#91a1b2", | ||
"TEXT": "#000000", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#4e535e"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Druid"] = {"BACKGROUND": "#4f4026", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#7a853b"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Fighter"] = {"BACKGROUND": "#9c0202", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#7f513e"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Monk"] = {"BACKGROUND": "#666666", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("black", "#51a5c5"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Paladin"] = {"BACKGROUND": "#40469c", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#b59e54"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Ranger"] = {"BACKGROUND": "#828282", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#507f62"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Rogue"] = {"BACKGROUND": "#171717", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#555752"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Sorcerer"] = {"BACKGROUND": "#991e2e", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#828282"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Warlock"] = {"BACKGROUND": "#292929", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("white", "#7b469b"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
sg.LOOK_AND_FEEL_TABLE["Wizard"] = {"BACKGROUND": "#2a50a1", | ||
"TEXT": "#ffffff", | ||
"INPUT": "#ffffff", | ||
"TEXT_INPUT": "#000000", | ||
"SCROLL": "#c7e78b", #not edited yet | ||
"BUTTON": ("black", "#b2bcd6"), | ||
"PROGRESS": ("#01826B", "#D0D0D0"), #not edited yet | ||
"BORDER": 1, "SLIDER_DEPTH": 0, "PROGRESS_DEPTH": 0, #not edited yet | ||
} | ||
|
||
themes=["Default", "Artificer", "Barbarian", "Bard", "Cleric", "Druid", "Fighter", "Monk", "Paladin", "Ranger", "Rogue", "Sorcerer", "Warlock", "Wizard"] | ||
|
||
if __name__=="__main__": | ||
|
||
theme=themes[1] | ||
print(theme) | ||
# Switch to use your newly created theme | ||
sg.theme(theme) | ||
# Call a popup to show what the theme looks like | ||
sg.popup_get_text("This how the \"{}\" custom theme looks".format(theme)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
import pickle | ||
from random import choice, randint | ||
import condition_lists as conditions | ||
######################################################## | ||
|
||
class db: | ||
|
||
def __init__(self): | ||
print("Initalising database...") | ||
""" | ||
self.day_data={"day_raw":0, | ||
"day": 1, | ||
"hour":0, | ||
"tenday":1, | ||
"month":[1,conditions.months[1]], | ||
"year":1491, | ||
"precipitation": choice(conditions.precipitation), | ||
"wind_dir": choice(conditions.wind_dir), | ||
"windspeed": choice(conditions.wind_speed), | ||
"temperature": choice(conditions.temp) | ||
} | ||
""" | ||
self.day_raw=0 | ||
self.day=1 | ||
self.hour=0 | ||
self.tenday=1 | ||
self.month=[1,conditions.months[1]] | ||
self.year=1491 | ||
self.precipitation= choice(conditions.precipitation) | ||
self.wind_dir=choice(conditions.wind_dir) | ||
self.windspeed=choice(conditions.wind_speed) | ||
self.temperature= choice(conditions.temp) | ||
# pickle.dump( self.day_data, open("db.pkl", "wb")) | ||
""" | ||
def save(): | ||
try: | ||
pickle.dump( db, open("db.pkl", "wb")) | ||
except: | ||
print("UNABLE TO SAVE DATABASE") | ||
else: | ||
print("Database saved") | ||
""" | ||
|
||
def show_all(self): | ||
for i in db: | ||
print("{}: {}".format(i,self.day_data[i])) | ||
|
||
def next_day(self, days=1): | ||
for i in range(abs(days)): | ||
x=[randint(0,5) for i in range(4)] | ||
if x[0]==0: | ||
self.precipitation=choice(conditions.precipitation) | ||
if x[1]==0: | ||
self.wind_dir=choice(conditions.wind_dir) | ||
if x[2]==0: | ||
self.windspeed=choice(conditions.wind_speed) | ||
if x[3]==0: | ||
self.temperature=choice(conditions.temp) | ||
|
||
self.day=self.day_raw%30+1 | ||
self.tenday=int((self.day_raw%30)/10)+1 | ||
m=int((self.day_raw%360)/30)+1 | ||
self.month=[m,conditions.months[m]] | ||
self.year=int(self.day_raw/360)+1491 | ||
|
||
|
||
def change_day(self, x): | ||
#x=input("Enter number of days to pass:\n>>") | ||
try: | ||
self.day_raw+=int(x) | ||
if int(x)!=0: | ||
self.next_day(int(x)) | ||
|
||
except TypeError as e: | ||
print("INVALID TIME INCREMENT") | ||
|
||
def change_hour(self, x): | ||
# x=input("Enter number of hours to pass:\n>>") | ||
try: | ||
self.hour+=int(x) | ||
while self.hour>=24: | ||
self.hour-=24 | ||
self.day_raw+=1 | ||
self.next_day() | ||
while self.hour<0: | ||
self.hour+=24 | ||
self.day_raw-=1 | ||
self.next_day(-1) | ||
print("Time: {}:00".format(self.hour)) | ||
except TypeError as e: | ||
print("INVALID TIME INCREMENT") | ||
|
||
|
||
def pickler(path,obj): | ||
outfile = open(path,'wb') | ||
pickle.dump(obj,outfile) | ||
outfile.close() | ||
print(path+" pickled") | ||
|
||
def unpickle(path): | ||
try: | ||
infile = open(path,'rb') | ||
obj = pickle.load(infile) | ||
infile.close() | ||
print(path+" unpickled") | ||
return obj | ||
except FileNotFoundError: | ||
return None | ||
|
||
|
||
########################################################### | ||
""" | ||
try: | ||
db=pickle.load(open( "db.pkl", "rb" ) ) | ||
except: | ||
init() | ||
db=pickle.load(open( "db.pkl", "rb" ) ) | ||
#while 1: | ||
# x=input("Enter command:\n>>") | ||
# commands(x) | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
new_pref={"last campaign": [], | ||
"theme": "Default", | ||
"new_theme": "Default" | ||
} |
Oops, something went wrong.