Skip to content

Commit

Permalink
fix icon path
Browse files Browse the repository at this point in the history
  • Loading branch information
jellydreams committed Dec 10, 2024
1 parent 0d4f6da commit ba11f07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
14 changes: 11 additions & 3 deletions plugin/nizima.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from pynizima.errors import InvalidToken
from info import VERSION, ICON_PATH


class Nizima(NizimaRequest):

def __init__(self, plugin_infos, token_path='token-fullbodytracking.txt', **kwargs):
Expand Down Expand Up @@ -42,7 +41,8 @@ async def establish_connection(self, **kwargs):
return enabled

async def register_plugin(self, **kwargs):
self.token = await super().register_plugin(name=self.plugin_name, developer=self.plugin_infos['Developer'], version=VERSION, icon=ICON_PATH)
icon_path = os.path.abspath(os.path.join(os.path.dirname(__file__), ICON_PATH)).replace("plugin\\", "")
self.token = await super().register_plugin(name=self.plugin_name, developer=self.plugin_infos['Developer'], version=VERSION, icon=icon_path)
self.save_token(self.token)
return self.token

Expand All @@ -56,7 +56,7 @@ async def create_parameters(self):
for parameter_name in parameter_names:
parameter = {
"Id": parameter_name,
"Group": parameter_name.split('_')[1],
"Group": self.group_name(parameter_name),
"Base": 0,
"Max": 10,
"Min": -10,
Expand Down Expand Up @@ -87,5 +87,13 @@ def load_token(self):
print(f"File not found: {self.token_path}")
return None

def group_name(self, input_name):
group = input_name
group.replace('RIGHT', 'R')
group.replace('LEFT', 'L')
group = group.split('_')
group.remove(group[-1]) # remove axis info
group_name = ' '.join([text.capitalize() for text in group])
return group_name


5 changes: 0 additions & 5 deletions plugin/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,9 @@
NIZIMA_LIVE = 'NizimaLIVE'
VTUBE_STUDIO = 'VTube Studio'


ICON_NIZIMA = 'icon_nizimalive.png'
ICON_VTUBE_STUDIO = 'icon_vtubestudio.png'

icon_nizima = os.path.abspath(os.path.join(os.path.dirname(__file__), ICON_NIZIMA))
icon_nizima = Image.open(icon_nizima.replace("plugin\\", ""))



def window_tracking_configuration():
""" Window for choosing configuration for tracking """
Expand Down

0 comments on commit ba11f07

Please sign in to comment.