Very simple party barter support. Builds upon the loot screen so is very little code:
Switch party members with left/right arrow keys
When leaving barter with items on the table (canceling), all items go to the PC's inventory
No special handling of money (yet)
The mod pins the player's money stack on top of the inventory list for all party members. That's nice, but also feels a little odd, but likely just because I'm used to the money stack being stuck at bottom. We can iterate on that.
Adding an interface will require art. I considered enabling mouse use triggered by clicking on the avatar which would be quite simple.
* Speed up Fallout1 .dat reader
It was reallocating a buffer on a loop, which caused large files to take minutes. Fixing this reduced it to a reasonable time, but still ~120s for the entire Fallout1 master.dat.
Also, bump the F2 gzip buffer to 4kB. It was only 400 bytes
In 8b2ead8a2b, soundLoad started honoring AudioFileInfo.channels, but the ACM decoder path historically only propagated sample rate. This changes playback in a way that caused the bug.
Verified by talking to good ol' Sulik
* Add support for new talking heads
Add [Heads] config section in ddraw.ini that maps critter PIDs to talking
head indices in art\heads\heads.lst. When a dialog script starts with
headId=-1, the engine now checks the critter proto's headFid first, then
falls back to the [Heads] mapping. This lets mods add talking heads
without patching dialog scripts.
Includes Cassidy mapping (PID 16777305 → head index 13) for use with
cassidy_head.dat mod.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Implement HOOK_INVENWIELD, HOOK_CANUSEWEAPON and fix HOOK_ADJUSTFID
Wire the sfall hooks that npc_armor.mod relies on so party-member sprites
actually change when armor is equipped:
- HOOK_INVENWIELD fires from inventoryEquipFunc/inventoryUnequipFunc with
(critter, item, slot, isWield). Script may veto by returning 0. Slot
values mirror interpreter_extra.cc: WORN=0, RIGHT_HAND=1, LEFT_HAND=2.
- HOOK_CANUSEWEAPON fires from _ai_search_inven_weap so the mod's
weapon-anim restriction can veto AI weapon picks.
- HOOK_ADJUSTFID arg list corrected to match sfall (single currFid arg,
critter resolved via dude_obj).
- ProgramValue::isEmpty no longer treats string values as empty — sfall
scripts like npc_armor's `while (sect.PID)` loop depend on a non-empty
string being truthy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* enum class
* chore: auto-format with clang-format
* bad merge
* PR feedback
* restore isEmpty() to vanilla while fixing bug
* fixes
* minor fixes
* extra
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: tectiv3 <tectiv3@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Sfall-like sound system
(I would like a better name for this system, but the opcodes themselves are called `play|stop_sfall_sound` and I can't think of a better name)
This is a sound management system very similar to Sfall's. With a few differences:
* No support for new sound formats yet. Support for at least ogg+wav will come next
* Does support reading from .dat files, hence playing any sound effect in the base game
* Support mode=3 for speech volume. This exists in Sfall but is ignored when called from the opcode.
Also, change GaplessMusic to use this system to play the "wind2" loading sound. This restores the "vanilla" feel map transitions, so I think it's reasonable to make GaplessMusic=1 the default. I can't imagine someone wanting to change it to 0 unless they are ultra purists
* Sfall saved arrays support
* Add "...all_arrays..." special case for a list of saved arrays
* Adjust error message on load fail
* Fix crash in GetArrayKey when index == size
* chore: auto-format with clang-format
* Update sfall compatibility md
* Add keyIndex for Assoc Arrays for O(1) key lookups
* Review feedback, more error logging
* Fix build, increase ARRAY_MAX_STRING to 1024 to match sfall, fix gl_test_arrays triggering dynamic string block merge failure, prevent potential string buffer corruption on very long strings
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* iOS: add touch gestures, HUD tap-through, quick-actions toolbar
Makes fallout2-ce playable on iPad without a keyboard, while leaving
non-iOS builds unchanged (all additions are TARGET_OS_IOS-guarded).
Touch gestures (src/mouse.cc):
- 3-finger swipe down → ESC
- 4-finger long-press → F6 (quicksave)
- 3-finger long-press → hold LShift (FO2tweaks highlighting). Uses
SDL_PushEvent so sfall's SDL_GetKeyboardState-based key_pressed()
sees the held key, not just the engine's own kb state.
HUD ergonomics (src/mouse.cc):
- Taps on interface-bar buttons inject the button's keyCode directly
so the cursor stays put. Taps on belt chrome are consumed rather
than teleporting the cursor to inert pixels.
- Two-finger taps on belt buttons → right-click handler.
Gameplay cursor (src/game_mouse.cc):
- On iPad, keep GAME_MOUSE_MODE_MOVE in relative (trackpad) mode so
screen taps don't teleport the cursor during combat. UI screens
that explicitly enable touchscreen mode are unaffected.
Quick-actions toolbar (src/platform/ios/quick_toolbar.{cc,h}):
- Optional iOS-only HUD strip above the belt with skill shortcuts
and end-turn. Header provides no-op stubs for non-iOS builds so
interface.cc can call it unconditionally.
- game.cc refactor: skilldex result handling factored into
gameHandleSkilldexResult() so the toolbar and the keyboard
shortcut share one path.
README: iPad controls section.
* iOS: add quick toolbar visibility preference
Adds a ui.quick_toolbar_visible config flag (default true)
* iOS: skip HUD tap-through when interface bar is hidden
When the interface bar window is hidden (e.g. on the world map),
windowGetRect still returns its rect, causing taps in that screen
area to be consumed as overHud even though there's nothing to interact
with. Check WINDOW_HIDDEN before treating the rect as active HUD.
Addresses Copilot review comment on PR #377.
* iOS: fix dialog options near bottom unclickable on iPad
Enable touchscreen mode for dialog UI so taps reach dialog option
buttons directly. The HUD tap interception in mouse.cc was consuming
taps that landed inside the interface bar rect, even when a dialog
window overlapped that region. Dialog options near the bottom of the
screen were silently swallowed by the belt chrome catch-all.
Skip HUD tap interception when touchscreen mode is active, since a UI
screen (dialog, inventory, skilldex, etc.) owns input in that state.
Add touch_get_touchscreen_mode() getter to support the check.
* iOS: add pipboy touch exception
* Apply fixes from review
* Change quick toolbar default visibility to false
* Add touch mode to character selector
update readme and simplify switch condition