import { useBackend } from '../backend'; import { Window } from '../layouts'; import { Button, Section } from '../components'; import { BooleanLike } from 'common/react'; const ModeSpan = { 'Hold': 'Hold', 'Digest': 'Digest', 'Absorb': 'Absorb', 'Drain': 'Drain', 'Selective': 'Selective', 'Unabsorb': 'Unabsorb', 'Heal': 'Heal', 'Shrink': 'Shrink', 'Grow': 'Grow', 'Size Steal': 'Size Steal', 'Encase In Egg': 'Encase In Egg', }; const ItemModeSpan = { 'Hold': 'Item: Hold', 'Digest (Food Only)': 'Item: Digest (Food Only)', 'Digest': 'Item: Digest', 'Digest (Dispersed Damage)': 'Item: Digest (Dispersed Damage)', }; const AddonIcon = { 'Numbing': '', 'Stripping': '', 'Leave Remains': '', 'Muffles': 'bi-volume-mute', 'Affect Worn Items': '', 'Jams Sensors': 'bi-wifi-off', 'Complete Absorb': '', }; const ReagentAddonIcon = { 'Produce Liquids': '', 'Digestion Liquids': '', 'Absorption Liquids': '', 'Draining Liquids': '', }; const GetAddons = (addons: string[]) => { let result: string[] = []; addons?.forEach((addon) => { result.push('' + addon + ''); }); if (result.length === 0) { result.push('No Addons Set'); } return result; }; const GetLiquidAddons = (addons: string[]) => { let result: string[] = []; addons?.forEach((addon) => { result.push( '' + addon + '' ); }); if (result.length === 0) { result.push('No Addons Set'); } return result; }; type Data = { db_version: string; db_repo: string; mob_name: string; bellies: Belly[]; }; type Belly = { // General Information name: string; desc: string; absorbed_desc: string; vore_verb: string; release_verb: string; // Controls mode: string; addons: string[]; item_mode: string; // Options digest_brute: number; digest_burn: number; digest_oxy: number; can_taste: BooleanLike; is_feedable: BooleanLike; contaminates: BooleanLike; contamination_flavor: string; contamination_color: string; nutrition_percent: number; bulge_size: number; display_absorbed_examine: BooleanLike; save_digest_mode: BooleanLike; emote_active: BooleanLike; emote_time: number; shrink_grow_size: number; vorespawn_blacklist: BooleanLike; egg_type: string; selective_preference: string; // Messages struggle_messages_outside: string[]; struggle_messages_inside: string[]; absorbed_struggle_messages_outside: string[]; absorbed_struggle_messages_inside: string[]; digest_messages_owner: string[]; digest_messages_prey: string[]; absorb_messages_owner: string[]; absorb_messages_prey: string[]; unabsorb_messages_owner: string[]; unabsorb_messages_prey: string[]; examine_messages: string[]; examine_messages_absorbed: string[]; // emote_list: any[]; emotes_digest; emotes_hold; emotes_holdabsorbed; emotes_absorb; emotes_heal; emotes_drain; emotes_steal; emotes_egg; emotes_shrink; emotes_grow; emotes_unabsorb; // Sounds is_wet: BooleanLike; wet_loop: BooleanLike; fancy_vore: BooleanLike; vore_sound: string; release_sound: string; // Visuals affects_vore_sprites: BooleanLike; count_absorbed_prey_for_sprite: BooleanLike; absorbed_multiplier: number; count_liquid_for_sprite: BooleanLike; liquid_multiplier: number; count_items_for_sprite: BooleanLike; item_multiplier: number; health_impacts_size: BooleanLike; resist_triggers_animation: BooleanLike; size_factor_for_sprite: number; belly_sprite_to_affect: string; // Visuals (Belly Fullscreens Preview and Coloring) belly_fullscreen_color: string; // Visuals (Vore FX) disable_hud: BooleanLike; // Interactions escapable: BooleanLike; escapechance: number; escapetime: number; transferchance: number; transferlocation: string; transferchance_secondary: number; transferlocation_secondary: string; absorbchance: number; digestchance: number; // Interactions (Auto-Transfer) autotransferwait: number; autotransferchance: number; autotransferlocation: string; autotransfer_enabled: BooleanLike; autotransferchance_secondary: number; autotransferlocation_secondary: string; autotransfer_min_amount: number; autotransfer_max_amount: number; // Liquid Options show_liquids: BooleanLike; reagentbellymode: BooleanLike; reagent_chosen: string; reagent_name: string; reagent_transfer_verb: string; gen_time_display: string; custom_max_volume: number; vorefootsteps_sounds: BooleanLike; reagent_mode_flag_list: string[]; // Liquid Messages liquid_fullness1_messages: BooleanLike; liquid_fullness2_messages: BooleanLike; liquid_fullness3_messages: BooleanLike; liquid_fullness4_messages: BooleanLike; liquid_fullness5_messages: BooleanLike; fullness1_messages: string[]; fullness2_messages: string[]; fullness3_messages: string[]; fullness4_messages: string[]; fullness5_messages: string[]; }; // prettier-ignore const generateBellyString = (belly: Belly, index: number) => { const { // General Information name, desc, absorbed_desc, vore_verb, release_verb, // Controls mode, addons, item_mode, // Options digest_brute, digest_burn, digest_oxy, can_taste, is_feedable, contaminates, contamination_flavor, contamination_color, nutrition_percent, bulge_size, display_absorbed_examine, save_digest_mode, emote_active, emote_time, shrink_grow_size, vorespawn_blacklist, egg_type, selective_preference, // Messages struggle_messages_outside, struggle_messages_inside, absorbed_struggle_messages_outside, absorbed_struggle_messages_inside, digest_messages_owner, digest_messages_prey, absorb_messages_owner, absorb_messages_prey, unabsorb_messages_owner, unabsorb_messages_prey, examine_messages, examine_messages_absorbed, // emote_list, emotes_digest, emotes_hold, emotes_holdabsorbed, emotes_absorb, emotes_heal, emotes_drain, emotes_steal, emotes_egg, emotes_shrink, emotes_grow, emotes_unabsorb, // Sounds is_wet, wet_loop, fancy_vore, vore_sound, release_sound, // Visuals affects_vore_sprites, count_absorbed_prey_for_sprite, resist_triggers_animation, size_factor_for_sprite, belly_sprite_to_affect, // Visuals (Belly Fullscreens Preview and Coloring) belly_fullscreen_color, // Visuals (Vore FX) disable_hud, // Interactions escapable, escapechance, escapetime, transferchance, transferlocation, transferchance_secondary, transferlocation_secondary, absorbchance, digestchance, // Interactions (Auto-Transfer) autotransferwait, autotransferchance, autotransferlocation, autotransferchance_secondary, autotransferlocation_secondary, autotransfer_enabled, autotransfer_min_amount, autotransfer_max_amount, // Liquid Options show_liquids, reagentbellymode, reagent_chosen, reagent_name, reagent_transfer_verb, gen_time_display, custom_max_volume, vorefootsteps_sounds, reagent_mode_flag_list, // Liquid Messages liquid_fullness1_messages, liquid_fullness2_messages, liquid_fullness3_messages, liquid_fullness4_messages, liquid_fullness5_messages, fullness1_messages, fullness2_messages, fullness3_messages, fullness4_messages, fullness5_messages, } = belly; let result = ''; result += '

'; result += '

'; result += '
'; result += '
'; result += 'Addons:
' + GetAddons(addons) + '

'; result += '== Descriptions ==
'; result += 'Vore Verb:
' + vore_verb + '

'; result += 'Release Verb:
' + release_verb + '

'; result += 'Description:
"' + desc + '"

'; result += 'Absorbed Description:
"' + absorbed_desc + '"

'; result += '
'; result += '== Messages ==
'; result += '
'; // Start Div messagesTabpanel result += '
'; result += '
'; result += '
'; result += '
'; struggle_messages_outside?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; struggle_messages_inside?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; absorbed_struggle_messages_outside?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; absorbed_struggle_messages_inside?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; digest_messages_owner?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; digest_messages_prey?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; absorb_messages_owner?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; absorb_messages_prey?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; unabsorb_messages_owner?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; unabsorb_messages_prey?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; examine_messages?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; examine_messages_absorbed?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; result += '
'; result += '
'; // End Div messagesTabpanel result += '
= Idle Messages =

'; result += '

Idle Messages (Hold):

'; emotes_hold?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Hold Absorbed):

'; emotes_holdabsorbed?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Digest):

'; emotes_digest?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Absorb):

'; emotes_absorb?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Unabsorb):

'; emotes_unabsorb?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Drain):

'; emotes_drain?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Heal):

'; emotes_heal?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Size Steal):

'; emotes_steal?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Shrink):

'; emotes_shrink?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Grow):

'; emotes_grow?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '
Idle Messages (Encase In Egg):

'; emotes_egg?.forEach((msg) => { result += msg + '
'; }); result += '


'; result += '


'; result += '
'; result += '
'; // OPTIONS result += '
'; result += '

'; result += '

'; result += '
'; result += '
'; result += '
    '; result += '
  • Can Taste: ' + (can_taste ? 'Yes' : 'No') + '
  • '; result += '
  • Feedable: ' + (is_feedable ? 'Yes' : 'No') + '
  • '; result += '
  • Contaminates: ' + (contaminates ? 'Yes' : 'No') + '
  • '; result += '
  • Contamination Flavor: ' + contamination_flavor + '
  • '; result += '
  • Contamination Color: ' + contamination_color + '
  • '; result += '
  • Nutritional Gain: ' + nutrition_percent + '%
  • '; result += '
  • Required Examine Size: ' + bulge_size * 100 + '%
  • '; result += '
  • Display Absorbed Examines: ' + (display_absorbed_examine ? 'True' : 'False') + '
  • '; result += '
  • Save Digest Mode: ' + (save_digest_mode ? 'True' : 'False') + '
  • '; result += '
  • Idle Emotes: ' + (emote_active ? 'Active' : 'Inactive') + '
  • '; result += '
  • Idle Emote Delay: ' + emote_time + ' seconds
  • '; result += '
  • Shrink/Grow Size: ' + shrink_grow_size * 100 + '%
  • '; result += '
  • Vore Spawn Blacklist: ' + (vorespawn_blacklist ? 'Yes' : 'No') + '
  • '; result += '
  • Egg Type: ' + egg_type + '
  • '; result += '
  • Selective Mode Preference: ' + selective_preference + '
  • '; result += '
'; result += '
'; // END OPTIONS // SOUNDS result += '
'; result += '

'; result += '

'; result += '
'; result += '
'; result += '
    '; result += '
  • Fleshy Belly: ' + (is_wet ? 'Yes' : 'No') + '
  • '; result += '
  • Internal Loop: ' + (wet_loop ? 'Yes' : 'No') + '
  • '; result += '
  • Use Fancy Sounds: ' + (fancy_vore ? 'Yes' : 'No') + '
  • '; result += '
  • Vore Sound: ' + vore_sound + '
  • '; result += '
  • Release Sound: ' + release_sound + '
  • '; result += '
'; result += '
'; // END SOUNDS // VISUALS result += '
'; result += '

'; result += '

'; result += '
'; result += 'Vore Sprites'; result += '
    '; result += '
  • Affect Vore Sprites: ' + (affects_vore_sprites ? 'Yes' : 'No') + '
  • '; result += '
  • Count Absorbed prey for vore sprites: ' + (count_absorbed_prey_for_sprite ? 'Yes' : 'No') + '
  • '; result += '
  • Animation when prey resist: ' + (resist_triggers_animation ? 'Yes' : 'No') + '
  • '; result += '
  • Vore Sprite Size Factor: ' + size_factor_for_sprite + '
  • '; result += '
  • Belly Sprite to affect: ' + belly_sprite_to_affect + '
  • '; result += '
'; result += 'Belly Fullscreens Preview and Coloring'; result += '
    '; result += '
  • Color: ' + belly_fullscreen_color + ''; result += '
'; result += 'Vore FX'; result += '
    '; result += '
  • Disable Prey HUD: ' + (disable_hud ? 'Yes' : 'No') + '
  • '; result += '
'; result += '
'; // END VISUALS // INTERACTIONS result += '
'; result += '

'; result += '

'; result += '
'; result += '
'; result += 'Belly Interactions (' + (escapable ? 'Enabled' : 'Disabled') + ')'; result += '
    '; result += '
  • Escape Chance: ' + escapechance + '%
  • '; result += '
  • Escape Time: ' + escapetime / 10 + 's
  • '; result += '
  • Transfer Chance: ' + transferchance + '%
  • '; result += '
  • Transfer Location: ' + transferlocation + '
  • '; result += '
  • Secondary Transfer Chance: ' + transferchance_secondary + '%
  • '; result += '
  • Secondary Transfer Location: ' + transferlocation_secondary + '
  • '; result += '
  • Absorb Chance: ' + absorbchance + '%
  • '; result += '
  • Digest Chance: ' + digestchance + '%
  • '; result += '
'; result += '
'; result += 'Auto-Transfer Options (' + (autotransfer_enabled ? 'Enabled' : 'Disabled') + ')'; result += '
    '; result += '
  • Auto-Transfer Time: ' + autotransferwait / 10 + 's
  • '; result += '
  • Auto-Transfer Chance: ' + autotransferchance + '%
  • '; result += '
  • Auto-Transfer Location: ' + autotransferlocation + '
  • '; result += '
  • Auto-Transfer Chance: ' + autotransferchance_secondary + '%
  • '; result += '
  • Auto-Transfer Location: ' + autotransferlocation_secondary + '
  • '; result += '
  • Auto-Transfer Min Amount: ' + autotransfer_min_amount + '
  • '; result += '
  • Auto-Transfer Max Amount: ' + autotransfer_max_amount + '
  • '; result += '
'; result += '
'; // END INTERACTIONS // LIQUID OPTIONS result += '
'; result += '

'; result += '

'; result += '
'; result += '
'; result += '
    '; result += '
  • Generate Liquids: ' + (reagentbellymode ? 'On' : 'Off') + '
  • '; result += '
  • Liquid Type: ' + reagent_chosen + '
  • '; result += '
  • Liquid Name: ' + reagent_name + '
  • '; result += '
  • Transfer Verb: ' + reagent_transfer_verb + '
  • '; result += '
  • Generation Time: ' + gen_time_display + '
  • '; result += '
  • Liquid Capacity: ' + custom_max_volume + '
  • '; result += '
  • Slosh Sounds: ' + (vorefootsteps_sounds ? 'On' : 'Off') + '
  • '; result += '
  • Liquid Addons: ' + GetLiquidAddons(reagent_mode_flag_list) + '
  • '; result += '
'; result += '
'; // END LIQUID OPTIONS // LIQUID MESSAGES result += '
'; result += '

'; result += '

'; result += '
'; result += '
'; result += '
'; // Start Div liquidMessagesTabpanel result += '
'; result += '
'; result += '
'; result += '
'; fullness1_messages?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; fullness2_messages?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; fullness3_messages?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; fullness4_messages?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; fullness5_messages?.forEach((msg) => { result += msg + '
'; }); result += '
'; result += '
'; result += '
'; result += '
'; // End Div liquidMessagesTabpanel result += '
'; // END LIQUID MESSAGES result += '
'; return result; }; const getCurrentTimestamp = (): string => { let now = new Date(); let hours = String(now.getHours()); if (hours.length < 2) { hours = '0' + hours; } let minutes = String(now.getMinutes()); if (minutes.length < 2) { minutes = '0' + minutes; } let dayofmonth = String(now.getDate()); if (dayofmonth.length < 2) { dayofmonth = '0' + dayofmonth; } let month = String(now.getMonth() + 1); // 0-11 if (month.length < 2) { month = '0' + month; } let year = String(now.getFullYear()); return ' ' + year + '-' + month + '-' + dayofmonth + ' (' + hours + ' ' + minutes + ')'; }; const downloadPrefs = (context, extension: string) => { const { act, data } = useBackend(context); const { db_version, db_repo, mob_name, bellies } = data; let datesegment = getCurrentTimestamp(); let filename = mob_name + datesegment + extension; let blob; if (extension === '.html') { let style = ''; blob = new Blob( [ '' + '' + '' + '' + bellies.length + ' Exported Bellies (DB_VER: ' + db_repo + '-' + db_version + ')' + '' + '' + style + '

Bellies of ' + mob_name + '

Generated on: ' + datesegment + '

', ], { type: 'text/html;charset=utf8', } ); bellies.forEach((belly, i) => { blob = new Blob([blob, generateBellyString(belly, i)], { type: 'text/html;charset=utf8' }); }); blob = new Blob( [ blob, '
', '', '
', ], { type: 'text/html;charset=utf8' } ); } if (extension === '.vrdb') { blob = new Blob([JSON.stringify(bellies)], { type: 'application/json' }); } (window.navigator as any).msSaveOrOpenBlob(blob, filename); }; export const VorePanelExport = () => { return ( ); }; const VorePanelExportContent = (props, context) => { const { act, data } = useBackend(context); const { bellies } = data; return (
); };