Commit graph

492 commits

Author SHA1 Message Date
b9873a6c49 adapted safe_eval call and optimised them. MKWF safe_eval are now easier to read 2022-08-06 23:28:52 +02:00
c232a8e328 renamed special ct_icon to ct_icons 2022-08-06 22:00:27 +02:00
42fef0b2e3 replaced the old safe_eval by the new safe_eval (from test, normal mode allow for ~26s -> ~13s, and with lambda mode ~26s -> ~0.03s) 2022-08-06 18:51:48 +02:00
998d1274ef started the rewrote of safe_eval to use AST (making it way easier to read and edit) and could fix some security issue.
Also allow for lambda expression to avoid recompiling and checking the expression at every call
2022-08-06 00:12:02 +02:00
1372a0eac2 fixed an issue where the custom tracks were no longer copied to the game 2022-08-05 18:57:47 +02:00
9b07400a3e implemented track filter in the settings (renamed remove_track_if -> include_track_if) 2022-08-05 18:37:20 +02:00
13bf66c94e mod settings name can now be translated in the settings window 2022-08-02 22:02:25 +02:00
6b001709c5 Custom tracks are now cached in a folder with the mod name instead of all sharing the same directory 2022-08-02 19:29:15 +02:00
e126a6b45b disk space check was done on the wrong directory 2022-08-02 18:37:47 +02:00
edb19e02e4 added a safe type function (disable the creation of class) 2022-08-02 18:03:40 +02:00
4ebd01e924 added a root property for all the container with the main window. (self.master.master ... -> self.root). Fixed an issue with mystuff profile not being deleted properly 2022-08-02 18:01:25 +02:00
5dcb0d4343 fully implemented track_selecting preview 2022-08-02 17:59:37 +02:00
222886e009 use import instead of using sys.modules to avoid a useless sys import 2022-08-02 17:57:46 +02:00
7d7df10217 removed "Track Filters" and "Debug Mode" menu since their are replaced by the mod settings window 2022-08-02 17:55:41 +02:00
d1b17e0a77 the lpar file is now customizable with the mod settings function 2022-08-01 23:06:21 +02:00
59106d8ed9 module filtering subclasses have been simplified to made the code easier to read with less directory inside other useless directory and comment have been added 2022-07-31 23:05:54 +02:00
547e9108da factorized global and specific window into the same one 2022-07-31 19:59:28 +02:00
4e596022a7 made the settings entry and combobox the same size 2022-07-31 19:51:31 +02:00
a2037fd084 implemented settings preview, tweaked some visual and made the preview window code a bit simpler 2022-07-31 19:09:49 +02:00
0a2adb1e6b can no longer modify the textbox in the track_formatting preview window 2022-07-31 00:09:53 +02:00
b4e52cfe58 started implementing ModSettings (only gui testing for now) 2022-07-31 00:03:19 +02:00
51a6e46930 added a scrollbar and made the text widget resizable 2022-07-29 21:01:52 +02:00
b3f85bbe43 implemented track_formatting interface 2022-07-29 19:46:21 +02:00
c39b6f4d4e testing track formatting 2022-07-28 23:00:36 +02:00
d615bbccb6 added the interface for the mod settings 2022-07-28 20:03:38 +02:00
ae5e9976e5 implemented track_new_if to select track that should be selected by "Random: New tracks" 2022-07-27 20:32:25 +02:00
677fb35427 added dict to safe_eval 2022-07-27 20:31:19 +02:00
9ece2b491b made the final message code more readable 2022-07-26 18:10:03 +02:00
0555539543 added custom message for when an installation end 2022-07-25 23:52:31 +02:00
d37ee5a79c added error.log file when an error was occuring 2022-07-25 21:57:00 +02:00
5466a88c2d moved bmg_color_text in safe_eval to ModConfig 2022-07-25 18:48:45 +02:00
abad5f8b5d backslash where only doubled inside multiple safe eval 2022-07-25 18:48:22 +02:00
9c2823af95 removed unnecessary import 2022-07-24 23:16:58 +02:00
8964a052c8 fixed a typo 2022-07-24 23:16:36 +02:00
340f985673 tracks prefix and suffix are now evaluated from mod_config.safe_eval instead of normal safe_eval 2022-07-24 23:16:29 +02:00
d25bc524c7 moved safe_eval from Patch to ModConfig for more global access 2022-07-24 23:14:28 +02:00
5ea1d87974 implemented macros to make safe_eval expression more readable. 2022-07-24 21:52:24 +02:00
62a2e31ce2 fixed safe_eval for PatchFile. Now condition need to be exactly True instead of everything but False 2022-07-24 17:38:55 +02:00
7866f5ca36 fixed JAP originals tracks prefix 2022-07-24 17:20:34 +02:00
70e324c03a fixed MyStuff patcher looking for files at the harddrive root 2022-07-24 00:32:50 +02:00
f519bbd554 added a textwrap to the progress bar description 2022-07-24 00:18:12 +02:00
c2e4833ee4 added MyStuff interface and made it work 2022-07-24 00:17:10 +02:00
062c1272dd made the installer interface a bit wider 2022-07-24 00:02:54 +02:00
ca698217dd added a TODO: patcher don't work on JAP 2022-07-22 15:11:24 +02:00
e570291b23 renamed all the wu8 to wbz to fit the correct extension 2022-07-22 14:42:14 +02:00
7f01c0b66b implemented MyStuff code 2022-07-22 12:54:14 +02:00
0f25ac8720 implemented threads amount options, added checkbox to language options and changed some part of the Option class 2022-07-22 12:00:01 +02:00
332edcdcc5 implemented threads amount options, added checkbox to language options and changed some part of the Option class 2022-07-22 11:59:50 +02:00
0e4c318c19 optimised regex used in bmg layer (100 seconds -> 1.7 seconds for Regex) (2 seconds -> 0.7 seconds for Original Track) 2022-07-22 00:01:02 +02:00
413e906547 track disabled in multiplayer are replaced by their original wii track corresponding to their special slot 2022-07-21 19:27:11 +02:00
4604aae270 renamed "multiplayer_use_default_track_if" to "multiplayer_disable_if" 2022-07-21 16:02:42 +02:00
2bb04dd97c added a point that could help for track file format that could have the same name but with a suffix 2022-07-21 15:53:36 +02:00
66ced040d7 implemented "multiplayer_use_default_track_if" 2022-07-21 15:07:11 +02:00
c5e254cc7d rearranged operators because some couldn't be accessed otherwise 2022-07-21 14:06:32 +02:00
15d84f757c simplified safe_eval by removing extra_token_map because env do the same thing but better and by making patch.safe_eval more similar to the normal safe_eval 2022-07-21 01:24:24 +02:00
448170dad9 simplified cat_data to use list instead of dict 2022-07-21 00:33:38 +02:00
150f0d6e60 added FormatOriginalTrackLayer, allowing for patching originals tracks name like the custom tracks (with tags name, ...) 2022-07-20 23:47:28 +02:00
1d88f89f3d patch_data have been renamed cat_data and can both patch and filters a bmg file 2022-07-20 23:27:02 +02:00
5d448369ee added color to prefix and suffix 2022-07-20 12:19:35 +02:00
aa6eeb2e49 implemented MKWColor for easier naming of BMG color 2022-07-20 10:30:37 +02:00
9a97453a20 added a todo 2022-07-20 10:30:03 +02:00
19ded49c27 added type hint for pycharm 2022-07-19 22:36:25 +02:00
8d30d1238a added CTFileLayer (allow for patching a bmg file with the ctfile with all the tracks name) 2022-07-19 18:23:41 +02:00
47f191c9be moved isinstance and issubclass to the start of operator because they were being overwritten "by" is and "in" 2022-07-19 18:14:57 +02:00
5207e18928 get_ctfile now have a template option for the track name 2022-07-19 15:39:55 +02:00
db87f6cdd7 added LECODE patching (the installer can now output a working game) 2022-07-19 13:42:49 +02:00
ea35b09f44 implemented patch function in lec 2022-07-18 23:58:39 +02:00
92ea7be730 normalizing tracks now use threads 2022-07-18 23:16:50 +02:00
39bd521511 threaded decorator now return the thread 2022-07-18 19:51:20 +02:00
186aa55f4a custom tracks are now converted into szs in the cache 2022-07-18 19:11:11 +02:00
63cbe06bf3 original tracks are now moved to original-tracks in the .cache 2022-07-18 13:18:18 +02:00
8d0544a084 in order to stay constitent with the operation style, bmg-edit have been splitted into bmg-decode, bmg-encode and bmgtxt-edit. This will also allow more possibility. 2022-07-16 22:48:17 +02:00
43018abdca fixed an issue where a .d directory in a Patch would not get his .szs equivalent extracted if the subfile where all at the root level (causing an issue with the MKWF Font patch) 2022-07-16 22:17:56 +02:00
f8c04f62a4 renamed event to plugins 2022-07-16 21:43:18 +02:00
4ede6f0b6b renamed img-generator to img-edit, split PatchOperation.py into a whole module 2022-07-16 01:18:58 +02:00
de52540735 added overwrite mode for PatchFile (write only if already existing) and shortened the writing code to the write_patch function 2022-07-16 00:01:15 +02:00
04268a17a1 added seek(0) before writing a PatchFile 2022-07-15 20:25:04 +02:00
7463e9f10b fixed an issue where 2 lines of wiimm's tools where getting into the file content data 2022-07-15 17:25:22 +02:00
e87f3dacef ct_icons was generated horizontally instead of vertically 2022-07-15 17:24:34 +02:00
d7a8e3c40b changed stderr from PIPE to DEVNULL (debug data was getting written to stdout) 2022-07-15 16:42:28 +02:00
22adc6e29e removed a TODO 2022-07-15 16:41:52 +02:00
db9d32a450 removed useless condition where .exe was added to the tools_path if it was a windows system 2022-07-15 16:41:42 +02:00
5aeb864ef7 added a TODO about using regex to speed up the patch of bmg-edit 2022-07-15 00:31:28 +02:00
06a557dac7 removed unused argument documentation 2022-07-15 00:30:22 +02:00
4d071e190f extracted szs directory will now be repacked into szs files 2022-07-15 00:28:04 +02:00
7f5e709aec started implementing main.dol and StaticR.rel patching 2022-07-15 00:05:54 +02:00
ea79f49121 set stderr to subprocess.PIPE to hide it from the shell 2022-07-14 22:26:07 +02:00
1881d579c9 removed unused import 2022-07-14 22:13:16 +02:00
ebb74a61df implemented decode_data in img (tpl -> png) and added img-decode operation (useful if a texture modification need the original game image as a base) 2022-07-14 18:30:06 +02:00
5ddae33393 added main.dol patch for lecode, and optionnally region, server url and section (cheat code) 2022-07-14 17:06:59 +02:00
ce30419f8c added patch_data to str.py, allowing for main.dol modification 2022-07-14 16:41:05 +02:00
f11c8a5de2 added rename operation 2022-07-14 16:15:41 +02:00
ea4a1d293e fixed an issue where ImageFont couldn't read directly from a Path object, and set CT_ICON_SIZE constant to 128 instead of hardcoding 128 2022-07-14 15:49:03 +02:00
2f71615ef3 removed a already implemented example and a todo 2022-07-14 15:48:06 +02:00
fbdd207c52 added special operation, allowing for replacing a file_content with a precalculated file, useful for ct_icons.tpl for example 2022-07-14 15:47:35 +02:00
cab9b7745d added bmg regex operation support + decoding and encoding are now only done at the start and end of a whole operation instead at every Layer 2022-07-12 22:42:41 +02:00
efd314fb9a patch.multiple_safe_eval and patch.safe_eval are now the safe function with a multiple parameter 2022-07-12 20:57:11 +02:00
4c1c8833b1 moved multiple safe eval from Track.py to safe_eval.py 2022-07-12 20:56:20 +02:00
cb38bf3ae5 Patch.safe_eval now have a env parameter where any variable can be used for the safe_eval 2022-07-12 20:31:47 +02:00
cb069fe240 safe_eval now has mod_config in the environnement 2022-07-12 20:02:03 +02:00
cf0f61d8ee implemented bmg patch operation by id 2022-07-11 23:46:48 +02:00
823dc4cc44 implemented decode_data, encode_data and patch_data 2022-07-11 23:09:04 +02:00
d9ec57a04c compacted _tools_run, _tools_run_popen and _tools_run_dict by creating a get function returning the shortcut function for every module from the tools_path 2022-07-11 00:16:03 +02:00
804c9f38f6 removed the need of temporary file by using stdin as input data 2022-07-10 23:56:57 +02:00
d456430714 made universal_newlines parameter in _run_popen optional 2022-07-10 23:56:10 +02:00
4cb2aa7379 added stdin support to _run_popen 2022-07-10 23:36:50 +02:00
803e9603e7 moved _run, _run_popen and _run_dict out of the class to make _tools_run, _tools_run_popen and _tools_run_dict for the whole module 2022-07-10 23:32:58 +02:00
69aa29c630 fixed untouched patched file content being erased if the mode was set to "edit" 2022-07-10 22:54:26 +02:00
e403d1dce1 added Layer, AbstractLayer, IDLayer and RegexLayer for bmg patch operation (unimplemented) 2022-07-09 23:08:08 +02:00
dde5a134a5 preparing bmg patch 2022-07-09 22:09:07 +02:00
093319eece fixed the ImageLayer Operation that was not pasting the image of top of the other correctly 2022-07-07 23:35:44 +02:00
6831b18c0a fixed image patch operation of type "image" that would not affect the final image 2022-07-05 23:25:42 +02:00
ca833eca2a fixed img-generate in the Patch and some other minor issue 2022-07-05 22:34:10 +02:00
90ab49aa29 splitted Patch.py into a package 2022-07-04 22:51:40 +02:00
cd064556b0 the file were not seeked to 0 after writing, causing a file set on match mode to only copy the first matched file, and then write empty file on the others 2022-07-03 23:45:06 +02:00
3eef32e202 bad stream were returned by the patch method 2022-07-03 23:34:07 +02:00
1cade9fa6f fixed ImageGenerator (ImageFont not imported, missing image variable in a method call) 2022-07-03 23:29:13 +02:00
d509567848 match type operation where not copied to the correct path 2022-07-03 23:27:40 +02:00
32dcefefc9 removed some match that return a subclass by a for loop on all the subclasses, checking for a property named type instead. 2022-07-02 11:14:39 +02:00
81c8ee18cd directory-archive are no longer represented by .szs directory in the patch but by .d directory for code simplicity. szs extraction are now implemented 2022-06-29 19:43:09 +02:00
40de14d201 fixed safe_eval for the Patch, and the region condition in the MKWF patch 2022-06-29 11:55:47 +02:00
5481b75cbf added Patch prototype implementation (untested and unfinished) 2022-06-28 23:43:27 +02:00
b34833397d moved ExtractedGame to a new file, changed the patch to fit the new syntax of the Patch system 2022-06-25 18:48:30 +02:00
4db2d9ee3a restructuring pack (part 4) 2022-06-15 17:18:51 +02:00
d5ef16611d started restructuring pack (part 3), added ct_icons generation, added ExtractedGame class alongside Game, started install_all_patch function 2022-06-14 14:27:48 +02:00
3402a9b26c started restructuring pack (part 2) 2022-06-13 22:40:13 +02:00
3932716227 added get_ctfile to Track, and implemented autoadd extraction 2022-06-13 22:18:08 +02:00
70ade3dc67 moved safe_eval from Track.py to safe_eval.py, allowed getattr with no function limitation, added track_formatting to mod_config.json to customize the track text format for the menu, the race and the filename. Added a Combobox on the install menu for the extension 2022-06-12 23:21:09 +02:00
31a28c3cf1 implemented user options and made translation capable of changing language 2022-06-11 22:38:53 +02:00
541a1b0689 selecting a mod now work, extraction now have a progress bar, clicking on the install button will start the installation 2022-06-11 18:45:29 +02:00
753be7df0d when pressing the install button, everything but the help menu is disabled. Added progress_function to start a function that yield data about the installation to show it on the progress bar 2022-06-10 21:40:03 +02:00
f9db2e96ea wit module now can simulate FST if the game is a FST. Moved many function from game to wit, added exists method to szs 2022-06-10 15:54:08 +02:00
9d97326f4b started implementing Game and wit for the game file manipulation, and modifying ModConfig syntax 2022-06-09 22:47:13 +02:00
f0476381da updated szs and wit, and made the installer the correct file for linux or windows 2022-06-09 22:42:15 +02:00
a83ce2c9c1 implemented ModConfig (new version of CtConfig), Track and TrackGroup 2022-06-09 16:49:46 +02:00
a04f7286b6 started working on the szs and wit wrapper 2022-06-08 16:24:02 +02:00
8d6141703b added permissions check 2022-06-08 14:39:43 +02:00
2f7f0ad5bf implemented events that can be registered from the ./plugins/ directory 2022-06-08 10:18:14 +02:00
404111948d menu design + translation system 2022-06-08 00:23:08 +02:00
599b520780 deleted every files that are not resources for the rewrite
Signed-off-by: Faraphel <rc60650@hotmail.com>
2022-06-07 19:37:38 +02:00
1ef62c5284 updated scripts to create minimap and map image 2022-05-24 10:34:23 +02:00
409fa2d4e2 fixed an issue with a default argument being an int instead of a list 2022-02-10 18:33:40 +01:00
3286f7e070 removed mkwf sort for testing 2022-02-10 14:52:16 +01:00
8e5f690358 improved the behaviour of the installer when a Pack does not provide some value in file_process
Many "x[y] if y in x else d" have been replaced by "x.get(y, d)"
2022-02-10 09:22:03 +01:00
821ae77a22 improved some aspect of the pack extraction tools (error check, automatically select the mod after installing) 2022-02-10 08:35:35 +01:00
2e5c7ec773 added a button to extract modpack with the .mkwf.pack extension 2022-02-09 16:05:16 +01:00
5dfaa35595 game now support special message in multiplayer room 2022-02-09 11:31:28 +01:00
f47049eb55 arena retro track now have their prefix colored 2022-02-08 19:54:49 +01:00
2aa84b8fab arenas are now supported by the installer 2022-02-08 19:24:17 +01:00
cd0c59de38 track with a dolphin warning now will not be included in the random new track per default 2022-02-07 08:54:23 +01:00