diff --git a/Helpers/Changes/latest.html b/Helpers/Changes/latest.html index cb032a9..9193516 100644 --- a/Helpers/Changes/latest.html +++ b/Helpers/Changes/latest.html @@ -1 +1,24 @@ -Redirect \ No newline at end of file + + + + + + + + +
+Liste des modifications
+    Modifications du 19-07-18-22-29
+    Modifications du 19-07-19-03-48
+    Modifications du 19-07-18-21-58
+    Modifications du 19-07-19-03-43
+    Modifications du 19-07-19-03-41
+    Modifications du 19-07-19-03-42
+    Modifications du 19-07-19-03-46
+    Modifications du 19-07-19-03-49
+    Modifications du 19-07-18-20-35
+    Modifications du 19-07-19-03-40
+    Modifications du 19-07-19-03-47
+    
+ + diff --git a/Helpers/Characters/exemple.ini b/Helpers/Characters/exemple.ini deleted file mode 100644 index 1ef3398..0000000 --- a/Helpers/Characters/exemple.ini +++ /dev/null @@ -1,10 +0,0 @@ -[Nom technique] - level = Ultime/Avancée/Simple - display_name = Nom de la technique - description = Description pour dev/balance/concept - self = Message complet pour l'utilisateur lors de l'utilisation - others = Message complet pour les autres lors de l'utilisation - var = Valeur de la variable {{var}} - macro = Macro propre de la technique, avec tout les setvars - special = Détails a prendre en compte, - les variables importantes, les stacks. (Notes pour la balance) diff --git a/Helpers/Generated/frene_macro.html b/Helpers/Generated/frene_macro.html new file mode 100644 index 0000000..be2f0d0 --- /dev/null +++ b/Helpers/Generated/frene_macro.html @@ -0,0 +1,13 @@ + + + + + + + + +
+Characters/frene.ini
+
+ + diff --git a/Helpers/Generated/voile_macro.html b/Helpers/Generated/voile_macro.html new file mode 100644 index 0000000..94dac1d --- /dev/null +++ b/Helpers/Generated/voile_macro.html @@ -0,0 +1,23 @@ + + + + + + + + +
+Characters/voile.ini
+[Harmony]
+    Une macro sert a ajuster l'harmonie et generer tous les bonus necessaires puis afficher ces bonus
+[Impact]
+    Reset du momentum, génération du hit
+[Adagio]
+    Augmenter le momentum
+[Tempo Martial]
+    sacrifier actions et générer un hit/afficher le bonus
+[Ire Sanglante]
+    Afficher le total
+
+ + diff --git a/Helpers/macro.py b/Helpers/macro.py index f468be8..7d11844 100755 --- a/Helpers/macro.py +++ b/Helpers/macro.py @@ -17,8 +17,7 @@ verbose=False def dprint(text): if verbose: print(text) -notrash_chars=["exemple.ini"] -reserved_chars=["exemple.ini","God.ini"] +reserved_chars=["God.ini"] errors={ "notfound":term.red("[Error] Couldn't find {char} in the Character directory"), @@ -29,10 +28,29 @@ god=configparser.ConfigParser(inline_comment_prefixes="#") god.read("Characters/God.ini") -def macro(e): - pass +def write_index(output): + list=[f for f in listdir(output) if (f != "latest.html" and isfile(join(output, f)))] + towrite=""" + + + + + + + +
+Liste des modifications
+"""
+    for file in list:
+        towrite+='    Modifications du {}\n'.format(file,file[:-5])
+    towrite+="""    
+ +""" + with open(join(output,"latest.html"),"w") as f: + f.write(towrite) + def save_text_ansi(foutput,ret): pi=subprocess.Popen(("./ansi2html.sh","--palette=xterm"),stdin=subprocess.PIPE,stdout=subprocess.PIPE) e=str.encode(ret,"utf8") @@ -46,6 +64,37 @@ def save_text_ansi(foutput,ret): break f.write(line) + +def macro(characters,output,version): + list_files,names=get_char(characters) + if not list_files: + return + ret="" + for file,name in zip(list_files,names): + ret=macro_one(file,output,version) + if output=="tty": + print(ret) + else: + foutput=join(output,name+"_macro.html") + save_text_ansi(foutput,ret) + +def macro_one(character,output,version): + config=configparser.ConfigParser(inline_comment_prefixes="#") + config.read(character) + ret=term.bold(character)+"\n" + for sect in config.sections(): + try: + text="" + if (config[sect]["macro"]) != "": + text+=term.bold_blue("[{name}]\n".format(name=config[sect]["display_name"])) + text+=" "+replace_vars(config[sect]["macro"],config,god,"macro",sect,character).replace("\n","\n ") + text+="\n" + ret+=text + except KeyError: + pass # No macro found, not really important + + return ret + def show(characters,output,version): list_files,names=get_char(characters) if not list_files: @@ -117,8 +166,7 @@ def diff(characters,output,version): save_file=join(output,date) with open(save_file,"wb") as file: file.write(pi) - with open(join(output,"latest.html"),"w") as file: - file.write('Redirect'.format(date)) + write_index(output) def get_char(names,all=False): if names[0]=="all": @@ -135,7 +183,9 @@ def get_char(names,all=False): def get_all_chars(all): if all: - reserved_chars=notrash_chars + c=[] + else: + c=reserved_chars names=[f for f in listdir("Characters") if (f not in reserved_chars and isfile(join("Characters", f)))] return [join("Characters", f) for f in names],[n[:-4] for n in names] # MOAR BLOBSHITCODING diff --git a/Helpers/term.css b/Helpers/term.css index 1e17482..6d44870 100644 --- a/Helpers/term.css +++ b/Helpers/term.css @@ -1,3 +1,11 @@ +a,a:link, a:visited { + color: #06005f; + text-decoration: none; +} +a:hover, a:active { + color: #9f99ff;;; + background-color: #666666; +} pre { white-space: pre-wrap; } .ef0,.f0 { color: #000000; } .eb0,.b0 { background-color: #000000; } .ef1,.f1 { color: #CD0000; } .eb1,.b1 { background-color: #CD0000; }