Releases: itb-community/ITB-ModLoader
Releases · itb-community/ITB-ModLoader
v2.2.5
General
- Repair replacement icons now are only drawn when the pawn is selected, and the icon no longer obscures the pilot tooltip.
- Added support for mod descriptions in mod configuration dialog via
description = "Some cool description"
mod table field. - Added support for mods specifying minimum required version of the mod loader via
modApiVersion = "2.2.5"
mod table field. - The mod loader will show a special dialog for mods that could not be loaded, because their mod loader version requirement was not satisfied.
- Fixed
DecoAnimSheet
not being loaded - Fixed an issue with queued spawn detection, where it could potentially miss some spawns (thanks Lemonymous)
API
- Added
GetParentPath
function - Added
rect_intersects
function - Added
sdlext.gameWindowResized
hook
v2.2.4
General:
- Modded UI dialogs with buttons now play highlight/click sounds
- Due to the game's quirks, these sounds can only be played while in game (ie. not in main menu/hangar)
- Minor fixes to main menu button decoration style.
API:
- Added
IsColorEqual()
- Added
GetCurrentRegion()
- Added
GetCurrentMission()
- Added
CreatePilotPersonality()
- Added
DecoAnimSheet
- Vek spawn locations are now tracked by the mod loader.
- This data is stored in
mission.QueuedSpawns
table. Index in the table specifies the order in which the vek will spawn.
- This data is stored in
Field | Description |
---|---|
location |
location of the spawn point |
type |
pawn type of the vek that will be spawned |
id |
id of the pawn that will be spawned (pretty useless at the moment, neither Board nor Game are aware of the pawn before it is spawned) |
turns |
how long the spawn point has been on the board |
- Added
GetSpawnPointData()
- Added
RemoveSpawnPoint()
- Added
MoveSpawnPoint()
- Added
vekSpawnAddedHook
andvekSpawnRemovedHook
v2.2.3
Requires Into the Breach version 1.0.22
Reuploaded with a fix for a crash when selecting islands
General:
- Tooltips can now optionally stick to UI elements that spawned them, imitating the behaviour of game's own tooltips.
- Fixed scroll areas not updating their offset when collapsing large expandable UI elements.
- Fixed difficulty selection buttons in the hangar showing up when clicking on locked pilot slots, or on last pilot button when no time-travelling pilot is available.
- Fixed leap movement with game's default
Move:GetSkillEffect
- Dropdowns can now be closed with Escape and opened with Enter (when focused)
- Fixed custom difficulty levels reusing
SectorSpawner
tables from vanilla difficulties without copying them.
API:
- Fixed
missionEndHook
not working for missions overridingMissionEnd
function (eg. final mission) - Added
sdlext.showButtonDialog
, which allows setting tooltips for the dialog's buttons. - Tables serialized to
GAME
can now optionally defineOnSerializationStart
andOnSerializationEnd
functions, to temporarily remove unserializable fields.- These functions provide a table in the argument, which allows for storage and later retrieval of removed fields
- Added simple support for dragging in base
Ui
class - Added
UiDraggable
, which provides utility functions for installing common mouse dragging operations (currently move and resize) UiWrappedText
can now optionally wrap text based on its actual screen width instead of character count (off by default, because it's pretty expensive).- To enable this behaviour, set
pixelWrap
field totrue
on your instance ofUiWrappedText
- To re-wrap the text, you will need to update the element's width, and then force it to rebuild its text by calling
rebuild()
- To enable this behaviour, set
- Added
RegisterRepairIconReplacement
function
v2.2.2
- Fixed
modApi:runLater()
causing errors due to a typo - Fixed resource error dialog not appearing
- (Hopefully) Fixed being able to bug out difficulty selection UI by dragging the mouse rapidly
- Added
preIslandSelectionHook
andpostIslandSelectionHook
v2.2.1
General
- Fixed custom difficulty not being correctly set after quitting a game in progress
- Fixed custom difficulty and vanilla difficulty being able to go out-of-sync, which could happen when switching profiles. Last selected custom difficulty is now stored in a global data file.
- (Hopefully) Fixed custom difficulty selection UI sometimes being drawn at an incorrect offset.
- Visual polish to modded UI:
- Wrapped text computes its size correctly now
- Modded windows now match game's own UI more closely
- Fixed some alignment issues (general text, pilot arrange window, tooltips)
- Opening a dialog window now fades in the black background, similar to opening the Options menu
- Scrollbars in modded UI no longer react to mouse clicks and dragging when there's not enough content to scroll through
- Added an information dialog that pops up when the modloader failed to load game resources.
API:
- Added
modApi:writeModData
andmodApi:readModData
- Used to store data that affects the entire game install / all profiles
- Changed
GetScreenCenter
to simply return center of the screen - Added
GetHangarOrigin
, which returns a reference point for modded UI in the hangar, which includes the offset that was previously accounted for inGetScreenCenter
- Added
modApi:splitStringEmpty
, which includes empty strings in the returned table - Added
sdlext.showAlertDialog
, which allows creating dialogs with buttons- These dialogs cannot be dismissed by clicking outside of them or pressing Escape, only by clicking one of the buttons
- Shorthand
sdlext.showInfoDialog
, which creates an alert dialog withOK
button. - Shorthand
sdlext.showConfirmDialog
, which creates an alert dialog withYES
andNO
buttons.
v2.2.0
This version includes moderate behind-the-scenes changes. I tried to keep things working, but I may have inadvertently broken compatibility with some mods.
General:
- Reorganized directory and file structure of the mod loader. Recommend doing a clean reinstall of the game to remove old mod loader files.
- Disabled mods no longer incorrectly report
installed = true
- Toggling mods in mod configuration window now shows a dialog reminding the user that game restart is required in order to apply the changes
- Mod content button now repositions itself to stay visible when the game window is resized
- Added a custom difficulty level system. Added Very Hard and Impossible difficulties.
- Important: this is merely a system defining difficulties and allowing for their selection in the hangar. Selecting these custom difficulty levels won't do anything without mods providing content for that difficulty.
- Very Hard: Intended for veteran Commanders looking for a challenge.
- Impossible: A punishing difficulty allowing no mistakes.
SetDifficulty
AddDifficulty
GetDifficultyId
GetBaselineDifficulty
IsVanillaDifficultyLevel
API:
- Added
modApi:conditionalHook
- Can schedule a function to run when a condition is fulfilled (checked once every frame)
- Added
modApi:loadIntoEnv
- Loads the specified file, but any global variables it defines will be stored in the returned table instead of
_G
, allowing finer control over what goes into the global table. - Mostly useful to the mod loader to implement the following functions, but maybe some mod finds this useful in the future
- Loads the specified file, but any global variables it defines will be stored in the returned table instead of
- Exposed
modApi:loadSettings()
- Reloads the settings file, and returns a table containing all game settings, allowing to access stuff like colorblind status, and currently selected profile name.
- Generally you shouldn't ever need to call this, the globally accessible
Settings
table is now updated frequently enough to hold up-to-date data - If your code needs to be notified as soon as settings are changed, use
settingsChangedHook
- Added
modApi:loadProfile()
- Loads profile data of the currently selected profile, and returns the table holding the data
- Similarily to
modApi:loadSettings()
, the mod loader calls this function and stores its result inProfile
table
- Added
modApi:writeProfileData
andmodApi:readProfileData
- Allows mods to store persistent profile-specific data (useful for stuff like unlocks or stuff that persists across multiple playthroughs)
- The local
Global_Texts
table fromtext.lua
is now made global by the mod loader. It can be directly modified to change texts in-game. Useful whenmodApi:overwriteText()
is insufficient. - Added
compare_tables()
global function, which returnstrue
if both tables passed into it hold the same data.- Nested tables are also compared using this function
- Userdata fields can't be compared, and are ignored
- Added
modApi:writeAsset
andmodApi:readAsset
- Added
modApi:copyAsset
- Copies an existing asset inside resource.dat to another path in resource.dat
UI:
- Added
DecoSurfaceButton
- Modded UI elements'
mousedown
andmouseup
now also receive the mouse button that was pressed as argument. - Tweaked the way modded UI registers clicks to use the same
contains
logic as game's own UI- Previously there were off-by-one errors if you created a button with the same position and size as a game UI element
- Added
sdlext.isConsoleOpen()
, which returns true if the console is currently open - Added
GetScreenCenter()
global function, which returns center of the screen (game window), correcting for some weird offsets present when the game is not running in fullscreen. - Tweaked the way text UI elements are drawn. Should cause text to be rendered more clearly.
- Changed font used by modded UI tooltips - more closely resembles in-game tooltips.
- Deprecated
sdlext.uiEventLoop
and replaced it withsdlext.showDialog
(takes the same arguments)uiEventLoop
used to freeze the game and had issues when multipleuiEventLoop
s were overlapping (dismissing one dismissed all of them).showDialog
does not stop the game, and allows multiple dialogs to be correctly layered on top of each other.- Note that
uiEventLoop
blocked until it returned. This is not the case withshowDialog
. Code that relied on this quirk will need to be reworked.
- Reworked modded UI (Mod Content and its suboptions) to use
showDialog
- New modded UI can now be added more easily without having to create draw/event hooks, via UI hooks:
sdlext.addUiRootCreatedHook
,sdlext.getUiRoot
sdlext.frameDrawnHook
sdlext.windowVisibleHook
sdlext.addMainMenuEnteredHook
,sdlext.addMainMenuExitedHook
, andsdlext.addMainMenuLeavingHook
sdlext.addHangarEnteredHook
,sdlext.addHangarExitedHook
, andsdlext.addHangarLeavingHook
sdlext.addGameEnteredHook
andsdlext.addGameExitedHook
sdlext.continueClickHook
andsdlext.newGameClickHook
sdlext.preKeyDownHook
andsdlext.preKeyUpHook
,sdlext.postKeyDownHook
andsdlext.postKeyUpHook
- Fired before (pre)/after (post) the root UI element has handled the key events
- Added
sdlext.showTextDialog()
, useful for showing simple information dialogs - Added
InterpolateColor()
v2.1.5
- Mod configuration window now also displays version string in addition to each mod's name.
- Mod loader no longer attempts to load mods which have failed initialization phase, or were not initialized in the first place.
LOG
now prints empty lines for every newline in the original message, to prevent overlapping when a new message is printed after a message containing newlines. Empty lines are slightly taller than a newline in the console, so the gap becomes bigger than necessary for messages with a lot of newlines.printCallerInfo
setting now also affects logging to files.- Altered
CreatePilot()
function to try to prevent duplicate pilots. - Renamed
missionAvailableHook
topostMissionAvailableHook
for consistency with other hooks (retained the old function for compatibility). - Added
missionNextPhaseCreatedHook
- Added string operations to modApi:
- Added
modApi:runLater
- Added
modApi:addMap
- Prevents vanilla maps from being overwritten (since the modloader has no way of restoring them to unmodded state at this time).
- Non-vanilla maps are removed at startup.
v2.1.4
- Voice event hooks now take a third argument indicating whether the voice event has been handled by another hook already. Voice event hooks should now return either
true
orfalse
depending on whether they want other hooks to display their dialogs. - Fixed
startMissionHook
not firing when the player entered the Test Mech scenario before selecting a mission. - Tooltip and data arguments to
addGenerationOption()
are now optional
v2.1.3
- Fixed an issue with
UiBoxLayout
not taking padding into account when laying out children. - Fixed an issue which caused the error frame to not actually show the error that occurred.
- Mods now have an additional
initialized
field. This is useless to mod makers, but allows the modloader to be aware of mods which have not been initialized. - Improved
ScrollArea
scrolling behaviour: scrolling with mouse scroll is faster, and holding and moving the scroll thumb now works outside of the scroll area. - Added
voiceEventHook
- Fixed a bug with infinite console scrolling when reloading scripts and getting a script error
v2.1.2
- Fixed logging to file crashing the game and generally not being set up correctly
- Fixed dropdowns lingering after being dismissed and continuing to intercept mouse clicks