From f65c71619e0e7008a39258cbc886a7c6c7e580c3 Mon Sep 17 00:00:00 2001 From: Marces Zastrow Date: Fri, 17 Jan 2025 08:31:27 +0100 Subject: [PATCH] + --- backend/database.db | Bin 21491712 -> 21491712 bytes frontend/src/pages/gameMasterPage.jsx | 98 +++++++++++++++----------- 2 files changed, 57 insertions(+), 41 deletions(-) diff --git a/backend/database.db b/backend/database.db index 71c46baa609d543f5bbf451f1d32b25f30377bdd..e5224fba8d556956b51ed45e91edbde20b6369e0 100644 GIT binary patch delta 1410 zcmZ|LXK+i4b8^em@e`_Zvm3T+SXrEzljN3cOfnCYY|IRbcRnwfJtU_zY1zCy zZPFyoNpm_E7p65+ru3}r*S~U7?UB z`rkmWNk`0>GWCBG&FUICHSsk=TgD3iY_VwVg6`!tgVTurYhIAn&C{B>Vv0GKi+NZN z>tj9^U?DcZB5a7oSb`ZW#WHM!<=7aT;3n7?1%kv01m`KxD^h@AvhF=;c%?R5jYY@ z;b`0%$KY7p2Dim=I3Bmd3AjB@#2s)F?ua|#&bSNiio41=zJM>{OZYOrg0JFh_&UCUZ{l0{ zHok-J;yQc}-^UN|L;MIo#!v85{0!IQ=lBJFiC^K@_zixG-{A)Q9)G|e@hAKlH{vh& zEB=PR&oiBG8gfEz$P4vC{g59DLSbkSibBIs97;kal!mgzG!4x{^RQ`X z5jG1gL#xm_RD?F6ZD<$Ths{HW&@prhokN$*SO|&jcf1S)kRc?kev}Ck+L#M@{v%VItfW+W@MZZ znOPahUKuHy?8x?ey?*b%zTemPH-Gz@y!pYhk`;+W<9Ufhadje*(K?Yxv|HA#Pn#8q zs=2cY3pOWmQ#HwSR(eZ%ZBc#U&Z0&6D|1(;YU)dhw`SK*$QhrRxu7bQQ@<)dD_OU$ zup+-Qy(ihCX=!P4VM$$Ws;q8a&c^&1)8|Z|HoJWC*eR3iX69C;vh%XzO(Idhqp(Bo z>|KfU?)0wulJafoWwqIZ(j`Na=|rm-kIP7A zR2HV{mM`tTKulr=Ho#2G!fedJ6y{w@hF^%N8>SgEFOo`@OV4{PsHhX5}u4R@D!Yhr{ZZi3s1+{I0w(bGx01u8_&VH zcrKoY=i>!959i~BxBxH0g?KT7m*6726c^)VcsX8yOK>TQ%Wyf?;gz@oufmmhHC}_) z;wrojSL5}#25-O{aV_42H{&gME8d2;<2t+p@5HZv(P-W2xXyVXcbzAHlaMU4edhv&>?gTokB(E94bSX&^2@m-9uIA5qgGR vp?ByL`i6d?e;5!3hCyL)7!rntVPSX}5k`hlVRWbtW5U=_lU(n( { const pcsResponse = await axios.get(`http://localhost:5000/games/${gameId}/playerchars`); const processedPCs = Array.isArray(pcsResponse.data) ? pcsResponse.data : [pcsResponse.data]; setPlayerCharacters(processedPCs.filter(pc => pc !== null)); - + // Fetch NPCs with different structure const npcsResponse = await axios.get(`http://localhost:5000/games/${gameId}/npcs`); const processedNPCs = Array.isArray(npcsResponse.data) ? npcsResponse.data : [npcsResponse.data]; setNpcs(processedNPCs.filter(npc => npc !== null)); - + // Fetch Items const itemsResponse = await axios.get(`http://localhost:5000/games/${gameId}/items`); const processedItems = Array.isArray(itemsResponse.data) ? itemsResponse.data : [itemsResponse.data]; @@ -37,19 +37,20 @@ const GameMasterPage = () => { console.error('Error fetching data:', error); } }; - + fetchData(); const interval = setInterval(fetchData, 5000); return () => clearInterval(interval); }, [gameId]); const Section = ({ title, items, createPath, createText }) => ( - {title} @@ -69,8 +70,8 @@ const GameMasterPage = () => { {items.map((item, index) => ( - { image={item.Img || defaultItemImage} alt={item.ItemName} className={`rarity-${item.Rarity} rarity-image`} - sx={{ + sx={{ objectFit: 'contain', width: '128px' }} /> - @@ -120,33 +121,34 @@ const GameMasterPage = () => { return ( // Update main container Box styling - Game Master Dashboard {/* Player Characters Section */} - Player Characters {playerCharacters.map((character, index) => ( - { height="140" image={character.Img || defaultCharacterImage} alt={character.CharName} - sx={{ + sx={{ objectFit: 'contain', width: '140px', borderRadius: '3px' @@ -187,12 +189,13 @@ const GameMasterPage = () => { {/* NPCs Section */} - NPCs @@ -212,8 +215,8 @@ const GameMasterPage = () => { {npcs.map((npc, index) => ( - { height="140" image={npc.Img || defaultCharacterImage} alt={npc.CharName} - sx={{ + sx={{ objectFit: 'contain', width: '140px', borderRadius: '3px' @@ -238,13 +241,26 @@ const GameMasterPage = () => { - {npc.CharName} + {npc.Name} - {npc.Race} + {npc.Race} - Level {npc.Level} - {npc.Job} + Job: {npc.Job} + + + Status: {npc.Allied === 0 + ? 'Allied' + : npc.Allied === 1 + ? 'Neutral' + : 'Enemy'}