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

Add checkbox to toggle infamous round-thingy #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 public/panel.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
"label": "Display settings",
"name":"display_settings",
"inputs": [
{
"type": "checkbox",
"name": "round_thingy_toggle",
"label": "Disable Round Thingy"
},
{
"type": "text",
"name": "left_title",
Expand Down
20 changes: 18 additions & 2 deletions src/HUD/MatchBar/TeamScore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import WinIndicator from "./WinIndicator";
import { Timer } from "./MatchBar";
import TeamLogo from './TeamLogo';
import PlantDefuse from "../Timers/PlantDefuse"
import { configs } from "../../App"

interface IProps {
team: I.Team;
Expand All @@ -12,15 +13,30 @@ interface IProps {
showWin: boolean;
}

export default class TeamScore extends React.Component<IProps> {
export default class TeamScore extends React.Component<IProps, {roundThingyToggle: boolean}> {
constructor(props: any){
super(props);
this.state = {
roundThingyToggle: false
}
}

componentDidMount(){
configs.onChange((data:any) =>{
if(!data) return;
const toggle = data.display_settings.round_thingy_toggle
this.setState({roundThingyToggle: toggle})
})
}
render() {
const { orientation, timer, team, showWin } = this.props;
const { roundThingyToggle } = this.state;
return (
<>
<div className={`team ${orientation} ${team.side}`}>
<div className="team-name">{team.name}</div>
<TeamLogo team={team} />
<div className="round-thingy"><div className="inner"></div></div>
<div className={`round-thingy ${roundThingyToggle ? 'PepeHands' : ''}`}><div className="inner"></div></div>
</div>
<PlantDefuse timer={timer} side={orientation} />
<WinIndicator team={team} show={showWin}/>
Expand Down
3 changes: 3 additions & 0 deletions src/HUD/MatchBar/matchbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@
align-items: center;
justify-content: center;
border-radius: 50%;
&.PepeHands{
opacity: 0;
}
.inner {
width: 35px;
height: 35px;
Expand Down