Skip to content

Commit

Permalink
Merge branch 'main' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSammyM committed Oct 17, 2024
2 parents 2d98728 + c413553 commit 9ffac05
Show file tree
Hide file tree
Showing 29 changed files with 188 additions and 188 deletions.
14 changes: 7 additions & 7 deletions client/src/components/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function NormalChatMessage(props: Readonly<{
let messageSender = "";
if (props.message.variant.messageSender.type === "player" || props.message.variant.messageSender.type === "livingToDead") {
messageSender = props.playerNames[props.message.variant.messageSender.player];
}else if(props.message.variant.messageSender.type === "jailor" || props.message.variant.messageSender.type === "journalist"){
}else if(props.message.variant.messageSender.type === "jailor" || props.message.variant.messageSender.type === "reporter"){
messageSender = translate("role."+props.message.variant.messageSender.type+".name");
}

Expand Down Expand Up @@ -456,9 +456,9 @@ export function translateChatMessage(message: ChatMessageVariant, playerNames?:
return translate("chatMessage.martyrRevealed",
playerNames[message.martyr],
);
case "journalistJournal":
return translate("chatMessage.journalistJournal",
sanitizePlayerMessage(replaceMentions(message.journal, playerNames))
case "reporterReport":
return translate("chatMessage.reporterReport",
sanitizePlayerMessage(replaceMentions(message.report, playerNames))
);
case "youAreInterviewingPlayer":
return translate("chatMessage.youAreInterviewingPlayer",
Expand Down Expand Up @@ -793,8 +793,8 @@ export type ChatMessageVariant = {
} | {
type: "mayorCantWhisper"
} | {
type: "journalistJournal",
journal: string
type: "reporterReport",
report: string
} | {
type: "youAreInterviewingPlayer",
playerIndex: PlayerIndex
Expand Down Expand Up @@ -1021,5 +1021,5 @@ export type MessageSender = {
type: "livingToDead",
player: PlayerIndex,
} | {
type: "jailor" | "journalist"
type: "jailor" | "reporter"
}
12 changes: 6 additions & 6 deletions client/src/components/RoleSpecific.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import LargeAuditorMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/L
import LargeHypnotistMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/LargeHypnotistMenu";
import LargeDoomsayerMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/LargeDoomsayerMenu";
import LargeForgerMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/LargeForgerMenu";
import LargeJournalistMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/LargeJournalistMenu";
import LargeReporterMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/LargeReporterMenu";
import StyledText from "./StyledText";
import translate from "../game/lang";
import GAME_MANAGER from "..";
Expand All @@ -21,7 +21,7 @@ import RetrainerMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/Retr
import { useGameState, usePlayerState } from "./useHooks";
import RecruiterMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/RecruiterMenu";
import StewardMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/StewardMenu";
import ImposterMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/ImposterMenu";
import ImpostorMenu from "../menu/game/gameScreenContent/RoleSpecificMenus/ImpostorMenu";

export default function RoleSpecificSection(){
const phaseState = useGameState(
Expand All @@ -42,8 +42,8 @@ export default function RoleSpecificSection(){
switch(roleState.type){
case "auditor":
return <LargeAuditorMenu/>;
case "journalist":
return <LargeJournalistMenu/>;
case "reporter":
return <LargeReporterMenu/>;
case "hypnotist":
return <LargeHypnotistMenu/>;
case "forger":
Expand All @@ -54,8 +54,8 @@ export default function RoleSpecificSection(){
return <LargeKiraMenu/>;
case "retrainer":
return <RetrainerMenu/>
case "imposter":
return <ImposterMenu/>
case "impostor":
return <ImpostorMenu/>
case "jailor":
return <JailorRoleSpecificMenu roleState={roleState}/>;
case "kidnapper":
Expand Down
4 changes: 2 additions & 2 deletions client/src/game/gameManager.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export type GameManager = {
]): void;
sendSetKiraGuess(guesses: Record<PlayerIndex, KiraGuess>): void;
sendSetWildcardRoleOutline(roleOutline: Role): void;
sendSetJournalistJournal(journal: string): void;
sendSetJournalistJournalPublic(isPublic: boolean): void;
sendSetReporterReport(report: string): void;
sendSetReporterReportPublic(isPublic: boolean): void;
sendSetConsortOptions(
roleblock: boolean,
youWereRoleblockedMessage: boolean,
Expand Down
10 changes: 5 additions & 5 deletions client/src/game/gameManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,15 @@ export function createGameManager(): GameManager {
role: role
});
},
sendSetJournalistJournal(journal: string) {
sendSetReporterReport(report: string) {
this.server.sendPacket({
type: "setJournalistJournal",
journal: journal,
type: "setReporterReport",
report: report,
});
},
sendSetJournalistJournalPublic(isPublic: boolean) {
sendSetReporterReportPublic(isPublic: boolean) {
this.server.sendPacket({
type: "setJournalistJournalPublic",
type: "setReporterReportPublic",
public: isPublic,
});
},
Expand Down
6 changes: 3 additions & 3 deletions client/src/game/packet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ export type ToServerPacket = {
type: "setWildcardRole",
role: Role
} | {
type: "setJournalistJournal",
journal: string
type: "setReporterReport",
report: string
} | {
type: "setJournalistJournalPublic",
type: "setReporterReportPublic",
public: boolean
} | {
type: "setConsortOptions",
Expand Down
6 changes: 3 additions & 3 deletions client/src/game/roleState.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export type RoleState = {
} | {
type: "retributionist"
} | {
type: "journalist",
type: "reporter",
public: boolean,
journal: string,
report: string,
interviewedTarget: PlayerIndex | null
} | {
type: "godfather"
Expand All @@ -99,7 +99,7 @@ export type RoleState = {
backup: PlayerIndex | null,
retrainsRemaining: number
} | {
type: "imposter"
type: "impostor"
backup: PlayerIndex | null,
fakeRole: Role
} | {
Expand Down
2 changes: 1 addition & 1 deletion client/src/menu/game/gameScreenContent/PlayerListMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function useDayTargetedPlayers(): PlayerIndex[] {
case "medium":
if (roleState.seancedTarget !== null) return [roleState.seancedTarget]
break;
case "journalist":
case "reporter":
if (roleState.interviewedTarget !== null) return [roleState.interviewedTarget]
break;
case "marksman":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { Role, roleJsonData } from "../../../../game/roleState.d";
import GAME_MANAGER from "../../../..";
import { usePlayerState } from "../../../../components/useHooks";

export default function ImposterMenu(): ReactElement {
export default function ImpostorMenu(): ReactElement {

const savedFakeRole = usePlayerState<Role | null>(
(playerState, gameState) => {
if(playerState.roleState.type === "imposter"){
if(playerState.roleState.type === "impostor"){
return playerState.roleState.fakeRole;
}
return null
Expand All @@ -34,7 +34,7 @@ export default function ImposterMenu(): ReactElement {

return <>
{alive && <>
<StyledText>{translate("role.imposter.roleMenu")}</StyledText>
<StyledText>{translate("role.impostor.roleMenu")}</StyledText>
<RoleDropdown
value={savedFakeRole??"jester"}
enabledRoles={allChoosableRoles}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const DOOMSAYER_GUESSES = [
"jailor", "villager",
"doctor", "bodyguard", "cop", "bouncer", "engineer", "armorsmith", "steward",
"vigilante", "veteran", "marksman", "deputy", "rabblerouser",
"escort", "medium", "retributionist", "journalist", "mayor", "transporter",
"escort", "medium", "retributionist", "reporter", "mayor", "transporter",
];

export type DoomsayerGuess = typeof DOOMSAYER_GUESSES[number];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const KIRA_GUESSES = [
"detective", "lookout", "spy", "tracker", "philosopher", "psychic", "auditor", "snoop", "gossip", "tallyClerk",
"doctor", "bodyguard", "cop", "bouncer", "engineer", "armorsmith", "steward",
"vigilante", "veteran", "marksman", "deputy", "rabblerouser",
"escort", "medium", "retributionist", "journalist", "mayor", "transporter", "warper",
"escort", "medium", "retributionist", "reporter", "mayor", "transporter", "warper",
];

export type KiraGuess = typeof KIRA_GUESSES[number];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import React from "react"
import GAME_MANAGER from "../../../.."
import translate from "../../../../game/lang"
import "./largeJournalistMenu.css"
import "./largeReporterMenu.css"
import { Button } from "../../../../components/Button"
import Icon from "../../../../components/Icon"

type LargeJournalistMenuProps = {
type LargeReporterMenuProps = {
}
type LargeJournalistMenuState = {
type LargeReporterMenuState = {
syncedPublic: boolean,
localJournal: string,
syncedJournal: string,
localReport: string,
syncedReport: string,
}
export default class LargeJournalistMenu extends React.Component<LargeJournalistMenuProps, LargeJournalistMenuState> {
export default class LargeReporterMenu extends React.Component<LargeReporterMenuProps, LargeReporterMenuState> {
listener: () => void;
constructor(props: LargeJournalistMenuState) {
constructor(props: LargeReporterMenuState) {
super(props);

if(
GAME_MANAGER.state.stateType === "game" &&
GAME_MANAGER.state.clientState.type === "player" &&
GAME_MANAGER.state.clientState.roleState?.type === "journalist"
GAME_MANAGER.state.clientState.roleState?.type === "reporter"
)
this.state = {
syncedPublic: GAME_MANAGER.state.clientState.roleState?.public,
localJournal: GAME_MANAGER.state.clientState.roleState?.journal,
syncedJournal: GAME_MANAGER.state.clientState.roleState?.journal,
localReport: GAME_MANAGER.state.clientState.roleState?.report,
syncedReport: GAME_MANAGER.state.clientState.roleState?.report,
};
this.listener = ()=>{
if(
GAME_MANAGER.state.stateType === "game" &&
GAME_MANAGER.state.clientState.type === "player" &&
GAME_MANAGER.state.clientState.roleState?.type === "journalist"
GAME_MANAGER.state.clientState.roleState?.type === "reporter"
){
this.setState({
syncedJournal: GAME_MANAGER.state.clientState.roleState.journal,
syncedReport: GAME_MANAGER.state.clientState.roleState.report,
syncedPublic: GAME_MANAGER.state.clientState.roleState.public,
})
}
Expand All @@ -47,26 +47,26 @@ export default class LargeJournalistMenu extends React.Component<LargeJournalist
GAME_MANAGER.removeStateListener(this.listener);
}
handlePublicToggle(){
GAME_MANAGER.sendSetJournalistJournalPublic(
GAME_MANAGER.sendSetReporterReportPublic(
!this.state.syncedPublic
);
}
handleSave(){
GAME_MANAGER.sendSetJournalistJournal(
this.state.localJournal,
GAME_MANAGER.sendSetReporterReport(
this.state.localReport,
);
}
handleSend(){
GAME_MANAGER.sendSendMessagePacket('\n' + this.state.syncedJournal);
GAME_MANAGER.sendSendMessagePacket('\n' + this.state.syncedReport);
}

render(){
return <div className="large-journalist-menu">
return <div className="large-reporter-menu">
<div>
{translate("role.journalist.menu.journal")}
{translate("role.reporter.menu.report")}
<div>
<Button
highlighted={this.state.syncedJournal !== this.state.localJournal}
highlighted={this.state.syncedReport !== this.state.localReport}
onClick={() => {
this.handleSave();
return true;
Expand All @@ -87,15 +87,15 @@ export default class LargeJournalistMenu extends React.Component<LargeJournalist
</div>
</div>
<div>
{translate("role.journalist.menu.public")}
{translate("role.reporter.menu.public")}
<label onClick={()=>this.handlePublicToggle()}>
<Icon>{this.state.syncedPublic ? "check" : "close"}</Icon>
</label>
</div>
<textarea
value={this.state.localJournal}
value={this.state.localReport}
onChange={(e) => {
this.setState({ localJournal: e.target.value });
this.setState({ localReport: e.target.value });
}}
onKeyDown={(e) => {
if (e.ctrlKey) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
.large-journalist-menu {
.large-reporter-menu {
padding-top: .2rem;
}
.large-journalist-menu textarea {
.large-reporter-menu textarea {
text-align: left;
height: 19em;
resize: none;
width: 100%;
margin: 0;
}
.large-journalist-menu div {
.large-reporter-menu div {
margin: .2rem;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.large-journalist-menu label {
.large-reporter-menu label {
display: inline-block;
height: 100%;
padding: .2rem;
Expand Down
Loading

0 comments on commit 9ffac05

Please sign in to comment.