settings page things

This commit is contained in:
Cynthia Foxwell 2018-05-20 10:14:31 -06:00
parent 7f7a375b76
commit 048f2858e1
2 changed files with 45 additions and 30 deletions

View file

@ -37,6 +37,7 @@ exports = {
var misc = $api.util.findFuncExports('statusRed-', 'inputDefault'); var misc = $api.util.findFuncExports('statusRed-', 'inputDefault');
var misc2 = $api.util.findFuncExports('multiInputField'); var misc2 = $api.util.findFuncExports('multiInputField');
var headers = $api.util.findFuncExports('h5-', 'h5'); var headers = $api.util.findFuncExports('h5-', 'h5');
var dividers = wc.findFunc('divider-')[0].exports;
var panels = wc.findFunc('flexChild-')[0].exports; var panels = wc.findFunc('flexChild-')[0].exports;
var panels2 = $api.util.findFuncExports('errorMessage-', 'inputWrapper'); var panels2 = $api.util.findFuncExports('errorMessage-', 'inputWrapper');
@ -202,7 +203,8 @@ exports = {
checkboxes:checkboxes, checkboxes:checkboxes,
misc:misc, misc:misc,
misc2:misc2, misc2:misc2,
headers:headers headers:headers,
dividers:dividers
} }
} }
} }
@ -303,6 +305,7 @@ exports = {
} }
function renderSettings(pane) { function renderSettings(pane) {
var em = $settingsapi.elements;
var needAuth = !$api.localStorage.get('customizer_signature'); var needAuth = !$api.localStorage.get('customizer_signature');
var content = createElement('div') var content = createElement('div')
@ -315,10 +318,32 @@ exports = {
) )
.appendTo(pane); .appendTo(pane);
em.createH2("Basic Settings")
.modify(x=>x.className = x.className.replace("epMargin","margin-bottom-20"))
.appendTo(content);
createElement("div")
.withClass(em.internal.panels.horizontal, 'epButtonPanel')
.withChildren(
em.createButton("Open Data Folder")
.modify(x => x.onclick = () => { electron.shell.openExternal($api.data) }),
em.createWarnButton("Restart in safe mode")
.modify(x => x.onclick = endpwn.safemode),
em.createDangerButton("Uninstall EndPwn")
.modify(x => x.onclick = endpwn.uninstall)
)
.appendTo(content);
createElement("div")
.withClass(em.internal.dividers.divider,"margin-bottom-40","margin-top-40")
.appendTo(content);
em.createH2("Customizer")
.modify(x=>x.className = x.className.replace("epMargin","margin-bottom-20"))
.appendTo(content);
if (!$api.localStorage.get('customizer_signature')) { if (!$api.localStorage.get('customizer_signature')) {
createHorizontalPanel() em.createHorizontalPanel()
.withChildren( .withChildren(
createButton("Authorize EndPwn Customizer") em.createButton("Authorize EndPwn Customizer")
.modify(x => x.onclick = authorizeCustomizer) .modify(x => x.onclick = authorizeCustomizer)
) )
.appendTo(content); .appendTo(content);
@ -326,40 +351,30 @@ exports = {
else { else {
var discrim, bot; var discrim, bot;
createVerticalPanel() em.createVerticalPanel()
.withChildren( .withChildren(
createH5('Discriminator'), em.createH5('Discriminator'),
createHorizontalPanel() em.createHorizontalPanel()
.withChildren( .withChildren(
discrim = createInput(endpwn.customizer.me.discrim ? endpwn.customizer.me.discrim : '') discrim = em.createInput(endpwn.customizer.me.discrim ? endpwn.customizer.me.discrim : '')
.withClass('epDiscrimField') .withClass('epDiscrimField')
.modify(x => x.maxLength = 4), .modify(x => x.maxLength = 4),
createVerticalPanel() em.createVerticalPanel()
.withChildren( .withChildren(
createH5('Bot?'), em.createH5('Bot?'),
bot = createSwitch(() => { }, endpwn.customizer.me.bot) bot = em.createSwitch(() => { }, endpwn.customizer.me.bot)
), ),
createButton("Submit") em.createButton("Submit")
.modify(x => x.onclick = () => submitCustomizer(discrim.value, bot.children[0].checked)) .modify(x => x.onclick = () => submitCustomizer(discrim.value, bot.children[0].checked))
) )
) )
.appendTo(content); .appendTo(content);
} }
createElement("div")
.withClass(panels.horizontal, 'epButtonPanel')
.withChildren(
createButton("Open Data Folder")
.modify(x => x.onclick = () => { electron.shell.openExternal($api.data) }),
createWarnButton("Restart in safe mode")
.modify(x => x.onclick = endpwn.safemode),
createDangerButton("Uninstall EndPwn")
.modify(x => x.onclick = endpwn.uninstall)
)
.appendTo(content);
} }
$settingsapi.addDivider();
$settingsapi.addHeader("Cynergy");
$settingsapi.addSection("ENDPWN","Cλnergy Settings","#c8f",renderSettings); $settingsapi.addSection("ENDPWN","Cλnergy Settings","#c8f",renderSettings);
} }
} }

View file

@ -38,7 +38,7 @@
/* settings page stuff */ /* settings page stuff */
.epSettingsHeader { .epSettingsHeader {
background: linear-gradient(to bottom right, #cf8, #c8f); background: linear-gradient(to bottom right, #c8f, #cf8);
-webkit-background-clip: text; -webkit-background-clip: text;
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
font-size: 36px; font-size: 36px;