MV Is there a way to reverse script calls?

I am looking for a way to negate the effect of script call, or, so to say, unmake it. The script call is -

const s = Graphics._video.style;
s.objectFit = 'cover';
s.minWidth = '100%';
s.minHeight = '100%';

I need it for specific moment in game, but then it starts creating problems. So it would be nice if i could deactivate it somehow. I assume that i should repeat the command with different parameters, the problem is i don't know the default ones.

Or maybe there are script call to reset everything to default? Like when loading or starting a game.
you can reverse it if you want, something like:

JavaScript:
function videoSettings(string = "cover", width = "100%", height = "100%") {
    let s = Graphics._video.style;
    s.objectFit = string;
    s.minWidth = widht;
    s.minHeight = height;
}

I changed const to let because it need to be changeable.

if you call videoSetttings() it set the base params to cover, 100% on width/height
you can override it if needed, like videoSettings("base", "80%") so height = 100%.
you can reverse it if you want, something like:

JavaScript:
function videoSettings(string = "cover", width = "100%", height = "100%") {
    let s = Graphics._video.style;
    s.objectFit = string;
    s.minWidth = widht;
    s.minHeight = height;
}

I changed const to let because it need to be changeable.

if you call videoSetttings() it set the base params to cover, 100% on width/height
you can override it if needed, like videoSettings("base", "80%") so height = 100%.
Sadly this does not work, the effect from the original command stays. Tried both with base and without.
I'm not 100% sure, but I believe the default for all 3 of those is "inherit"… so try changing the first line of that function to put those defaults in, instead of the other values.
I'm not 100% sure, but I believe the default for all 3 of those is "inherit"… so try changing the first line of that function to put those defaults in, instead of the other values.
Not sure what exactly do you mean. If replacing everything by "const s = inherit" it gives an error.
I am looking for a way to negate the effect of script call, or, so to say, unmake it. The script call is -

const s = Graphics._video.style;
s.objectFit = 'cover';
s.minWidth = '100%';
s.minHeight = '100%';

I need it for specific moment in game, but then it starts creating problems. So it would be nice if i could deactivate it somehow. I assume that i should repeat the command with different parameters, the problem is i don't know the default ones.

Or maybe there are script call to reset everything to default? Like when loading or starting a game.
These are usually empty strings by default so:
JavaScript:
const s = Graphics._video.style;
s.objectFit = '';
s.minWidth = '';
s.minHeight = '';
Sadly this does not work, the effect from the original command stays. Tried both with base and without.
the params is set to the default, you should save it as a plugin, so you can call it
easy.

while string, width, height has default values, you can call it directly without
setting any values, so changing those values to default, is videoSettings()
so it take the default values.

if what bass2yang is true to empty them to default, use this:

JavaScript:
function videoSettings(string = "", width = "", height = "") {
    let s = Graphics._video.style;
    s.objectFit = string;
    s.minWidth = widht;
    s.minHeight = height;
}

so default has empty strings by calling the function, override them
with value or strings videoSettings("cover", "100%", "100%") and call without
the values for direct resetting.

your free to change the function name of videoSettings to whatever suit you.

its just a helper plugin, so put below the plugin you use for this scriptcall.
Not sure what exactly do you mean. If replacing everything by "const s = inherit" it gives an error.
Yes, because you left out the quotes. It's possible bass2yang is correct instead, not sure.
These are usually empty strings by default so:
JavaScript:
const s = Graphics._video.style;
s.objectFit = '';
s.minWidth = '';
s.minHeight = '';
YES! This seem to be working. Need to run full test on all videos still, but looks like the issue is solved. Thank you!
the params is set to the default, you should save it as a plugin, so you can call it
easy.
I only need to use it once in current project, so seems like creating two plugins would be an overkill. Howewer, i will save this post since i might run into simillar issue again.
Yes, because you left out the quotes.
Ah, yes, now it works, but does not solve the issue. Luckily, Bass's solution worked!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-reverse-script-calls.180670/