-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from chiefeu/2d-frontview-stage-map
display map type and name based from url params
- Loading branch information
Showing
8 changed files
with
184 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,93 @@ | ||
import React from "react"; | ||
import styles from './Agent.module.css'; | ||
|
||
const AgentSprite: React.FC<{ agentName: string, isTalking: boolean, isThinking: boolean, status: string }> = ({ agentName, isTalking, isThinking, status }) => { | ||
const AgentSprite: React.FC<{ agentName: string, isTalking: boolean, isThinking: boolean, status: string, map: string }> = ({ agentName, isTalking, isThinking, status, map }) => { | ||
let agentImage = `${process.env.NEXT_PUBLIC_BASE_PATH}/images/characters/${agentName}.png`; | ||
console.log("AgentSpriteeee status = ", status); | ||
|
||
// Check if agentName matches "Zombie" using regex | ||
if (/Zombie/.test(agentName)) { | ||
agentImage = `${process.env.NEXT_PUBLIC_BASE_PATH}/images/characters/Zombie_1.png`; | ||
} | ||
return ( | ||
<div className={styles.agent}> | ||
<div> | ||
<img | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/ChatCircleDots-R.png`} | ||
alt="Talking" | ||
className={`${styles.leftChatIcon} ${isTalking ? '' : styles.hidden}`} | ||
width={32} | ||
height={32} | ||
/> | ||
{isThinking && ( | ||
|
||
if (map == "stage") { | ||
return ( | ||
<div className={styles.agent}> | ||
<div> | ||
<img | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/lightbulb.gif`} | ||
alt="Thinking" | ||
className={styles.thoughtBubbleIcon} | ||
width={16} | ||
height={16} | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/ChatCircleDots-R.png`} | ||
alt="Talking" | ||
className={`${styles.stageLeftChatIcon} ${isTalking ? '' : styles.hidden}`} | ||
width={90} | ||
height={90} | ||
/> | ||
)} | ||
{status == "dead" && ( | ||
{isThinking && ( | ||
<img | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/lightbulb.gif`} | ||
alt="Thinking" | ||
className={styles.stageThoughtBubbleIcon} | ||
width={75} | ||
height={75} | ||
/> | ||
)} | ||
{status == "dead" && ( | ||
<img | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/dead.png`} | ||
alt="Dead" | ||
className={styles.stageDeadIcon} | ||
width={75} | ||
height={75} | ||
/> | ||
)} | ||
</div> | ||
<img | ||
src={agentImage} | ||
alt={agentName} | ||
width={150} | ||
height={150} | ||
/> | ||
</div> | ||
); | ||
} | ||
else { | ||
return ( | ||
<div className={styles.agent}> | ||
<div> | ||
<img | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/dead.png`} | ||
alt="Dead" | ||
className={styles.deadIcon} | ||
width={16} | ||
height={16} | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/ChatCircleDots-R.png`} | ||
alt="Talking" | ||
className={`${styles.leftChatIcon} ${isTalking ? '' : styles.hidden}`} | ||
width={32} | ||
height={32} | ||
/> | ||
)} | ||
{isThinking && ( | ||
<img | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/lightbulb.gif`} | ||
alt="Thinking" | ||
className={styles.thoughtBubbleIcon} | ||
width={16} | ||
height={16} | ||
/> | ||
)} | ||
{status == "dead" && ( | ||
<img | ||
src={`${process.env.NEXT_PUBLIC_BASE_PATH}/images/icons/dead.png`} | ||
alt="Dead" | ||
className={styles.deadIcon} | ||
width={16} | ||
height={16} | ||
/> | ||
)} | ||
</div> | ||
<img | ||
src={agentImage} | ||
alt={agentName} | ||
width={32} | ||
height={32} | ||
/> | ||
</div> | ||
<img | ||
src={agentImage} | ||
alt={agentName} | ||
width={32} | ||
height={32} | ||
/> | ||
</div> | ||
); | ||
); | ||
} | ||
}; | ||
|
||
export default AgentSprite; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters