mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Exclude disabled icons from firmware
This commit is contained in:
@@ -154,7 +154,8 @@ class Main(App):
|
||||
if "frame_rate" in filenames:
|
||||
self.logger.debug("Folder contains animation")
|
||||
icon_name = "A_" + os.path.split(dirpath)[1].replace("-", "_")
|
||||
if not is_main_assets and api_has_icon(icon_name):
|
||||
icon_in_api = api_has_icon(icon_name)
|
||||
if not is_main_assets and icon_in_api:
|
||||
self.logger.info(
|
||||
f"{self.args.filename}: ignoring duplicate icon {icon_name}"
|
||||
)
|
||||
@@ -194,7 +195,8 @@ class Main(App):
|
||||
icons_c.write("\n")
|
||||
icons.append((icon_name, width, height, frame_rate, frame_count))
|
||||
p = dirpath.removeprefix(self.args.input_directory)[1:]
|
||||
paths.append((icon_name, p.replace("\\", "/")))
|
||||
if icon_in_api:
|
||||
paths.append((icon_name, p.replace("\\", "/")))
|
||||
else:
|
||||
# process icons
|
||||
for filename in filenames:
|
||||
@@ -204,7 +206,8 @@ class Main(App):
|
||||
icon_name = "I_" + "_".join(filename.split(".")[:-1]).replace(
|
||||
"-", "_"
|
||||
)
|
||||
if not is_main_assets and api_has_icon(icon_name):
|
||||
icon_in_api = api_has_icon(icon_name)
|
||||
if not is_main_assets and icon_in_api:
|
||||
self.logger.info(
|
||||
f"{self.args.filename}: ignoring duplicate icon {icon_name}"
|
||||
)
|
||||
@@ -223,7 +226,8 @@ class Main(App):
|
||||
icons_c.write("\n")
|
||||
icons.append((icon_name, width, height, 0, 1))
|
||||
p = fullfilename.removeprefix(self.args.input_directory)[1:]
|
||||
paths.append((icon_name, p.replace("\\", "/").rsplit(".", 1)[0]))
|
||||
if icon_in_api:
|
||||
paths.append((icon_name, p.replace("\\", "/").rsplit(".", 1)[0]))
|
||||
# Create array of images:
|
||||
self.logger.debug("Finalizing source file")
|
||||
for name, width, height, frame_rate, frame_count in icons:
|
||||
|
||||
Reference in New Issue
Block a user