Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export const QUICK_BUILD_REQUEST = "builder.QUICK_BUILD_REQUEST";
|
||||
export const RANDOM_BUILD_REQUEST = "builder.RANDOM_BUILD_REQUEST";
|
||||
export const STEP_BUILD_REQUEST = "builder.STEP_BUILD_REQUEST";
|
||||
export const CHARACTER_LOAD_REQUEST = "builder.CHARACTER_LOAD_REQUEST";
|
||||
export const BUILDER_METHOD_SET = "builder.BUILDER_METHOD_SET";
|
||||
export const BUILDER_METHOD_SET_COMMIT = "builder.BUILDER_METHOD_SET_COMMIT";
|
||||
export const CHARACTER_LOADING_SET_COMMIT =
|
||||
"builder.CHARACTER_LOADING_SET_COMMIT";
|
||||
export const CHARACTER_LOADED_SET_COMMIT =
|
||||
"builder.CHARACTER_LOADED_SET_COMMIT";
|
||||
export const CONFIRM_SPECIES_SET = "builder.CONFIRM_SPECIES_SET";
|
||||
export const CONFIRM_CLASS_SET = "builder.CONFIRM_CLASS_SET";
|
||||
export const SHOW_HELP_TEXT_SET = "builder.SHOW_HELP_TEXT_SET";
|
||||
export const SUGGESTED_NAMES_SET = "builder.SUGGESTED_NAMES_SET";
|
||||
export const SUGGESTED_NAMES_REQUEST = "builder.SUGGESTED_NAMES_REQUEST";
|
||||
@@ -0,0 +1,169 @@
|
||||
import {
|
||||
ClassDefinitionContract,
|
||||
RaceDefinitionContract,
|
||||
} from "@dndbeyond/character-rules-engine/es";
|
||||
|
||||
import { builderActionTypes } from "../builder";
|
||||
import {
|
||||
BuilderMethodSetAction,
|
||||
BuilderMethodSetActionPayload,
|
||||
BuilderMethodSetCommitAction,
|
||||
CharacterLoadedSetCommitAction,
|
||||
CharacterLoadingSetCommitAction,
|
||||
CharacterLoadRequestAction,
|
||||
ConfirmClassSetAction,
|
||||
ConfirmSpeciesSetAction,
|
||||
QuickBuildRequestAction,
|
||||
RandomBuildRequestAction,
|
||||
ShowHelpTextSetAction,
|
||||
StepBuildRequestAction,
|
||||
SuggestedNamesRequestAction,
|
||||
SuggestedNamesSetAction,
|
||||
} from "./typings";
|
||||
|
||||
export function characterLoadRequest(): CharacterLoadRequestAction {
|
||||
return {
|
||||
type: builderActionTypes.CHARACTER_LOAD_REQUEST,
|
||||
payload: {},
|
||||
};
|
||||
}
|
||||
|
||||
export function quickBuildRequest(
|
||||
entitySpeciesId: number | null,
|
||||
entitySpeciesTypeId: number | null,
|
||||
classId: number | null,
|
||||
name: string | null
|
||||
): QuickBuildRequestAction {
|
||||
return {
|
||||
type: builderActionTypes.QUICK_BUILD_REQUEST,
|
||||
payload: {
|
||||
entityRaceId: entitySpeciesId,
|
||||
entityRaceTypeId: entitySpeciesTypeId,
|
||||
classId,
|
||||
name,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function randomBuildRequest(
|
||||
level: number | null,
|
||||
entitySpeciesId: number | null,
|
||||
entitySpeciesTypeId: number | null,
|
||||
classId: number | null,
|
||||
allowMulticlass: boolean,
|
||||
allowFeats: boolean,
|
||||
name: string | null
|
||||
): RandomBuildRequestAction {
|
||||
return {
|
||||
type: builderActionTypes.RANDOM_BUILD_REQUEST,
|
||||
payload: {
|
||||
level,
|
||||
entityRaceId: entitySpeciesId,
|
||||
entityRaceTypeId: entitySpeciesTypeId,
|
||||
classId,
|
||||
allowMulticlass,
|
||||
allowFeats,
|
||||
name,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function stepBuildRequest(
|
||||
showHelpText: boolean
|
||||
): StepBuildRequestAction {
|
||||
return {
|
||||
type: builderActionTypes.STEP_BUILD_REQUEST,
|
||||
payload: {
|
||||
showHelpText,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function characterLoadingSetCommit(
|
||||
isLoading: boolean
|
||||
): CharacterLoadingSetCommitAction {
|
||||
return {
|
||||
type: builderActionTypes.CHARACTER_LOADING_SET_COMMIT,
|
||||
payload: {
|
||||
isLoading,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function characterLoadedSetCommit(
|
||||
isLoaded: boolean
|
||||
): CharacterLoadedSetCommitAction {
|
||||
return {
|
||||
type: builderActionTypes.CHARACTER_LOADED_SET_COMMIT,
|
||||
payload: {
|
||||
isLoaded,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function showHelpTextSet(showHelpText: boolean): ShowHelpTextSetAction {
|
||||
return {
|
||||
type: builderActionTypes.SHOW_HELP_TEXT_SET,
|
||||
payload: {
|
||||
showHelpText,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function builderMethodSet(method: string): BuilderMethodSetAction {
|
||||
return {
|
||||
type: builderActionTypes.BUILDER_METHOD_SET,
|
||||
payload: {
|
||||
method,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function builderMethodSetCommit(
|
||||
payload: BuilderMethodSetActionPayload
|
||||
): BuilderMethodSetCommitAction {
|
||||
return {
|
||||
type: builderActionTypes.BUILDER_METHOD_SET_COMMIT,
|
||||
payload,
|
||||
};
|
||||
}
|
||||
|
||||
export function confirmSpeciesSet(
|
||||
species: RaceDefinitionContract
|
||||
): ConfirmSpeciesSetAction {
|
||||
return {
|
||||
type: builderActionTypes.CONFIRM_SPECIES_SET,
|
||||
payload: {
|
||||
race: species,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function confirmClassSet(
|
||||
charClass: ClassDefinitionContract
|
||||
): ConfirmClassSetAction {
|
||||
return {
|
||||
type: builderActionTypes.CONFIRM_CLASS_SET,
|
||||
payload: {
|
||||
charClass,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function suggestedNamesSet(
|
||||
suggestedNames: Array<string>
|
||||
): SuggestedNamesSetAction {
|
||||
return {
|
||||
type: builderActionTypes.SUGGESTED_NAMES_SET,
|
||||
payload: {
|
||||
suggestedNames,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function suggestedNamesRequest(): SuggestedNamesRequestAction {
|
||||
return {
|
||||
type: builderActionTypes.SUGGESTED_NAMES_REQUEST,
|
||||
payload: {},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as actionTypes from "./actionTypes";
|
||||
import * as actions from "./actions";
|
||||
import * as typings from "./typings";
|
||||
|
||||
export const builderActionTypes = actionTypes;
|
||||
export const builderActions = actions;
|
||||
export const builderTypings = typings;
|
||||
|
||||
export * from "./typings";
|
||||
Reference in New Issue
Block a user