Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Desktop Client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SpinShare
Desktop Client
Commits
42c9d9e9
Commit
42c9d9e9
authored
Apr 02, 2020
by
Andreas Heimann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added settings
parent
1d8c9c04
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
248 additions
and
18 deletions
+248
-18
src/assets/css/main.css
src/assets/css/main.css
+1
-0
src/assets/css/main.less
src/assets/css/main.less
+1
-0
src/assets/css/settings.css
src/assets/css/settings.css
+80
-0
src/assets/css/settings.less
src/assets/css/settings.less
+81
-0
src/assets/js/download.js
src/assets/js/download.js
+1
-1
src/assets/js/module.srxd.js
src/assets/js/module.srxd.js
+2
-2
src/assets/js/module.usersettings.js
src/assets/js/module.usersettings.js
+39
-0
src/assets/js/section.settings.js
src/assets/js/section.settings.js
+43
-0
src/assets/js/userData.js
src/assets/js/userData.js
+0
-15
No files found.
src/assets/css/main.css
View file @
42c9d9e9
...
...
@@ -30,6 +30,7 @@ body {
main
{
display
:
grid
;
margin-left
:
60px
;
min-height
:
100vh
;
overflow-y
:
scroll
;
}
main
aside
{
...
...
src/assets/css/main.less
View file @
42c9d9e9
...
...
@@ -28,6 +28,7 @@ body {
main {
display: grid;
margin-left: 60px;
min-height: 100vh;
overflow-y: scroll;
& aside {
...
...
src/assets/css/settings.css
0 → 100644
View file @
42c9d9e9
.section-settings
{
padding
:
50px
;
flex-direction
:
column
;
align-items
:
center
;
}
.section-settings
.settings-title
{
font-size
:
14px
;
letter-spacing
:
0.25em
;
font-weight
:
bold
;
text-transform
:
uppercase
;
}
.section-settings
.settings-box
{
width
:
600px
;
padding
:
25px
;
background
:
rgba
(
255
,
255
,
255
,
0.1
);
border-radius
:
6px
;
margin-bottom
:
25px
;
}
.section-settings
.settings-box
.settings-item
{
display
:
grid
;
grid-template-columns
:
200px
1
fr
;
grid-gap
:
15px
;
margin-top
:
15px
;
}
.section-settings
.settings-box
.settings-item
.settings-label
{
align-self
:
center
;
opacity
:
0.6
;
}
.section-settings
.settings-box
.settings-item
.settings-input
{
display
:
grid
;
grid-template-columns
:
1
fr
;
grid-gap
:
5px
;
}
.section-settings
.settings-box
.settings-item
.settings-input.settings-input-twobuttons
{
grid-template-columns
:
1
fr
auto
auto
;
}
.section-settings
.settings-box
.settings-item
.settings-input
select
,
.section-settings
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
]
{
width
:
100%
;
font-family
:
'Open Sans'
,
sans-serif
;
font-size
:
12px
;
color
:
#fff
;
background
:
rgba
(
255
,
255
,
255
,
0.2
);
text-transform
:
uppercase
;
font-weight
:
700
;
border-radius
:
4px
;
padding
:
7px
14px
;
border
:
0px
;
transition
:
0.2s
ease-in-out
all
;
}
.section-settings
.settings-box
.settings-item
.settings-input
select
:not
(
:disabled
)
:hover
,
.section-settings
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
]
:not
(
:disabled
)
:hover
{
background
:
rgba
(
255
,
255
,
255
,
0.4
);
color
:
#fff
;
cursor
:
pointer
;
}
.section-settings
.settings-box
.settings-item
.settings-input
select
:focus
,
.section-settings
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
]
:focus
{
outline
:
0
;
}
.section-settings
.settings-box
.settings-item
.settings-input
select
::placeholder
,
.section-settings
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
]
::placeholder
{
color
:
rgba
(
255
,
255
,
255
,
0.6
);
}
.section-settings
.settings-box
.settings-item
.settings-input
select
option
,
.section-settings
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
]
option
{
background
:
#222
;
text-transform
:
initial
;
}
.section-settings
.settings-box
.settings-item
.settings-input
select
:disabled
,
.section-settings
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
]
:disabled
{
opacity
:
0.4
;
}
.section-settings
.settings-box
.settings-item
.settings-input
input
[
type
=
"text"
]
{
text-transform
:
initial
;
font-weight
:
normal
;
}
.section-settings.active
{
display
:
flex
;
}
src/assets/css/settings.less
0 → 100644
View file @
42c9d9e9
.section-settings {
padding: 50px;
flex-direction: column;
align-items: center;
& .settings-title {
font-size: 14px;
letter-spacing: 0.25em;
font-weight: bold;
text-transform: uppercase;
}
& .settings-box {
width: 600px;
padding: 25px;
background: rgba(255,255,255,0.1);
border-radius: 6px;
margin-bottom: 25px;
& .settings-item {
display: grid;
grid-template-columns: 200px 1fr;
grid-gap: 15px;
margin-top: 15px;
& .settings-label {
align-self: center;
opacity: 0.6;
}
& .settings-input {
display: grid;
grid-template-columns: 1fr;
grid-gap: 5px;
&.settings-input-twobuttons {
grid-template-columns: 1fr auto auto;
}
& select, input[type="text"] {
width: 100%;
font-family: 'Open Sans', sans-serif;
font-size: 12px;
color: #fff;
background: rgba(255,255,255,0.2);
text-transform: uppercase;
font-weight: 700;
border-radius: 4px;
padding: 7px 14px;
border: 0px;
transition: 0.2s ease-in-out all;
&:not(:disabled):hover {
background: rgba(255,255,255,0.4);
color: #fff;
cursor: pointer;
}
&:focus {
outline: 0;
}
&::placeholder {
color: rgba(255,255,255,0.6);
}
& option {
background: #222;
text-transform: initial;
}
&:disabled {
opacity: 0.4;
}
}
& input[type="text"] {
text-transform: initial;
font-weight: normal;
}
}
}
}
&.active {
display: flex;
}
}
\ No newline at end of file
src/assets/js/download.js
View file @
42c9d9e9
...
...
@@ -39,7 +39,7 @@ ipcRenderer.on("download-complete", (event, downloadPath) => {
// Install local backup folder
async
function
installBackup
(
backupLocation
)
{
// Copy temp folder to game dir
await
ncp
(
backupLocation
,
user
GameDirectory
,
function
(
error
)
{
await
ncp
(
backupLocation
,
user
Settings
.
get
(
'
gameDirectory
'
)
,
function
(
error
)
{
if
(
error
)
{
console
.
error
(
error
);
console
.
error
(
"
Couldn't copy backup!
"
);
...
...
src/assets/js/module.srxd.js
View file @
42c9d9e9
...
...
@@ -97,10 +97,10 @@ class SRXD {
return
dir
.
filter
(
elm
=>
elm
.
match
(
new
RegExp
(
`.*\.srtb$`
,
'
ig
'
)));
}
getSongCover
(
fileName
)
{
let
dir
=
fs
.
readdirSync
(
path
.
join
(
user
GameDirectory
,
"
AlbumArt
"
)
);
let
dir
=
fs
.
readdirSync
(
path
.
join
(
user
Settings
.
get
(
'
gameDirectory
'
)
,
"
AlbumArt
"
)
);
let
fileExtension
=
dir
.
filter
(
elm
=>
elm
.
match
(
new
RegExp
(
`(
${
fileName
}
).*\.$`
,
'
ig
'
)));
let
finalPath
=
path
.
join
(
user
GameDirectory
,
"
AlbumArt
"
,
fileExtension
[
0
]);
let
finalPath
=
path
.
join
(
user
Settings
.
get
(
'
gameDirectory
'
)
,
"
AlbumArt
"
,
fileExtension
[
0
]);
let
base64Data
=
"
data:image/jpg;base64,
"
+
fs
.
readFileSync
(
finalPath
,
{
encoding
:
'
base64
'
});
...
...
src/assets/js/module.usersettings.js
0 → 100644
View file @
42c9d9e9
const
electron
=
require
(
'
electron
'
);
const
path
=
require
(
'
path
'
);
const
fs
=
require
(
'
fs
'
);
class
UserSettings
{
constructor
(
opts
)
{
const
userDataPath
=
(
electron
.
app
||
electron
.
remote
.
app
).
getPath
(
'
userData
'
);
this
.
path
=
path
.
join
(
userDataPath
,
'
UserSettings.json
'
);
this
.
data
=
parseDataFile
(
this
.
path
,
opts
.
defaults
);
}
get
(
key
)
{
return
this
.
data
[
key
];
}
set
(
key
,
val
)
{
this
.
data
[
key
]
=
val
;
this
.
write
();
}
clear
(
key
)
{
this
.
data
[
key
]
=
null
;
this
.
write
();
}
write
()
{
fs
.
writeFileSync
(
this
.
path
,
JSON
.
stringify
(
this
.
data
));
}
}
function
parseDataFile
(
filePath
,
defaults
)
{
try
{
return
JSON
.
parse
(
fs
.
readFileSync
(
filePath
));
}
catch
(
error
)
{
return
defaults
;
}
}
module
.
exports
=
UserSettings
;
\ No newline at end of file
src/assets/js/section.settings.js
0 → 100644
View file @
42c9d9e9
const
DOMSettingsInputVersion
=
document
.
querySelector
(
"
.settings-input-version
"
);
const
DOMSettingsInputLanguage
=
document
.
querySelector
(
"
.settings-input-language
"
);
const
DOMSettingsInputGameDirectory
=
document
.
querySelector
(
"
.settings-input-gamedirectory
"
);
function
InitSettings
()
{
DOMSettingsInputVersion
.
innerText
=
app
.
getVersion
()
+
"
-
"
+
(
isDev
?
"
dev
"
:
"
prod
"
);
DOMSettingsInputLanguage
.
querySelectorAll
(
"
option
"
).
forEach
(
function
(
optionItem
)
{
if
(
optionItem
.
value
==
userSettings
.
get
(
'
language
'
))
{
optionItem
.
selected
=
true
;
}
});
DOMSettingsInputGameDirectory
.
value
=
userSettings
.
get
(
'
gameDirectory
'
);
}
function
CheckForUpdate
()
{
}
function
SettingsChangeLanguage
()
{
let
selectedLanguage
=
DOMSettingsInputLanguage
.
value
;
userSettings
.
set
(
'
language
'
,
selectedLanguage
);
// App restart
window
.
location
=
window
.
location
;
}
function
SettingsSelectGameDirectory
()
{
dialog
.
showOpenDialog
({
title
:
"
Open Game Directory
"
,
properties
:
[
'
openDirectory
'
]
}).
then
(
result
=>
{
if
(
!
result
.
canceled
)
{
let
directoryPath
=
result
.
filePaths
[
0
];
userSettings
.
set
(
'
gameDirectory
'
,
directoryPath
);
DOMSettingsInputGameDirectory
.
value
=
userSettings
.
get
(
'
gameDirectory
'
);
}
});
}
function
SettingsResetGameDirectory
()
{
userSettings
.
set
(
'
gameDirectory
'
,
detectGameDirectory
());
DOMSettingsInputGameDirectory
.
value
=
userSettings
.
get
(
'
gameDirectory
'
);
}
\ No newline at end of file
src/assets/js/userData.js
deleted
100644 → 0
View file @
1d8c9c04
console
.
log
(
"
Initializing System.
"
);
let
systemOS
=
process
.
platform
;
let
tempDirLocation
=
app
.
getPath
(
'
temp
'
);
let
userShowExplicit
=
false
;
let
userGameDirectory
=
""
;
// TODO: Mac/Linux Support
// TODO: Custom Dir
if
(
process
.
platform
==
"
win32
"
)
{
userGameDirectory
=
path
.
join
(
app
.
getPath
(
"
userData
"
),
"
../..
"
,
"
LocalLow
"
,
"
Super Spin Digital
"
,
"
Spin Rhythm XD
"
,
"
Custom
"
);
}
else
{
console
.
error
(
"
Unsupported system
"
);
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment