Da M-E nichts mehr postet, habe ich mir mal schnell die Skripte zusammen gesucht
Picture-in-Picture:
Code:
scriptName "fn_pip.sqf";
/*
File: pip.sqf
Author: Karel Moricky
Description:
Picture In Picture
Parameter(s):
_this: Picture or Array of pictures
Returns:
Nothing
*/
private ["_input","_inputtype","_layer","_display","_pip","_file1","_file2","_layer1","_layer2"];
disableserialization;
_input = _this select 0;
_inputtype = typename _input;
//--- Single picture
if (_inputtype == typename "") then {
if (_input != "") then {
_layer = if (count _this > 1) then {_this select 1} else {100011};
_display = uinamespace getvariable "str_pip";
if (isnil "_display") then {
100011 cutrsc ["PIP","plain"];
_display = uinamespace getvariable "str_pip";
};
if (isnull _display) then {
100011 cutrsc ["PIP","plain"];
_display = uinamespace getvariable "str_pip";
};
_pip = _display displayctrl _layer;
_pip ctrlsettext _input;
_pip ctrlcommit 0;
rah1 setObjectTexture [1,_input];
rah1 animate ["map_repos",0.6];
} else {
100011 cuttext ["","plain"];
rah1 animate ["map_repos",1];
};
};
//--- Multiple pictures
if (_inputtype == typename []) then {
_count = (count _input - 1);
for "_i" from 0 to _count do {
_file = _input select _i;
_layer = 100011 + _i;
[_file,_layer] call bis_ew_fnc_pip;
};
sleep 1;
_display = uinamespace getvariable "str_pip";
_load = _display displayctrl 100099;
_load ctrlsetfade 1;
_load ctrlcommit 0;
for "_i" from 0 to _count do {
_layer = 100011 + _count - _i;
_pip = _display displayctrl _layer;
_pip ctrlsetfade 1;
_pip ctrlcommit 0.2;
sleep 1;
};
[""] call bis_ew_fnc_pip;
};
Und Screen Effekte:
Code:
scriptname "EW screen.sqf";
/*
File: screen.sqf
Author: Karel Moricky
Description:
Screen Effects
Parameter(s):
_this select 0: Intensity (0-1)
_this select 1: (Optional) Dirt
*/
disableserialization;
_int = _this select 0;
_dirt = if (count _this > 1) then {_this select 1} else {false};
if (isnil {uinamespace getvariable "str_screen"}) then {uinamespace setvariable ["str_screen",displaynull]};
if (isnull (uinamespace getvariable "str_screen")) then {1918 cutrsc ["screen","plain"]};
_display = uinamespace getvariable "str_screen";
if (!_dirt) then {
//--- Select free layer
_control = controlnull;
for "_i" from 1001 to 1006 do {
_c = _display displayctrl _i;
_f = ctrlfade _c;
_p = ctrlposition _c;
if ((_p select 3) == 0) then {_f = 1};
if (_f == 1) exitwith {_control = _c};
};
if (isnull _control) exitwith {debuglog ["Log::::::FAIL"]};
//--- Select position
_w = safezoneW * _int;
_h = _w / 0.75;
_pos = [
((safezoneX - _w/2) + random (safezoneW)),
((safezoneY - _h/2) + random (safezoneH)),
_w,
_h
];
//--- Fade out (0s)
_control ctrlsetposition _pos;
_control ctrlsetfade 1;
_control ctrlcommit 0;
//--- Fade in (0.1s)
_control ctrlsetfade 0;
_control ctrlcommit 0.1;
waituntil {ctrlcommitted _control};
sleep 3;
//--- Fade out (random 5-15s)
_control ctrlsetfade 1;
_control ctrlcommit (5 + random 10);
waituntil {ctrlcommitted _control};
//--- Reset
if (ctrlfade _control == 0) then {
_control ctrlsetposition [0,0,0,0];
_control ctrlcommit 0;
};
} else {
_control = _display displayctrl 1000;
_pos = [safezoneX,safezoneY,safezoneW,safezoneH];
//--- Fade out (0s)
_control ctrlsetposition _pos;
_control ctrlsetfade 1;
_control ctrlcommit 0;
//--- Fade in (0.2s)
_control ctrlsetfade 0;
_control ctrlcommit 0.2;
waituntil {ctrlcommitted _control};
sleep 3;
//--- Fade out (random 5-10s)
_control ctrlsetfade 1;
_control ctrlcommit (5 + random 5);
waituntil {ctrlcommitted _control};
};