Merge pull request #5861 from Seris02/belleh

fixes a few belly bugs and improves belly color selection
This commit is contained in:
BlackMajor
2023-03-08 17:10:16 +13:00
committed by GitHub
3 changed files with 59 additions and 35 deletions

View File

@@ -373,7 +373,7 @@
var/taste
if(can_taste && (taste = M.get_taste_message(FALSE)))
to_chat(owner, "<span class='notice'>[M] tastes of [taste].</span>")
vore_fx(M)
vore_fx(M, TRUE) //CHOMPEdit: update belleh
owner.update_fullness() //CHOMPEdit - This is run whenever a belly's contents are changed.
//Stop AI processing in bellies
if(M.ai_holder)

View File

@@ -619,11 +619,13 @@
host.show_vore_fx = !host.show_vore_fx
if(host.client.prefs_vr)
host.client.prefs_vr.show_vore_fx = host.show_vore_fx
if(!host.show_vore_fx)
if (isbelly(host.loc)) //CHOMPEdit
var/obj/belly/B = host.loc
B.vore_fx(host, TRUE)
else
host.clear_fullscreen("belly")
//host.clear_fullscreen("belly2") //For multilayered stomachs. Not currently implemented.
if(!host.hud_used.hud_shown)
host.toggle_hud_vis()
if(!host.hud_used.hud_shown)
host.toggle_hud_vis()
unsaved_changes = TRUE
return TRUE
if("toggle_noisy")

View File

@@ -1,7 +1,7 @@
import { capitalize } from 'common/string';
import { Fragment } from 'inferno';
import { useBackend, useLocalState } from '../backend';
import { Box, Button, Flex, Collapsible, Icon, LabeledList, NoticeBox, Section, Tabs, Divider } from '../components';
import { Box, Button, Flex, Collapsible, Icon, LabeledList, NoticeBox, Section, Tabs, Divider, Stack } from '../components';
import { Window } from '../layouts';
import { classes } from 'common/react';
@@ -939,35 +939,31 @@ const VoreSelectedBellyVisuals = (props, context) => {
</Section>
<Section title="Belly Fullscreens Preview and Coloring">
<Flex direction="row">
<Box backgroundColor={belly_fullscreen_color} width="20px" height="20px" />
<Button
icon="eye-dropper"
onClick={() => act('set_attribute', { attribute: 'b_fullscreen_color', val: null })}>
Select Color 1
</Button>
<Box backgroundColor={belly_fullscreen_color2} width="20px" height="20px" />
<Button
icon="eye-dropper"
onClick={() => act('set_attribute', { attribute: 'b_fullscreen_color2', val: null })}>
Select Color 2
</Button>
<Box backgroundColor={belly_fullscreen_color3} width="20px" height="20px" />
<Button
icon="eye-dropper"
onClick={() => act('set_attribute', { attribute: 'b_fullscreen_color3', val: null })}>
Select Color 3
</Button>
<Box backgroundColor={belly_fullscreen_color4} width="20px" height="20px" />
<Button
icon="eye-dropper"
onClick={() => act('set_attribute', { attribute: 'b_fullscreen_color4', val: null })}>
Select Color 4
</Button>
<Button
icon="eye-dropper"
onClick={() => act('set_attribute', { attribute: 'b_fullscreen_alpha', val: null })}>
Set Alpha
</Button>
<FeatureColorInput
action_name="b_fullscreen_color"
value_of={null}
back_color={belly_fullscreen_color}
name_of="1"
/>
<FeatureColorInput
action_name="b_fullscreen_color2"
value_of={null}
back_color={belly_fullscreen_color2}
name_of="2"
/>
<FeatureColorInput
action_name="b_fullscreen_color3"
value_of={null}
back_color={belly_fullscreen_color3}
name_of="3"
/>
<FeatureColorInput
action_name="b_fullscreen_color4"
value_of={null}
back_color={belly_fullscreen_color4}
name_of="4"
/>
<FeatureColorInput action_name="b_fullscreen_alpha" value_of={null} back_color="#FFFFFF" name_of="Alpha" />
<LabeledList.Item label="Enable Coloration">
<Button
onClick={() => act('set_attribute', { attribute: 'b_colorization_enabled' })}
@@ -2019,3 +2015,29 @@ const VoreUserPreferenceItem = (props, context) => {
/>
);
};
const FeatureColorInput = (props, context) => {
const { act } = useBackend(context);
const { action_name, value_of, back_color, name_of } = props;
return (
<Button
onClick={() => {
act('set_attribute', { attribute: action_name, val: value_of });
}}>
<Stack align="center" fill>
<Stack.Item>
<Box
style={{
background: back_color.startsWith('#') ? back_color : `#${back_color}`,
border: '2px solid white',
'box-sizing': 'content-box',
height: '11px',
width: '11px',
}}
/>
</Stack.Item>
<Stack.Item>Change {name_of}</Stack.Item>
</Stack>
</Button>
);
};