mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-25 17:59:34 +00:00
Make priority an option to texture masks
This commit is contained in:
parent
963097b98b
commit
eda0722107
3 changed files with 10 additions and 2 deletions
BondageClub
|
@ -809,6 +809,8 @@ type AssetDefinition = (
|
|||
interface AssetLayerMaskTexureDefinition {
|
||||
/** The groups that will be affected */
|
||||
Groups: AssetGroupName[];
|
||||
/** If true, the texture mask will apply to all layers in the groups specified, event if their priority is higher than the mask layer */
|
||||
ApplyToAbove?: boolean;
|
||||
}
|
||||
|
||||
interface AssetLayerDefinition extends AssetCommonPropertiesGroupAssetLayer, AssetCommonPropertiesAssetLayer {
|
||||
|
|
|
@ -95,11 +95,14 @@ function CommonDrawAppearancePrepareMaskLayers(C) {
|
|||
const urlParts = [asset.Name, parentAssetName, layerType, layerSegment].filter(c => c);
|
||||
const layerURL = urlParts.join("_") + ".png";
|
||||
|
||||
const maskPriority = layer.TextureMask.ApplyToAbove ? -1 : (item.Property?.OverridePriority?.[layer.Name] ?? layer.Priority);
|
||||
|
||||
/** @type {TextureAlphaMask} */
|
||||
const maskLayer = {
|
||||
Url: baseURL + layerURL,
|
||||
X, Y,
|
||||
Mode: blendingMode,
|
||||
Priority: maskPriority,
|
||||
};
|
||||
|
||||
/** @type {TextureAlphaMask} */
|
||||
|
@ -107,6 +110,7 @@ function CommonDrawAppearancePrepareMaskLayers(C) {
|
|||
Url: baseURLBlink + layerURL,
|
||||
X, Y,
|
||||
Mode: blendingMode,
|
||||
Priority: maskPriority,
|
||||
};
|
||||
|
||||
for(const maskedGroup of layer.TextureMask.Groups) {
|
||||
|
@ -341,8 +345,8 @@ function CommonDrawAppearanceBuild(C, {
|
|||
|
||||
|
||||
// prepare mask layers for the current group
|
||||
const maskLayer = maskTexLayers.get(groupName) ?? [];
|
||||
const maskLayerBlink = maskTexLayersBlink.get(groupName) ?? [];
|
||||
const maskLayer = (maskTexLayers.get(groupName) ?? []).filter(m => m.Priority < 0 || m.Priority >= layer.Priority);
|
||||
const maskLayerBlink = (maskTexLayersBlink.get(groupName) ?? []).filter(m => m.Priority < 0 || m.Priority >= layer.Priority);
|
||||
|
||||
if (shouldColorize) {
|
||||
drawImageColorize(
|
||||
|
|
2
BondageClub/Scripts/Typedef.d.ts
vendored
2
BondageClub/Scripts/Typedef.d.ts
vendored
|
@ -3855,6 +3855,8 @@ interface TextureAlphaMask {
|
|||
Y: number;
|
||||
Url: string;
|
||||
Mode: "destination-in" | "destination-out";
|
||||
/** The priority of the mask, -1 means it will ignores priority and applied to the layers on top of it */
|
||||
Priority: number;
|
||||
}
|
||||
|
||||
/** Options available to most draw calls */
|
||||
|
|
Loading…
Add table
Reference in a new issue