mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Fix ghost interact, ENTER works on modal, knob position
This commit is contained in:
@@ -125,7 +125,7 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/sleeper/attack_ghost(mob/user)
|
||||
return attack_hand(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/sleeper/attack_hand(mob/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/bodyscanner/attack_ghost(user)
|
||||
return attack_hand(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/bodyscanner/attack_hand(user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/attack_ghost(mob/user)
|
||||
return attack_hand(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/attack_hand(mob/user)
|
||||
if(user == occupant)
|
||||
|
||||
@@ -309,13 +309,13 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/chem_dispenser/attack_ghost(mob/user)
|
||||
if(user.can_admin_interact())
|
||||
return attack_hand(user)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/chem_dispenser/attack_hand(mob/user)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/chem_dispenser/soda
|
||||
|
||||
@@ -91,8 +91,7 @@
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/chem_heater/attack_ghost(mob/user)
|
||||
if(user.can_admin_interact())
|
||||
return attack_hand(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/chem_heater/attack_ai(mob/user)
|
||||
add_hiddenprint(user)
|
||||
|
||||
@@ -238,8 +238,7 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/chem_master/attack_ghost(mob/user)
|
||||
if(user.can_admin_interact())
|
||||
return attack_hand(user)
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/chem_master/attack_hand(mob/user)
|
||||
if(..())
|
||||
|
||||
@@ -35,6 +35,7 @@ export const Knob = props => {
|
||||
size,
|
||||
bipolar,
|
||||
children,
|
||||
popUpPosition,
|
||||
...rest
|
||||
} = props;
|
||||
return (
|
||||
@@ -102,7 +103,10 @@ export const Knob = props => {
|
||||
</div>
|
||||
</div>
|
||||
{dragging && (
|
||||
<div className="Knob__popupValue">
|
||||
<div className={classes([
|
||||
'Knob__popupValue',
|
||||
popUpPosition && 'Knob__popupValue--' + popUpPosition,
|
||||
])}>
|
||||
{displayElement}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -6,10 +6,18 @@ export const Modal = props => {
|
||||
const {
|
||||
className,
|
||||
children,
|
||||
onEnter,
|
||||
...rest
|
||||
} = props;
|
||||
let handleKeyDown;
|
||||
if (onEnter) {
|
||||
handleKeyDown = e => {
|
||||
onEnter(e);
|
||||
};
|
||||
}
|
||||
return (
|
||||
<Dimmer>
|
||||
<Dimmer
|
||||
onKeyDown={handleKeyDown}>
|
||||
<div
|
||||
className={classes([
|
||||
'Modal',
|
||||
|
||||
@@ -302,6 +302,7 @@ const DNAModifierMainRadiationEmitter = (props, context) => {
|
||||
maxValue="10"
|
||||
stepPixelSize="20"
|
||||
value={radiationIntensity}
|
||||
popUpPosition="right"
|
||||
ml="0"
|
||||
onChange={(e, val) => act('radiationIntensity', { value: val })}
|
||||
/>
|
||||
@@ -313,6 +314,7 @@ const DNAModifierMainRadiationEmitter = (props, context) => {
|
||||
stepPixelSize="10"
|
||||
unit="s"
|
||||
value={radiationDuration}
|
||||
popUpPosition="right"
|
||||
ml="0"
|
||||
onChange={(e, val) => act('radiationDuration', { value: val })}
|
||||
/>
|
||||
|
||||
@@ -79,6 +79,7 @@ export const ComplexModal = (props, context) => {
|
||||
type,
|
||||
} = data.modal;
|
||||
|
||||
let modalOnEnter;
|
||||
let modalBody;
|
||||
let modalFooter = (
|
||||
<Button
|
||||
@@ -93,6 +94,8 @@ export const ComplexModal = (props, context) => {
|
||||
if (bodyOverrides[id]) {
|
||||
modalBody = bodyOverrides[id](data.modal, context);
|
||||
} else if (type === "input") {
|
||||
let curValue = data.modal.value;
|
||||
modalOnEnter = e => modalAnswer(context, id, curValue);
|
||||
modalBody = (
|
||||
<Input
|
||||
value={data.modal.value}
|
||||
@@ -100,9 +103,30 @@ export const ComplexModal = (props, context) => {
|
||||
width="100%"
|
||||
my="0.5rem"
|
||||
autofocus
|
||||
onEnter={(e, val) => modalAnswer(context, id, val)}
|
||||
onChange={(_e, val) => {
|
||||
curValue = val;
|
||||
}}
|
||||
/>
|
||||
);
|
||||
modalFooter = (
|
||||
<Box mt="0.5rem">
|
||||
<Button
|
||||
icon="arrow-left"
|
||||
content="Cancel"
|
||||
color="grey"
|
||||
onClick={() => modalClose(context)}
|
||||
/>
|
||||
<Button
|
||||
icon="check"
|
||||
content={"Confirm"}
|
||||
color="good"
|
||||
float="right"
|
||||
m="0"
|
||||
onClick={() => modalAnswer(context, id, curValue)}
|
||||
/>
|
||||
<Box clear="both" />
|
||||
</Box>
|
||||
);
|
||||
} else if (type === "choice") {
|
||||
const realChoices = (typeof data.modal.choices === "object")
|
||||
? Object.values(data.modal.choices)
|
||||
@@ -162,6 +186,7 @@ export const ComplexModal = (props, context) => {
|
||||
<Modal
|
||||
maxWidth={props.maxWidth || (window.innerWidth / 2 + "px")}
|
||||
maxHeight={props.maxHeight || (window.innerHeight / 2 + "px")}
|
||||
onEnter={modalOnEnter}
|
||||
mx="auto">
|
||||
<Box display="inline">
|
||||
{text}
|
||||
|
||||
@@ -59,7 +59,7 @@ $inner-padding: 0.1em;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.Knob__popupValue {
|
||||
.Knob__popupValue, .Knob__popupValue--right {
|
||||
position: absolute;
|
||||
top: -2rem;
|
||||
right: 50%;
|
||||
@@ -71,6 +71,11 @@ $inner-padding: 0.1em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.Knob__popupValue--right {
|
||||
top: 0.25rem;
|
||||
right: -50%;
|
||||
}
|
||||
|
||||
.Knob__ring {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
||||
Reference in New Issue
Block a user