-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- We load a simplified character sheet - We load monsters Various refactorings and changes, including adding in a progress loader. Also created a way where we can simplify some of the imports such as the api handler, the new game loader context and so on.
- Loading branch information
Showing
81 changed files
with
4,764 additions
and
4,302 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
File renamed without changes.
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
4 changes: 2 additions & 2 deletions
4
...urces/js/axios/axios-service-container.ts → ...js/api-handler/axios-service-container.ts
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,11 +1,11 @@ | ||
import { ModularContainerDefinition } from 'configuration/deffinitions/modular-container-definition'; | ||
|
||
import Axios from './axios'; | ||
import ApiHandler from './api-handler'; | ||
import AxiosDefinition from './definitions/axios-definition'; | ||
import CoreContainerDefinition from '../service-container/deffinitions/core-container-definition'; | ||
|
||
export const axiosServiceContainer: ModularContainerDefinition = ( | ||
container: CoreContainerDefinition | ||
) => { | ||
container.register<AxiosDefinition>('ApiHandler', new Axios()); | ||
container.register<AxiosDefinition>('ApiHandler', new ApiHandler()); | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
resources/js/api-handler/definitions/api-parameters-definitions.ts
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default interface ApiParametersDefinitions { | ||
url: string; | ||
urlParams?: Record<string, number>; | ||
} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
resources/js/api-handler/definitions/axios-error-definition.ts
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type AxiosErrorDefinition = { | ||
message: string; | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
33 changes: 33 additions & 0 deletions
33
resources/js/game-data/api-data-definitions/character/character-sheet-definition.ts
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import InventoryCountDefinition from './inventory-count-definition'; | ||
|
||
export default interface CharacterSheetDefinition { | ||
id: number; | ||
user_id: number; | ||
name: string; | ||
class: string; | ||
class_id: number; | ||
class_bonus_chance: number; | ||
race: string; | ||
race_id: number; | ||
level: string; | ||
max_level: string; | ||
xp: number; | ||
xp_next: number; | ||
to_hit_stat: string; | ||
ac: number; | ||
attack: number; | ||
health: number; | ||
resurrection_chance: number; | ||
gold: string; | ||
gold_dust: string; | ||
shards: string; | ||
copper_coins: string; | ||
str_modded: number; | ||
dex_modded: number; | ||
int_modded: number; | ||
dur_modded: number; | ||
agi_modded: number; | ||
chr_modded: number; | ||
focus_modded: number; | ||
inventory_count: InventoryCountDefinition; | ||
} |
7 changes: 7 additions & 0 deletions
7
resources/js/game-data/api-data-definitions/character/inventory-count-definition.ts
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default interface InventoryCountDefinition { | ||
inventory_max: number; | ||
inventory_count: number; | ||
gem_bag_count: number; | ||
inventory_bag_count: number; | ||
alchemy_item_count: number; | ||
} |
4 changes: 4 additions & 0 deletions
4
resources/js/game-data/api-data-definitions/monsters/monster-definition.ts
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default interface MonsterDefinition { | ||
name: string; | ||
id: number; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React, { useState } from 'react'; | ||
|
||
import { GameDataContext } from '../game-data-context'; | ||
import GameDataProviderProps from './types/game-data-provider-props'; | ||
import GameDataDefinition from '../deffinitions/game-data-definition'; | ||
|
||
const GameDataProvider = (props: GameDataProviderProps): React.ReactNode => { | ||
const [gameData, setGameData] = useState<GameDataDefinition | null>(null); | ||
|
||
return ( | ||
<GameDataContext.Provider value={{ gameData, setGameData }}> | ||
{props.children} | ||
</GameDataContext.Provider> | ||
); | ||
}; | ||
|
||
export default GameDataProvider; |
5 changes: 5 additions & 0 deletions
5
resources/js/game-data/components/types/game-data-provider-props.ts
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { ReactNode } from 'react'; | ||
|
||
export default interface GameDataProviderProps { | ||
children: ReactNode; | ||
} |
8 changes: 8 additions & 0 deletions
8
resources/js/game-data/deffinitions/game-data-context-definition.ts
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
|
||
import GameDataDefinition from './game-data-definition'; | ||
|
||
export default interface GameDataContextDefinition { | ||
gameData: GameDataDefinition | null; | ||
setGameData: React.Dispatch<React.SetStateAction<GameDataDefinition | null>>; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import CharacterSheetDefinition from '../api-data-definitions/character/character-sheet-definition'; | ||
import MonsterDefinition from '../api-data-definitions/monsters/monster-definition'; | ||
|
||
export default interface GameDataDefinition { | ||
character: CharacterSheetDefinition | null; | ||
monsters: MonsterDefinition[] | []; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { createContext } from 'react'; | ||
|
||
import GameDataContextDefinition from './deffinitions/game-data-context-definition'; | ||
|
||
export const GameDataContext = createContext<GameDataContextDefinition | null>( | ||
null | ||
); |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useContext } from 'react'; | ||
|
||
import GameDataContextDefinition from '../deffinitions/game-data-context-definition'; | ||
import { GameDataContext } from '../game-data-context'; | ||
|
||
export const useGameData = (): GameDataContextDefinition => { | ||
const context = useContext(GameDataContext); | ||
|
||
if (!context) { | ||
throw new Error('useGameData must be used within an GameDataProvider'); | ||
} | ||
|
||
return context; | ||
}; |
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
3 changes: 0 additions & 3 deletions
3
...s/character-sheet/api/definitions/character-api-definitions/character-sheet-definition.ts
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
.../js/game/components/character-sheet/api/definitions/use-character-sheet-api-definition.ts
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
...s/js/game/components/character-sheet/api/definitions/use-character-sheet-api-paramters.ts
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
resources/js/game/components/character-sheet/api/enums/api-urls.ts
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
resources/js/game/components/character-sheet/api/hooks/use-character-sheet-api.ts
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
resources/js/game/components/character-sheet/api/types/use-character-sheet-api-state.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.