Skip to content

Commit

Permalink
Uploading Modifications for v0.9a
Browse files Browse the repository at this point in the history
  • Loading branch information
hypertacos520 committed Oct 20, 2021
1 parent a93fc14 commit 6bf08ce
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 28 deletions.
14 changes: 12 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
# RP3P-OS v0.8a

![Main Menu](https://github.com/hypertacos520/RP3P-OS/blob/master/assets/images/screenshots/MainMenu.png?raw=true)
![Settings Screen](https://github.com/hypertacos520/RP3P-OS/blob/master/assets/images/screenshots/SettingsScreen.png?raw=true)

## RP3P-OS theme for Pegasus Frontend | Based on switchOS and skylineOS

A theme that aims to recreate a game console-like experience through the Pegasus Frontend. RP3P-OS is a theme for [Pegasus Frontend](http://pegasus-frontend.org/).

Platform logos courtesy of [lilbud](https://github.com/lilbud/es-theme-switch).

## Notes on Theme Layout

Retropie settings are located in the settings menu under 'OS Settings' instead of in the games library. This is to help create the feel of an actual game console. The OS Settings tab is only visable if there is a 'retropie' collection present.

## Installation

Simply download the theme and place it in your [Pegasus theme directory](http://pegasus-frontend.org/docs/user-guide/installing-themes/) under a folder called RP3P-OS.


## Version history
v0.9a
- OS Settings tab now only appears if a 'retropie' collection is present
- 'retropie' collection items do not appear in full library list
- 'retropie' collection items do not appear in recently played on the main menu
- Started to add code for battery life monitoring
- Started to add code for dynamic 'theme' list
- Removed 'show OS settings' option as it is now unnecessary

v0.8a
- Added Video Background support
- Added Background Music support
Expand Down
90 changes: 87 additions & 3 deletions layer_grid/SoftwareScreen.qml
Original file line number Diff line number Diff line change
@@ -1,11 +1,90 @@
import QtQuick 2.8
import QtGraphicalEffects 1.0
import SortFilterProxyModel 0.2
import "../global"
import "../utils.js" as Utils
import "qrc:/qmlutils" as PegasusUtils

FocusScope
{
ListView {
//PUTS GAMES IN ORDER OF LAST PLAYED
Item {
id: root
//Retropie Collection
ListModel {
id: retropieCollection
function getRetropieIndex()
{
var i = 0;
while(api.collections.get(i).shortName != null)
{
if (api.collections.get(i).shortName == "retropie")
{
return i;
}
i++;
}
}
}
//Games filter
property alias games: gamesFiltered
function currentGame(index) { return api.allGames.get(lastPlayedGames.mapToSource(index)) }
property int max: lastPlayedGames.count //Number of games total in list

SortFilterProxyModel {
id: lastPlayedGames

sourceModel: api.allGames
//sorters: RoleSorter { roleName: "lastPlayed"; sortOrder: Qt.DescendingOrder }
}

//Remove Retropie Items from List
ListModel{
id: removedRetropieItems
function buildGameList(){
for (var i = 0; i < lastPlayedGames.count; i++){
for (var j = 0; j < api.collections.get(retropieCollection.getRetropieIndex()).games.count; j++){ //retropieCollection.count is always 0 for some reason???
if (lastPlayedGames.get(i).title != api.collections.get(retropieCollection.getRetropieIndex()).games.get(j).title){
if (j == api.collections.get(retropieCollection.getRetropieIndex()).games.count - 1){
append(lastPlayedGames.get(i))
}
}
else{
break
}
}
}
}
Component.onCompleted: {
buildGameList();
}
}

SortFilterProxyModel {
id: gamesFiltered

sourceModel: removedRetropieItems//lastPlayedGames
filters: IndexFilter { maximumIndex: 11}//max - 1 } //- 1
}

property var collection: {
return {
name: "Continue Playing",
shortName: "lastplayed",
games: gamesFiltered
}
}
function buildList() {
gamesFiltered.append({
"name": "All Games",
"idx": -3,
"icon": "assets/images/navigation/All Games.png",
"background": ""
})
}
}
}

property int numcolumns: widescreen ? 6 : 3

Expand Down Expand Up @@ -123,8 +202,13 @@ FocusScope
Keys.onPressed: {
if (api.keys.isAccept(event) && !event.isAutoRepeat) {
event.accepted = true;
//currentItem.currentGame.launch();
launchGame();
launchSfx.play()
root.state = "playgame"
for (var k = 0; k < api.allGames.count; k++){
if (api.allGames.get(k).title == removedRetropieItems.get(currentIndex).title){
api.allGames.get(k).launch() //This code can launch games in the Most Recently Played Order without the items in the Retropie Collection
}
}
}
}

Expand Down Expand Up @@ -154,7 +238,7 @@ FocusScope
highlightMoveDuration: 200


model: api.allGames //api.collections.get(collectionIndex).games
model: gamesFiltered //api.collections.get(collectionIndex).games
delegate: gameGridDelegate

Component
Expand Down
53 changes: 44 additions & 9 deletions layer_platform/PlatformBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,26 @@ ListView {
//PUTS GAMES IN ORDER OF LAST PLAYED
Item {
id: root
//Retropie Collection
ListModel {
id: retropieCollection
function getRetropieIndex()
{
var i = 0;
while(api.collections.get(i).shortName != null)
{
if (api.collections.get(i).shortName == "retropie")
{
return i;
}
i++;
}
}
}
//Games filter
property alias games: gamesFiltered
function currentGame(index) { return api.allGames.get(lastPlayedGames.mapToSource(favoriteGames.mapToSource(index))) }
property int max: lastPlayedGames.count //Max games in list. Change to 12 later
function currentGame(index) { return api.allGames.get(lastPlayedGames.mapToSource(index)) }
property int max: lastPlayedGames.count //Number of games total in list

SortFilterProxyModel {
id: lastPlayedGames
Expand All @@ -20,17 +36,32 @@ ListView {
sorters: RoleSorter { roleName: "lastPlayed"; sortOrder: Qt.DescendingOrder }
}

SortFilterProxyModel {
id: favoriteGames

sourceModel: lastPlayedGames
sorters: FilterSorter { ValueFilter { roleName: "favorite"; value: false } }
//Remove Retropie Items from List
ListModel{
id: removedRetropieItems
function buildGameList(){
for (var i = 0; i < lastPlayedGames.count; i++){
for (var j = 0; j < api.collections.get(retropieCollection.getRetropieIndex()).games.count; j++){ //retropieCollection.count is always 0 for some reason???
if (lastPlayedGames.get(i).title != api.collections.get(retropieCollection.getRetropieIndex()).games.get(j).title){
if (j == api.collections.get(retropieCollection.getRetropieIndex()).games.count - 1){
append(lastPlayedGames.get(i))
}
}
else{
break
}
}
}
}
Component.onCompleted: {
buildGameList();
}
}

SortFilterProxyModel {
id: gamesFiltered

sourceModel: favoriteGames
sourceModel: removedRetropieItems//lastPlayedGames
filters: IndexFilter { maximumIndex: 11}//max - 1 } //- 1
}

Expand Down Expand Up @@ -82,7 +113,11 @@ ListView {
//showSoftwareScreen(); //this event is being retired in favor of a game launching mechanic
launchSfx.play()
root.state = "playgame"
api.allGames.get(lastPlayedGames.mapToSource(favoriteGames.mapToSource(currentIndex))).launch() //This code can launch games in the Most Recently Played Order
for (var k = 0; k < api.allGames.count; k++){
if (api.allGames.get(k).title == removedRetropieItems.get(currentIndex).title){
api.allGames.get(k).launch() //This code can launch games in the Most Recently Played Order without the items in the Retropie Collection
}
}
}

Keys.onPressed: {
Expand Down
33 changes: 21 additions & 12 deletions layer_settings/SettingsScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ id: root
}
}

property var generalPage: {
property var osPage: {
return {
pageName: "Operating System",
listmodel: retropieCollection
Expand All @@ -55,6 +55,11 @@ id: root

ListModel {
id: homeSettingsModel
function getThemesList(){
var fs = require('fs');
var files = fs.readdirSync('/assets/themes/');
print(files);
}
ListElement {
settingName: "Theme"
settingSubtitle: ""
Expand All @@ -70,16 +75,11 @@ id: root
settingSubtitle: "(Blank for no user)"
setting: "Hypertacos,"
}
ListElement {
settingName: "Display Battery Life"
settingSubtitle: "(Currently Unavailable)"
setting: "No"
}
ListElement {
settingName: "Display OS Settings Tab"
settingSubtitle: "(Currently Unavailable)"
setting: "Yes"
}
// ListElement {
// settingName: "Display Battery Life"
// settingSubtitle: "(Currently Unavailable)"
// setting: "No,Yes"
// }
}

property var homePage: {
Expand All @@ -89,7 +89,16 @@ id: root
}
}

property var settingsArr: [homePage, generalPage]
function makeSettingsList(){
if (osPage.listmodel.count){
return [homePage, osPage];
}
else{
return [homePage];
}
}

property var settingsArr: makeSettingsList();

property real itemheight: vpx(50)

Expand Down
4 changes: 2 additions & 2 deletions theme.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: RP3P-OS
author: Hypertacos
version: 0.8a
summary: Nintendo Switch inspired theme for the pegasus frontend. Heavily Modified version of switchOS/skylineOS for Pegasus.
version: 0.9a
summary: Nintendo Switch inspired theme for the pegasus frontend. Modified version of switchOS/skylineOS for Pegasus.

0 comments on commit 6bf08ce

Please sign in to comment.