diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 252ed732ca4..06f5da9acea 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -246,10 +246,18 @@ GLOBAL_LIST_INIT(skin_tone_names, list( var/endtime = world.time + delay var/starttime = world.time + var/dilation_tick = world.time // VOIDCREW EDIT ADDITION - cyberware time dilation . = TRUE while (world.time < endtime) stoplag(1) + // VOIDCREW EDIT ADDITION START - cyberware time dilation (voidcrew/modules/cyberware/ware_sandy_timestop.dm): a slowed body works slower, a frozen one not at all + var/dilation_lost = cyberware_time_lost(user, world.time - dilation_tick) + dilation_tick = world.time + endtime += dilation_lost + starttime += dilation_lost + // VOIDCREW EDIT ADDITION END + if(!QDELETED(progbar)) progbar.update(world.time - starttime) diff --git a/code/datums/components/ranged_attacks.dm b/code/datums/components/ranged_attacks.dm index b998362cfc6..787c3b0b527 100644 --- a/code/datums/components/ranged_attacks.dm +++ b/code/datums/components/ranged_attacks.dm @@ -66,8 +66,12 @@ INVOKE_ASYNC(src, PROC_REF(async_fire_ranged_attack), firer, target, modifiers) if(isnull(burst_shots)) return + // VOIDCREW EDIT CHANGE START - cyberware time dilation (voidcrew/modules/cyberware/ware_sandy_timestop.dm): each burst shot waits for the mob's own clock, so a slowed mob's burst slows down too + cyberware_burst_start = cyberware_burst_clock(firer) for(var/i in 1 to (burst_shots - 1)) - addtimer(CALLBACK(src, PROC_REF(async_fire_ranged_attack), firer, target, modifiers), i * burst_intervals) + addtimer(CALLBACK(src, PROC_REF(cyberware_burst_shot), firer, target, modifiers, i), i * burst_intervals) + // ORIGINAL: addtimer(CALLBACK(src, PROC_REF(async_fire_ranged_attack), firer, target, modifiers), i * burst_intervals) + // VOIDCREW EDIT CHANGE END /// Actually fire the damn thing /datum/component/ranged_attacks/proc/async_fire_ranged_attack(mob/living/basic/firer, atom/target, modifiers) diff --git a/code/game/objects/items/grenades/_grenade.dm b/code/game/objects/items/grenades/_grenade.dm index 262a493cc75..dc7317e696c 100644 --- a/code/game/objects/items/grenades/_grenade.dm +++ b/code/game/objects/items/grenades/_grenade.dm @@ -166,7 +166,7 @@ active = TRUE icon_state = (base_icon_state || initial(icon_state)) + "_active" SEND_SIGNAL(src, COMSIG_GRENADE_ARMED, det_time, delayoverride) - addtimer(CALLBACK(src, PROC_REF(detonate)), isnull(delayoverride)? det_time : delayoverride) + addtimer(CALLBACK(src, PROC_REF(cyberware_fuse_done)), isnull(delayoverride)? det_time : delayoverride) // VOIDCREW EDIT CHANGE - cyberware time dilation (voidcrew/modules/cyberware/ware_sandy_timestop.dm): the fuse burns slow in a slowed field. ORIGINAL: addtimer(CALLBACK(src, PROC_REF(detonate)), isnull(delayoverride)? det_time : delayoverride) /** * detonate (formerly prime) refers to when the grenade actually delivers its payload (whether or not a boom/bang/detonation is involved) diff --git a/code/game/sound/sound.dm b/code/game/sound/sound.dm index 60452addb21..459ddcf5ec3 100644 --- a/code/game/sound/sound.dm +++ b/code/game/sound/sound.dm @@ -31,6 +31,12 @@ var/turf/turf_source = get_turf(source) if (!turf_source) return + // VOIDCREW EDIT ADDITION START - cyberware: a Sandevistan slow-mo keeps its sounds for its replay, and a replay's start sound goes to its viewers from their views (voidcrew/modules/cyberware/ware_sandy_replay.dm) + if(length(GLOB.sandy_replays)) + var/list/sandy_heard = sandy_replay_hear(turf_source, soundin, vol, vary, extrarange, falloff_exponent, frequency, pressure_affected, ignore_walls, falloff_distance, use_reverb, volume_preference) + if(sandy_heard) + return sandy_heard + // VOIDCREW EDIT ADDITION END //allocate a channel if necessary now so its the same for everyone channel = channel || SSsounds.random_available_channel() @@ -200,6 +206,14 @@ if(HAS_TRAIT(src, TRAIT_SOUND_DEBUGGED)) to_chat(src, span_admin("Max Range-[max_distance] Distance-[distance] Vol-[round(sound_to_use.volume, 0.01)] Sound-[sound_to_use.file]")) + // VOIDCREW EDIT CHANGE START - cyberware: a Sandevistan user hears the slowed world slowed (voidcrew/modules/cyberware/ware_sandy_senses.dm) + if(length(GLOB.cyberware_time_fields)) + var/sandy_frequency = sound_to_use.frequency + cyberware_dilate_heard(src, turf_source, sound_to_use, usr) + SEND_SOUND(src, sound_to_use) + sound_to_use.frequency = sandy_frequency // the datum can be shared with the next listener + return + // VOIDCREW EDIT CHANGE END SEND_SOUND(src, sound_to_use) /proc/sound_to_playing_players(soundin, volume = 100, vary = FALSE, frequency = 0, channel = 0, pressure_affected = FALSE, sound/S) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 78941bbe241..741c7164b05 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -380,7 +380,7 @@ // VOIDCREW EDIT ADDITION START: a point-blank head shot at someone helpless is an execution (voidcrew/modules/hyperviolence/overlays_exec/executions.dm) if(flag && hv_try_head_execution(user, target, params)) - return + return TRUE // handled: without this the click fell through to a gun-bash on the body once the execution was over // VOIDCREW EDIT ADDITION END if(!can_shoot()) //Just because you can pull the trigger doesn't mean it can shoot. @@ -448,6 +448,12 @@ if(!user || !firing_burst) firing_burst = FALSE return FALSE + // VOIDCREW EDIT ADDITION START - cyberware time dilation (voidcrew/modules/cyberware/ware_sandy_timestop.dm): each burst shot waits for the shooter's own clock, so a burst slows or stops with them + var/dilation_wait = cyberware_burst_wait(user, cyberware_burst_start, cyberware_burst_gap, iteration - 1) + if(dilation_wait > 0) + addtimer(CALLBACK(src, PROC_REF(process_burst), user, target, message, params, zone_override, random_spread, burst_spread_mult, iteration), dilation_wait) + return TRUE + // VOIDCREW EDIT ADDITION END if(!issilicon(user)) if(iteration > 1 && !(user.is_holding(src))) //for burst firing firing_burst = FALSE @@ -517,6 +523,11 @@ if(user && HAS_TRAIT(user, TRAIT_DOUBLE_TAP)) modified_burst_delay = ROUND_UP(burst_delay * 0.5) modified_fire_delay = ROUND_UP(fire_delay * 0.5) + // VOIDCREW EDIT ADDITION START - cyberware time dilation (voidcrew/modules/cyberware/ware_sandy_timestop.dm): a slowed shooter's gun cycles slowly too + cyberware_burst_start = cyberware_burst_clock(user) + cyberware_burst_gap = modified_burst_delay + modified_fire_delay = cyberware_dilated_time(user, modified_fire_delay) + // VOIDCREW EDIT ADDITION END if(burst_size > 1) firing_burst = TRUE diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 4c9cc36adb4..b2e64b15edf 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -708,7 +708,7 @@ SEND_SIGNAL(user, COMSIG_MOB_USED_CLICK_MECH_MELEE, src) if(target.mech_melee_attack(src, user)) - TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MELEE_ATTACK, melee_cooldown) + TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MELEE_ATTACK, cyberware_dilated_time(src, melee_cooldown)) // VOIDCREW EDIT CHANGE - cyberware time dilation (voidcrew/modules/cyberware/ware_sandy_timestop.dm). ORIGINAL: TIMER_COOLDOWN_START(src, COOLDOWN_MECHA_MELEE_ATTACK, melee_cooldown) /// Driver alt clicks anything while in mech /obj/vehicle/sealed/mecha/proc/on_click_alt(mob/user, atom/target, params) diff --git a/code/modules/vehicles/mecha/equipment/mecha_equipment.dm b/code/modules/vehicles/mecha/equipment/mecha_equipment.dm index c03240b4a66..223f5d09c50 100644 --- a/code/modules/vehicles/mecha/equipment/mecha_equipment.dm +++ b/code/modules/vehicles/mecha/equipment/mecha_equipment.dm @@ -114,7 +114,7 @@ return TRUE /obj/item/mecha_parts/mecha_equipment/proc/action(mob/source, atom/target, list/modifiers) - TIMER_COOLDOWN_START(chassis, COOLDOWN_MECHA_EQUIPMENT(type), equip_cooldown)//Cooldown is on the MECH so people dont bypass it by switching equipment + TIMER_COOLDOWN_START(chassis, COOLDOWN_MECHA_EQUIPMENT(type), cyberware_dilated_time(chassis, equip_cooldown)) // VOIDCREW EDIT CHANGE - cyberware time dilation (voidcrew/modules/cyberware/ware_sandy_timestop.dm): a slowed mech's weapons cycle slowly. ORIGINAL: TIMER_COOLDOWN_START(chassis, COOLDOWN_MECHA_EQUIPMENT(type), equip_cooldown)//Cooldown is on the MECH so people dont bypass it by switching equipment SEND_SIGNAL(source, COMSIG_MOB_USED_MECH_EQUIPMENT, chassis) chassis.use_energy(energy_drain) return TRUE diff --git a/tgstation.dme b/tgstation.dme index edc62458eea..d7632a15eee 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6750,6 +6750,7 @@ #include "voidcrew\_DEFINES\subsystems.dm" #include "voidcrew\_DEFINES\techweb_nodes.dm" #include "voidcrew\_DEFINES\trade.dm" +#include "voidcrew\_DEFINES\tutorials.dm" #include "voidcrew\_HELPERS\data_huds.dm" #include "voidcrew\_HELPERS\debug_atmos.dm" #include "voidcrew\_HELPERS\docking.dm" @@ -7236,6 +7237,12 @@ #include "voidcrew\modules\cyberware\ware_pro_combat.dm" #include "voidcrew\modules\cyberware\ware_pro_utility.dm" #include "voidcrew\modules\cyberware\ware_registry.dm" +#include "voidcrew\modules\cyberware\ware_sandy_replay.dm" +#include "voidcrew\modules\cyberware\ware_sandy_senses.dm" +#include "voidcrew\modules\cyberware\ware_sandy_sound.dm" +#include "voidcrew\modules\cyberware\ware_sandy_timestop.dm" +#include "voidcrew\modules\cyberware\ware_sandy_timestop_cover.dm" +#include "voidcrew\modules\cyberware\ware_sandy_timestop_shared.dm" #include "voidcrew\modules\cyberware\ware_second_wind.dm" #include "voidcrew\modules\cyberware\ware_street.dm" #include "voidcrew\modules\cyberware\ware_street_passives.dm" @@ -7337,6 +7344,7 @@ #include "voidcrew\modules\hyperviolence\visuals\_motion_core.dm" #include "voidcrew\modules\hyperviolence\visuals\blood_motion.dm" #include "voidcrew\modules\hyperviolence\visuals\death_falls.dm" +#include "voidcrew\modules\hyperviolence\visuals\execution_aim.dm" #include "voidcrew\modules\hyperviolence\visuals\execution_motion.dm" #include "voidcrew\modules\hyperviolence\visuals\finisher_motion.dm" #include "voidcrew\modules\hyperviolence\visuals\flying_gore.dm" @@ -7578,7 +7586,6 @@ #include "voidcrew\modules\npc_ships\code\subtrees\combat_subtree.dm" #include "voidcrew\modules\npc_ships\code\subtrees\movement_subtree.dm" #include "voidcrew\modules\onboarding\first_time_notice.dm" -#include "voidcrew\modules\onboarding\orientation.dm" #include "voidcrew\modules\onboarding\zone_advisory.dm" #include "voidcrew\modules\outfits\corporate.dm" #include "voidcrew\modules\outfits\misc.dm" @@ -7907,6 +7914,27 @@ #include "voidcrew\modules\trade\favor_uniques\outfitter.dm" #include "voidcrew\modules\trade\favor_uniques\pike.dm" #include "voidcrew\modules\trade\favor_uniques\vex.dm" +#include "voidcrew\modules\tutorials\hooks_chrome_finisher.dm" +#include "voidcrew\modules\tutorials\hooks_contract.dm" +#include "voidcrew\modules\tutorials\hooks_medical.dm" +#include "voidcrew\modules\tutorials\hooks_pirates.dm" +#include "voidcrew\modules\tutorials\hooks_power.dm" +#include "voidcrew\modules\tutorials\hooks_repair_drones.dm" +#include "voidcrew\modules\tutorials\hooks_research.dm" +#include "voidcrew\modules\tutorials\hooks_ship.dm" +#include "voidcrew\modules\tutorials\hooks_ship_combat.dm" +#include "voidcrew\modules\tutorials\hooks_ship_save.dm" +#include "voidcrew\modules\tutorials\hooks_storage.dm" +#include "voidcrew\modules\tutorials\hooks_trade.dm" +#include "voidcrew\modules\tutorials\hooks_vestige.dm" +#include "voidcrew\modules\tutorials\hooks_world.dm" +#include "voidcrew\modules\tutorials\hooks_zones.dm" +#include "voidcrew\modules\tutorials\preferences.dm" +#include "voidcrew\modules\tutorials\tutorial_catalog.dm" +#include "voidcrew\modules\tutorials\tutorial_highlights.dm" +#include "voidcrew\modules\tutorials\tutorial_panel.dm" +#include "voidcrew\modules\tutorials\tutorial_progress.dm" +#include "voidcrew\modules\tutorials\tutorial_ship_hud.dm" #include "voidcrew\modules\transporter\_transporter.dm" #include "voidcrew\modules\transporter\transporter_console.dm" #include "voidcrew\modules\transporter\transporter_designs.dm" diff --git a/tgui/packages/tgui/interfaces/Autolathe.tsx b/tgui/packages/tgui/interfaces/Autolathe.tsx index a9e2f1720e5..2139b90d1cb 100644 --- a/tgui/packages/tgui/interfaces/Autolathe.tsx +++ b/tgui/packages/tgui/interfaces/Autolathe.tsx @@ -12,6 +12,7 @@ import { import { type BooleanLike, classes } from 'tgui-core/react'; import { capitalize } from 'tgui-core/string'; +import { TutorialFocus } from '../../voidcrew_tgui/components/TutorialFocus'; // VOIDCREW EDIT ADDITION import { useBackend } from '../backend'; import { Window } from '../layouts'; import { DesignBrowser } from './Fabrication/DesignBrowser'; @@ -221,7 +222,8 @@ const AutolatheRecipe = (props: AutolatheRecipeProps) => { maxmult = Math.min(Math.floor(maxmult), 50); const canPrint = maxmult > 0; - return ( + // VOIDCREW EDIT CHANGE: was `return (`, wrapped below + const recipe = (
{
); + + // VOIDCREW EDIT ADDITION: the tutorial checklist outlines the design it points at. + return {recipe}; }; diff --git a/tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx b/tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx index ace3da2d709..b8076931f9b 100644 --- a/tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx +++ b/tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx @@ -9,7 +9,8 @@ import { } from 'tgui-core/components'; import { classes } from 'tgui-core/react'; -import { useSharedState } from '../../backend'; +import { useBackend, useSharedState } from '../../backend'; // VOIDCREW EDIT CHANGE: useBackend +import { TutorialFocus } from '../../../voidcrew_tgui/components/TutorialFocus'; // VOIDCREW EDIT ADDITION import { SearchBar } from '../common/SearchBar'; import type { Design, MaterialMap } from './Types'; @@ -355,7 +356,22 @@ const DesignBrowserTab = ( depth ??= 0; maxDepth ??= 3; - return ( + // VOIDCREW EDIT ADDITION START - the tutorial checklist pulses the top-level tab holding + // the circuit imprinter or autolathe design it points at (imprinter_, + // autolathe_). + const tutorialFocus = + useBackend<{ tutorial_focus?: string | null }>().data?.tutorial_focus || ''; + const focusDesign = + /^(imprinter|autolathe)_(.+)$/.exec(tutorialFocus)?.[2] ?? ''; + const tabFocused = + depth === 0 && + !!focusDesign && + selectedCategory !== category.title && + !!category.descendants[focusDesign]; + // VOIDCREW EDIT ADDITION END + + // VOIDCREW EDIT CHANGE: was `return (`, wrapped below + const tab = (
( )}
); + // VOIDCREW EDIT ADDITION START - the tutorial checklist pulses this tab + return ( + {tab} + ); + // VOIDCREW EDIT ADDITION END }; type CategoryViewProps = { diff --git a/tgui/packages/tgui/interfaces/Fabricator.tsx b/tgui/packages/tgui/interfaces/Fabricator.tsx index 5f611e61fe0..e35120b5959 100644 --- a/tgui/packages/tgui/interfaces/Fabricator.tsx +++ b/tgui/packages/tgui/interfaces/Fabricator.tsx @@ -9,6 +9,7 @@ import { } from 'tgui-core/components'; import { classes } from 'tgui-core/react'; +import { TutorialFocus } from '../../voidcrew_tgui/components/TutorialFocus'; // VOIDCREW EDIT ADDITION import { useBackend } from '../backend'; import { Window } from '../layouts'; import { DesignBrowser } from './Fabrication/DesignBrowser'; @@ -161,7 +162,8 @@ const Recipe = (props: RecipeProps) => { !available[material] || amount > (available[material] ?? 0), ); - return ( + // VOIDCREW EDIT CHANGE: was `return (`, wrapped below + const recipe = (
{
); + // VOIDCREW EDIT ADDITION START - the tutorial checklist outlines the design it points at + return ( + {recipe} + ); + // VOIDCREW EDIT ADDITION END }; diff --git a/tgui/packages/tgui/interfaces/SurgeryInitiator.tsx b/tgui/packages/tgui/interfaces/SurgeryInitiator.tsx index 73acf3e3798..7cde3233647 100644 --- a/tgui/packages/tgui/interfaces/SurgeryInitiator.tsx +++ b/tgui/packages/tgui/interfaces/SurgeryInitiator.tsx @@ -4,6 +4,7 @@ import { Button, KeyListener, Stack } from 'tgui-core/components'; import { KEY_DOWN, KEY_ENTER, KEY_UP } from 'tgui-core/keycodes'; import type { BooleanLike } from 'tgui-core/react'; +import { TutorialFocus } from '../../voidcrew_tgui/components/TutorialFocus'; // VOIDCREW EDIT ADDITION: tutorial checklist import { useBackend } from '../backend'; import { Window } from '../layouts'; import { type BodyZone, BodyZoneSelector } from './common/BodyZoneSelector'; @@ -11,6 +12,7 @@ import { type BodyZone, BodyZoneSelector } from './common/BodyZoneSelector'; type Surgery = { name: string; blocked?: BooleanLike; + tutorial_id?: string; // VOIDCREW EDIT ADDITION: tutorial checklist }; type SurgeryInitiatorData = { @@ -77,33 +79,43 @@ class SurgeryInitiatorInner extends Component< - - act('change_zone', { new_zone: zone })} - selectedZone={selected_zone} - /> - + {/* VOIDCREW EDIT CHANGE START: tutorial checklist focus (voidcrew/modules/tutorials) */} + + + act('change_zone', { new_zone: zone })} + selectedZone={selected_zone} + /> + + + {/* VOIDCREW EDIT CHANGE END */} + {/* VOIDCREW EDIT CHANGE START: tutorial checklist focus */} {surgeries.map((surgery, index) => ( - + + ))} + {/* VOIDCREW EDIT CHANGE END */} diff --git a/tgui/packages/voidcrew_tgui/components/TutorialFocus.tsx b/tgui/packages/voidcrew_tgui/components/TutorialFocus.tsx new file mode 100644 index 00000000000..8c77a8072a2 --- /dev/null +++ b/tgui/packages/voidcrew_tgui/components/TutorialFocus.tsx @@ -0,0 +1,42 @@ +/** + * Pulses a gold outline around one element while the tutorial checklist points at it. + * + * The window's ui_data sends `tutorial_focus` from `tutorial_ui_focus(user, "")` + * (voidcrew/modules/tutorials/tutorial_highlights.dm). Wrap each element a step can point + * at, giving it the focus key from that step's `ui_focus`: + * + * + * + * It adds the `TutorialFocus` class to its one child and renders nothing of its own, so + * layout never changes. The child must pass `className` through to its DOM element: plain + * elements, tgui Button, Tabs.Tab, Table.Row and Box all do; a custom component needs a + * `className` prop. The outline is drawn inside the element, so a clipping parent can't + * hide it. + */ +import { Children, cloneElement, isValidElement, type ReactNode } from 'react'; + +import { useBackend } from '../backend'; + +type FocusData = { tutorial_focus?: string | null }; + +type Props = { + /** The focus key (or keys) this element answers to, e.g. "helm_dock". */ + id: string | string[]; + /** Overrides the window's `tutorial_focus`, for windows that send it under another name. */ + focus?: string | null; + children: ReactNode; +}; + +export const TutorialFocus = (props: Props) => { + const { id, children } = props; + const { data } = useBackend(); + const focus = props.focus === undefined ? data?.tutorial_focus : props.focus; + const matches = Array.isArray(id) ? id.includes(focus || '') : focus === id; + if (!focus || !matches) return <>{children}; + const child = Children.only(children); + if (!isValidElement<{ className?: string }>(child)) return <>{children}; + const existing = child.props.className; + return cloneElement(child, { + className: existing ? `${existing} TutorialFocus` : 'TutorialFocus', + }); +}; diff --git a/tgui/packages/voidcrew_tgui/interfaces/ChromeCradle.tsx b/tgui/packages/voidcrew_tgui/interfaces/ChromeCradle.tsx index cf51c16a304..5c8130b9d23 100644 --- a/tgui/packages/voidcrew_tgui/interfaces/ChromeCradle.tsx +++ b/tgui/packages/voidcrew_tgui/interfaces/ChromeCradle.tsx @@ -6,6 +6,7 @@ import { type BooleanLike, classes } from 'tgui-core/react'; import { resolveAsset } from '../../tgui/assets'; import { useBackend } from '../backend'; +import { TutorialFocus } from '../components/TutorialFocus'; import { Window } from '../layouts'; import { BROWNOUT_COLOR, @@ -131,6 +132,7 @@ type Data = { ink: Ink | null; groups: Group[]; tray_count: number; + tutorial_focus?: string | null; }; const TIER_NAMES: Record = { @@ -309,7 +311,9 @@ const LoadRail = () => { className="Cradle__loadCell" style={{ width: `${(segment.load / scale) * 100}%`, - backgroundColor: brownout ? BROWNOUT_COLOR : segmentColor(segment), + backgroundColor: brownout + ? BROWNOUT_COLOR + : segmentColor(segment), }} />
@@ -369,9 +373,7 @@ const Rack = () => { const { groups, has_occupant } = data; if (!has_occupant) { - return ( -
The rack is dark.
- ); + return
The rack is dark.
; } return ( @@ -425,6 +427,13 @@ const Tile = (props: { ware: Ware }) => { const { act, data } = useBackend(); const picked = data.selected === ware.ref; const fault = faultLabel(ware); + // The tutorial points at the first part that fits until one is picked. Set on the button by hand: + // the Tooltip clones its child, so a TutorialFocus wrapper there would swallow its hover props. + const tutorialPulse = + data.tutorial_focus === 'cradle_install' && + !!data.occupant_is_user && + !data.selected && + firstFittingRef(data.groups) === ware.ref; return ( } position="right"> @@ -435,6 +444,7 @@ const Tile = (props: { ware: Ware }) => { !!ware.installed && 'Cradle__tile--installed', picked && 'Cradle__tile--picked', !ware.installed && !ware.fits && 'Cradle__tile--nofit', + tutorialPulse && 'TutorialFocus', ])} style={{ borderColor: tierColor(ware.tier) }} onClick={() => act('select', { ref: ware.ref })} @@ -455,6 +465,16 @@ const Tile = (props: { ware: Ware }) => { ); }; +/** The first part not yet installed that fits, in rack order, or null. */ +function firstFittingRef(groups: Group[]): string | null { + for (const group of groups) { + for (const ware of group.ware) { + if (!ware.installed && ware.fits) return ware.ref; + } + } + return null; +} + /** * What a tile says on hover: the whole card without having to commit a click. * Clicking is what puts the piece on the body, so hovering has to be enough to @@ -516,9 +536,7 @@ const Detail = () => { .find((entry) => entry.ref === selected); if (!ware) { - return ( -
Nothing selected.
- ); + return
Nothing selected.
; } // Only the occupant, conscious and unrestrained, may order work on their own @@ -613,14 +631,16 @@ const Detail = () => { EXTRACT ) : ( - act('install', { ref: ware.ref })} - > - INSTALL - + + act('install', { ref: ware.ref })} + > + INSTALL + + )}
@@ -708,9 +728,10 @@ const ActionButton = (props: { disabled?: boolean; hint?: string; onClick: () => void; + className?: string; children; }) => { - const { tone, disabled, hint, onClick, children } = props; + const { tone, disabled, hint, onClick, className, children } = props; return ( + + + )) )} @@ -3468,20 +3478,24 @@ const DockPickerMenu = (props: {
Nothing to dock with
) : ( options.map((option) => ( - + + )) )} @@ -4152,20 +4166,24 @@ const DockVariantButtons = (props: { target?: string | null }) => { return (data.dockOptions ?? []) .filter((option) => option.ref === props.target && option.variant) .map((option) => ( - + + )); }; @@ -4483,45 +4501,47 @@ const HelmRose = () => { return (
-
- {ROSE_CELLS.map(([name, direction, rotation]) => { - const isStop = direction === BURN_STOP; - const lit = isStop - ? burnDirection === BURN_STOP - : commandedCourse === direction; - return ( - - ); - })} -
+ +
+ {ROSE_CELLS.map(([name, direction, rotation]) => { + const isStop = direction === BURN_STOP; + const lit = isStop + ? burnDirection === BURN_STOP + : commandedCourse === direction; + return ( + + ); + })} +
+
); }; @@ -4604,10 +4624,12 @@ const OpsButton = (props: { state?: 'armed' | 'active' | 'distress'; title: string; onClick: (event: React.MouseEvent) => void; + /** Extra classes, e.g. from TutorialFocus. */ + className?: string; }) => ( + + + diff --git a/tgui/packages/voidcrew_tgui/interfaces/MissionBoard.tsx b/tgui/packages/voidcrew_tgui/interfaces/MissionBoard.tsx index 8335a59a283..ce44fc7b23a 100644 --- a/tgui/packages/voidcrew_tgui/interfaces/MissionBoard.tsx +++ b/tgui/packages/voidcrew_tgui/interfaces/MissionBoard.tsx @@ -19,6 +19,7 @@ import type { BooleanLike } from 'tgui-core/react'; import { useBackend } from '../../tgui/backend'; import { Window } from '../../tgui/layouts'; +import { TutorialFocus } from '../components/TutorialFocus'; type RewardItem = { name: string; @@ -120,6 +121,8 @@ type Data = { wanted?: WantedEntry[]; // Static data: record id -> base64 mugshot, never sent in the live data wanted_mugshots?: Record; + /** The tutorial checklist's focus key for this window (TutorialFocus), or null. */ + tutorial_focus?: string | null; }; /** One wanted criminal on the board: a public bounty or this ship's private offer. */ @@ -407,12 +410,22 @@ const MissionBoardContent = () => { > Available ({offered.length}) - setCurrentTab('active')} + - Active ({activeCount}) - + setCurrentTab('active')} + > + Active ({activeCount}) + + @@ -539,6 +552,7 @@ const MissionCard = (props: MissionCardProps) => { const { active_count, max_missions } = data; const canAccept = !isActive && active_count < max_missions; + const canTurnIn = !!mission.can_complete || padContents.length > 0; // Format time remaining const formatTime = (deciseconds: number) => { @@ -589,38 +603,44 @@ const MissionCard = (props: MissionCardProps) => { {mission.requires_item ? ( - + + + ) : ( - + + + )} )} {!isActive && ( - + + + )} ); @@ -742,16 +762,18 @@ const BountyCard = (props: BountyCardProps) => { {bounty.is_hunting ? ( - + + + {!bounty.has_tracking && ( @@ -775,16 +797,18 @@ const BountyCard = (props: BountyCardProps) => { ) : ( - + + + )} diff --git a/tgui/packages/voidcrew_tgui/interfaces/OrientationBriefing.tsx b/tgui/packages/voidcrew_tgui/interfaces/OrientationBriefing.tsx deleted file mode 100644 index ed8c1761516..00000000000 --- a/tgui/packages/voidcrew_tgui/interfaces/OrientationBriefing.tsx +++ /dev/null @@ -1,180 +0,0 @@ -import { useState } from 'react'; -import { - Box, - Button, - Icon, - NoticeBox, - Section, - Stack, - Tabs, -} from 'tgui-core/components'; -import type { BooleanLike } from 'tgui-core/react'; - -import { useBackend } from '../backend'; -import { Window } from '../layouts'; - -type Zone = { - name: string; - color: string; - summary: string; - rules: string[]; -}; - -type ResearchNode = { - name: string; - desc: string; -}; - -type Data = { - ship_name: string | null; - combat_researched: BooleanLike; - zones: Zone[]; - research_path: ResearchNode[]; -}; - -type TabName = 'welcome' | 'zones' | 'combat'; - -const TABS: { id: TabName; label: string; icon: string }[] = [ - { id: 'welcome', label: 'Welcome', icon: 'hand-spock' }, - { id: 'zones', label: 'Zones', icon: 'circle-half-stroke' }, - { id: 'combat', label: 'Ship Combat', icon: 'crosshairs' }, -]; - -export const OrientationBriefing = () => { - const [tab, setTab] = useState('welcome'); - - return ( - - - - - - {TABS.map((entry) => ( - setTab(entry.id)} - icon={entry.icon} - > - {entry.label} - - ))} - - - - {tab === 'welcome' && } - {tab === 'zones' && } - {tab === 'combat' && } - - - - - ); -}; - -/** The reason this window exists at all: the server is being tested on you. */ -const WelcomeTab = () => { - const { act } = useBackend(); - - return ( -
- - Things will break. Expect bugs, half-finished features and rounds that - end badly through no fault of your own. - - - Report anything broken to jackrip on the Discord, what you were - doing and roughly when is usually enough to find it in the logs. The - wiki covers ships, the overmap, missions and everything else Voidcrew - adds, in far more detail than this window. - - - - - - - - - - - You crew a ship on an overmap. Take contracts, mine, trade and explore; - fly further out for better pay and worse odds. The other two tabs cover - where you are allowed to go and how to arm the ship. - -
- ); -}; - -/** What the three overmap bands permit, straight off the defines that enforce it. */ -const ZonesTab = () => { - const { data } = useBackend(); - const { zones } = data; - - return ( -
- - Your helm console always shows which ring you are in. Crossing a border - takes ten seconds and can be cancelled until it completes. - - {zones.map((zone) => ( - - - - {zone.name} - - {zone.summary} - - {zone.rules.map((rule) => ( - - • {rule} - - ))} - - - ))} - - Farther out, be ready for meteors, radiation storms on planets, hostile - crews and worse. - -
- ); -}; - -/** Why a new crew should not simply fly outward, and what fixes that. */ -const CombatTab = () => { - const { data } = useBackend(); - const { research_path, combat_researched, ship_name } = data; - - return ( -
- - Shields, turrets, missiles and interdictors are researched on your own - ship, not bought. Use an R&D console wired to your ship's - research server; each node unlocks a board you print and build in. - - {research_path.map((node) => ( - - {node.name} - {node.desc} - - ))} - {combat_researched ? ( - - {ship_name ?? 'Your ship'} has Shuttle Warfare Systems researched. You - can build shields and weapons whenever you are ready. - - ) : ( - - {ship_name ?? 'Your ship'} has no Shuttle Warfare Systems research yet: - no shields, nothing to shoot back with. Take contracts in the middle - ring, earn research points, and stay out of the outer ring until you - are equipped. - - )} -
- ); -}; diff --git a/tgui/packages/voidcrew_tgui/interfaces/OutpostElevator.tsx b/tgui/packages/voidcrew_tgui/interfaces/OutpostElevator.tsx index eaf0f3cb5df..8d88649911e 100644 --- a/tgui/packages/voidcrew_tgui/interfaces/OutpostElevator.tsx +++ b/tgui/packages/voidcrew_tgui/interfaces/OutpostElevator.tsx @@ -10,6 +10,7 @@ import type { BooleanLike } from 'tgui-core/react'; import { useBackend } from '../../tgui/backend'; import { Window } from '../../tgui/layouts'; +import { TutorialFocus } from '../components/TutorialFocus'; type Floor = { id: number; @@ -24,6 +25,8 @@ type Data = { moving: BooleanLike; linked: BooleanLike; floors: Floor[]; + /** The tutorial checklist's focus key for this window (TutorialFocus), or null. */ + tutorial_focus?: string | null; }; export const OutpostElevator = (props) => { @@ -49,39 +52,47 @@ export const OutpostElevator = (props) => { {floors.map((floor) => ( - + + ))} diff --git a/tgui/packages/voidcrew_tgui/interfaces/OutpostMissionBoard.tsx b/tgui/packages/voidcrew_tgui/interfaces/OutpostMissionBoard.tsx index 1a4e708e03c..cc4226be9d4 100644 --- a/tgui/packages/voidcrew_tgui/interfaces/OutpostMissionBoard.tsx +++ b/tgui/packages/voidcrew_tgui/interfaces/OutpostMissionBoard.tsx @@ -15,6 +15,7 @@ import type { BooleanLike } from 'tgui-core/react'; import { useBackend } from '../../tgui/backend'; import { Window } from '../../tgui/layouts'; +import { TutorialFocus } from '../components/TutorialFocus'; type RewardItem = { name: string; @@ -64,6 +65,8 @@ type Data = { crew_ships: { ref: string; name: string }[]; crew_ship_ref: string | null; reputation?: Reputation | null; + /** The tutorial checklist's focus key for this window (TutorialFocus), or null. */ + tutorial_focus?: string | null; }; const ARCHETYPE_ICONS = { @@ -202,20 +205,22 @@ const OfferCard = (props: { offer: Offer; canAccept: boolean }) => { - + + + @@ -269,7 +274,9 @@ const ShipMissionRow = (props: { mission: ShipMission }) => { {!canTurnIn && mission.turn_in_hint ? ( {turnInButton} ) : ( - turnInButton + + {turnInButton} + )} diff --git a/tgui/packages/voidcrew_tgui/interfaces/ShipCombatConsole.tsx b/tgui/packages/voidcrew_tgui/interfaces/ShipCombatConsole.tsx index dc4ce68e113..3687ce8688f 100644 --- a/tgui/packages/voidcrew_tgui/interfaces/ShipCombatConsole.tsx +++ b/tgui/packages/voidcrew_tgui/interfaces/ShipCombatConsole.tsx @@ -20,6 +20,7 @@ import { type BooleanLike } from 'tgui-core/react'; import { resolveAsset } from '../../tgui/assets'; import { useBackend } from '../backend'; +import { TutorialFocus } from '../components/TutorialFocus'; import { Window } from '../layouts'; // ---------------------------------------------------------------- geometry @@ -230,6 +231,8 @@ type Data = { cloak_active: BooleanLike; attack_mode: BooleanLike; is_in_attack_mode: BooleanLike; + /** The tutorial checklist's focus key for this window (TutorialFocus), or null. */ + tutorial_focus?: string | null; target_name: string | null; target_ref: string | null; // Targeting lock-in-progress data @@ -1621,6 +1624,11 @@ const ApproachCluster = () => { const TABS = ['Contacts', 'Exploits', 'Defense', 'Systems'] as const; type Tab = (typeof TABS)[number]; +/** Tutorial focus key each drawer tab answers to. */ +const TAB_FOCUS: Partial> = { + Contacts: 'wpn_contact', + Exploits: 'wpn_hack', +}; const Drawer = () => { const { data } = useBackend(); @@ -1637,23 +1645,27 @@ const Drawer = () => {
{TABS.map((name) => ( - + + ))}
@@ -1797,46 +1809,50 @@ const ContactsTab = () => { others.map((ship) => { const targetable = !!ship.same_zone; return ( -
{ - if (targetable) act('select_target', { ref: ship.ref }); - }} + id={targetable ? 'wpn_contact' : ''} > - - - - {ship.name} - - {ship.distance} {bearingOf(ship.dx, ship.dy)} - - - {ship.identified ? ( - <> - shd {Math.round(ship.shields)}/{ship.shields_max} · hull{' '} - {Math.round(ship.integrity)}% - - ) : ( - 'no signature' - )} - {!targetable && ( - [{ship.zone_name}] - )} - -
+
{ + if (targetable) act('select_target', { ref: ship.ref }); + }} + > + + + + {ship.name} + + {ship.distance} {bearingOf(ship.dx, ship.dy)} + + + {ship.identified ? ( + <> + shd {Math.round(ship.shields)}/{ship.shields_max} · hull{' '} + {Math.round(ship.integrity)}% + + ) : ( + 'no signature' + )} + {!targetable && ( + [{ship.zone_name}] + )} + +
+ ); }) )} @@ -1988,6 +2004,9 @@ const ExploitsTab = () => { ); }; +/** Tutorial focus keys a runnable cartridge's run buttons answer to. */ +const EXEC_FOCUS = ['wpn_hack', 'wpn_execute']; + const EwChipRow = (props: { chip: EwChip }) => { const { chip } = props; const { act, data } = useBackend(); @@ -2058,27 +2077,30 @@ const EwChipRow = (props: { chip: EwChip }) => {
{chip.modes && chip.modes.length > 0 ? ( chip.modes.map((mode) => ( + + + + )) + ) : ( + - )) - ) : ( - + )}
@@ -2533,24 +2555,28 @@ const TubesPanel = () => {
- - + + + + + + {pod_tubes.length > 0 && (
- + + + {!!reason &&
{reason}
} ); @@ -2815,10 +2843,15 @@ const OpsButton = (props: { state?: 'armed' | 'active'; title: string; onClick: () => void; + className?: string; }) => ( + + + + + ); @@ -1313,26 +1339,28 @@ const Research = () => { return ( - + 0 ? 'survey_print' : ''}> + + { ); } + // Tutorial checklist (rd_node_): list the node it points at first, and pulse the + // Available tab while that node is available but another tab is open. + const tutorialFocus = data.tutorial_focus || ''; + const focusNodeId = tutorialFocus.startsWith('rd_node_') + ? tutorialFocus.slice('rd_node_'.length) + : ''; + const focusNode = focusNodeId + ? displayedNodes.find((x) => x.id === focusNodeId) + : undefined; + if (focusNode) { + displayedNodes = [ + focusNode, + ...displayedNodes.filter((x) => x !== focusNode), + ]; + } + const focusAvailable = + !!focusNodeId && + (searching || tabIndex !== 1) && + nodes.some((x) => x.id === focusNodeId && x.tier === 1); + const switchTab = (tab) => { setTabIndex(tab); setSearchText(null); @@ -281,12 +302,14 @@ const TechwebOverview = (props) => { > Researched - switchTab(1)} - > - Available - + + switchTab(1)} + > + Available + + switchTab(2)} @@ -578,7 +601,12 @@ const TechNode = (props) => { return (
). + data.tutorial_focus === `rd_node_${id}` + ? 'Techweb__NodeContainer TutorialFocus' + : 'Techweb__NodeContainer' + } title={name} buttons={ !nocontrols && ( diff --git a/tgui/packages/voidcrew_tgui/interfaces/TraderShop.tsx b/tgui/packages/voidcrew_tgui/interfaces/TraderShop.tsx index 73f84f403a7..68aa1831f9f 100644 --- a/tgui/packages/voidcrew_tgui/interfaces/TraderShop.tsx +++ b/tgui/packages/voidcrew_tgui/interfaces/TraderShop.tsx @@ -15,6 +15,7 @@ import type { BooleanLike } from 'tgui-core/react'; import { useBackend } from '../../tgui/backend'; import { Window } from '../../tgui/layouts'; +import { TutorialFocus } from '../components/TutorialFocus'; type CatalogSku = { ref: string; @@ -83,6 +84,8 @@ type Data = { crew_ships: { ref: string; name: string }[]; crew_ship_ref: string | null; reputation?: Reputation | null; + /** The tutorial checklist's focus key for this window (TutorialFocus), or null. */ + tutorial_focus?: string | null; }; const SHELF_TAGS = { @@ -261,13 +264,26 @@ const SkuRow = (props: { {live?.denial && !live.can_buy && !barred && (isFavor || !soldOut) ? ( {buyButton} ) : ( - buyButton + + {buyButton} + )} ); }; +/** The shop category the Buy chrome tutorial step points at. */ +const CHROME_CATEGORY = 'Street Chrome'; + const BuyView = (props: { barred: BooleanLike }) => { const { data } = useBackend(); const { barred } = props; @@ -303,13 +319,21 @@ const BuyView = (props: { barred: BooleanLike }) => { All ({catalog.length}) {withItems.map((cat) => ( - setCategory(cat)} + id={ + cat === CHROME_CATEGORY && category !== cat + ? 'trader_chrome_tab' + : '' + } > - {cat} ({catalog.filter((sku) => sku.category === cat).length}) - + setCategory(cat)} + > + {cat} ({catalog.filter((sku) => sku.category === cat).length}) + + ))} @@ -342,13 +366,15 @@ const LedgerRow = (props: { const sellButtons = ( <> - + 0 ? 'trader_sell' : ''}> + + {!done && carrying > 1 && (