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

Darkmode & timestamps #490

Open
wants to merge 95 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
abd6c40
Merge pull request #256 from Xzandro/master
Xzandro Aug 28, 2019
ed2f2b0
Merge pull request #266 from Xzandro/master
Xzandro Aug 31, 2019
a699275
Merge pull request #292 from Xzandro/master
Xzandro Oct 12, 2019
e98fc5c
Merge pull request #293 from Xzandro/master
Xzandro Oct 12, 2019
1cdbdd2
Merge pull request #315 from Xzandro/master
Xzandro Mar 24, 2020
09623ff
Merge pull request #322 from Xzandro/master
Xzandro Jun 4, 2020
498947f
Merge pull request #323 from Xzandro/master
Xzandro Jun 5, 2020
d737c1f
Merge pull request #332 from Xzandro/master
Xzandro Jul 31, 2020
1eb55fc
Merge pull request #346 from Xzandro/master
Xzandro Dec 3, 2020
505a98b
Merge pull request #358 from Xzandro/master
Xzandro Jan 12, 2021
c7eef57
Merge pull request #406 from Xzandro/master
Xzandro Sep 5, 2021
baee6f1
Merge pull request #407 from Xzandro/master
Xzandro Sep 5, 2021
4752cda
Merge pull request #408 from Xzandro/master
Xzandro Sep 5, 2021
7606438
Merge pull request #409 from Xzandro/master
Xzandro Sep 5, 2021
a97a365
Merge pull request #412 from Xzandro/master
Xzandro Sep 9, 2021
e09a85a
Merge pull request #413 from Xzandro/master
Xzandro Sep 9, 2021
42c873e
Merge pull request #414 from Xzandro/master
Xzandro Sep 9, 2021
839f417
Merge pull request #416 from Xzandro/master
Xzandro Sep 10, 2021
b6f660b
Merge pull request #420 from Xzandro/master
Xzandro Oct 1, 2021
ad26c25
Merge pull request #430 from Xzandro/master
Xzandro Dec 20, 2021
dfed1a3
Merge pull request #432 from Xzandro/master
Xzandro Dec 20, 2021
3fae8e4
package update bump
EytanMorg Dec 28, 2021
f8915c3
bump to beta
EytanMorg Dec 28, 2021
3fa764f
Reappraisal efficentcie calculation added
EytanMorg Dec 28, 2021
d5bf305
package bump
EytanMorg Dec 29, 2021
a4661fb
Merge pull request #434 from Xzandro/master
Xzandro Jan 30, 2022
2f8a83e
Merge pull request #452 from Xzandro/master
Xzandro Aug 5, 2022
79d634b
Merge branch 'master' of github.com:EytanMorg/sw-exporter
EytanMorg Aug 21, 2022
f0f6b13
Merge branch 'master' into reapp-precalc
EytanMorg Aug 21, 2022
f1f427b
update to 0.51
EytanMorg Aug 21, 2022
976b567
added line to tell user it is the reapped value
EytanMorg Aug 21, 2022
4320cf2
bump to 0.0.51
EytanMorg Aug 21, 2022
1de5922
text edit
EytanMorg Aug 21, 2022
815e81e
Merge pull request #1 from EytanMorg/reapp-precalc
EytanMorg Aug 21, 2022
5809c38
linter was complaining
EytanMorg Aug 21, 2022
ca17cff
Merge pull request #2 from EytanMorg/reapp-precalc
EytanMorg Aug 21, 2022
fa082f8
modified help section
EytanMorg Aug 25, 2022
61faaf3
M1 support added
EytanMorg Aug 25, 2022
4d0abe3
version bump @electron/get
EytanMorg Aug 25, 2022
7a7d05b
Revert "version bump @electron/get"
EytanMorg Aug 25, 2022
10a86d3
Revert "version bump @electron/get"
EytanMorg Aug 25, 2022
53a6b6d
Merge branch 'update-help-screen' of github.com:EytanMorg/sw-exporter…
EytanMorg Aug 25, 2022
34dbcd6
electron downgrade back to v15, v16 gives problems
EytanMorg Aug 25, 2022
d36a622
readded missing lines from backup
EytanMorg Aug 25, 2022
7a13e9a
Merge branch 'reapp-precalc'
EytanMorg Aug 26, 2022
aac9cee
Merge remote-tracking branch 'origin/master' into update-help-screen
EytanMorg Aug 26, 2022
2e33a2f
Package errors fixed by Mintal
EytanMorg Aug 26, 2022
51dd3b0
move textblock
EytanMorg Aug 26, 2022
b150098
path to cs file
EytanMorg Sep 1, 2022
acac9bb
reactive css dependent on system color
EytanMorg Sep 1, 2022
f704cc5
Darkmode added with rgb values
EytanMorg Sep 1, 2022
286318a
moved dark mode switch to same box as proxy start
EytanMorg Sep 2, 2022
d2b40ea
minWidth +100 px, due to extra button
EytanMorg Sep 5, 2022
59e6902
spelling fixes
EytanMorg Sep 5, 2022
040b24e
Fixed darkmode color regenerate cert button
EytanMorg Sep 5, 2022
52a0a64
increased window size and added cellpadding
EytanMorg Sep 9, 2022
daf3c4a
globalised table styling RuneDropEfficiency2
EytanMorg Sep 10, 2022
d17cd57
Merge pull request #456 from Xzandro/master
Xzandro Sep 16, 2022
c580493
Merge pull request #3 from Xzandro/master
EytanMorg Sep 16, 2022
a0e1064
change checkbox and input filed color
EytanMorg Sep 17, 2022
fff0868
0.52 bump
EytanMorg Sep 17, 2022
98b2bf8
attempt to make the log colors dynamic
EytanMorg Sep 17, 2022
b9261bd
lighten default colors
EytanMorg Sep 17, 2022
65dbbdc
Merge branch 'Dark_mode' into dev
EytanMorg Sep 17, 2022
511db26
marked with branch name
EytanMorg Sep 18, 2022
3815f39
Merge pull request #464 from Xzandro/master
Xzandro Nov 12, 2022
441c82b
version update in package files
EytanMorg Jan 23, 2023
9e32cad
fixed readablility certificate regeneration pop-up
EytanMorg Jan 23, 2023
7be6c17
Merge remote branch upstream/master into dev
EytanMorg Jan 23, 2023
84083c4
Merge pull request #4 from EytanMorg/dev
EytanMorg Jan 23, 2023
cb91791
help.js
EytanMorg Jan 25, 2023
653755f
expantion on hlp.js
EytanMorg Jan 25, 2023
cfca8f0
removed duplicate "blanked out text error"
EytanMorg Jan 25, 2023
57ffb2f
formatting
EytanMorg Jan 25, 2023
2ff6a58
added timestamps to exported profile.json
EytanMorg Jan 30, 2023
9eac3a1
added dedicated folder for profile.json storage
EytanMorg Jan 30, 2023
bd99a76
added the needed requirement for ensureDirSync
EytanMorg Jan 30, 2023
0b2c07e
removed old status colors
EytanMorg Jan 30, 2023
eafb728
fix linting issue " → '
EytanMorg Jan 31, 2023
5e1eacb
linting
EytanMorg Jan 31, 2023
3658a32
Merge pull request #487 from Xzandro/master
Xzandro Jul 3, 2023
496ba2a
Merge remote-tracking branch 'upstream/master' into dev
EytanMorg Jul 3, 2023
acf5ed2
linitng issues profile export and help
EytanMorg Jul 4, 2023
75d0ab8
profile-exporter
EytanMorg Jul 5, 2023
c3d7357
ES linter
EytanMorg Jul 5, 2023
0d94a99
ES lint
EytanMorg Jul 5, 2023
ed79762
versio naming scheme
EytanMorg Jul 11, 2023
d9502ed
Merge branch 'dev' of https://github.com/EytanMorg/sw-exporter into dev
EytanMorg Jul 11, 2023
533a067
Added a functioning switch for timestamp function
EytanMorg Jul 12, 2023
efde236
removed consol logging
EytanMorg Jul 12, 2023
6fa9035
Merge pull request #6 from Xzandro/stable
EytanMorg Jul 12, 2023
81046d6
Merge branch 'master' into dev
EytanMorg Jul 12, 2023
742c72e
Merge pull request #8 from EytanMorg/dev
EytanMorg Jul 13, 2023
ceaebf8
Help screen update
EytanMorg Jul 15, 2023
5795d94
Merge pull request #9 from EytanMorg/dev
EytanMorg Jul 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/components/Head.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class Head extends React.Component {
ipcRenderer.send('updateConfig');
}

