import { capitalize } from 'common/string';
import { useBackend } from '../backend';
import { Box, ByondUi, Button, Flex, LabeledList, Section, ColorBox } from '../components';
import { Window } from '../layouts';
export const BodyDesigner = (props, context) => {
const { act, data } = useBackend(context);
const { menu, disk, diskStored, activeBodyRecord } = data;
let body = MenuToTemplate[menu];
return (
{disk ? (
) : null}
{body}
);
};
const BodyDesignerMain = (props, context) => {
const { act, data } = useBackend(context);
return (
act('menu', { menu: 'Body Records' })}
/>
act('menu', { menu: 'Stock Records' })}
/>
);
};
const BodyDesignerBodyRecords = (props, context) => {
const { act, data } = useBackend(context);
const { bodyrecords } = data;
return (
act('menu', { menu: 'Main' })}
/>
}>
{bodyrecords.map((record) => (
act('view_brec', { view_brec: record.recref })}
/>
))}
);
};
const BodyDesignerStockRecords = (props, context) => {
const { act, data } = useBackend(context);
const { stock_bodyrecords } = data;
return (
act('menu', { menu: 'Main' })}
/>
}>
{stock_bodyrecords.map((record) => (
act('view_stock_brec', { view_stock_brec: record })}
/>
))}
);
};
const BodyDesignerSpecificRecord = (props, context) => {
const { act, data } = useBackend(context);
const { activeBodyRecord, mapRef } = data;
return activeBodyRecord ? (
act('menu', { menu: 'Main' })}
/>
}>
{activeBodyRecord.real_name}
{activeBodyRecord.speciesname}
act('href_conversion', {
target_href: 'bio_gender',
target_value: 1,
})
}
/>
{activeBodyRecord.synthetic}
{activeBodyRecord.locked}
act('boocnotes')}
/>
act('href_conversion', {
target_href: 'size_multiplier',
target_value: 1,
})
}
/>
{Object.keys(activeBodyRecord.styles).map((key) => {
const style = activeBodyRecord.styles[key];
return (
{style.styleHref ? (
act('href_conversion', {
target_href: style.styleHref,
target_value: 1,
})
}
/>
) : null}
{style.colorHref ? (
act('href_conversion', {
target_href: style.colorHref,
target_value: 1,
})
}
/>
) : null}
{style.colorHref2 ? (
act('href_conversion', {
target_href: style.colorHref2,
target_value: 1,
})
}
/>
) : null}
);
})}
act('href_conversion', {
target_href: 'marking_style',
target_value: 1,
})
}
/>
{Object.keys(activeBodyRecord.markings).map((key) => {
const marking = activeBodyRecord.markings[key];
return (
act('href_conversion', {
target_href: 'marking_remove',
target_value: key,
})
}
/>
act('href_conversion', {
target_href: 'marking_color',
target_value: key,
})
}
/>
);
})}
) : (
ERROR: Record Not Found!
);
};
const BodyDesignerOOCNotes = (props, context) => {
const { act, data } = useBackend(context);
const { activeBodyRecord } = data;
return (
act('menu', { menu: 'Specific Record' })}
/>
}
style={{ 'word-break': 'break-all' }}>
{(activeBodyRecord && activeBodyRecord.booc) ||
'ERROR: Body record not found!'}
);
};
const MenuToTemplate = {
'Main': ,
'Body Records': ,
'Stock Records': ,
'Specific Record': ,
'OOC Notes': ,
};