diff --git a/docs/spec/CodeCharacter-API.yml b/docs/spec/CodeCharacter-API.yml index ed33ccf..830e3a6 100644 --- a/docs/spec/CodeCharacter-API.yml +++ b/docs/spec/CodeCharacter-API.yml @@ -446,6 +446,11 @@ paths: in: query name: size description: Size of the page + - schema: + $ref: '#/components/schemas/TierType' + in: query + name: tier + description: Leaderboard Tier description: Get PvP leaderboard parameters: [] @@ -1659,23 +1664,31 @@ paths: components: schemas: UserMatchStats: - title: UserMatchStats + title: UserMatchStat + type: array + description: User Match Stats array model + items: + anyOf: + - $ref: '#/components/schemas/UserMatchStat' + required: + - stat + + UserMatchStat: + title: UserMatchStat type: object - description: User Match Stats model + description: User Match Stat model properties: avgAtk: type: number - default: 0 dc_wins: type: number - default: 0 coins: type: number - default: 0 required: - avgAtk - dc_wins - coins + PasswordLoginRequest: title: PasswordLoginRequest type: object @@ -2596,6 +2609,7 @@ components: - DAILYCHALLENGE - PVP - SELFPVP + - AUTOPVP description: Match Mode Verdict: type: string diff --git a/packages/client/src/apis/LeaderboardApi.ts b/packages/client/src/apis/LeaderboardApi.ts index 9ea2c4c..2ad6631 100644 --- a/packages/client/src/apis/LeaderboardApi.ts +++ b/packages/client/src/apis/LeaderboardApi.ts @@ -28,6 +28,7 @@ export interface GetLeaderboardRequest { export interface GetPvPLeaderboardRequest { page?: number; size?: number; + tier?: TierType; } /** @@ -68,6 +69,7 @@ export interface LeaderboardApiInterface { * @summary Get PvP leaderboard * @param {number} [page] Index of the page * @param {number} [size] Size of the page + * @param {TierType} [tier] Leaderboard Tier * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LeaderboardApiInterface @@ -84,6 +86,7 @@ export interface LeaderboardApiInterface { getPvPLeaderboard( page?: number, size?: number, + tier?: TierType, initOverrides?: RequestInit | runtime.InitOverrideFunction, ): Promise>; } @@ -175,6 +178,10 @@ export class LeaderboardApi queryParameters['size'] = requestParameters.size; } + if (requestParameters.tier !== undefined) { + queryParameters['tier'] = requestParameters.tier; + } + const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { @@ -205,10 +212,11 @@ export class LeaderboardApi async getPvPLeaderboard( page?: number, size?: number, + tier?: TierType, initOverrides?: RequestInit | runtime.InitOverrideFunction, ): Promise> { const response = await this.getPvPLeaderboardRaw( - { page: page, size: size }, + { page: page, size: size, tier: tier }, initOverrides, ); return await response.value(); diff --git a/packages/client/src/apis/StatsApi.ts b/packages/client/src/apis/StatsApi.ts index 4f15029..814f426 100644 --- a/packages/client/src/apis/StatsApi.ts +++ b/packages/client/src/apis/StatsApi.ts @@ -4,7 +4,7 @@ * CodeCharacter API * Specification of the CodeCharacter API * - * The version of the OpenAPI document: 2023.0.1 + * The version of the OpenAPI document: 2024.0.1 * Contact: delta@nitt.edu * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -13,7 +13,7 @@ */ import * as runtime from '../runtime'; -import type { UserMatchStats } from '../models'; +import type { UserMatchStatsInner } from '../models'; /** * StatsApi - interface @@ -31,7 +31,7 @@ export interface StatsApiInterface { */ getStatsRaw( initOverrides?: RequestInit | runtime.InitOverrideFunction, - ): Promise>>; + ): Promise>>>; /** * Gets all statistics for the current user @@ -39,7 +39,7 @@ export interface StatsApiInterface { */ getStats( initOverrides?: RequestInit | runtime.InitOverrideFunction, - ): Promise>; + ): Promise>>; } /** @@ -52,7 +52,7 @@ export class StatsApi extends runtime.BaseAPI implements StatsApiInterface { */ async getStatsRaw( initOverrides?: RequestInit | runtime.InitOverrideFunction, - ): Promise>> { + ): Promise>>> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -75,7 +75,7 @@ export class StatsApi extends runtime.BaseAPI implements StatsApiInterface { initOverrides, ); - return new runtime.JSONApiResponse(response); + return new runtime.JSONApiResponse(response); } /** @@ -84,7 +84,7 @@ export class StatsApi extends runtime.BaseAPI implements StatsApiInterface { */ async getStats( initOverrides?: RequestInit | runtime.InitOverrideFunction, - ): Promise> { + ): Promise>> { const response = await this.getStatsRaw(initOverrides); return await response.value(); } diff --git a/packages/client/src/models/index.ts b/packages/client/src/models/index.ts index 3fcd30f..0105428 100644 --- a/packages/client/src/models/index.ts +++ b/packages/client/src/models/index.ts @@ -749,6 +749,7 @@ export const MatchMode = { Dailychallenge: 'DAILYCHALLENGE', Pvp: 'PVP', Selfpvp: 'SELFPVP', + Autopvp: 'AUTOPVP', } as const; export type MatchMode = (typeof MatchMode)[keyof typeof MatchMode]; @@ -1376,27 +1377,52 @@ export interface UpdatePasswordRequest { passwordConfirmation: string; } /** - * User Match Stats model + * User Match Stat model * @export - * @interface UserMatchStats + * @interface UserMatchStat */ -export interface UserMatchStats { +export interface UserMatchStat { /** * * @type {number} - * @memberof UserMatchStats + * @memberof UserMatchStat */ avgAtk: number; /** * * @type {number} - * @memberof UserMatchStats + * @memberof UserMatchStat */ dcWins: number; /** * * @type {number} - * @memberof UserMatchStats + * @memberof UserMatchStat + */ + coins: number; +} +/** + * + * @export + * @interface UserMatchStatsInner + */ +export interface UserMatchStatsInner { + /** + * + * @type {number} + * @memberof UserMatchStatsInner + */ + avgAtk: number; + /** + * + * @type {number} + * @memberof UserMatchStatsInner + */ + dcWins: number; + /** + * + * @type {number} + * @memberof UserMatchStatsInner */ coins: number; } diff --git a/packages/renderer/src/RendererComponent.tsx b/packages/renderer/src/RendererComponent.tsx index 4c3fd36..1c52416 100644 --- a/packages/renderer/src/RendererComponent.tsx +++ b/packages/renderer/src/RendererComponent.tsx @@ -19,7 +19,7 @@ import { Renderer } from './Renderer'; const RendererLayer = createComponent(React, 'cc-renderer', Renderer); -const StatsText = () => { +const StatsText = ({ shouldShowStats }: { shouldShowStats: boolean }) => { const [turns, setTurns] = React.useState(0); const [coins, setCoins] = React.useState(0); const [destruction, setDestruction] = React.useState(0); @@ -51,7 +51,7 @@ const StatsText = () => { events.once(RendererEvents.CHANGE_DESTRUCTION, onDestructionUpdated); }, [destruction]); - return ( + return shouldShowStats ? (

{
Destruction : {String(destruction.toFixed(2)).padStart(6, '\xa0')} %

+ ) : ( +

+ Turn : {String(turns).padStart(8, '\xa0')} +
+

); }; -export default function RendererComponent(): JSX.Element { +export default function RendererComponent({ + shouldShowStats, +}: { + shouldShowStats?: boolean; +}): JSX.Element { const [isPaused, setPaused] = React.useState(false); const [isFullscreen, setFullscreen] = React.useState(false); @@ -166,7 +183,7 @@ export default function RendererComponent(): JSX.Element { )} - + diff --git a/public/assets/map-2.json b/public/assets/map-2.json index 4c0cc24..d35316c 100644 --- a/public/assets/map-2.json +++ b/public/assets/map-2.json @@ -10,166 +10,166 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4, 2, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 2, - 2, 2, 2, 2, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 4, 4, 2, - 2, 2, 2, 2, 4, 2, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, 4, 4, 2, 2, 5, 5, 1, - 1, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 5, 1, 1, 5, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 2, -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 2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 1, 1, 5, 5, 4, 4, 4, 4, 4, - 4, 4, 6, 2, 4, 4, 4, 4, 2, 4, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, - 2, 2, 4, 4, 4, 4, 4, 2, 6, 2, 2, 2, 2, 4, 4, 4, 4, 4, 2, 2, 2, 4, 4, 4, + 4, 4, 2, 2, 4, 4, 4, 4, 2, 4, 4, 4, 2, 2, 4, 4, 6, 6, 4, 4, 4, 4, 4, 4, + 2, 2, 4, 4, 4, 4, 4, 2, 6, 6, 2, 2, 2, 4, 4, 4, 4, 4, 2, 2, 2, 4, 4, 4, 4, 4, 2, 2, 2, 2, 5, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, @@ -376,7 +376,7 @@ "nextobjectid": 1, "orientation": "isometric", "renderorder": "right-down", - "tiledversion": "1.9.2", + "tiledversion": "1.10.2", "tileheight": 64, "tilesets": [ { @@ -468,7 +468,7 @@ "margin": 0, "name": "Towers", "spacing": 0, - "tilecount": 2, + "tilecount": 3, "tileheight": 512, "tileoffset": { "x": -192, @@ -499,6 +499,6 @@ ], "tilewidth": 128, "type": "map", - "version": "1.9", + "version": "1.10", "width": 64 } diff --git a/public/assets/tile_e.png b/public/assets/tile_e.png index 1e43285..171f7e4 100644 Binary files a/public/assets/tile_e.png and b/public/assets/tile_e.png differ diff --git a/public/assets/tile_f.png b/public/assets/tile_f.png index 3ccbaa0..8703701 100644 Binary files a/public/assets/tile_f.png and b/public/assets/tile_f.png differ diff --git a/public/assets/tile_metallic.png b/public/assets/tile_metallic.png index 87e54ed..7791b31 100644 Binary files a/public/assets/tile_metallic.png and b/public/assets/tile_metallic.png differ diff --git a/public/assets/tower1.png b/public/assets/tower1.png index 6b620eb..eafd2ee 100644 Binary files a/public/assets/tower1.png and b/public/assets/tower1.png differ diff --git a/public/assets/tower2.png b/public/assets/tower2.png index ffcfca7..15824b9 100644 Binary files a/public/assets/tower2.png and b/public/assets/tower2.png differ diff --git a/public/assets/tower3.png b/public/assets/tower3.png index 0114507..3810fa2 100644 Binary files a/public/assets/tower3.png and b/public/assets/tower3.png differ diff --git a/public/assets/tower3nEW.png b/public/assets/tower3nEW.png new file mode 100644 index 0000000..0114507 Binary files /dev/null and b/public/assets/tower3nEW.png differ diff --git a/src/assets/book (1).png:Zone.Identifier b/src/assets/book (1).png:Zone.Identifier deleted file mode 100644 index 053138f..0000000 --- a/src/assets/book (1).png:Zone.Identifier +++ /dev/null @@ -1,4 +0,0 @@ -[ZoneTransfer] -ZoneId=3 -ReferrerUrl=https://www.flaticon.com/free-icon/book_13637888?term=code+tutorials&page=1&position=1&origin=search&related_id=13637888 -HostUrl=https://www.flaticon.com/download/icon/edited diff --git a/src/assets/codes b/src/assets/codes index 948f577..7856e91 160000 --- a/src/assets/codes +++ b/src/assets/codes @@ -1 +1 @@ -Subproject commit 948f577896b4f4802e9701028032fe2580dcc9e1 +Subproject commit 7856e91953f0d57777353f3162c44993d5803316 diff --git a/src/assets/tutorial.png b/src/assets/tutorial.png index 757b773..2c9b3ce 100644 Binary files a/src/assets/tutorial.png and b/src/assets/tutorial.png differ diff --git a/src/components/Background/BackGroundVideo.module.css b/src/components/Background/BackGroundVideo.module.css index 59e9560..4ad15fb 100644 --- a/src/components/Background/BackGroundVideo.module.css +++ b/src/components/Background/BackGroundVideo.module.css @@ -4,4 +4,5 @@ width: 100vw; object-fit: cover; position: fixed; + top: 0; } diff --git a/src/components/BattleTV/BattleTV.tsx b/src/components/BattleTV/BattleTV.tsx index 58b36b3..6d4237b 100644 --- a/src/components/BattleTV/BattleTV.tsx +++ b/src/components/BattleTV/BattleTV.tsx @@ -32,7 +32,7 @@ import { useTour } from '@reactour/tour'; import { apiConfig } from '../../api/ApiConfig'; import codecharacterIcon from '../../../public/assets/codechar_favicon.png'; import { Button, ButtonGroup } from 'react-bootstrap'; -import { GameType } from '../../store/editor/code'; +import { GameType, changeEditorGameType } from '../../store/editor/code'; interface MatchType { Match: Match; @@ -161,6 +161,13 @@ function PaginatedItems({ battleTvType }: { battleTvType: BattleType }) {
{ + dispatch( + changeEditorGameType( + battleTvType === BattleType.PVP + ? GameType.PVP + : GameType.NORMAL, + ), + ); dispatch( getLogAction({ //needs to be changed @@ -194,9 +201,11 @@ function PaginatedItems({ battleTvType }: { battleTvType: BattleType }) { {'games' in match && ( - {[...match.games.values()][ - [...match.games.values()].length === 1 ? 0 : 1 - ].destruction.toFixed(2)} + { + [...match.games.values()][ + [...match.games.values()].length === 1 ? 0 : 1 + ].coinsUsed + } )} diff --git a/src/components/Editor/Editor.tsx b/src/components/Editor/Editor.tsx index e446088..6c41b9a 100644 --- a/src/components/Editor/Editor.tsx +++ b/src/components/Editor/Editor.tsx @@ -28,6 +28,8 @@ import { import { GameType, + GameTypeAndLanguage, + updateEditorCodeState, updateUserCode, UpdateUserCodeRequestObject, UserCode, @@ -188,14 +190,14 @@ export default function CodeEditor(props: Editor.Props): JSX.Element { if (props.page == 'Dashboard' || props.page == 'Tutorials') { editor.addCommand( monaco.KeyMod.CtrlCmd | monaco.KeyMod.Alt | monaco.KeyCode.KeyN, - function () { - if (GameType.NORMAL) { + () => { + if (props.gameType === GameType.NORMAL) { dispatch(isSelfMatchModalOpened(true)); dispatch(codeCommitNameChanged('Current Code')); dispatch(codeCommitIDChanged(null)); dispatch(mapCommitNameChanged('Current Map')); dispatch(mapCommitIDChanged(null)); - } else if (GameType.PVP) { + } else if (props.gameType === GameType.PVP) { dispatch(isPvPSelfMatchModalOpened(true)); dispatch(code1CommitNameChanged('Current Code')); dispatch(code1CommitIDChanged(null)); @@ -219,6 +221,17 @@ export default function CodeEditor(props: Editor.Props): JSX.Element { }, ); + //Keybinding for GameMode Change -> CTRL+M + editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyM, () => { + const newGameType = + props.gameType == GameType.NORMAL ? GameType.PVP : GameType.NORMAL; + const gameTypeAndLanguage: GameTypeAndLanguage = { + gameType: newGameType, + language: language, + }; + dispatch(updateEditorCodeState(gameTypeAndLanguage)); + }); + return editor; }; diff --git a/src/components/EditorInfo/data.ts b/src/components/EditorInfo/data.ts index f2fee0e..757f607 100644 --- a/src/components/EditorInfo/data.ts +++ b/src/components/EditorInfo/data.ts @@ -3,6 +3,5 @@ export const shortcuts = [ { key: 'Ctrl + ALT + N', description: 'Simulate' }, { key: 'Ctrl + K', description: 'Commit' }, { key: 'Ctrl + Shift + S', description: 'Submit' }, - { key: 'Ctrl + Z', description: 'Undo' }, - { key: 'Ctrl + Y', description: 'Redo' }, + { key: 'Ctrl + M', description: 'Change Mode' }, ]; diff --git a/src/components/Home/Footer/Footer.tsx b/src/components/Home/Footer/Footer.tsx index 8c6d93b..b7e38b6 100644 --- a/src/components/Home/Footer/Footer.tsx +++ b/src/components/Home/Footer/Footer.tsx @@ -25,13 +25,13 @@ export default function Footer(): JSX.Element {
Contact
- Ezhil: +91 6381553859 + Shubham: +91 9790959370
- Ram Ganesh: +91 9025517379 + Bhoopesh: +91 9962099029
- Vignesh: +91 6381196740 + Raghavan: +91 9940107606
@@ -43,7 +43,7 @@ export default function Footer(): JSX.Element {
(undefined); + const dispatch = useAppDispatch(); const handleClose = () => setShow(false); const handleShow = (username: string) => { @@ -55,7 +57,7 @@ function PaginatedItems(props: LeaderboardType.Props) { switch (props.page) { case 'PvP': useEffect(() => { - fetchPvPLeaderboard(page); + fetchPvPLeaderboard(page, activeTier); }, [page]); useEffect(() => { checkPvPEmpty(); @@ -124,10 +126,10 @@ function PaginatedItems(props: LeaderboardType.Props) { }); }; - const fetchPvPLeaderboard = (pageNum: number) => { + const fetchPvPLeaderboard = (pageNum: number, tier?: TierType) => { setIsPvPLoaded(false); leaderboardAPI - .getPvPLeaderboard(pageNum, itemsPerPage) + .getPvPLeaderboard(pageNum, itemsPerPage, tier) .then(response => { setPvpItems(response); setIsPvPLoaded(true); @@ -136,7 +138,7 @@ function PaginatedItems(props: LeaderboardType.Props) { if (error instanceof ApiError) Toast.error(error.message); }); leaderboardAPI - .getPvPLeaderboard(pageNum + 1, itemsPerPage) + .getPvPLeaderboard(pageNum + 1, itemsPerPage, tier) .then(response => { setPvpNextItems(response); setIsPvPLoaded(true); @@ -179,6 +181,7 @@ function PaginatedItems(props: LeaderboardType.Props) { .catch(error => { if (error instanceof ApiError) Toast.error(error.message); }); + dispatch(changeEditorGameType(GameType.NORMAL)); setShow(false); } async function handlePvPMatchStart() { @@ -193,6 +196,7 @@ function PaginatedItems(props: LeaderboardType.Props) { .catch(error => { if (error instanceof ApiError) Toast.error(error.message); }); + dispatch(changeEditorGameType(GameType.PVP)); setShow(false); } return ( @@ -465,7 +469,11 @@ function PaginatedItems(props: LeaderboardType.Props) { type="button" className={styles.button} onClick={() => { - if (!checkEmpty()) { + if (props.page == 'Normal' && !checkEmpty()) { + setPage(prevPage => prevPage + 1); + } else if (props.page == 'PvP' && !checkPvPEmpty()) { + setPage(prevPage => prevPage + 1); + } else if (props.page == 'DailyChallenge' && !checkDcEmpty()) { setPage(prevPage => prevPage + 1); } else { Toast("You're at the last page"); @@ -481,16 +489,18 @@ function PaginatedItems(props: LeaderboardType.Props) { if (props.page == 'Normal') { fetchLeaderboardByTier(0, activeTier); setPage(0); - } else { - fetchPvPLeaderboard(0); + } else if (props.page == 'PvP') { + fetchPvPLeaderboard(0, activeTier); setPage(0); + } else if (props.page == 'DailyChallenge') { + fetchDcLeaderboard(0); } }} id="refresh" > Refresh - {props.page == 'Normal' ? ( + {props.page != 'DailyChallenge' ? ( {activeTier?.toString() || 'All Tiers'} @@ -501,7 +511,9 @@ function PaginatedItems(props: LeaderboardType.Props) { className={styles.menuText} onClick={() => { setActiveTier(undefined); - fetchLeaderboardByTier(0); + props.page == 'Normal' + ? fetchLeaderboardByTier(0) + : fetchPvPLeaderboard(0); setPage(0); }} > @@ -511,7 +523,9 @@ function PaginatedItems(props: LeaderboardType.Props) { className={styles.menuText} onClick={() => { setActiveTier(TierType.Tier1); - fetchLeaderboardByTier(0, TierType.Tier1); + props.page == 'Normal' + ? fetchLeaderboardByTier(0, TierType.Tier1) + : fetchPvPLeaderboard(0, TierType.Tier1); setPage(0); }} > @@ -521,7 +535,9 @@ function PaginatedItems(props: LeaderboardType.Props) { className={styles.menuText} onClick={() => { setActiveTier(TierType.Tier2); - fetchLeaderboardByTier(0, TierType.Tier2); + props.page == 'Normal' + ? fetchLeaderboardByTier(0, TierType.Tier2) + : fetchPvPLeaderboard(0, TierType.Tier2); setPage(0); }} > diff --git a/src/components/MapDesigner/MapDesigner.tsx b/src/components/MapDesigner/MapDesigner.tsx index 4901e0d..5665a91 100644 --- a/src/components/MapDesigner/MapDesigner.tsx +++ b/src/components/MapDesigner/MapDesigner.tsx @@ -203,8 +203,10 @@ export default function MapDesigner(props: MapDesignerProps): JSX.Element { useEffect(() => { MapDesignerUtils.setLocalStorageKey( - props.pageType == 'MapDesigner' || props.pageType == 'Tutorials' + props.pageType == 'MapDesigner' ? 'cc-map-designer-map' + : props.pageType == 'Tutorials' + ? 'tc-map-designer-map' : 'dc-map-designer-map', ); }, [props.pageType]); @@ -241,11 +243,15 @@ export default function MapDesigner(props: MapDesignerProps): JSX.Element { - -

- SAVE : Save map only. -

-
+ {props.pageType == 'MapDesigner' ? ( + +

+ SAVE : Save map only. +

+
+ ) : ( + <> + )}

SUBMIT :{' '} @@ -266,16 +272,21 @@ export default function MapDesigner(props: MapDesignerProps): JSX.Element { )} - + {props.pageType == 'MapDesigner' || + props.pageType == 'DailyChallenge' ? ( + + ) : ( + <> + )}

- - - e.target.value == 'PvP' - ? handlePvPTake() - : handlePvPClose() - } - id="ModeSelector" - > - {modes.map(mode => ( - - ))} - - + {pageState == 'Dashboard' ? ( + + + e.target.value == 'PvP' + ? handlePvPTake() + : handlePvPClose() + } + id="GameModeSelector" + title="Game-Mode" + > + {modes.map(mode => ( + + ))} + + + ) : ( + <> + )}
@@ -820,7 +847,8 @@ export default function Dashboard(): JSX.Element {
{pageState == 'Dashboard' || dailyChallenge.challType == 'MAP' || - (pageState == 'Tutorials' && codeTutorialNumber != 4) ? ( + (pageState == 'Tutorials' && + tutorialsType == ChallengeType.Map) ? ( - ) : pageState == 'Tutorials' && codeTutorialNumber == 4 ? ( + ) : pageState == 'Tutorials' ? (
{pageState == 'Dashboard' || - (pageState == 'Tutorials' && codeTutorialNumber != 4) || + (pageState == 'Tutorials' && dailyChallengeSimulationState) || dailyChallengeSimulationState ? ( - - ) : dailyChallenge.challType == 'MAP' ? ( + + ) : dailyChallenge.challType == 'MAP' || + (pageState == 'Tutorials' && + tutorialsType == ChallengeType.Map) ? ( <>
- {dailyChallenge.challName} + {pageState === 'DailyChallenge' + ? dailyChallenge.challName + : 'Tutorial'}
- ) : pageState == 'Tutorials' && codeTutorialNumber == 4 ? ( + ) : pageState == 'Tutorials' && + tutorialsType == ChallengeType.Code ? ( ) : ( )}
- {pageState == 'Dashboard' || - pageState == 'Tutorials' || - dailyChallengeSimulationState ? ( + {pageState == 'Dashboard' || dailyChallengeSimulationState ? ( ) : ( <> diff --git a/src/store/EditorSettings/settings.ts b/src/store/EditorSettings/settings.ts index 904140b..ce772b2 100644 --- a/src/store/EditorSettings/settings.ts +++ b/src/store/EditorSettings/settings.ts @@ -22,7 +22,7 @@ const initialState: settingsStateType = { enableSnippets: true, isInfoOpen: false, isCommitModalOpen: false, - autocomplete: false, + autocomplete: true, }; export interface CodeAndLanguage { diff --git a/src/store/Tutorials/tutorials.ts b/src/store/Tutorials/tutorials.ts index af24298..10ee43e 100644 --- a/src/store/Tutorials/tutorials.ts +++ b/src/store/Tutorials/tutorials.ts @@ -1,14 +1,15 @@ import { ChallengeType, TutorialsGetRequest } from '@codecharacter-2024/client'; import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import { RootState } from '../store'; -import { CodeAndLanguage, languagesAvailable } from '../editor/code'; +import { languagesAvailable } from '../editor/code'; import defaultCppCode from '../../assets/codes/cpp/run.cpp?raw'; import defaultPythonCode from '../../assets/codes/python/run.py?raw'; import defaultJavaCode from '../../assets/codes/java/Run.java?raw'; +import { CodeAndLanguage } from '../EditorSettings/settings'; export interface TutorialStateType { tutorials: TutorialsGetRequest; - tutorialCode: string | undefined; + tutorialCode: string; tutorialAllLanguagesCode: string[]; tutorialLanguage: string; tutorialMap: Array>; @@ -27,6 +28,7 @@ const initialState: TutorialStateType = { python: ' ', image: ' ', }, + tutorialId: 0, }, tutorialCode: defaultCppCode, tutorialAllLanguagesCode: [ @@ -49,14 +51,18 @@ export const tutorialsSlice = createSlice({ action: PayloadAction, ) => { state.tutorials.tutorialName = action.payload.tutorialName; + state.tutorials.tutorialType = action.payload.tutorialType; (state.tutorials.description = action.payload.description ? action.payload.description : ''), (state.tutorials.tutorialCodes = action.payload.tutorialCodes); - state.tutorialCode = action.payload.tutorialCodes.cpp; - state.tutorialAllLanguagesCode[0] = action.payload.tutorialCodes.cpp; - state.tutorialAllLanguagesCode[1] = action.payload.tutorialCodes.python; - state.tutorialAllLanguagesCode[2] = action.payload.tutorialCodes.java; + state.tutorialCode = action.payload.tutorialCodes.cpp ?? ''; + state.tutorialAllLanguagesCode[0] = + action.payload.tutorialCodes.cpp ?? ''; + state.tutorialAllLanguagesCode[1] = + action.payload.tutorialCodes.python ?? ''; + state.tutorialAllLanguagesCode[2] = + action.payload.tutorialCodes.java ?? ''; state.isCompleted = false; }, changeTutorialCode: (state, action: PayloadAction) => { @@ -116,5 +122,7 @@ export const tutorialCompletion = (state: RootState): boolean => state.tutorials.isCompleted; export const tutorialAllLanguagesCode = (state: RootState): string[] => state.tutorials.tutorialAllLanguagesCode; +export const tutorialType = (state: RootState): ChallengeType => + state.tutorials.tutorials.tutorialType as ChallengeType; export default tutorialsSlice.reducer; diff --git a/src/store/editor/code.ts b/src/store/editor/code.ts index 8e885f2..86603c7 100644 --- a/src/store/editor/code.ts +++ b/src/store/editor/code.ts @@ -126,6 +126,19 @@ export const editorSlice = createSlice({ } state.language = action.payload; }, + + changeEditorGameType: (state, action: PayloadAction) => { + state.gameType = action.payload; + if (action.payload === GameType.NORMAL) { + state.userCode = + state.allLanguagesNormalCode[ + languagesAvailable.indexOf(state.language) + ]; + } else { + state.userCode = + state.allLanguagesPvPCode[languagesAvailable.indexOf(state.language)]; + } + }, }, }); @@ -135,6 +148,7 @@ export const { initializeEditorStates, initializePvPEditorStates, updateEditorCodeState, + changeEditorGameType, } = editorSlice.actions; export const UserCode = (state: RootState): string => state.codeEditorReducer.editorState.userCode;