mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-03-20 17:48:46 +00:00
readded an improved screen flickering
This commit is contained in:
parent
35ffbe91a7
commit
5a158f6c65
@ -72,6 +72,11 @@ ApplicationWindow {
|
|||||||
onValueChanged: shadersettings.screen_distortion = value;
|
onValueChanged: shadersettings.screen_distortion = value;
|
||||||
Component.onCompleted: _value = shadersettings.screen_distortion;
|
Component.onCompleted: _value = shadersettings.screen_distortion;
|
||||||
}
|
}
|
||||||
|
SettingComponent{
|
||||||
|
name: "Screen flickering"
|
||||||
|
onValueChanged: shadersettings.brightness_flickering = value;
|
||||||
|
Component.onCompleted: _value = shadersettings.brightness_flickering;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,15 +91,25 @@ ApplicationWindow{
|
|||||||
|
|
||||||
property real scanlines: shadersettings.scanlines ? 1.0 : 0.0
|
property real scanlines: shadersettings.scanlines ? 1.0 : 0.0
|
||||||
|
|
||||||
NumberAnimation on brightness{
|
Behavior on brightness {
|
||||||
property real randval: 0
|
NumberAnimation{
|
||||||
to: 1.0
|
duration: 250
|
||||||
duration: 300
|
onRunningChanged:
|
||||||
onStopped: {
|
if(!running) shadercontainer.brightness = 1.0;
|
||||||
to = 1 - Math.random() * shadersettings.brightness_flickering;
|
|
||||||
start();
|
|
||||||
}
|
}
|
||||||
running: false
|
}
|
||||||
|
|
||||||
|
Timer{
|
||||||
|
property real randval
|
||||||
|
id: flickertimer
|
||||||
|
interval: 500
|
||||||
|
onTriggered: {
|
||||||
|
randval = Math.random();
|
||||||
|
if(randval < shadersettings.brightness_flickering)
|
||||||
|
shadercontainer.brightness = Math.random() * 0.5 + 0.5;
|
||||||
|
}
|
||||||
|
running: true
|
||||||
|
repeat: true
|
||||||
}
|
}
|
||||||
|
|
||||||
property real deltay: 3 / terminal.height
|
property real deltay: 3 / terminal.height
|
||||||
|
Loading…
x
Reference in New Issue
Block a user