Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
✨ Minor bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
catheart97 committed Nov 9, 2023
1 parent 82d1d00 commit 68ec1ea
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ const VITE_DEV_SERVER_URL = process.env['VITE_DEV_SERVER_URL']
function createWindow() {

ipcMain.handle("m-userData", (_event, _arg) => {
const path = isProd ? (app.getPath("documents") + "/Dragon's Eye/") : (app.getPath("userData") + "/Dragon's Eye/");
// const path = isProd ? () : (app.getPath("userData") + "/Dragon's Eye/");
const path = app.getPath("documents") + "/Dragon's Eye/";
if (!fsExtra.existsSync(path)) {
fsExtra.mkdirSync(path);
}
Expand Down
4 changes: 2 additions & 2 deletions source/components/StatblockComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ export const RawStatblockComponent = (props: {

{/* Languages */}
{
editMode || statblock.languages.length > 0 ? (
editMode || statblock.languages && statblock.languages.length > 0 ? (
<>
<UIGroup title="Languages" className="text-orange-600">
</UIGroup>
Expand All @@ -937,7 +937,7 @@ export const RawStatblockComponent = (props: {

{/* Skills */}
{
editMode || statblock.skills.length > 0 ? (
editMode || statblock.skills && statblock.skills.length > 0 ? (
<>

<UIGroup title="Skills" className="text-orange-600">
Expand Down
14 changes: 13 additions & 1 deletion source/components/view/BoardApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const BoardApp = (props: IAppView & {

const [importanceRect, setImportanceRect] = React.useState<Rect | null>(null);

const [initiativeEnabled, setInitiativeEnabled] = React.useState<boolean>(true);

const forceUpdate = useForceUpdate();
const update = () => {
forceUpdate();
Expand Down Expand Up @@ -51,7 +53,16 @@ const BoardApp = (props: IAppView & {
Dragon's Eye
</div>
<button
className=" h-full flex items-center"
className=" h-full flex items-center px-2"
onClick={() => {
setInitiativeEnabled(!initiativeEnabled);
forceUpdate();
}}
>
<span className={"mso flex text-xl " + (initiativeEnabled ? "msf" : "mso")}>swords</span>
</button>
<button
className=" h-full flex items-center pl-2"
onClick={() => {
props.playerViewOpen.current = !props.playerViewOpen.current;
forceUpdate();
Expand All @@ -77,6 +88,7 @@ const BoardApp = (props: IAppView & {
board={props.board}
update={update}
importanceRect={importanceRect}
initiaitveEnabled={initiativeEnabled}
/>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion source/components/view/BoardPlayerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Marquee from "react-fast-marquee";
export type BoardPlayerViewProps = {
board: React.MutableRefObject<Board>;
importanceRect: Rect | null;
initiaitveEnabled: boolean;
} & IPlayerAppView

export type BoardPlayerViewHandle = {
Expand Down Expand Up @@ -49,7 +50,7 @@ const BoardPlayerViewRenderer: React.ForwardRefRenderFunction<BoardPlayerViewHan
importanceRect={props.importanceRect}
/>
{
props.board.current.initiative ? (
props.initiaitveEnabled && props.board.current.initiative ? (
<div className="absolute bottom-0 p-3 pointer-events-none flex items-end z-[60] justify-start top-0 right-0 overflow-hidden transition-all duration-200 ease-in-out"
style={{
left: -props.board.current.initiativeIndex! * 9 + "rem"
Expand Down
2 changes: 1 addition & 1 deletion source/components/view/CampaignApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const CampaignApp = (props: IAppView & {
{props.campaign.current!.title} - Dragon's Eye
</div>
<button
className=" h-full flex items-center"
className=" h-full flex items-center pl-2"
onClick={() => {
props.playerViewOpen.current = !props.playerViewOpen.current;
forceUpdate();
Expand Down

0 comments on commit 68ec1ea

Please sign in to comment.