mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-03-20 09:39:07 +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;
|
||||
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
|
||||
|
||||
NumberAnimation on brightness{
|
||||
property real randval: 0
|
||||
to: 1.0
|
||||
duration: 300
|
||||
onStopped: {
|
||||
to = 1 - Math.random() * shadersettings.brightness_flickering;
|
||||
start();
|
||||
Behavior on brightness {
|
||||
NumberAnimation{
|
||||
duration: 250
|
||||
onRunningChanged:
|
||||
if(!running) shadercontainer.brightness = 1.0;
|
||||
}
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user