Skip to content

Commit

Permalink
Merge pull request #446 from Mindgamesnl/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Mindgamesnl authored Aug 11, 2024
2 parents f48acc3 + 2d6907c commit 6d816f0
Show file tree
Hide file tree
Showing 48 changed files with 2,811 additions and 951 deletions.
3 changes: 3 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Million Lint
.million
2,214 changes: 1,818 additions & 396 deletions client/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"dependencies": {
"@fontsource/roboto": "^5.0.8",
"@million/lint": "^1.0.0-rc.84",
"immer": "^9.0.17",
"js-cookie": "^3.0.1",
"mediastream-gain": "^1.0.1",
Expand Down
12 changes: 4 additions & 8 deletions client/public/en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ vc.aboutPositionalAudio=Render a 360 degree soundscape, allowing positional awar
vc.settingsDisable=Disable
vc.settingsEnablePositionalAudio=Enable Positional Audio
vc.settingsDisablePositionalAudio=Disable Positional Audio
vc.automaticAdjustments=Adjust automatically
vc.automaticAdjustments=Adjust sensitivity automatically
vc.sensitivity=Noise Gate
vc.aboutSensitivity=Configure the noise gate of your microphone, this will automatically mute your microphone when you're not talking. <b>Fully to the left</b> will disable the noise gate, <b>fully to the right</b> will mute your microphone all the time.
vc.peerTable=connected to {total} players, {talking} talking
Expand All @@ -81,14 +81,10 @@ vc.hero.title=Welcome to VoiceChat!
vc.hero.subtitle=This is your voice chat dashboard, here you can see who is in range of your voice, and who you can hear. You can also mute people if you don't want to hear them.
vc.statusTitle=My status
vc.settings.globalVolumeTitle=General VoiceChat volume
vc.settings.surround.disable=Disable Surround
vc.settings.surround.enable=Enable Surround
vc.settings.surround.toggle=Surround sound
vc.settings.globalVolumeAbout=Change the master volume of all your VoiceChat peers
vc.settings.toggleMenuTitle=VoiceChat input settings
vc.settings.toggleMenu=Toggle Menu
vc.settings.monitoring.title=Microphone Monitoring
vc.settings.monitoring.about=Monitoring plays your own voice back for yourself like how others hear you, useful to test your microphone and sensitivity settings.
vc.settings.monitoring.toggle=Enable monitoring
vc.settings.completelyFadePeers=Fade volume out completely over distance
vc.settings.monitoring.title=Microphone Monitoring (listen to yourself)
vc.operaWarning=Your login seems to be taking a while, this is most likely due to your Opera settings. Please open your browser settings, search for "WebRTC" and select the enable-all option
vc.youAreModerating=Watch out! you are now a moderator, you can now hear everyone in voice chat but they can't hear you.
vc.noMicInputYetTitle=We're having trouble hearing you!
Expand Down
2 changes: 1 addition & 1 deletion client/public/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"buildMajor":1,"buildMinor":125,"buildRevision":251,"buildTag":"dev","buildDate":"Tue Jul 09 2024","build":"1.125.251 dev"}
{"buildMajor":1,"buildMinor":125,"buildRevision":266,"buildTag":"dev","buildDate":"Fri Aug 02 2024","build":"1.125.266 dev"}
4 changes: 2 additions & 2 deletions client/public/nl.lang
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ vc.statusTitle=Mijn status
vc.settings.globalVolumeTitle=Algemeen VoiceChat volume
vc.settings.surround.disable=Surround Uitschakelen
vc.settings.surround.enable=Surround Inschakelen
vc.settings.globalVolumeAbout=Wijzig het hoofdvolume van alle personen in VoiceChat
vc.settings.globalVolumeAbout=Wijzig het hoofdvolume van alle personen in VoiceChat
vc.settings.toggleMenuTitle=VoiceChat-invoerinstellingen
vc.settings.toggleMenu=Toggle Menu
vc.settings.monitoring.title=Microfoon Monitoren
Expand Down Expand Up @@ -147,4 +147,4 @@ settings.interpolation.button=Versoepelen inschakelen

network.serverUnhealthy=De verbinding tussen {serverName} en OpenAudioMc is onstabiel. Sommige functies werken mogelijk niet goed tot dit is opgelost.

