Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed addon #171

Closed
Pawe98 opened this issue Jan 30, 2019 · 3 comments
Closed

Fixed addon #171

Pawe98 opened this issue Jan 30, 2019 · 3 comments

Comments

@Pawe98
Copy link

Pawe98 commented Jan 30, 2019

Have a good day:
https://github.com/Pawe98/luna/releases/tag/v0.7.0-rc7-fixed

I take no credit (literally only typos fixed)

Don't want to trust my zip? : look at /resources/lib/launch scripts/ and compare the files

@Pawe98
Copy link
Author

Pawe98 commented Feb 16, 2019

@wackerl91

I would like to add a button to luna to close a session. Can you give me little guidance on how I could do this? Which are the files I need to edit? I would just run a script from there terminating the session. The script doesn't need parameters, I just don't know wich files and generally how kodi adons work to do this. Your help is very appreciated :)

Grüße aus Stuttgart

@wackerl91
Copy link
Owner

wackerl91 commented Feb 18, 2019

@Pawe98
What's your goal here? Closing a hanging session?
I'm honestly kind of confused, because you won't be able to close a running session (as Luna isn't running at that time) and most failed sessions should get closed automatically.

Either way, there are multiple files involved when adding new functionality:

  • the XML files in /resources/skins/Default/720p/, essentially defining the layout
  • controllers for each view, which can be found in resources/lib/controller/
  • potentially the routing information (resources/lib/config/routing.yml) when routing to another controller and / or adding a new one
  • the view definitions in resources/lib/views/

Have a look at e.g. how the "Add Host" button is added to the view and when it's selected calls the main_add_host action, where this string is essentially the prefix for the main controller defined in routing.yaml plus the action to call (add_host, which exists as a function in maincontroller.py which again is decorated with @route(name='add_host')).

An example of how you can run scripts instead of a displaying a view can be found in gamelistcontroller.py (which essentially just calls the moonlight launch helper and tells it to launch a game. If you want to go back to the previous view, you will need to run your script -if possible, display a confirmation to the user e.g. using a banner like it's done for errors etc. - and render the previous view again, e.g. the main menu or the game list). One thing to note here is that cancelling a session is a host-based action, so it should probably be part of the host context menu (as it makes sense there) and you need to pass the paths to the key files / dirs.

Last thing I want to mention is that Luna isn't exactly your standard Kodi addon - there's a lot of magic involved in lots of different places which make the architecture pretty tidy, but can also be intimidating when diving in. Just try to figure out how specific functionalities have been added in the past and you'll be fine :) It's just that Kodi addon tutorials won't help you much (if at all).

If you need any more detailed guidance (or you'd rather discuss this in german) feel free to send me an email (address is on my github profile).

Cheers!

@Pawe98
Copy link
Author

Pawe98 commented Feb 18, 2019 via email

@Pawe98 Pawe98 closed this as completed Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants