mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-15 19:28:51 +01:00
FootMsg changes for the buttons layout
This commit is contained in:
parent
0f2cf846eb
commit
badeb13268
@ -15,6 +15,8 @@ from lang_manager import MyLangManager
|
|||||||
from widget import Widget
|
from widget import Widget
|
||||||
from skin_manager import MySkinManager
|
from skin_manager import MySkinManager
|
||||||
|
|
||||||
|
import config
|
||||||
|
|
||||||
icon_base_path = MySkinManager.GiveIcon("gameshell/footbar_icons/")
|
icon_base_path = MySkinManager.GiveIcon("gameshell/footbar_icons/")
|
||||||
|
|
||||||
class FootBarIcon(MultiIconItem):
|
class FootBarIcon(MultiIconItem):
|
||||||
@ -134,7 +136,10 @@ class FootBar(Widget):
|
|||||||
self.Draw()
|
self.Draw()
|
||||||
|
|
||||||
def SetLabelTexts(self,texts):
|
def SetLabelTexts(self,texts):
|
||||||
barr = ["nav","y","x","b","a","select"]
|
if config.ButtonsLayout == "xbox":
|
||||||
|
barr = ["nav","y","x","b","a","select"]
|
||||||
|
else:
|
||||||
|
barr = ["nav","x","y","a","b","select"]
|
||||||
texts2 = texts + [""] if len(texts) == 5 else texts
|
texts2 = texts + [""] if len(texts) == 5 else texts
|
||||||
|
|
||||||
for idx,x in enumerate(barr):
|
for idx,x in enumerate(barr):
|
||||||
|
|||||||
@ -6,9 +6,8 @@ from sys import exit
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import config
|
||||||
from config import CurKeySet
|
from config import CurKeySet ## read only
|
||||||
|
|
||||||
|
|
||||||
def GetButtonsLayoutMode():
|
def GetButtonsLayoutMode():
|
||||||
lm = "xbox"
|
lm = "xbox"
|
||||||
@ -25,6 +24,7 @@ def SetButtonsLayoutMode(mode):
|
|||||||
SetXYABButtons(mode)
|
SetXYABButtons(mode)
|
||||||
with open(".buttonslayout", "w") as f:
|
with open(".buttonslayout", "w") as f:
|
||||||
f.write(mode)
|
f.write(mode)
|
||||||
|
config.ButtonsLayout = mode
|
||||||
|
|
||||||
def SetXYABButtons(mode):
|
def SetXYABButtons(mode):
|
||||||
if mode == "snes":
|
if mode == "snes":
|
||||||
|
|||||||
@ -19,6 +19,8 @@ VERSION="stable 1.25"
|
|||||||
|
|
||||||
SKIN=None
|
SKIN=None
|
||||||
|
|
||||||
|
ButtonsLayout="xbox"
|
||||||
|
|
||||||
## three timer values in seconds: dim screen, close screen,PowerOff
|
## three timer values in seconds: dim screen, close screen,PowerOff
|
||||||
## zero means no action
|
## zero means no action
|
||||||
PowerLevels = {}
|
PowerLevels = {}
|
||||||
@ -30,7 +32,7 @@ PowerLevels["balance_saving"] = [40,0,0]
|
|||||||
PowerLevel = "balance_saving"
|
PowerLevel = "balance_saving"
|
||||||
|
|
||||||
def PreparationInAdv():
|
def PreparationInAdv():
|
||||||
global SKIN
|
global SKIN,ButtonsLayout
|
||||||
global PowerLevel
|
global PowerLevel
|
||||||
|
|
||||||
if SKIN != None:
|
if SKIN != None:
|
||||||
@ -44,7 +46,16 @@ def PreparationInAdv():
|
|||||||
|
|
||||||
gameshell_skin = gameshell_skin.strip()
|
gameshell_skin = gameshell_skin.strip()
|
||||||
SKIN= gameshell_skin
|
SKIN= gameshell_skin
|
||||||
|
|
||||||
|
if FileExists(".buttonslayout") == True:
|
||||||
|
with open(".buttonslayout") as f:
|
||||||
|
btnlayout = f.read()
|
||||||
|
|
||||||
|
btnlayout = btnlayout.strip()
|
||||||
|
ButtonsLayout = btnlayout
|
||||||
|
if ButtonsLayout != "xbox" and ButtonsLayout != "snes":
|
||||||
|
ButtonsLayout = "xbox"
|
||||||
|
|
||||||
if FileExists(".powerlevel") == False:
|
if FileExists(".powerlevel") == False:
|
||||||
os.system("touch .powerlevel")
|
os.system("touch .powerlevel")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user