tooltip.close=Sluiten
tooltip.close=Sluiten
6 changes: 4 additions & 2 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import './App.css';
import 'react-tooltip/dist/react-tooltip.css';
import React from 'react';
import React, { memo } from 'react';
import { Provider } from 'react-redux';
import OpenAudioAppContainer from './client/OpenAudioAppContainer';
import OpenAudioController from './components/OpenAudioRouter';
import { store } from './state/store';
import NoSleepComponent from './components/activity/browser-activity';
import FadeTo from './components/fadeto/fadeto';

const MemoizedOpenAudioController = memo(OpenAudioController);

function App() {
return (
<Provider store={store}>
<NoSleepComponent>
<FadeTo>
<OpenAudioAppContainer>
<OpenAudioController />
<MemoizedOpenAudioController />
</OpenAudioAppContainer>
</FadeTo>
</NoSleepComponent>
Expand Down
2 changes: 2 additions & 0 deletions client/src/client/OpenAudioAppContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ export function setBgColor(col) {
setGlobalState({ settings: { accentColor: col } });
}

window.debugSetBgColor = setBgColor;

function setBgImage(bg) {
// if (bg.endsWith("mp4") && result.response.isPatreon) {
// // use mp4
Expand Down
7 changes: 7 additions & 0 deletions client/src/client/services/voice/VoiceModule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ export const VoiceModule = new class IVoiceModule {
});
}

restartVoiceChat() {
const currentPreferredMic = getGlobalState().settings.preferredMicId;
if (currentPreferredMic && this.isReady()) {
this.changeInput(currentPreferredMic);
}
}

pushSocketEvent(event) {
if (this.peerManager != null) {
SocketManager.send(PluginChannel.RTC_READY, { event });
Expand Down
39 changes: 39 additions & 0 deletions client/src/components/buttons/VoicePageButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import PropTypes from 'prop-types';
import './oabutton.css';

export function VoicePageButton(props) {
return (
<button
type="button"
className={
`oa-button-modern ${
props.highlighted && props.highlightRed ? 'button-off ' : ''
}${props.highlighted && props.highlightGreen ? 'button-on ' : ''
}${props.isDisabled ? 'disabled ' : ''}`
}
onClick={props.onClick}
disabled={props.isEnabled}
>
<div className="content">
{props.children}
</div>
</button>
);
}

// default props
VoicePageButton.defaultProps = {
isDisabled: false,
highlightRed: false,
highlightGreen: false,
};

VoicePageButton.propTypes = {
highlighted: PropTypes.bool.isRequired,
isDisabled: PropTypes.bool,
onClick: PropTypes.func.isRequired,

highlightRed: PropTypes.bool,
highlightGreen: PropTypes.bool,
};
60 changes: 60 additions & 0 deletions client/src/components/buttons/oabutton.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
:root {
--theme-primary-off: color-mix(in srgb, var(--primary-accent), red 75%);
--theme-secondary-off: color-mix(in srgb, var(--dark-primary-background), red 25%);
--theme-secondary-ON: color-mix(in srgb, var(--dark-primary-background), green 50%);
--theme-primary-hover: color-mix(in srgb, var(--primary-accent), #336699 50%);
}

.oa-button-modern {
background-color: var(--dark-primary-background);
color: #fff;
cursor: pointer;
display: inline-block;
font-size: 16px;
font-weight: 500;
margin: 2px;
padding: 14px 20px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
transition: all 0.15s ease-in-out;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.oa-button-modern .disabled {
background-color: #e0e0e0;
color: #808080;
cursor: not-allowed;
opacity: 0.7;
box-shadow: none;
}

.oa-button-modern:hover {
background-color: var(--theme-primary-hover);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.oa-button-modern.button-off {
box-shadow: inset 0 0 0 2px red;
background-color: var(--theme-secondary-off);
}

.oa-button-modern.button-on {
box-shadow: inset 0 0 0 2px green;
background-color: var(--theme-secondary-ON);
}

.oa-button-modern .content .icon {
margin-right: 8px;
vertical-align: middle;
font-size: 18px;
height: 32px;
color: #fff;
}

.oa-button-modern .content {
display: flex;
align-items: center;
justify-content: center;
}
6 changes: 3 additions & 3 deletions client/src/components/dpip/PipVector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';

export function PipVector() {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" className="ml-3" fill="none">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" className="icon" fill="none">
<g transform="translate(0,1)">
<path d="M13 17C13 15.1144 13 14.1716 13.5858 13.5858C14.1716 13 15.1144 13 17 13H18C19.8856 13 20.8284 13 21.4142 13.5858C22 14.1716 22 15.1144 22 17C22 18.8856 22 19.8284 21.4142 20.4142C20.8284 21 19.8856 21 18 21H17C15.1144 21 14.1716 21 13.5858 20.4142C13 19.8284 13 18.8856 13 17Z" fill="#1C274C" />
<path fillRule="evenodd" clipRule="evenodd" d="M10 3H14C17.7712 3 19.6569 3 20.8284 4.17157C21.7775 5.1206 21.9577 6.86626 21.992 9.49974C22.0042 10.4366 22.0102 10.905 21.7166 11.2025C21.4229 11.5 20.9486 11.5 20 11.5H17.5C14.6716 11.5 13.2574 11.5 12.3787 12.3787C11.5 13.2574 11.5 14.6716 11.5 17.5V19.5C11.5 19.9659 11.5 20.1989 11.4239 20.3827C11.3224 20.6277 11.1277 20.8224 10.8827 20.9239C10.6989 21 10.4659 21 10 21C6.22876 21 4.34315 21 3.17157 19.8284C2 18.6569 2 16.7712 2 13V11C2 7.22876 2 5.34315 3.17157 4.17157C4.34315 3 6.22876 3 10 3ZM8.03033 6.96967C7.73744 6.67678 7.26256 6.67678 6.96967 6.96967C6.67678 7.26256 6.67678 7.73744 6.96967 8.03033L9.68934 10.75H8.5C8.08579 10.75 7.75 11.0858 7.75 11.5C7.75 11.9142 8.08579 12.25 8.5 12.25H11.5C11.9142 12.25 12.25 11.9142 12.25 11.5V8.5C12.25 8.08579 11.9142 7.75 11.5 7.75C11.0858 7.75 10.75 8.08579 10.75 8.5V9.68934L8.03033 6.96967Z" fill="#1C274C" />
<path d="M13 17C13 15.1144 13 14.1716 13.5858 13.5858C14.1716 13 15.1144 13 17 13H18C19.8856 13 20.8284 13 21.4142 13.5858C22 14.1716 22 15.1144 22 17C22 18.8856 22 19.8284 21.4142 20.4142C20.8284 21 19.8856 21 18 21H17C15.1144 21 14.1716 21 13.5858 20.4142C13 19.8284 13 18.8856 13 17Z" fill="currentColor" />
<path fillRule="evenodd" clipRule="evenodd" d="M10 3H14C17.7712 3 19.6569 3 20.8284 4.17157C21.7775 5.1206 21.9577 6.86626 21.992 9.49974C22.0042 10.4366 22.0102 10.905 21.7166 11.2025C21.4229 11.5 20.9486 11.5 20 11.5H17.5C14.6716 11.5 13.2574 11.5 12.3787 12.3787C11.5 13.2574 11.5 14.6716 11.5 17.5V19.5C11.5 19.9659 11.5 20.1989 11.4239 20.3827C11.3224 20.6277 11.1277 20.8224 10.8827 20.9239C10.6989 21 10.4659 21 10 21C6.22876 21 4.34315 21 3.17157 19.8284C2 18.6569 2 16.7712 2 13V11C2 7.22876 2 5.34315 3.17157 4.17157C4.34315 3 6.22876 3 10 3ZM8.03033 6.96967C7.73744 6.67678 7.26256 6.67678 6.96967 6.96967C6.67678 7.26256 6.67678 7.73744 6.96967 8.03033L9.68934 10.75H8.5C8.08579 10.75 7.75 11.0858 7.75 11.5C7.75 11.9142 8.08579 12.25 8.5 12.25H11.5C11.9142 12.25 12.25 11.9142 12.25 11.5V8.5C12.25 8.08579 11.9142 7.75 11.5 7.75C11.0858 7.75 10.75 8.08579 10.75 8.5V9.68934L8.03033 6.96967Z" fill="currentColor" />
</g>
</svg>
);
Expand Down
62 changes: 26 additions & 36 deletions client/src/components/icons/VoiceMic.jsx
Original file line number Diff line number Diff line change
@@ -1,53 +1,43 @@
import React from 'react';
import PropTypes from 'prop-types';

export function VoiceMicButton(props) {
export function VoiceMicButtonContent(props) {
if (props.muted) {
return (
<button className="content-pill status-button red" onClick={props.onClick} type="button">
<svg
className="h-8 text-white ml-1"
fill="none"
viewBox="0 0 19 24"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<line x1="1" y1="1" x2="23" y2="23" />
<path d="M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6" />
<path d="M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23" />
<line x1="12" y1="19" x2="12" y2="23" />
<line x1="8" y1="23" x2="16" y2="23" />
</svg>
</button>
<svg
className="icon"
viewBox="0 0 19 24"
width="95%"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<line x1="1" y1="1" x2="23" y2="23" />
<path d="M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6" fill="transparent" />
<path d="M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23" fill="transparent" />
<line x1="12" y1="19" x2="12" y2="23" />
<line x1="8" y1="23" x2="16" y2="23" />
</svg>
);
}

return (
<button
className="content-pill status-button green text-center"
onClick={props.onClick}
type="button"
>
<svg className="h-8 text-gray-900 ml-1" fill="none" viewBox="0 0 19 24" stroke="currentColor">
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"
/>
</svg>
</button>
<svg className="icon" fill="none" viewBox="0 0 19 24" stroke="currentColor">
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"
/>
</svg>
);
}

VoiceMicButton.defaultProps = {
onClick: () => {},
VoiceMicButtonContent.defaultProps = {
muted: false,
};

VoiceMicButton.propTypes = {
onClick: PropTypes.func,
VoiceMicButtonContent.propTypes = {
muted: PropTypes.bool,
};
28 changes: 9 additions & 19 deletions client/src/components/icons/VoicechatDeafenButton.jsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
import React from 'react';
import PropTypes from 'prop-types';

export function VoiceDeafenButton(props) {
export function VoiceDeafenButtonContent(props) {
if (props.deafened) {
return (
<button className="content-pill status-button red ml-2" onClick={props.onClick} type="button">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="2" stroke="currentColor" aria-hidden="true" className="h-8 pl-1 text-white ml-1">
<path strokeLinecap="round" strokeLinejoin="round" d="M17.25 9.75L19.5 12m0 0l2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6l4.72-4.72a.75.75 0 011.28.531V19.94a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.506-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.395C2.806 8.757 3.63 8.25 4.51 8.25H6.75z" />
</svg>
</button>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="2" stroke="currentColor" aria-hidden="true" className="icon">
<path strokeLinecap="round" strokeLinejoin="round" d="M17.25 9.75L19.5 12m0 0l2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6l4.72-4.72a.75.75 0 011.28.531V19.94a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.506-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.395C2.806 8.757 3.63 8.25 4.51 8.25H6.75z" />
</svg>
);
}

return (
<button
className="content-pill status-button green text-center ml-2"
onClick={props.onClick}
type="button"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="2" stroke="currentColor" aria-hidden="true" className="h-8 pl-1 text-gray-900 ml-1">
<path strokeLinecap="round" strokeLinejoin="round" d="M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z" />
</svg>
</button>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="2" stroke="currentColor" aria-hidden="true" className="icon">
<path strokeLinecap="round" strokeLinejoin="round" d="M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z" />
</svg>
);
}

VoiceDeafenButton.defaultProps = {
onClick: () => {},
VoiceDeafenButtonContent.defaultProps = {
deafened: false,
};

VoiceDeafenButton.propTypes = {
onClick: PropTypes.func,
VoiceDeafenButtonContent.propTypes = {
deafened: PropTypes.bool,
};
6 changes: 3 additions & 3 deletions client/src/components/tabwindow/TabWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TabWindow extends Component {
<nav className="navbar-bg shadow-lg flex items-center p-2 md:hidden">
<div className="flex justify-between items-center w-full">
<div className="flex items-center">
<img src={this.props.settings.logoImage} alt="Logo" className="pl-2 h-8" />
<img src={this.props.logoImage} alt="Logo" className="pl-2 h-8" />
<span className="ml-2 font-semibold text-xl text-gray-300">
{msg('serverName')}
</span>
Expand Down Expand Up @@ -132,7 +132,7 @@ class TabWindow extends Component {
{/* Desktop Navbar */}
<nav className="hidden-on-mobile md:flex navbar-bg shadow-lg flex items-center p-2">
<div className="basis-1/3 flex items-center">
<img src={this.props.settings.logoImage} alt="Logo" className="pl-2 h-8" />
<img src={this.props.logoImage} alt="Logo" className="pl-2 h-8" />
<span className="ml-2 font-semibold text-xl text-gray-300">
{msg('serverName')}
</span>
Expand Down Expand Up @@ -198,7 +198,7 @@ function mapStateToProps(state) {
currentUser: state.currentUser,
navbarDetails: state.navbarDetails,
clickLock: state.clickLock,
settings: state.settings,
logoImage: state.settings.logoImage,
};
}

Expand Down
Loading

0 comments on commit 6d816f0

Please sign in to comment.