diff --git a/EXE/CONFIGURATION.md b/EXE/CONFIGURATION.md new file mode 100644 index 00000000..9f985e7a --- /dev/null +++ b/EXE/CONFIGURATION.md @@ -0,0 +1,138 @@ +# Configuration + +`rem-essentials` uses one active runtime configuration and, when the REM +Launcher is used, one persistent user override file. + +## Configuration files + +### Active game configuration + +The DLL reads only this file at game startup: + +```text +Freelancer/EXE/rem-essentials.ini +``` + +The file is shipped with the mod and contains the complete setting schema, +descriptions, metadata, and release defaults. A manual installation only needs +this INI and `rem-essentials.dll` in the `EXE` directory. + +If the active INI is missing, the DLL uses its compiled defaults. The compiled +defaults intentionally match the shipped INI, but distributing the INI is +recommended because it exposes every feature and typed parameter. + +### Launcher user overrides + +The REM Launcher stores player choices separately: + +```text +My Games/REM/rem-essentials.user.ini +``` + +On Wine or Proton, `My Games` is inside the Windows user profile of the active +prefix. Its exact Linux path depends on how the Launcher or game prefix was +created. + +The DLL does not read this user file. The Launcher merges matching values from +the user file into `Freelancer/EXE/rem-essentials.ini`: + +- after a game/mod update +- after saving settings in the Launcher +- immediately before starting Freelancer + +This allows an update to replace the shipped schema while retaining player +choices. New settings from an updated default INI appear automatically. Values +from the user override win when the same section and key exist in both files. + +## Value precedence + +At runtime, the effective value is determined in this order: + +1. The compiled DLL fallback is used when no setting can be read. +2. `Freelancer/EXE/rem-essentials.ini` overrides the compiled fallback. +3. Before launch, the Launcher materializes values from + `rem-essentials.user.ini` into the active INI. + +For a manual installation without the Launcher, only the first two levels +apply. Editing the active INI is therefore sufficient. + +## Sections and value types + +Feature switches live in `[rem-essentials]`. Parameters used by migrated +flplusplus behavior live in `[flplusplus]`. + +Boolean values accept: + +```text +true / false +1 / 0 +yes / no +on / off +``` + +Integer, float, and string settings are described by the comments immediately +above each key. Metadata such as `type`, `min`, `max`, `default`, `group`, and +`risk` is also used by the Launcher to build the settings UI. + +## Save directory behavior + +REM keeps the historical installation-local save directory as its default: + +```ini +[rem-essentials] +save_path_feature = true + +[flplusplus] +save_in_directory = true +save_folder_name = Freelancer +``` + +With `save_in_directory = true`, the patched path is calculated relative to +`Freelancer.exe`: + +```text +Freelancer/EXE/../SAVE +``` + +For an installation such as: + +```text +/home//Schreibtisch/RemLauncher_AppData/current/Freelancer/EXE/Freelancer.exe +``` + +the effective save directory is: + +```text +/home//Schreibtisch/RemLauncher_AppData/current/Freelancer/SAVE +``` + +With `save_in_directory = false`, the plugin instead uses the Windows +Documents folder exposed by Windows, Wine, or Proton and appends: + +```text +My Games/ +``` + +`save_folder_name` is therefore only relevant when +`save_in_directory = false`. Setting `save_path_feature = false` disables this +hook completely and restores Freelancer's unpatched path behavior. + +Changing the setting does not move existing saves. Move existing files to the +selected directory before launching when switching between layouts. + +## Manual installation + +1. Copy `rem-essentials.dll` and `rem-essentials.ini` into `Freelancer/EXE`. +2. Add `rem-essentials.dll` to the appropriate `[Libraries]` section in + `dacom.ini` and, for FLServer features, `dacomsrv.ini`. +3. Ensure `save_path_feature = true` and `save_in_directory = true` for the REM + installation-local `SAVE` layout. +4. Fully restart Freelancer after changing the INI. Settings are read when the + DLL is loaded. + +## Launcher-managed installation + +Use the Game Settings page to change supported values. Saving creates or +updates `My Games/REM/rem-essentials.user.ini`. Avoid manually changing the +active INI while a conflicting user override exists, because the Launcher will +materialize the user value again before game startup. diff --git a/EXE/THIRD_PARTY_NOTICES.md b/EXE/THIRD_PARTY_NOTICES.md new file mode 100644 index 00000000..827e5fa4 --- /dev/null +++ b/EXE/THIRD_PARTY_NOTICES.md @@ -0,0 +1,57 @@ +# Third Party Notices + +This project contains code derived from: + +- FLSharp, https://github.com/BC46/FLSharp +- flplusplus, https://github.com/FLHDE/flplusplus + +FLSharp is licensed under the MIT License. + +Copyright (c) 2026 C.S. Melis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +flplusplus is licensed under the BSD 3-Clause License. + +Copyright 2020 Callum McGing, flplusplus contributors + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/EXE/dacom.ini b/EXE/dacom.ini index 5fec0d2d..cf2c87b4 100644 --- a/EXE/dacom.ini +++ b/EXE/dacom.ini @@ -31,6 +31,7 @@ storyfactions.dll Territory.dll TurretZoom.dll max=1000 shift=100 ctrl=10 alt=2 s+c=0.2 c+a=0.1 switch=50 interval=250 adjust=0.85 MultiIntro.dll +rem-essentials.dll WheelScroll.dll Zone.dll HUDless.dll diff --git a/EXE/rem-essentials.dll b/EXE/rem-essentials.dll new file mode 100644 index 00000000..6d7c34a5 Binary files /dev/null and b/EXE/rem-essentials.dll differ diff --git a/EXE/rem-essentials.ini b/EXE/rem-essentials.ini new file mode 100644 index 00000000..3a9d89a5 --- /dev/null +++ b/EXE/rem-essentials.ini @@ -0,0 +1,258 @@ +[rem-essentials] +; type=bool group=Server default=true +; Do not kick players from the server for re-purchasing the same ship. +ship_buy_kick_fix = true + +; type=bool group=Client Stability default=true +; Fix Freelancer sometimes getting stuck in the message loop after the Quit message is retrieved. +quit_message_fix = true + +; type=bool group=Client Stability default=true +; Fix rare alchemy.dll crashes around offsets 0x701b and 0x77cb. +alchemy_crash_fix = true + +; type=bool group=Navigation default=true +; Clear the jump destination waypoint after a successful system jump. +jump_destination_waypoint_fix = true + +; type=bool group=Mouse default=true +; Hide the in-game cursor when the real cursor is outside the game window. +cursor_visibility_fix = true + +; type=bool group=Mouse default=false risk=proton +; Fix Windows cursor flicker at screen borders in borderless windowed mode. +cursor_border_flicker_fix = true + +; type=bool group=Mouse default=false risk=proton +; Prevent mouse warps to the center of the game window in windowed modes. +mouse_warp_fix = true + +; type=bool group=Client Updates default=false +; Smooth client-server updates and fix incorrect engine-state updates. +better_updates = true + +; type=bool group=Navigation default=true +; Keep cross-system waypoints and prevent setting waypoints on the player ship. +waypoint_fixes = true + +; type=bool group=Navigation default=true +; Fix waypoint names and waypoint information in target/current-info views. +waypoint_name_fixes = true + +; type=bool group=Combat default=true +; Play one-shot sounds for multi-barrel launchers. +projectiles_sound_fix = true + +; type=bool group=Combat default=true +; Fix ammo decrementing for multi-barrel launchers on client/server. +projectiles_server_fix = true + +; type=bool group=Display default=false +; Expand selectable resolutions and use the main monitor as default. +better_resolutions = false + +; type=bool group=Audio default=true +; Add interface/ambience test sounds and safer volume slider behavior. +more_test_sounds = true + +; type=bool group=World default=true +; Fix trade-lane lights not turning back on after disruptions. +trade_lane_lights_fix = true + +; type=bool group=UI default=false +; Enable Ctrl+C/Ctrl+V in Freelancer input boxes. +copy_paste_feature = false + +; type=bool group=UI default=true +; Improve slide-out animation for multiplayer menu buttons. +slide_ui_anim_fix = true + +; type=bool group=Equipment default=true +; Enable weapon use_animation scripts and parent animations with leading underscore. +weapon_anim_fix = true + +; type=bool group=Equipment default=true +; Play weapon flash particles on all barrels instead of only the first. +flash_particle_fix = true + +; type=bool group=Dealer default=false +; Print exact reputation requirements in dealer rejection text when resources support it. +print_rep_requirements = false + +; type=bool group=Client Stability default=true +; Move DirectPlay shutdown before process exit to avoid post-game deadlocks. +post_game_deadlock_fix = true + +; type=bool group=Controls default=true +; Reset rotation lock and auto-level defaults when launching to space. +flight_controls_fix = true + +; type=bool group=Infocards default=false +; Show infocards for dynamic solars and archetype fallback infocards. +dynamic_solar_infocards = false + +; type=bool group=Client Stability default=true +; Prevent crashes from malformed save files. +save_crash_fix = true + +; type=bool group=Infocards default=true +; Fix blank faction text for fc_uk_grp ships. +blank_faction_fix = true + +; type=bool group=Client Stability default=true +; Fix crash when closing the Server Filter dialog. +server_filter_crash_fix = true + +; type=bool group=Client Stability default=true +; Fix sudden game-speed increases after opening the Server Filter dialog. +server_filter_speed_fix = true + +; type=bool group=Client Stability default=true +; Prevent Freelancer and FLServer crashing on missing DLL entries in freelancer.ini. +freelancer_dll_crash_fix = true + +; type=bool group=Infocards default=true +; Show shield capacity reduced by offline_threshold. +shield_capacity_fix = true + +; type=bool group=Dealer default=true +; Fix dealer menus not opening when clicking the dealer twice. +dealer_menu_open_fix = true + +; type=bool group=Dealer default=true +; Fix crashes that can occur when opening dealer menus. +dealer_crash_fix = true + +; type=bool group=Groups default=false +; Allow entering formation with hostile group members. +hostile_group_formation = false + +; type=bool group=Groups default=true +; Prevent hostile group members from being shown as hostile. +unhostile_group_members = true + +; type=bool group=Groups default=true +; Show GROUP MEMBER attitude for group members. +group_member_attitude = true + +; type=bool group=Targeting default=false +; Add custom targeting cursor colors for group members and trade request senders. +more_cursor_colors = true + +; type=bool group=Infocards default=true +; Fix first sold-item category entry alignment in Current Information on some resolutions. +base_info_spacing_fix = true + +; type=bool group=Infocards default=true +; Fix long pilot names being truncated in Current Information, comms, and cargo dialogs. +pilot_names_fix = true + +; type=bool group=Logging default=true source=flplusplus +; Add timestamps to FLSpew.txt and server log output. +timestamped_logs = true + +; type=bool group=Logging default=false source=flplusplus +; Redirect FLSpew output to a console window. +log_to_console = false + +; type=bool group=Saves default=true source=flplusplus +; Use the configured save folder path instead of Freelancer's hard-coded default. +save_path_feature = true + +; type=bool group=Wine default=true source=flplusplus +; Suppress MP3 codec warning spam on Wine/Proton. +wine_mp3_codec_warning_fix = true + +; type=bool group=Logging default=true source=flplusplus +; Remove the Failed to get start location warning. +remove_start_location_warning = true + +; type=bool group=Saves default=true source=flplusplus +; Regenerate Restart.fl on startup to avoid malformed restart-file crashes. +always_regenerate_restart_file = true + +; type=bool group=Screenshots default=false source=flplusplus +; Replace default screenshots with PNG output. +png_screenshots = false + +; type=bool group=Screenshots default=true source=flplusplus +; Use the configured screenshot folder instead of Freelancer's default path. +screenshot_path_feature = true + +; type=bool group=Fonts default=false source=flplusplus +; Load private TTF font resources from DATA/FONTS/fonts.ini [FontFiles]. +font_file_loading = false + +; type=bool group=Developer default=false source=flplusplus +; Enable THN player behavior when Freelancer is launched with -thn. +thn_player = false + +; type=bool group=Input default=false source=flplusplus risk=mouse +; Fix touchpad scrolling but may break normal mouse wheel scrolling. +touchpad_support = false + +; type=bool group=Mouse default=false source=flplusplus risk=mouse +; Confine the in-game cursor in windowed mode. +confine_cursor = true + +; type=bool group=Dealer default=false source=flplusplus +; Enable mouse-wheel zoom in the ship dealer preview. +ship_preview_scroll = true + +; type=bool group=Graphics default=true source=flplusplus +; Disable unsupported video dialog, fix max texture size, and suppress Vibrocentric font override. +graphics_base_fixes = true + +; type=bool group=Graphics default=true source=flplusplus +; Apply configurable LOD, pBubble, character-detail, and asteroid-distance scaling. +graphics_detail_scaling = true + +; type=bool group=Saves default=true source=flplusplus +; Override the IDS shown when Freelancer cannot initialize the saves directory. +failed_save_dir_ids_override = true + +[flplusplus] +; type=float min=1 max=1000000 group=Graphics default=1.0 +lod_scale = 1.0 + +; type=float min=1 max=1000000 group=Graphics default=1.0 +pbubble_scale = 1.0 + +; type=float min=1 max=1000000 group=Graphics default=1.0 +character_detail_scale = 1.0 + +; type=float min=1 max=10 group=Graphics default=1.0 +asteroid_dist_scale = 1.0 + +; type=string group=Saves default=Freelancer +save_folder_name = Freelancer + +; type=bool group=Saves default=true +save_in_directory = true + +; type=string group=Screenshots default=FreelancerShots +screenshots_folder_name = FreelancerShots + +; type=bool group=Screenshots default=false +screenshots_in_directory = false + +; type=bool group=Screenshots risk=proton default=true +alternative_fullscreen_screenshots_code = true + +; type=bool group=Screenshots risk=proton default=false +alternative_windowed_screenshots_code = false + +; type=int min=0 group=Saves default=1849 +failed_to_init_saves_dir_ids = 1849 + +; type=float min=0 max=50 group=Dealer default=3.0 +ship_preview_scrolling_speed = 3.0 + +; type=bool group=Dealer default=false +ship_preview_scrolling_inverse = false + +; type=float min=0 max=100 group=Dealer default=0.0 +ship_preview_scrolling_min_distance = 0.0 + +; type=float min=0 max=100 group=Dealer default=100.0 +ship_preview_scrolling_max_distance = 100.0