This patch bumps IDs of scrollable border to 0x1000 and above, so that
they don't conflict with IDs normal borders, additionally to support this
change windowType is changed from `byte` type to `uint32` type.
This patch implements events for scrolltype text cast members, callbacks
in MacTextWindow is used to redirect events to director engine.
`ATD\HD\bbTWRFL2.DXR@392` of 'totaldistortion-win' uses `mouseUp` score
script attached to scrolltype text cast member, which when clicked calls
`getMouseLine` to find the clicked book, thus opening it.
Win95 scrollbar loading is refactored to use existing `borders` array
in `datafiles.cpp`, Added no-border scrollbar for MacOS, Win95.
This is to support scrollable text cast members in Director, which
will be used by `totaldistortion-win` game.
--start-movie="ATD\HD\bbTWRFL2.DXR@392" totaldistortion-win
This patch adds background window, these are special type of window where
the window is always in background and in a multi-window environment, it
will prevent the window from being brought to front.
Memory leak happened because the scaled generated fonts were not
being cached or saved anywhere, thus they were not being destructed
and freed. Added logic to cache generated font in _winFontRegistry
itself.
Leaks observed in `trektech-win` of director engine in first few frames itself.
Allow scaling of window font, ie FON, FNT. Internally this uses
same implementation as BDFScaling and MacFontScaling. Uses function
scaleSingleGlyph to scale each glyph.
Fonts in `mcluhan-win` used some of these fonts where the sizes
were different than parsed.
This commit removes Mac Roman from plainByteMode(), this partially
reverts commit `9d4ac18be542eed5fdbb52519fd95ea7ac47a9e4` from
PR #3823, this change breaks Hebrew rendering in Pink.
Fixes rendering of texts in `theapartment` using MacRoman fonts.
This patch fixes the alignment issue for multiline text in text castMember
it increases the line height of each line by one, this added change over
multiple lines result in fixed alignment. This patch also removes the height
reduction due to empty line (which cumulatively caused the alignment issue).
`DATA/SUPPORT/INTRODUCTION@111` of 'warlock-100' has this alignment issue
where the text "The Blaster" was above the button it was supposed to be.
Lockable widgets are those which takes in all input
and if set then no other widget can take any input
its same as them being inactive, no buttons, animations
etc will work.
This is implemented to support `modal` property of window,
which requires a window to take all input and prevent all
others from having any actions.
Modifies border of window by first changing title to "", then updating
window border to borderType 2 `ThinNoTitle`.
`titleVisible of window` to verify this behavior.
Co-authored-by: Pragyansh Chaturvedi <pragyanshchaturvedi18@gmail.com>
Added setInnerDimension which calls resize (with bool inner dimension change: true), moveto and finally updateOuterDimension.
This was implemented to match window rectangle size as used by window property `rect`, `rect of window` in `workshop` uses this.
resize function is extracted to new function resize and resizeInner,
also a new private function rebuildSurface is created to handle common
code of refreshing/rebuilding surface after modifying inner or outer
window dimensions.
Smartmenu implementation using offsetY to displace popup such that the previous selected item will fall onto cursor, includes checked item and highlighted.
For `Popup Menu` in theapartment, without this patch the second popmenu was not remembering the last selected item and was opening it from scratch, after this patch popupmenu will open from the last selected item already selected with checkbox.
Additional logic for drawing blinks when closing popup menu is added, closeMenu is overriden because it is called inside eventLoop and therefore need to be captured when closingMenu.
Add blinking animation support for macpopups, affects `Popup Menu` in theapartment, before this there was no animation when selecting item and the menu just used to immediately close, now however there is proper animation for item selection.
Added functions for menu drawing/selections, this uses the base functions of macmenu to implement mac-styled popupmenu's, also return selected item index/text.
Used by 'Popup Menu' in theapartment: With this changes the popupmenu is working with both item selectors, doesn't implement the icon selector.
Exposed MacMenuItem, MacMenuSubMenu, MacMenuItem and MacMenuData to headers and changed visibility of needed functions to protected.
These structs and functions is used in popupmenu for reusing macmenu code.
When text is emptied by user action, e.g. backspace, the formattting
should be preserved.
In the game Majestic a text box for user input would start out with the
correct formatting, i.e. green text on a black background. When the user
would then press backspace till the text was gone, the method
`MacText::getTextChunk` would return an empty string, with the
formatting removed. If the user started typing again the text would use
the default formatting with black text on black background.
Fixes: https://trello.com/c/POQZRCEO/546-text-doesnt-show-in-majestic-in-text-box
The color values went inverted, but in several places they left
untouched.
In general, it is not a good idea to have this hardcoded, but at least
now we have this addressed.
MacFontManager didn't have a mechanism to report which fonts it loaded
from an external resource. It also requires that any fonts that aren't
built-in be explicitly registered by name by the client before they can
be used. This combination meant that a client couldn't load fonts from
an external file and use them by their properties (id / size / style).
SCI contains Mac fonts in its executable along with a table that maps
each SCI font id to a Mac font id and size. The font name isn't a part
of this since the Classic Mac Toolbox API took id / size / style as
input when drawing text.
Now MacFontManager exposes the font families it has loaded along with
their names. This allows a client to see which fonts were loaded,
register them by name, and proceed to use them with the existing API.