toggleTheme() {
ipcRenderer.invoke('dark-mode:toggle');
}

render() {
const interfaces = ipcRenderer.sendSync('proxyGetInterfaces').map((interfaceEntry, i) => ({ key: i, text: interfaceEntry, value: i }));
return (
Expand All @@ -68,6 +72,7 @@ class Head extends React.Component {
labelPosition="right"
onClick={this.toggleProxy.bind(this)}
/>
<Button onClick={this.toggleTheme.bind(this)} icon={'adjust'} />
</Menu.Item>
</Menu>
);
Expand Down
20 changes: 17 additions & 3 deletions app/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { app, BrowserWindow, ipcMain, Menu, shell, Tray } = require('electron');
const { app, BrowserWindow, ipcMain, Menu, shell, Tray, nativeTheme } = require('electron');
require('@electron/remote/main').initialize();
const fs = require('fs-extra');
const storage = require('electron-json-storage');
Expand Down Expand Up @@ -38,12 +38,12 @@ let defaultConfigDetails = {

function createWindow() {
let mainWindowState = windowStateKeeper({
defaultWidth: 800,
defaultWidth: 1100,
defaultHeight: 600,
});

global.win = new BrowserWindow({
minWidth: 800,
minWidth: 1100,
minHeight: 600,
x: mainWindowState.x,
y: mainWindowState.y,
Expand Down Expand Up @@ -115,6 +115,20 @@ function createWindow() {
e.preventDefault();
shell.openExternal(link);
});

//dark mode toggles
ipcMain.handle('dark-mode:toggle', () => {
if (nativeTheme.shouldUseDarkColors) {
nativeTheme.themeSource = 'light';
} else {
nativeTheme.themeSource = 'dark';
}
return nativeTheme.shouldUseDarkColors;
});

ipcMain.handle('dark-mode:system', () => {
nativeTheme.themeSource = 'system';
});
}

const proxy = new SWProxy();
Expand Down
288 changes: 169 additions & 119 deletions app/pages/Help.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions app/pages/Logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ import React from 'react';
import { Header, Feed, Divider, Label, Icon } from 'semantic-ui-react';
import { capitalize, toLower } from 'lodash/string';

const { ipcRenderer } = require('electron');
const { ipcRenderer, ipcMain } = require('electron');
const remote = require('@electron/remote');

const config = remote.getGlobal('config');

const STATUS_COLOR_MAP = {
success: 'green',
info: 'blue',
warning: 'yellow',
warning: 'orange',
error: 'red',
debug: 'darkgrey',
debug: 'black',
};

const STATUS_ICON_MAP = {
success: 'check',
info: 'info circle',
warning: 'warning sign',
error: 'x',
debug: 'code',
};

const determineLabelColor = (status) => STATUS_COLOR_MAP[status] || 'grey';
const determineLabelIcon = (status) => STATUS_ICON_MAP[status] || 'question';

Expand Down
25 changes: 25 additions & 0 deletions app/plugins/profile-export.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const fs = require('fs');
const fse = require('fs-extra');
const path = require('path');
const sanitize = require('sanitize-filename');
const dateformat = require('date-fns');
const MISSING_DATA_ERROR =
'No file created. Data was missing during the Export process. This happens sometimes, when com2us failes to include important data during the request. Normally this fixes itself after a few tries.';

Expand All @@ -9,10 +11,12 @@ module.exports = {
enabled: true,
sortData: true,
mergeStorage: true,
timestampedCopy: false,
},
defaultConfigDetails: {
sortData: { label: 'Sort data like ingame' },
mergeStorage: { label: 'Merge sealed monster storage into profile data' },
timestampedCopy: { label: 'Timestamped copy in separate folder' },
},
pluginName: 'ProfileExport',
pluginDescription: 'Exports your monster and rune data.',
Expand All @@ -32,6 +36,10 @@ module.exports = {
if (!config.Config.Plugins[this.pluginName].mergeStorage) {
this.writeProfileToFile(proxy, resp.wizard_info.wizard_id);
}

if (config.Config.Plugins[this.pluginName].timestampedCopy) {
this.writeProfileToFolder(proxy, resp.wizard_info.wizard_id);
}
}
});
proxy.on('GuestLogin', (req, resp) => {
Expand Down Expand Up @@ -71,6 +79,7 @@ module.exports = {
});
},
writeProfileToFile(proxy, wizardID) {
const timestamp = dateformat.format(new Date(), 'yyyy-MM-dd_HHmmss');
const wizardName = this.temp[wizardID].wizard_info.wizard_name;
const filename = sanitize(`${wizardName}-${wizardID}`).concat('.json');

Expand All @@ -83,6 +92,22 @@ module.exports = {
outFile.end();
proxy.log({ type: 'success', source: 'plugin', name: this.pluginName, message: 'Saved profile data to '.concat(filename) });
},

writeProfileToFolder(proxy, wizardID) {
const wizardName = this.temp[wizardID].wizard_info.wizard_name;
const timestamp = dateformat.format(new Date(), 'yyyy-MM-dd_HHmmss');
const filename = sanitize(`${wizardName}-${wizardID}-${timestamp}`).concat('.json');

fse.ensureDirSync(path.join(config.Config.App.filesPath, 'profile saves'));
let outFile = fs.createWriteStream(path.join(config.Config.App.filesPath, 'profile saves', filename), {
flags: 'w',
autoClose: true,
});

outFile.write(JSON.stringify(this.temp[wizardID], true, 2));
outFile.end();
proxy.log({ type: 'success', source: 'plugin', name: this.pluginName, message: 'Saved profile data to '.concat(filename) });
},
checkData(data) {
// Sometimes com2us doesn't include al lthe required data in the request
// Most notably is the missing of the building_list object.
Expand Down
2 changes: 1 addition & 1 deletion app/proxy/SWProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path');
const os = require('os');
const net = require('net');
const url = require('url');
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const Proxy = require('http-mitm-proxy');
const { differenceInMonths } = require('date-fns');
const storage = require('electron-json-storage');
Expand Down
93 changes: 88 additions & 5 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@ body {
.ui.menu.main-menu {
margin-bottom: 0;
}

.ui.menu.side-menu {
top: 65px;
z-index: 1;
}

.ui.segment.main-content {
margin-top: 65px;
margin-left: 210px;
}

.ui.segment.main-content.compacted {
margin: 0;
}

.ui.segment.app-segment {
border-radius: 0;
margin-top: 0;
border-bottom: none;
border-left: none;
}

.main-menu .item.right button {
margin-left: 15px !important;
}
Expand All @@ -35,7 +40,7 @@ body {
text-align: center;
}

.rune .ui.image.label > img {
.rune .ui.image.label>img {
margin: 0 auto;
max-width: none;
}
Expand Down Expand Up @@ -63,8 +68,86 @@ body {
color: #ffffff;
}

.ui.label.image.horizontal > .detail {
padding-top: .4em;
padding-bottom: .4em;
margin-top: -.4em;
.ui.label.image.horizontal>.detail {
padding-top: 0.4em;
padding-bottom: 0.4em;
margin-top: -0.4em;
}

/* only for when using RuneDropEfficiency2 */
.gem-table td {
min-width: 60px !important;
text-align: right !important;
}

td[bgcolor='lightgreen'] {
background-color: #27bb67 !important;
color: black !important;
}

@media (prefers-color-scheme: dark) {
* {
color: rgb(255, 255, 255) !important;
}

body {
background: rgb(51, 51, 51);
}

.main-menu {
background-color: rgb(51, 51, 51) !important;
}

.main-menu * {
color: rgb(0, 0, 0) !important;
}

h4.ui.top.header,
.ui.attached.segment {
background-color: rgb(51, 51, 51);
}

.ui.fluid.action.input *,
.ui.fluid.input *,
.ui.input *,
.ui.compact.icon.right.floated.button *,
.ui.compact.icon.left.floated.button *,
.ui.small.icon.left.labeled.button *,
.ui.small.icon.left.labeled.button,
.ui.top.left.small.popup.transition.visible *,
textarea {
color: rgb(0, 0, 0) !important;
}

.ui.small.modal.transition.visible.active * {
background-color: rgb(51, 51, 51);
}

.ui.selection.dropdown *,
.listbox,
.ui.selection.dropdown,
.ui.active.visible.selection.dropdown,
.textarea *,
.ui.labeled.input *,
.ui.fluid.action.input *,
.ui.fluid.input *,
.ui.input *,
.ui.selection.dropdown *,
.listbox,
.ui.selection.dropdown,
.ui.active.visible.selection.dropdown,
textarea {
background-color: rgb(209, 209, 209) !important;
}

.ui.checkbox label::before {
background-color: rgb(190, 190, 190) !important;
}
}

@media (prefers-color-scheme: light) {
body {
background: rgb(255, 255, 255);
color: rgb(0, 0, 0);
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sw-exporter",
"productName": "Summoners War Exporter",
"version": "0.0.53",
"version": "0.0.54B",
"description": "This tool will parse intercepted data from Summoners War and extract information on the monsters and runes of the user.",
"main": "./app/main.js",
"scripts": {
Expand Down Expand Up @@ -98,4 +98,4 @@
"semantic-ui-react": "^2.0.4",
"uuid": "^3.4.0"
}
}
}