Skip to content

Commit a6e5425

Browse files
authored
Merge pull request #11 from Proxwian/screenshot-viewer
Screenshot viewer
2 parents ecc0b18 + 28813b8 commit a6e5425

File tree

28 files changed

+6250
-1488
lines changed

28 files changed

+6250
-1488
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# OxLAUNCHER [![OxLAUNCHER CI](https://github.com/Proxwian/OxLAUNCHER/actions/workflows/nodejs.yml/badge.svg)](https://github.com/Proxwian/OxLAUNCHER/actions/workflows/nodejs.yml)
22

3-
Latest version: 1.4.0
3+
Latest version: 1.4.1

package-lock.json

Lines changed: 5335 additions & 1343 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oxlauncher",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "OxLAUNCHER is simple and powerful tool to download and manage minecraft modpacks. Based on GDLauncher",
55
"keywords": [
66
"minecraft",

public/discordRPC.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let activity;
77
const initialAppStartup = Math.floor(Date.now() / 1000);
88

99
const defaultValue = {
10-
details: 'Смотрит сборки',
10+
details: 'На главном экране',
1111
startTimestamp: initialAppStartup,
1212
largeImageKey: 'default_big',
1313
largeImageText: 'OxLAUNCHER - Лучший Minecraft лаунчер для установки сборок с модификациями и не только',
@@ -38,7 +38,7 @@ exports.update = details => {
3838
activity = {
3939
...activity,
4040
startTimestamp: Math.floor(Date.now() / 1000),
41-
details: `Играет в ${details}`
41+
details: `${details}`
4242
};
4343
client.setActivity(activity);
4444
};

src/app/desktop/DesktopRoot.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,25 @@ function DesktopRoot({ store }) {
8181

8282
const manifests = await dispatch(initManifests());
8383

84-
let isJava8OK = javaPath;
85-
let isJavaLatestOk = javaLatestPath;
86-
87-
if (!javaPath) {
88-
({ isValid: isJava8OK } = await isLatestJavaDownloaded(
89-
manifests,
90-
userData,
91-
true
92-
));
93-
}
94-
95-
if (!isJavaLatestOk) {
96-
({ isValid: isJavaLatestOk } = await isLatestJavaDownloaded(
97-
manifests,
98-
userData,
99-
true,
100-
LATEST_JAVA_VERSION
101-
));
102-
}
84+
let isJava8OK = true;
85+
let isJavaLatestOk = true;
86+
87+
// if (!javaPath) {
88+
// ({ isValid: isJava8OK } = await isLatestJavaDownloaded(
89+
// manifests,
90+
// userData,
91+
// true
92+
// ));
93+
// }
94+
95+
// if (!isJavaLatestOk) {
96+
// ({ isValid: isJavaLatestOk } = await isLatestJavaDownloaded(
97+
// manifests,
98+
// userData,
99+
// true,
100+
// LATEST_JAVA_VERSION
101+
// ));
102+
// }
103103

104104
if (!isJava8OK || !isJavaLatestOk) {
105105
dispatch(openModal('JavaSetup', { preventClose: true }));

src/app/desktop/components/Instances/Instance.js

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import {
1818
faBoxOpen,
1919
faCopy,
2020
faServer,
21-
faHammer
21+
faHammer,
22+
faImage
2223
} from '@fortawesome/free-solid-svg-icons';
2324
import psTree from 'ps-tree';
2425
import { ContextMenuTrigger, ContextMenu, MenuItem } from 'react-contextmenu';
@@ -250,11 +251,8 @@ const Instance = ({ instanceName }) => {
250251
finallyUpdate;
251252
setNeedUpdate(false);
252253
}
253-
const updatePack = () => {
254-
dispatch(openModal('InstanceManager', { instanceName: instanceName, openUpdater: true }));
255-
};
256-
const openBisectModal = () => {
257-
dispatch(openModal('BisectHosting'));
254+
const openScreenshots = () => {
255+
dispatch(openModal('InstanceManager', { instanceName: instanceName, openScreenshots: true }));
258256
};
259257
const instanceExportCurseForge = () => {
260258
dispatch(openModal('InstanceExportCurseForge', { instanceName }));
@@ -392,31 +390,41 @@ const Instance = ({ instanceName }) => {
392390
</MenuItem>
393391
)}
394392
{Boolean(isNeedUpdate) && (
395-
<MenuItem disabled={Boolean(isInQueue)}
396-
css={`
393+
<MenuItem disabled={Boolean(isInQueue)}
394+
css={`
395+
color: #6D4D52;
396+
`}
397+
onClick={updateDatapack}>
398+
<FontAwesomeIcon
399+
icon={faSpinner}
400+
css={`
397401
color: #6D4D52;
398-
`}
399-
onClick={updateDatapack}>
402+
margin-right: 10px;
403+
width: 25px !important;
404+
`}
405+
/>
406+
Обновить
407+
</MenuItem>
408+
)}
409+
<MenuItem disabled={Boolean(isInQueue)} onClick={manageInstance}>
400410
<FontAwesomeIcon
401-
icon={faSpinner}
411+
icon={faWrench}
402412
css={`
403-
color: #6D4D52;
404413
margin-right: 10px;
405414
width: 25px !important;
406415
`}
407416
/>
408-
Обновить
417+
Управление
409418
</MenuItem>
410-
)}
411-
<MenuItem disabled={Boolean(isInQueue)} onClick={manageInstance}>
419+
<MenuItem disabled={Boolean(isInQueue)} onClick={openScreenshots}>
412420
<FontAwesomeIcon
413-
icon={faWrench}
421+
icon={faImage}
414422
css={`
415423
margin-right: 10px;
416424
width: 25px !important;
417425
`}
418426
/>
419-
Настройки
427+
Скриншоты
420428
</MenuItem>
421429
<MenuItem onClick={openFolder}>
422430
<FontAwesomeIcon

src/app/desktop/utils/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -911,18 +911,16 @@ export const getPlayerSkinMojang = async (uuid) => {
911911
return decoded?.textures?.SKIN?.url;
912912
};
913913

914-
export const getPlayerSkinOx = async (nickname) => {
915-
return oxGetPlayerSkin(nickname);
916-
const playerSkin = await oxGetPlayerSkin(nickname);
914+
export const getPlayerSkinOx = async (uuid) => {
915+
const playerSkin = await oxGetPlayerSkin(uuid);
917916
const { data } = playerSkin;
918917
const base64 = data.properties[0].value;
919918
const decoded = JSON.parse(Buffer.from(base64, 'base64').toString());
920919
return decoded?.textures?.SKIN?.url;
921920
};
922921

923-
export const getPlayerSkinElyBy = async (nickname) => {
924-
return elybyGetPlayerSkin(nickname);
925-
const playerSkin = await elybyGetPlayerSkin(nickname);
922+
export const getPlayerSkinElyBy = async (uuid) => {
923+
const playerSkin = await elybyGetPlayerSkin(uuid);
926924
const { data } = playerSkin;
927925
const base64 = data.properties[0].value;
928926
const decoded = JSON.parse(Buffer.from(base64, 'base64').toString());

src/app/desktop/views/Home.js

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useEffect, memo, useMemo } from 'react';
22
import styled from 'styled-components';
33
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4-
import { faPlus } from '@fortawesome/free-solid-svg-icons';
4+
import { faImages, faPlus } from '@fortawesome/free-solid-svg-icons';
55
import { Button } from 'antd';
66
import { useSelector, useDispatch } from 'react-redux';
77
import { ipcRenderer } from 'electron';
@@ -21,14 +21,20 @@ import { updateLastUpdateVersion } from '../../../common/reducers/actions';
2121
import { _getInstances, _getInstancesPath, _getTempPath } from '../../../common/utils/selectors';
2222

2323
import { useDebouncedCallback } from 'use-debounce';
24-
import { ACCOUNT_MICROSOFT } from '../../../common/utils/constants';
24+
import { ACCOUNT_ELYBY, ACCOUNT_MICROSOFT, ACCOUNT_OFFLINE, ACCOUNT_OXAUTH } from '../../../common/utils/constants';
2525

2626
const AddInstanceIcon = styled(Button)`
2727
position: fixed;
2828
bottom: 20px;
2929
left: 20px;
3030
`;
3131

32+
const ShowScreenshotsIcon = styled(Button)`
33+
position: fixed;
34+
bottom: 20px;
35+
left: 80px;
36+
`;
37+
3238
const AccountContainer = styled(Button)`
3339
position: fixed;
3440
bottom: 20px;
@@ -55,6 +61,8 @@ const Home = () => {
5561
const [annoucement, setAnnoucement] = useState(null);
5662

5763
useEffect(() => {
64+
const discordRPCDetails = `На главной`;
65+
ipcRenderer.invoke('update-discord-rpc', discordRPCDetails);
5866
const init = async () => {
5967
// setInstalling(false);
6068
// setInitinstall(false);
@@ -79,23 +87,6 @@ const Home = () => {
7987
useEffect(() => {
8088
extractFace(account.skin).then(setProfileImage).catch(console.error);
8189
}, [account]);
82-
83-
const getInstances = (instances, sortOrder) => {
84-
// Data normalization for missing fields
85-
const inst = instances.map(instance => {
86-
return {
87-
...instance,
88-
timePlayed: instance.timePlayed || 0,
89-
lastPlayed: instance.lastPlayed || 0
90-
};
91-
});
92-
93-
switch (sortOrder) {
94-
default:
95-
return inst;
96-
}
97-
};
98-
9990

10091
return (
10192
<div>
@@ -112,16 +103,26 @@ const Home = () => {
112103
{annoucement}
113104
</div>
114105
) : null}
115-
<Instances
116-
css={`
117-
bottom: 20px;
118-
left: 20px;`
119-
}/>
106+
<Instances
107+
css={`
108+
bottom: 20px;
109+
left: 20px;`
110+
}/>
120111
<AddInstanceIcon type="primary" onClick={() => openAddInstanceModal(0)}>
121112
<FontAwesomeIcon icon={faPlus} />
122113
</AddInstanceIcon>
123-
<AccountContainer type="primary" onClick={openAccountModal}>
124-
{profileImage && account.accountType === ACCOUNT_MICROSOFT ? (
114+
<ShowScreenshotsIcon type="primary" onClick={() => dispatch(openModal('ScreenshotManager'))}>
115+
<FontAwesomeIcon icon={faImages} />
116+
</ShowScreenshotsIcon>
117+
<AccountContainer
118+
type="primary"
119+
onClick={openAccountModal}
120+
css={`
121+
background-color: ${account.accountType == ACCOUNT_OFFLINE ? (`#545454`) : account.accountType == ACCOUNT_OXAUTH ? (`#3c6a5b`) : account.accountType == ACCOUNT_ELYBY ? (`#187c41`) : (`#830d0d`)};
122+
border-color: ${account.accountType == ACCOUNT_OFFLINE ? (`#545454`) : account.accountType == ACCOUNT_OXAUTH ? (`#3c6a5b`) : account.accountType == ACCOUNT_ELYBY ? (`#187c41`) : (`#830d0d`)};
123+
`}
124+
>
125+
{profileImage && account.accountType !== ACCOUNT_OFFLINE ? (
125126
<img
126127
src={`data:image/jpeg;base64,${profileImage}`}
127128
css={`

src/app/desktop/views/Login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ const Login = () => {
383383
`}
384384
>
385385
<center>
386-
<a onClick={() => dispatch(openModal('ChangeLogs'))}>v. 1.4.0</a>
386+
<a onClick={() => dispatch(openModal('ChangeLogs'))}>v. 1.4.1</a>
387387
</center>
388388
</div>
389389
<div

src/app/desktop/views/Onboarding.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
faLongArrowAltUp,
99
faLongArrowAltDown
1010
} from '@fortawesome/free-solid-svg-icons';
11-
import backgroundVideo from '../../../common/assets/onboarding.webm';
1211
import { _getCurrentAccount } from '../../../common/utils/selectors';
1312
import BisectHosting from '../../../ui/BisectHosting';
1413
import KoFiButton from '../../../common/assets/ko-fi.png';

0 commit comments

Comments
 (0)