first working version
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 78 KiB |
@@ -1,8 +0,0 @@
|
||||
[Plymouth Theme]
|
||||
Name=Ceratopsian theme for Debian 13.0 Trixie
|
||||
Description=Ceratopsian theme by Elise Couper
|
||||
ModuleName=script
|
||||
|
||||
[script]
|
||||
ImageDir=/usr/share/plymouth/themes/ceratopsian
|
||||
ScriptFile=/usr/share/plymouth/themes/ceratopsian/ceratopsian.script
|
||||
|
Before Width: | Height: | Size: 274 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,8 @@
|
||||
[Plymouth Theme]
|
||||
Name=HfG OS Falbella Theme
|
||||
Description=HfG OS Falbella Theme by hfg_of
|
||||
ModuleName=script
|
||||
|
||||
[script]
|
||||
ImageDir=/usr/share/plymouth/themes/falbella
|
||||
ScriptFile=/usr/share/plymouth/themes/falbella/falbella.script
|
||||
|
After Width: | Height: | Size: 78 KiB |
@@ -141,13 +141,11 @@ small_dimension = Math.Min(window_max.width, window_max.height);
|
||||
|
||||
#---------------------------- Frills ---------------------------------
|
||||
|
||||
fun calcfmt(frill,logo_base) {
|
||||
fun calcfmt(logo_base) {
|
||||
x0 = Window.GetWidth();
|
||||
y0 = Window.GetHeight();
|
||||
xlogo = logo_base.GetWidth();
|
||||
ylogo = logo_base.GetHeight();
|
||||
xfrill = frill.GetWidth();
|
||||
yfrill = frill.GetHeight();
|
||||
|
||||
coef = 0.6;
|
||||
|
||||
@@ -160,43 +158,20 @@ fun calcfmt(frill,logo_base) {
|
||||
dim.logo.xsize = logoscale*x0;
|
||||
dim.logo.ysize = (logoscale*x0/xlogo)*ylogo;
|
||||
}
|
||||
|
||||
dim.logo.x = 0.01*x0;
|
||||
#dim.logo.y = 0.01*y0;
|
||||
dim.logo.y = 0.99*y0 - dim.logo.ysize;
|
||||
|
||||
if (x0>=y0) {
|
||||
dim.frill.ysize = coef*y0;
|
||||
dim.frill.xsize = coef*y0*(xfrill/yfrill);
|
||||
dim.frill.x = x0-coef*y0*(xfrill/yfrill);
|
||||
dim.frill.y = y0-coef*y0;
|
||||
}
|
||||
else {
|
||||
dim.frill.xsize = coef*x0;
|
||||
dim.frill.ysize = coef*x0*(yfrill/xfrill);
|
||||
dim.frill.x = x0 - coef*x0;
|
||||
dim.frill.y = y0 - coef*x0*(yfrill/xfrill);
|
||||
}
|
||||
return dim;
|
||||
}
|
||||
|
||||
|
||||
logo = Image("logo.png");
|
||||
frill = Image("frill.png");
|
||||
glow = Image("glow.png");
|
||||
|
||||
frilldim = calcfmt(frill,logo);
|
||||
|
||||
frill = frill.Scale(frilldim.frill.xsize, frilldim.frill.ysize);
|
||||
frill_sprite = Sprite(frill);
|
||||
frill_sprite.SetPosition(frilldim.frill.x,frilldim.frill.y,-2);
|
||||
|
||||
glow = glow.Scale(frilldim.frill.xsize, frilldim.frill.ysize);
|
||||
glow_sprite = Sprite(glow);
|
||||
glow_sprite.SetPosition(frilldim.frill.x,frilldim.frill.y,-1);
|
||||
|
||||
logo = logo.Scale(frilldim.logo.xsize,frilldim.logo.ysize);
|
||||
logodim = calcfmt(logo);
|
||||
logo = logo.Scale(logodim.logo.xsize,logodim.logo.ysize);
|
||||
logo_sprite = Sprite(logo);
|
||||
logo_sprite.SetPosition(frilldim.logo.x,frilldim.logo.y,-4);
|
||||
logo_sprite.SetPosition(logodim.logo.x,logodim.logo.y,-4);
|
||||
|
||||
|
||||
#------------------------------String functions-------------------------------
|
||||
@@ -261,29 +236,30 @@ fun StringToInteger (str) {
|
||||
# #263a47 --> 0.1484, 0.2266, 0.2773
|
||||
# Bottom background colour
|
||||
# #263a47 --> 0.1484, 0.2266, 0.2773
|
||||
#
|
||||
Window.SetBackgroundTopColor (0.1484, 0.2266, 0.2773); # Nice colour on top of the screen fading to
|
||||
Window.SetBackgroundBottomColor (0.1484, 0.2266, 0.2773); # an equally nice colour on the bottom
|
||||
|
||||
fun calchorse(horse_base) {
|
||||
x0 = Window.GetWidth();
|
||||
y0 = Window.GetHeight();
|
||||
xhorse = horse_base.GetWidth();
|
||||
yhorse = horse_base.GetHeight();
|
||||
|
||||
dim.horse.xsize = x0;
|
||||
dim.horse.ysize = y0;
|
||||
|
||||
return dim;
|
||||
}
|
||||
|
||||
horse = Image("falbella.png");
|
||||
|
||||
Window.SetBackgroundTopColor (0.0, 1.0, 1.0); # Nice colour on top of the screen fading to
|
||||
Window.SetBackgroundBottomColor (1.0, 1.0, 0.0); # an equally nice colour on the bottom
|
||||
|
||||
bits_per_pixel = Window.GetBitsPerPixel ();
|
||||
# TODO need to handle 16 colors ?
|
||||
#if (bits_per_pixel == 4) {
|
||||
# logo_filename = "debian_logo16.png";
|
||||
# progress_dot_off_filename = "progress_dot_off16.png";
|
||||
# progress_dot_on_filename = "progress_dot_on16.png";
|
||||
# password_dot_filename = "password_dot.png";
|
||||
# password_field_filename = "password_field16.png";
|
||||
#} else {
|
||||
# logo_filename = "debian_logo.png";
|
||||
# progress_dot_off_filename = "progress_dot_off.png";
|
||||
# progress_dot_on_filename = "progress_dot_on.png";
|
||||
password_dot_filename = "password_dot.png";
|
||||
password_field_filename = "password_field.png";
|
||||
#}
|
||||
password_dot_filename = "password_dot.png";
|
||||
password_field_filename = "password_field.png";
|
||||
|
||||
message_notification[0].image = ImageFromTintedText ("");
|
||||
message_notification[1].image = ImageFromTintedText ("");
|
||||
fsck_notification.image = ImageFromActionText ("");
|
||||
|
||||
status = "normal";
|
||||
|
||||
@@ -297,87 +273,19 @@ first_line_height = ImageFromTintedText ("AfpqtM").GetHeight();
|
||||
# a bit if needed.
|
||||
top_of_the_text = TextYOffset();
|
||||
|
||||
horse_dim = calchorse(horse);
|
||||
horse = horse.Scale(Window.GetWidth(), Window.GetHeight());
|
||||
horse_sprite = Sprite(horse);
|
||||
|
||||
SetPosition(horse_sprite, 0, 0, 0);
|
||||
|
||||
#-------------------------------Progress Indicator-----------------------------
|
||||
# Implement in boot progress callback
|
||||
fun animate_progress_indicator (time, progress) {
|
||||
progress_time = time;
|
||||
progress_pct = progress;
|
||||
# progress_time = time;
|
||||
# progress_pct = progress;
|
||||
|
||||
#Debug ("mode = " + Plymouth.GetMode() + ", progress_time = " + progress_time + ", progress_pct = " + progress_pct);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------Label utility functions---------------------
|
||||
|
||||
# label should be either a string or NULL
|
||||
# Images for n lines will be created and returned as items of the
|
||||
# message_label array
|
||||
#
|
||||
fun get_message_label (label, is_fake, is_action_line) {
|
||||
#Debug("Get Label position");
|
||||
local.message_label;
|
||||
|
||||
if (is_fake)
|
||||
# Create a fake label so as to get the y coordinate of
|
||||
# a standard-length label.
|
||||
local.message_image = ImageFromTintedText ("This is a fake message");
|
||||
else
|
||||
local.message_image = (is_action_line) && ImageFromActionText (label) || ImageFromTintedText (label);
|
||||
|
||||
message_label.width = message_image.GetWidth ();
|
||||
message_label.height = message_image.GetHeight ();
|
||||
|
||||
# Center the line horizontally
|
||||
message_label.x = Window.GetX () + Window.GetWidth () / 2 - message_label.width / 2;
|
||||
|
||||
message_label.y = top_of_the_text;
|
||||
|
||||
# Put the 2nd line below the fsck line
|
||||
if (is_action_line) {
|
||||
local.fsck_label.y = message_label.y + (first_line_height + first_line_height / 2);
|
||||
message_label.y = local.fsck_label.y + (first_line_height * 1.5);
|
||||
}
|
||||
|
||||
#Debug("action label x = " + message_label.x + " y = " + message_label.y );
|
||||
|
||||
# message_debug = "msg_x = " + message_label.x + " msg_y = " + message_label.y +
|
||||
# "msg_width = " + message_label.width + " msg_height = " +
|
||||
# message_label.height + " message = " + label;
|
||||
# Debug(message_debug);
|
||||
|
||||
return message_label;
|
||||
|
||||
}
|
||||
|
||||
# Create an fsck label and/or get its position
|
||||
fun get_fsck_label (label, is_fake) {
|
||||
# Debug("Get Label position");
|
||||
local.fsck_label = global.progress_label;
|
||||
|
||||
if (is_fake)
|
||||
fsck_label.image = ImageFromTintedText ("This is a fake message");
|
||||
else
|
||||
fsck_label.image = ImageFromTintedText (label);
|
||||
|
||||
fsck_label.width = fsck_label.image.GetWidth ();
|
||||
fsck_label.height = fsck_label.image.GetHeight ();
|
||||
|
||||
# Centre the label horizontally
|
||||
fsck_label.x = Window.GetX () + Window.GetWidth () / 2 - fsck_label.width / 2;
|
||||
|
||||
local.first_label = get_message_label (label, 1, 0);
|
||||
|
||||
# Place the label below the 1st message line
|
||||
fsck_label.y = local.first_label.y + local.first_label.height + (local.first_label.height / 2);
|
||||
|
||||
# message_debug = "msg_x = " + fsck_label.x + " msg_y = " + fsck_label.y +
|
||||
# "msg_width = " + fsck_label.width + " msg_height = " +
|
||||
# fsck_label.height + " message = " + label;
|
||||
# Debug(message_debug);
|
||||
|
||||
return fsck_label;
|
||||
}
|
||||
|
||||
#-----------------------------------------Message stuff --------------------------------
|
||||
@@ -566,332 +474,6 @@ Plymouth.SetBootProgressFunction (animate_progress_indicator);
|
||||
# Plymouth.SetRootMountedFunction: the callback function is called when a new root is mounted
|
||||
# Plymouth.SetKeyboardInputFunction: the callback function is called with a string containing a new character entered on the keyboard
|
||||
|
||||
#----------------------------------------- FSCK Counter --------------------------------
|
||||
|
||||
# Initialise the counter
|
||||
fun init_fsck_count () {
|
||||
# The number of fsck checks in this cycle
|
||||
global.counter.total = 0;
|
||||
# The number of fsck checks already performed + the current one
|
||||
global.counter.current = 1;
|
||||
# The previous fsck
|
||||
global.counter.last = 0;
|
||||
}
|
||||
|
||||
# Increase the total counter
|
||||
fun increase_fsck_count () {
|
||||
global.counter.total++;
|
||||
}
|
||||
|
||||
fun increase_current_fsck_count () {
|
||||
global.counter.last = global.counter.current++;
|
||||
}
|
||||
|
||||
# Clear the counter
|
||||
fun clear_fsck_count () {
|
||||
global.counter = NULL;
|
||||
init_fsck_count ();
|
||||
}
|
||||
|
||||
#----------------------------------------- Progress Label ------------------------------
|
||||
|
||||
|
||||
# Change the opacity level of a progress label
|
||||
#
|
||||
# opacity = 1 -> show
|
||||
# opacity = 0 -> hide
|
||||
# opacity = 0.3 (or any other float) -> translucent
|
||||
#
|
||||
fun set_progress_label_opacity (opacity) {
|
||||
# the label
|
||||
progress_label.sprite.SetOpacity (opacity);
|
||||
|
||||
# Make the slot available again when hiding the bar
|
||||
# So that another bar can take its place
|
||||
if (opacity == 0) {
|
||||
progress_label.is_available = 1;
|
||||
progress_label.device = "";
|
||||
}
|
||||
}
|
||||
|
||||
# Set up a new Progress Bar
|
||||
#
|
||||
# TODO: Make it possible to reuse (rather than recreate) a bar
|
||||
# if .is_available = 1. Ideally this would just reset the
|
||||
# label, the associated
|
||||
# device and the image size of the sprite.
|
||||
|
||||
fun init_progress_label (device, status_string) {
|
||||
# Make the slot unavailable
|
||||
global.progress_label.is_available = 0;
|
||||
progress_label.progress = 0;
|
||||
progress_label.device = device;
|
||||
progress_label.status_string = status_string;
|
||||
}
|
||||
|
||||
# See if the progress label is keeping track of the fsck
|
||||
# of "device"
|
||||
#
|
||||
fun device_has_progress_label (device) {
|
||||
#DebugBottom ("label device = " + progress_label.device + " checking device " + device);
|
||||
return (progress_label.device == device);
|
||||
}
|
||||
|
||||
# Update the Progress bar which corresponds to index
|
||||
#
|
||||
fun update_progress_label (progress) {
|
||||
# If progress is NULL then we just refresh the label.
|
||||
# This happens when only counter.total has changed.
|
||||
if (progress != NULL) {
|
||||
progress_label.progress = progress;
|
||||
|
||||
#Debug("device " + progress_label.device + " progress " + progress);
|
||||
|
||||
# If progress >= 100% hide the label and make it available again
|
||||
if (progress >= 100) {
|
||||
set_progress_label_opacity (0);
|
||||
|
||||
# See if we any other fsck check is complete
|
||||
# and, if so, hide the progress bars and the labels
|
||||
on_fsck_completed ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
# Update progress label here
|
||||
#
|
||||
# FIXME: the queue logic from this theme should really be moved into mountall
|
||||
# instead of using string replacement to deal with localised strings.
|
||||
label = StringReplace (progress_label.status_string[0], "%1$d", global.counter.current);
|
||||
label = StringReplace (label, "%2$d", global.counter.total);
|
||||
label = StringReplace (label, "%3$d", progress_label.progress);
|
||||
label = StringReplace (label, "%%", "%");
|
||||
|
||||
progress_label = get_fsck_label (label, 0);
|
||||
#progress_label.progress = progress;
|
||||
|
||||
progress_label.sprite = Sprite (progress_label.image);
|
||||
|
||||
# Set up the bar
|
||||
progress_label.sprite.SetPosition(progress_label.x, progress_label.y, 1);
|
||||
|
||||
set_progress_label_opacity (1);
|
||||
|
||||
}
|
||||
|
||||
# Refresh the label so as to update counters
|
||||
fun refresh_progress_label () {
|
||||
update_progress_label (NULL);
|
||||
}
|
||||
|
||||
#----------------------------------------- FSCK Queue ----------------------------------
|
||||
|
||||
# Initialise the fsck queue
|
||||
fun init_queue () {
|
||||
global.fsck_queue[0].device;
|
||||
global.fsck_queue[0].progress;
|
||||
global.fsck_queue.counter = 0;
|
||||
global.fsck_queue.biggest_item = 0;
|
||||
}
|
||||
|
||||
fun clear_queue () {
|
||||
global.fsck_queue = NULL;
|
||||
init_queue ();
|
||||
}
|
||||
|
||||
# Return either the device index in the queue or -1
|
||||
fun queue_look_up_by_device (device) {
|
||||
for (i=0; i <= fsck_queue.biggest_item; i++) {
|
||||
if ((fsck_queue[i]) && (fsck_queue[i].device == device))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
# Keep track of an fsck process in the queue
|
||||
fun add_fsck_to_queue (device, progress) {
|
||||
# Look for an empty slot in the queue
|
||||
for (i=0; global.fsck_queue[i].device; i++) {
|
||||
continue;
|
||||
}
|
||||
local.index = i;
|
||||
|
||||
# Set device and progress
|
||||
global.fsck_queue[local.index].device = device;
|
||||
global.fsck_queue[local.index].progress = progress;
|
||||
|
||||
# Increase the queue counter
|
||||
global.fsck_queue.counter++;
|
||||
|
||||
# Update the max index of the array for iterations
|
||||
if (local.index > global.fsck_queue.biggest_item)
|
||||
global.fsck_queue.biggest_item = local.index;
|
||||
|
||||
#DebugMedium ("Adding " + device + " at " + local.index);
|
||||
}
|
||||
|
||||
fun is_queue_empty () {
|
||||
return (fsck_queue.counter == 0);
|
||||
}
|
||||
|
||||
fun is_progress_label_available () {
|
||||
return (progress_label.is_available == 1);
|
||||
}
|
||||
|
||||
|
||||
# This should cover the case in which the fsck checks in
|
||||
# the queue are completed before the ones showed in the
|
||||
# progress label
|
||||
fun on_queued_fsck_completed () {
|
||||
if (!is_queue_empty ())
|
||||
return;
|
||||
|
||||
# Hide the extra label, if any
|
||||
#if (progress_bar.extra_label.sprite)
|
||||
# progress_bar.extra_label.sprite.SetOpacity(0);
|
||||
}
|
||||
|
||||
fun remove_fsck_from_queue (index) {
|
||||
# Free memory which was previously allocated for
|
||||
# device and progress
|
||||
global.fsck_queue[index].device = NULL;
|
||||
global.fsck_queue[index].progress = NULL;
|
||||
|
||||
# Decrease the queue counter
|
||||
global.fsck_queue.counter--;
|
||||
|
||||
# See if there are other processes in the queue
|
||||
# if not, clear the extra_label
|
||||
on_queued_fsck_completed ();
|
||||
}
|
||||
|
||||
fun on_fsck_completed () {
|
||||
# We have moved on to tracking the next fsck
|
||||
increase_current_fsck_count ();
|
||||
|
||||
if (!is_progress_label_available ())
|
||||
return;
|
||||
|
||||
if (!is_queue_empty ())
|
||||
return;
|
||||
|
||||
# Hide the progress label
|
||||
if (progress_label.sprite)
|
||||
progress_label.sprite.SetOpacity (0);
|
||||
|
||||
# Clear the queue
|
||||
clear_queue ();
|
||||
|
||||
# Clear the fsck counter
|
||||
clear_fsck_count ();
|
||||
}
|
||||
|
||||
# Update an fsck process that we keep track of in the queue
|
||||
fun update_progress_in_queue (index, device, progress) {
|
||||
# If the fsck is complete, remove it from the queue
|
||||
if (progress >= 100) {
|
||||
remove_fsck_from_queue (index);
|
||||
on_queued_fsck_completed ();
|
||||
return;
|
||||
}
|
||||
|
||||
global.fsck_queue[index].device = device;
|
||||
global.fsck_queue[index].progress = progress;
|
||||
|
||||
}
|
||||
|
||||
# TODO: Move it to some function
|
||||
# Create an empty queue
|
||||
#init_queue ();
|
||||
|
||||
|
||||
#----------------------------------------- FSCK Functions ------------------------------
|
||||
|
||||
|
||||
# Either add a new bar for fsck checks or update an existing bar
|
||||
#
|
||||
# NOTE: no more than "progress_bar.max_number" bars are allowed
|
||||
#
|
||||
fun fsck_check (device, progress, status_string) {
|
||||
|
||||
# The 1st time this will take place
|
||||
if (!global.progress_label) {
|
||||
# Increase the fsck counter
|
||||
increase_fsck_count ();
|
||||
|
||||
# Set up a new label for the check
|
||||
init_progress_label (device, status_string);
|
||||
update_progress_label (progress);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (device_has_progress_label (device)) {
|
||||
# Update the progress of the existing label
|
||||
update_progress_label (progress);
|
||||
}
|
||||
else {
|
||||
# See if there's already a slot in the queue for the device
|
||||
local.queue_device_index = queue_look_up_by_device(device);
|
||||
|
||||
# See if the progress_label is available
|
||||
if (progress_label.is_available) {
|
||||
|
||||
# local.my_string = "available index " + local.available_index + " progress_bar counter is " + progress_bar.counter;
|
||||
# Debug(local.my_string);
|
||||
|
||||
|
||||
# If the fsck check for the device was in the queue, then
|
||||
# remove it from the queue
|
||||
if (local.queue_device_index >= 0) {
|
||||
remove_fsck_from_queue (index);
|
||||
}
|
||||
else {
|
||||
# Increase the fsck counter
|
||||
increase_fsck_count ();
|
||||
}
|
||||
|
||||
# local.my_string += local.message;
|
||||
#Debug("setting new label for device " + device + " progress " + progress);
|
||||
|
||||
# Set up a new label for the check
|
||||
init_progress_label (device, status_string);
|
||||
update_progress_label (progress);
|
||||
|
||||
}
|
||||
# If the progress_label is not available
|
||||
else {
|
||||
|
||||
# If the fsck check for the device is already in the queue
|
||||
# just update its progress in the queue
|
||||
if (local.queue_device_index >= 0) {
|
||||
#DebugMedium("Updating queue at " + local.queue_device_index + " for device " + device);
|
||||
update_progress_in_queue (local.queue_device_index, device, progress);
|
||||
}
|
||||
# Otherwise add the check to the queue
|
||||
else {
|
||||
#DebugMedium("Adding device " + device + " to queue at " + local.queue_device_index);
|
||||
add_fsck_to_queue (device, progress);
|
||||
|
||||
# Increase the fsck counter
|
||||
increase_fsck_count ();
|
||||
|
||||
refresh_progress_label ();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# if (!is_queue_empty ()) {
|
||||
# DebugBottom("Extra label for "+ device);
|
||||
#}
|
||||
# else {
|
||||
# DebugBottom("No extra label for " + device + ". 1st Device in the queue "+ fsck_queue[0].device + " counter = " + global.fsck_queue.counter);
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------Update Status stuff --------------------------
|
||||
#
|
||||
# The update_status_callback is what we can use to pass plymouth whatever we want so
|
||||
@@ -923,52 +505,6 @@ fun update_status_callback (status) {
|
||||
|
||||
# my_string = update_strings[0] + " " + update_strings[1] + " " + update_strings[2];
|
||||
# Debug(my_string);
|
||||
# Let's assume that we're dealing with these strings fsck:sda1:40
|
||||
if ((string_it >= 2) && (update_strings[0] == "fsck")) {
|
||||
|
||||
device = update_strings[1];
|
||||
progress = update_strings[2];
|
||||
status_string[0] = update_strings[3]; # "Checking disk %1$d of %2$d (%3$d %% complete)"
|
||||
if (!status_string[0])
|
||||
status_string[0] = "Checking disk %1$d of %2$d (%3$d %% complete)";
|
||||
|
||||
if ((device != "") && (progress != "")) {
|
||||
progress = StringToInteger (progress);
|
||||
|
||||
# Make sure that the fsck_queue is initialised
|
||||
if (!global.fsck_queue)
|
||||
init_queue ();
|
||||
|
||||
# Make sure that the fsck counter is initialised
|
||||
if (!global.counter)
|
||||
init_fsck_count ();
|
||||
|
||||
# if (!global.progress_bar.extra_label.sprite)
|
||||
# create_extra_fsck_label ();
|
||||
|
||||
# Keep track of the fsck check
|
||||
fsck_check (device, progress, status_string);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# systemd-fsckd pass fsckd:<number_devices>:<progress>:<l10n_string>
|
||||
if (update_strings[0] == "fsckd") {
|
||||
number_devices = StringToInteger(update_strings[1]);
|
||||
|
||||
if (number_devices > 0) {
|
||||
label = update_strings[3];
|
||||
|
||||
progress_label = get_fsck_label (label, 0);
|
||||
progress_label.sprite = Sprite (progress_label.image);
|
||||
progress_label.sprite.SetPosition(progress_label.x, progress_label.y, 1);
|
||||
progress_label.sprite.SetOpacity (1);
|
||||
} else {
|
||||
if (progress_label.sprite)
|
||||
progress_label.sprite.SetOpacity (0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Plymouth.SetUpdateStatusFunction (update_status_callback);
|
||||
|
||||
@@ -993,27 +529,27 @@ Plymouth.SetUpdateStatusFunction (update_status_callback);
|
||||
# return rotated_img;
|
||||
#}
|
||||
|
||||
fun update_glow_anim () {
|
||||
if (global.anim_iter > NB_ANIM_STEPS) {
|
||||
global.anim_iter = 0;
|
||||
}
|
||||
#DebugMedium("iter = " + global.anim_iter);
|
||||
glow_opacity = 0.6 + 0.3 * Math.Cos(global.anim_iter / NB_ANIM_STEPS * 2 * Math.Pi);
|
||||
#Debug("glow_opacity = " + glow_opacity);
|
||||
if (global.anim_start_time != global.progress_time && global.anim_status != "running") {
|
||||
global.anim_start_time = global.progress_time;
|
||||
global.anim_iter = 0;
|
||||
global.anim_status = "running";
|
||||
}
|
||||
|
||||
if (global.anim_status == "running") {
|
||||
global.glow_sprite.SetOpacity(glow_opacity);
|
||||
global.anim_iter++;
|
||||
|
||||
if (global.anim_iter >= NB_ANIM_STEPS) {
|
||||
global.anim_status = "stopped";
|
||||
}
|
||||
}
|
||||
fun update_horse () {
|
||||
# if (global.anim_iter > NB_ANIM_STEPS) {
|
||||
# global.anim_iter = 0;
|
||||
# }
|
||||
# #DebugMedium("iter = " + global.anim_iter);
|
||||
# #glow_opacity = 0.6 + 0.3 * Math.Cos(global.anim_iter / NB_ANIM_STEPS * 2 * Math.Pi);
|
||||
# #Debug("glow_opacity = " + glow_opacity);
|
||||
# if (global.anim_start_time != global.progress_time && global.anim_status != "running") {
|
||||
# global.anim_start_time = global.progress_time;
|
||||
# global.anim_iter = 0;
|
||||
# global.anim_status = "running";
|
||||
# }
|
||||
#
|
||||
# if (global.anim_status == "running") {
|
||||
# global.glow_sprite.SetOpacity(glow_opacity);
|
||||
# global.anim_iter++;
|
||||
#
|
||||
# if (global.anim_iter >= NB_ANIM_STEPS) {
|
||||
# global.anim_status = "stopped";
|
||||
# }
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
@@ -1030,8 +566,7 @@ fun refresh_callback ()
|
||||
global.refresh_iter++;
|
||||
if (global.refresh_iter == NB_REFRESHS_BETWEEN_ANIMS) {
|
||||
global.refresh_iter = 0;
|
||||
update_glow_anim();
|
||||
|
||||
update_horse();
|
||||
}
|
||||
#DebugBottom ("refresh_iter=" + refresh_iter + "; anim_status=" + anim_status + "; anim_start_time=" + anim_start_time + "; anim_iter=" + anim_iter);
|
||||
}
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 827 B After Width: | Height: | Size: 827 B |
|
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 364 B |
|
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |