-
Notifications
You must be signed in to change notification settings - Fork 13
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 #397 from Wolfy76700/game/bh
BH: Added a batch of characters
- Loading branch information
Showing
23 changed files
with
203 additions
and
13 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,36 @@ | ||
import json | ||
import os | ||
|
||
game_codename = "bh" | ||
|
||
config_path = f"../../games/{game_codename}/base_files/config.json" | ||
asset_pack = "full" | ||
asset_config_path = f"../../games/{game_codename}/{asset_pack}/config.json" | ||
|
||
with open(config_path, "rt", encoding="utf-8") as config_file: | ||
config = json.loads(config_file.read()) | ||
|
||
with open(asset_config_path, "rt", encoding="utf-8") as asset_config_file: | ||
asset_config = json.loads(asset_config_file.read()) | ||
|
||
characters = config.get("character_to_codename") | ||
|
||
eyesights_dict = {} | ||
new_file_list = [] | ||
|
||
for character_name in characters.keys(): | ||
codename = characters[character_name].get("codename") | ||
prefix = asset_config.get("prefix") | ||
postfix = asset_config.get("postfix") | ||
file_path = f"../../games/{game_codename}/{asset_pack}/{prefix}{codename}{postfix}0.png" | ||
if not os.path.exists(file_path): | ||
new_file_list.append(f"{file_path}") | ||
if codename not in asset_config.get("eyesights").keys(): | ||
eyesights_dict[codename] = {0: {"x": 0, "y": 0}} | ||
|
||
with open("eyesights.json", "wt", encoding="utf-8") as eyesights_file: | ||
eyesights_file.write(json.dumps({"eyesights": eyesights_dict}, indent=2)) | ||
|
||
for file_path in new_file_list: | ||
with open(file_path, "wb") as new_file: | ||
new_file.write(bytearray()) |