Skip to content

Commit b91a520

Browse files
Merge remote-tracking branch 'upstream/main'
2 parents 6991988 + 0079900 commit b91a520

12 files changed

Lines changed: 181 additions & 112 deletions

Themes/MINIMAL/config.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"showBottomBar": false,
2+
"showBottomBar": true,
33
"name": "Minimal",
44
"author": "@chrisbastion",
55
"description": "Minimal",
66
"mainMenuViewType": "TEXT_ONLY",
77
"systemSelectViewType": "TEXT_ONLY",
88
"appMenuViewType": "TEXT_ONLY",
99
"gameSelectionViewType": "TEXT_ONLY",
10-
"showIndexText": false,
10+
"showIndexText": true,
11+
"confirmText":"",
12+
"backText":"",
1113
"batteryPercentage": {
1214
"color": "#FFFFFF",
1315
"font": "nunwen.ttf",
66 Bytes
Loading

main-ui/menus/games/game_config_menu.py

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -135,66 +135,69 @@ def show_config(self, rom_file_path) :
135135
while(selected is not None):
136136

137137
config_list = []
138-
for config_option in self.game_system.game_system_config.get_launchlist():
139-
config_list.append(
140-
GridOrListEntry(
141-
primary_text=config_option.get('name'),
142-
image_path=None,
143-
image_path_selected=None,
144-
description=None,
145-
icon=None,
146-
value=lambda input_value, launch_option=config_option.get('launch')
147-
: self.run_launch_option(input_value,launch_option)
148-
149-
138+
if(not Device.get_system_config().simple_mode_enabled()):
139+
for config_option in self.game_system.game_system_config.get_launchlist():
140+
config_list.append(
141+
GridOrListEntry(
142+
primary_text=config_option.get('name'),
143+
image_path=None,
144+
image_path_selected=None,
145+
description=None,
146+
icon=None,
147+
value=lambda input_value, launch_option=config_option.get('launch')
148+
: self.run_launch_option(input_value,launch_option)
149+
150+
151+
)
150152
)
151-
)
152153

153154

154155
config_list.extend(self.gen_additional_game_options())
155156

156157
menu_options = self.game_system.game_system_config.get_menu_options()
157158

158-
overridable_entries = []
159-
for name, option in menu_options.items():
160-
devices = option.get("devices")
161-
supported_device = not devices or Device.get_device_name() in devices
162-
if(supported_device):
163-
effective_value = self.game_system.game_system_config.get_effective_menu_selection(name,rom_file_path)
164-
display_name = option.get('display')
165-
contains_override = self.game_system.game_system_config.contains_menu_override(name,rom_file_path)
166-
if(contains_override):
167-
display_name = display_name + "*"
168-
169-
overridable_entries.append(name)
159+
if(not Device.get_system_config().simple_mode_enabled()):
160+
161+
overridable_entries = []
162+
for name, option in menu_options.items():
163+
devices = option.get("devices")
164+
supported_device = not devices or Device.get_device_name() in devices
165+
if(supported_device):
166+
effective_value = self.game_system.game_system_config.get_effective_menu_selection(name,rom_file_path)
167+
display_name = option.get('display')
168+
contains_override = self.game_system.game_system_config.contains_menu_override(name,rom_file_path)
169+
if(contains_override):
170+
display_name = display_name + "*"
171+
172+
overridable_entries.append(name)
173+
config_list.append(
174+
GridOrListEntry(
175+
primary_text=display_name,
176+
value_text="< " + effective_value + " >",
177+
image_path=None,
178+
image_path_selected=None,
179+
description=None,
180+
icon=None,
181+
value=lambda input_value, entry_name=name, rom_file_path=rom_file_path, contains_override=contains_override,
182+
all_options=option.get('options', []), current_value=effective_value,
183+
update_value=self.game_system.game_system_config.set_menu_option, update_override=self.game_system.game_system_config.set_menu_override,
184+
remove_override=self.game_system.game_system_config.delete_menu_override
185+
: self.change_indexed_array_option(entry_name, input_value, rom_file_path, contains_override, all_options, current_value, update_value, update_override, remove_override)
186+
)
187+
)
188+
189+
if(overridable_entries):
170190
config_list.append(
171-
GridOrListEntry(
172-
primary_text=display_name,
173-
value_text="< " + effective_value + " >",
174-
image_path=None,
175-
image_path_selected=None,
176-
description=None,
177-
icon=None,
178-
value=lambda input_value, entry_name=name, rom_file_path=rom_file_path, contains_override=contains_override,
179-
all_options=option.get('options', []), current_value=effective_value,
180-
update_value=self.game_system.game_system_config.set_menu_option, update_override=self.game_system.game_system_config.set_menu_override,
181-
remove_override=self.game_system.game_system_config.delete_menu_override
182-
: self.change_indexed_array_option(entry_name, input_value, rom_file_path, contains_override, all_options, current_value, update_value, update_override, remove_override)
191+
GridOrListEntry(
192+
primary_text="Toggle Settings as Game Specific Override",
193+
image_path=None,
194+
image_path_selected=None,
195+
description=None,
196+
icon=None,
197+
value=lambda input_value,rom_file_path=rom_file_path, overridable_entries=overridable_entries,
198+
: self.toggle_overridable_entries(input_value,rom_file_path,overridable_entries)
183199
)
184-
)
185-
186-
if(overridable_entries):
187-
config_list.append(
188-
GridOrListEntry(
189-
primary_text="Toggle Settings as Game Specific Override",
190-
image_path=None,
191-
image_path_selected=None,
192-
description=None,
193-
icon=None,
194-
value=lambda input_value,rom_file_path=rom_file_path, overridable_entries=overridable_entries,
195-
: self.toggle_overridable_entries(input_value,rom_file_path,overridable_entries)
196200
)
197-
)
198201

199202
if(view is None):
200203
view = ViewCreator.create_view(

main-ui/menus/games/game_select_menu_popup.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,15 @@ def run_game_select_popup_menu(self, rom_info : RomInfo, additional_popup_option
119119

120120
popup_options.extend(self.get_game_options(rom_info, additional_popup_options, rom_list, use_full_text=False))
121121

122-
popup_options.append(GridOrListEntry(
123-
primary_text=f"Toggle View",
124-
image_path=Theme.settings(),
125-
image_path_selected=Theme.settings_selected(),
126-
description=None,
127-
icon=None,
128-
value=lambda input_value: self.toggle_view()
129-
))
122+
if(not Device.get_system_config().simple_mode_enabled()):
123+
popup_options.append(GridOrListEntry(
124+
primary_text=f"Toggle View",
125+
image_path=Theme.settings(),
126+
image_path_selected=Theme.settings_selected(),
127+
description=None,
128+
icon=None,
129+
value=lambda input_value: self.toggle_view()
130+
))
130131

131132
popup_view = ViewCreator.create_view(
132133
view_type=ViewType.POPUP,

main-ui/menus/games/game_system_select_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def get_images(self, game_system : GameSystem):
177177
if(index is not None):
178178
icon = icon_system_name_priority[index]
179179
selected_icon = selected_icon_system_name_priority[index]
180-
if not os.path.isfile(selected_icon):
180+
if selected_icon is None or not os.path.isfile(selected_icon):
181181
selected_icon = icon
182182
return icon, selected_icon
183183
else:

main-ui/menus/games/roms_menu_common.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ def __init__(self, ):
2929
self.in_game_menu_listener = InGameMenuListener()
3030
self.popup_menu = GameSelectMenuPopup()
3131

32-
system_config = Device.get_system_config()
33-
self.support_only_game_launching = system_config.game_selection_only_mode_enabled() or system_config.simple_mode_enabled()
34-
self.force_allow_b_button = not system_config.game_selection_only_mode_enabled()
32+
self.support_only_game_launching = Device.get_system_config().game_selection_only_mode_enabled()
3533

3634
def _remove_extension(self,file_name):
3735
return os.path.splitext(file_name)[0]
@@ -248,7 +246,7 @@ def _run_rom_selection_for_rom_list(self, page_name, rom_list) :
248246
new_length = len(rom_list)
249247
if(Theme.get_game_selection_view_type() != prev_view or original_length != new_length):
250248
view = self.create_view(page_name,rom_list,selected)
251-
elif(ControllerInput.B == selected.get_input() and (not self.support_only_game_launching or self.force_allow_b_button)):
249+
elif(ControllerInput.B == selected.get_input() and (not self.support_only_game_launching)):
252250

253251
#What is happening on muOS where this is becoming None?
254252
if(selected is not None and selected.get_selection() is not None and selected.get_selection().get_value() is not None):

main-ui/menus/settings/basic_settings_menu.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from menus.settings.extra_settings_menu import ExtraSettingsMenu
1010
from menus.settings.bluetooth_menu import BluetoothMenu
1111
from menus.settings.sound_settings import SoundSettings
12-
from menus.settings.theme.list_of_options_selection_menu import ListOfOptionsSelectionMenu
12+
from menus.settings.list_of_options_selection_menu import ListOfOptionsSelectionMenu
13+
from menus.settings.theme.theme_selection_menu import ThemeSelectionMenu
1314
from menus.settings.theme.theme_settings_menu import ThemeSettingsMenu
1415
from menus.settings.wifi_menu import WifiMenu
1516
from themes.theme import Theme
@@ -90,10 +91,10 @@ def change_theme(self, input):
9091
selected_index+=1
9192
if(selected_index == len(theme_folders)):
9293
selected_index = 0
93-
elif(ControllerInput.X == input):
94+
elif(ControllerInput.X == input and not Device.get_system_config().simple_mode_enabled()):
9495
ThemeSettingsMenu().show_theme_options_menu()
9596
elif(ControllerInput.A == input):
96-
selected_index = ListOfOptionsSelectionMenu().get_selected_option_index(theme_folders, "Themes")
97+
selected_index = ThemeSelectionMenu().get_selected_option_index(theme_folders, "Themes")
9798

9899

99100
if(selected_index is not None):
@@ -189,31 +190,31 @@ def build_options_list(self):
189190
)
190191
)
191192

193+
option_list.append(
194+
GridOrListEntry(
195+
primary_text="Theme",
196+
value_text="< " + Device.get_system_config().get_theme() + " >",
197+
image_path=None,
198+
image_path_selected=None,
199+
description=None,
200+
icon=None,
201+
value=self.change_theme
202+
)
203+
)
204+
205+
206+
if(not Device.get_system_config().simple_mode_enabled()):
192207
option_list.append(
193208
GridOrListEntry(
194-
primary_text="Theme",
195-
value_text="< " + Device.get_system_config().get_theme() + " >",
209+
primary_text="Theme Settings",
210+
value_text=None,
196211
image_path=None,
197212
image_path_selected=None,
198213
description=None,
199214
icon=None,
200-
value=self.change_theme
201-
)
215+
value=self.launch_theme_settings
216+
)
202217
)
203-
204-
option_list.append(
205-
GridOrListEntry(
206-
primary_text="Theme Settings",
207-
value_text=None,
208-
image_path=None,
209-
image_path_selected=None,
210-
description=None,
211-
icon=None,
212-
value=self.launch_theme_settings
213-
)
214-
)
215-
216-
if(not Device.get_system_config().simple_mode_enabled()):
217218

218219
option_list.append(
219220
GridOrListEntry(

main-ui/menus/settings/game_system_select_settings_menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
from controller.controller_inputs import ControllerInput
33
from menus.settings import settings_menu
4-
from menus.settings.theme.list_of_options_selection_menu import ListOfOptionsSelectionMenu
4+
from menus.settings.list_of_options_selection_menu import ListOfOptionsSelectionMenu
55
from utils.py_ui_config import PyUiConfig
66
from views.grid_or_list_entry import GridOrListEntry
77

main-ui/menus/settings/theme/list_of_options_selection_menu.py renamed to main-ui/menus/settings/list_of_options_selection_menu.py

File renamed without changes.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
import os
3+
from controller.controller_inputs import ControllerInput
4+
from utils.logger import PyUiLogger
5+
from utils.py_ui_config import PyUiConfig
6+
from views.grid_or_list_entry import GridOrListEntry
7+
from views.selection import Selection
8+
from views.view_creator import ViewCreator
9+
from views.view_type import ViewType
10+
11+
12+
class ThemeSelectionMenu:
13+
def __init__(self):
14+
pass
15+
16+
def get_selected_option_index(self, options, title):
17+
selected = Selection(None, None, 0)
18+
option_list = []
19+
theme_dir = PyUiConfig.get("themeDir")
20+
for index, opt in enumerate(options):
21+
png_path = os.path.join(theme_dir,opt,"preview.png")
22+
image_path = png_path
23+
if(not os.path.exists(image_path)):
24+
qoi_path = os.path.join(theme_dir,opt,"preview.qoi")
25+
image_path = qoi_path
26+
PyUiLogger.get_logger().info(f"{opt} : {image_path}")
27+
option_list.append(
28+
GridOrListEntry(
29+
primary_text=opt,
30+
value=index,
31+
image_path=image_path
32+
)
33+
)
34+
35+
#convert to text and desc and show the theme desc
36+
#maybe preview too if theyre common
37+
view = ViewCreator.create_view(
38+
view_type=ViewType.TEXT_AND_IMAGE,
39+
top_bar_text=title,
40+
options=option_list,
41+
selected_index=selected.get_index())
42+
43+
accepted_inputs = [ControllerInput.A, ControllerInput.B]
44+
45+
while (True):
46+
selected = view.get_selection(accepted_inputs)
47+
if (ControllerInput.A == selected.get_input()):
48+
return selected.get_selection().get_value()
49+
elif (ControllerInput.B == selected.get_input()):
50+
return None

0 commit comments

Comments
 (0)