@@ -60,6 +60,16 @@ def check_files_updated():
6060def refill_menu ():
6161 menu .categories .clear ()
6262
63+ sc_category = Menu .Category (0 , locale .sc_label )
64+ ktx_category = Menu .Category (1 , locale .ktx_label )
65+ csv_category = Menu .Category (2 , locale .csv_label )
66+ other = Menu .Category (10 , locale .other_features_label )
67+
68+ menu .add_category (sc_category )
69+ menu .add_category (ktx_category )
70+ menu .add_category (csv_category )
71+ menu .add_category (other )
72+
6373 try :
6474 import sc_compression
6575
@@ -86,7 +96,6 @@ def refill_menu():
8696 encode_textures_only ,
8797 )
8898
89- sc_category = Menu .Category (0 , locale .sc_label )
9099 sc_category .add (
91100 Menu .Item (
92101 name = locale .decode_sc ,
@@ -122,9 +131,29 @@ def refill_menu():
122131 handler = lambda : collect_objects_and_encode (True ),
123132 )
124133 )
125- menu .add_category (sc_category )
126134
127- csv_category = Menu .Category (1 , locale .csv_label )
135+ from system .lib .features .ktx import (
136+ convert_ktx_textures_to_png ,
137+ convert_png_textures_to_ktx ,
138+ )
139+ from system .lib .pvr_tex_tool import can_use_pvr_tex_tool
140+
141+ if can_use_pvr_tex_tool ():
142+ ktx_category .add (
143+ Menu .Item (
144+ name = locale .ktx_from_png_label ,
145+ description = locale .ktx_from_png_description ,
146+ handler = convert_png_textures_to_ktx ,
147+ )
148+ )
149+ ktx_category .add (
150+ Menu .Item (
151+ name = locale .png_from_ktx_label ,
152+ description = locale .png_from_ktx_description ,
153+ handler = convert_ktx_textures_to_png ,
154+ )
155+ )
156+
128157 csv_category .add (
129158 Menu .Item (
130159 name = locale .decompress_csv ,
@@ -139,9 +168,7 @@ def refill_menu():
139168 handler = compress_csv ,
140169 )
141170 )
142- menu .add_category (csv_category )
143171
144- other = Menu .Category (10 , locale .other_features_label )
145172 other .add (
146173 Menu .Item (
147174 name = locale .check_update ,
@@ -181,4 +208,3 @@ def refill_menu():
181208 )
182209 )
183210 other .add (Menu .Item (name = locale .exit , handler = lambda : (clear (), exit ())))
184- menu .add_category (other )
0 commit comments