mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 13:55:07 +00:00
filter-blur: Update long description of Type and Subtype fields
Automatically updates the long description (hover text) if the Type or Subtype field is changed, allowing for more contextual information about what the selected information does.
This commit is contained in:
parent
c59ec2511b
commit
e24b9a61fa
2 changed files with 55 additions and 2 deletions
|
@ -11,14 +11,23 @@ FileType.Effects="Effects"
|
|||
|
||||
# Blur
|
||||
Blur.Type.Box="Box"
|
||||
Blur.Type.Box.Description="Box blur (named for its distinct shape) is a simple average over a number of pixels, resulting in a box like look."
|
||||
Blur.Type.BoxLinear="Box Linear"
|
||||
Blur.Type.BoxLinear.Description="Box blur (named for its distinct shape) is a simple average over a number of pixels, resulting in a box like look.\nThis is a linear optimized version of the normal Box blur."
|
||||
Blur.Type.Gaussian="Gaussian"
|
||||
Blur.Type.Gaussian.Description="Gaussian blur uses the Gaussian Bell curve as a weight for each sampled pixel, resulting in a smooth look."
|
||||
Blur.Type.GaussianLinear="Gaussian Linear"
|
||||
Blur.Type.GaussianLinear.Description="Gaussian blur uses the Gaussian Bell curve as a weight for each sampled pixel, resulting in a smooth look.\nThis is a linear optimized version of the normal Gaussian blur, but might look slightly worse"
|
||||
Blur.Type.DualFiltering="Dual Filtering"
|
||||
Blur.Type.DualFiltering.Description="Dual Filtering is a Gaussian approximation that is able to get similar results as Gaussian blur at much lower cost."
|
||||
Blur.Subtype.Area="Area"
|
||||
Blur.Subtype.Area.Description="A 2-Dimensional area blur."
|
||||
Blur.Subtype.Directional="Directional"
|
||||
Blur.Subtype.Directional.Description="A 1-Dimensional directional blur."
|
||||
Blur.Subtype.Rotational="Rotational"
|
||||
Blur.Subtype.Rotational.Description="A blur that rotates around a center point."
|
||||
Blur.Subtype.Zoom="Zoom"
|
||||
Blur.Subtype.Zoom.Description="A blur that zooms towards a center point."
|
||||
|
||||
# Mip Generator
|
||||
MipGenerator="Mipmap Generator"
|
||||
|
|
|
@ -446,18 +446,62 @@ bool filter::blur::blur_instance::modified_properties(void*, obs_properties_t* p
|
|||
for (size_t idx = 0, edx = obs_property_list_item_count(prop_subtype); idx < edx; idx++) {
|
||||
if (!obs_property_list_item_disabled(prop_subtype, idx)) {
|
||||
obs_data_set_string(settings, P_SUBTYPE, obs_property_list_item_string(prop_subtype, idx));
|
||||
|
||||
// Find new Subtype
|
||||
auto subtype_found2 = list_of_subtypes.find(vsubtype);
|
||||
if (subtype_found2 == list_of_subtypes.end()) {
|
||||
subtype_found = list_of_subtypes.end();
|
||||
} else {
|
||||
subtype_found = subtype_found2;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update hover text with new descriptions.
|
||||
if (type_found != list_of_types.end()) {
|
||||
if (type_found->first == "box") {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_TYPE), P_TRANSLATE(P_DESC(S_BLUR_TYPE_BOX)));
|
||||
} else if (type_found->first == "box_linear") {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_TYPE),
|
||||
P_TRANSLATE(P_DESC(S_BLUR_TYPE_BOX_LINEAR)));
|
||||
} else if (type_found->first == "gaussian") {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_TYPE),
|
||||
P_TRANSLATE(P_DESC(S_BLUR_TYPE_GAUSSIAN)));
|
||||
} else if (type_found->first == "gaussian_linear") {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_TYPE),
|
||||
P_TRANSLATE(P_DESC(S_BLUR_TYPE_GAUSSIAN_LINEAR)));
|
||||
}
|
||||
} else {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_TYPE), P_TRANSLATE(P_DESC(P_TYPE)));
|
||||
}
|
||||
if (subtype_found != list_of_subtypes.end()) {
|
||||
if (subtype_found->first == "area") {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_SUBTYPE),
|
||||
P_TRANSLATE(P_DESC(S_BLUR_SUBTYPE_AREA)));
|
||||
} else if (subtype_found->first == "directional") {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_SUBTYPE),
|
||||
P_TRANSLATE(P_DESC(S_BLUR_SUBTYPE_DIRECTIONAL)));
|
||||
} else if (subtype_found->first == "rotational") {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_SUBTYPE),
|
||||
P_TRANSLATE(P_DESC(S_BLUR_SUBTYPE_ROTATIONAL)));
|
||||
} else if (subtype_found->first == "zoom") {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_SUBTYPE),
|
||||
P_TRANSLATE(P_DESC(S_BLUR_SUBTYPE_ZOOM)));
|
||||
}
|
||||
} else {
|
||||
obs_property_set_long_description(obs_properties_get(props, P_SUBTYPE), P_TRANSLATE(P_DESC(P_SUBTYPE)));
|
||||
}
|
||||
|
||||
// Blur Sub-Type
|
||||
{
|
||||
bool has_angle_support = (subtype_found->second.type == ::gfx::blur::type::Directional)
|
||||
|| (subtype_found->second.type == ::gfx::blur::type::Rotational);
|
||||
bool has_center_support =
|
||||
(subtype_found->second.type == ::gfx::blur::type::Rotational) || (subtype_found->second.type == ::gfx::blur::type::Zoom);
|
||||
bool has_center_support = (subtype_found->second.type == ::gfx::blur::type::Rotational)
|
||||
|| (subtype_found->second.type == ::gfx::blur::type::Zoom);
|
||||
bool has_stepscale_support = type_found->second.fn().is_step_scale_supported(subtype_found->second.type);
|
||||
bool show_scaling = obs_data_get_bool(settings, P_STEPSCALE) && has_stepscale_support;
|
||||
|
||||
|
|
Loading…
Reference in a new issue