Compare commits

..

No commits in common. "014cc73c918f7248469f7cdd271a71ddc10583d1" and "5aac99f408ff66858307f25b07ac4a227ddeefde" have entirely different histories.

36 changed files with 148 additions and 555 deletions

15
.github/FUNDING.yml vendored Executable file
View File

@ -0,0 +1,15 @@
# These are supported funding model platforms
#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
#patreon: # Replace with a single Patreon username
#open_collective: # Replace with a single Open Collective username
#ko_fi: # Replace with a single Ko-fi username
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
#liberapay: # Replace with a single Liberapay username
#issuehunt: # Replace with a single IssueHunt username
#otechie: # Replace with a single Otechie username
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
#github: [Valeria-Fadeeva]
custom: ["https://www.tinkoff.ru/rm/fadeeva.valeriya96/9bLRi79066", "https://yoomoney.ru/to/4100115921160758", "https://qiwi.com/n/VALERIAFADEEVA", "valeria.fadeeva.me"]

View File

@ -12,7 +12,7 @@ sudo plymouth message --text="resuming boot"
sudo plymouth unpause-progress sudo plymouth unpause-progress
#sudo plymouth ask-question --prompt "what is your name? " | /usr/bin/tee #sudo plymouth ask-question --prompt "what is your name? " | /usr/bin/tee
sudo plymouth ask-for-password --prompt "specify password: /dev/sda8: LABEL=\"Data\" UUID=\"2fd2a700-319b-41f2-853f-c57667d4081d\" UUID_SUB=\"62109da7-2b4b-4c2d-b590-1c0436c7c3a4\" PARTUUID=\"c05c942b-bd7e-487a-87a0-592df3334ff5\"" | /usr/bin/tee sudo plymouth ask-for-password --prompt "specify password: " | /usr/bin/tee
#sudo plymouth message --text="Hello" #sudo plymouth message --text="Hello"

267
dev/script.js Normal file → Executable file
View File

@ -1,5 +1,5 @@
/* /*
Theme Name: Melawy Theme Name: Melawy Lera Sugar
Version: 1.0 Version: 1.0
Description: My theme Description: My theme
Author: Valeria Fadeeva - https://github.com/Valeria-Fadeeva Author: Valeria Fadeeva - https://github.com/Valeria-Fadeeva
@ -105,62 +105,12 @@ SetSpriteImage = function(asset, x, y, z) {
return sprite; return sprite;
}; };
Blur = function(background_src, foreground_src, x, y, z, width, height, scale_width, scale_height) {
index = 0;
local.image[index];
image[index].image = Image(background_src);
image[index].image = ScaleImage(image[index].image, Limit(scale_width, scale_height, 100));
image[index].image = image[index].image.Crop(x, y, width, height);
image[index].image = ScaleImage(image[index].image, Limit(Percent(120, width), Percent(120, height), 100));
image[index].image = image[index].image.Crop(x, y, width, height);
image[index].sprite0 = Sprite(image[index].image);
image[index].sprite1 = Sprite(image[index].image);
image[index].sprite2 = Sprite(image[index].image);
image[index].sprite3 = Sprite(image[index].image);
image[index].sprite4 = Sprite(image[index].image);
image[index].sprite0.SetOpacity(0.25);
image[index].sprite1.SetOpacity(0.25);
image[index].sprite2.SetOpacity(0.25);
image[index].sprite3.SetOpacity(0.25);
image[index].sprite4.SetOpacity(0.25);
image[index].sprite0.SetPosition(x, y, z);
image[index].sprite1.SetPosition(x++, y, z++);
image[index].sprite2.SetPosition(x, y++, z++);
image[index].sprite3.SetPosition(x--, y, z++);
image[index].sprite5.SetPosition(x, y--, z++);
index = 1;
image[index].image = Image(foreground_src);
image[index].image = image[index].image.Scale(width, height);
image[index].sprite = Sprite(image[index].image);
image[index].sprite.SetOpacity(0.75);
image[index].sprite.SetPosition(x, y, z++);
return local.image;
};
// TEXT // TEXT
common_font = "Noto Sans Mono Regular 10"; common_font = "Noto Sans Mono Regular 10";
progress_font = "Noto Sans Mono Regular 12"; progressfont = "Noto Sans Mono Regular 12";
link_font = "Noto Sans Italic 16"; link_font = "Noto Sans Italic 16";
common_symbol.image = Image.Text("M", 0.5, 0.5, 0.5, 1, common_font);
common_symbol.height = common_symbol.image.GetHeight(); // высота символа
common_symbol.width = common_symbol.image.GetWidth(); // ширина символа
progress_symbol.image = Image.Text("M", 0.5, 0.5, 0.5, 1, progress_font);
progress_symbol.height = progress_symbol.image.GetHeight(); // высота символа
progress_symbol.width = progress_symbol.image.GetWidth(); // ширина символа
link_symbol.image = Image.Text("M", 0.5, 0.5, 0.5, 1, link_font);
link_symbol.height = link_symbol.image.GetHeight(); // высота символа
link_symbol.width = link_symbol.image.GetWidth(); // ширина символа
starting_text = "Starting up..."; starting_text = "Starting up...";
bye_text = "System is shutting down"; bye_text = "System is shutting down";
progress_t= 0; progress_t= 0;
@ -190,61 +140,51 @@ background.y = y0 + screen.height / 2 - background.height / 2;
background.sprite = SpriteNew(); background.sprite = SpriteNew();
background.sprite.SetImage(background.image); background.sprite.SetImage(background.image);
background.sprite.SetOpacity(1);
background.sprite.SetPosition(background.x, background.y, 0); background.sprite.SetPosition(background.x, background.y, 0);
background.sprite.SetOpacity(1);
// SIDE BACKGROUND // MESSAGE BACKGROUND
side_panel.background_src = "BACKGROUND.png"; side_background.image = Image("SIDE_BACKGROUND2.png");
side_panel.foreground_src = "SIDE_BACKGROUND2.png"; side_background.image = side_background.image.Scale(Percent(25, screen.width), Percent(100, screen.height));
side_panel.x = x0;
side_panel.y = y0;
side_panel.z = 1;
side_panel.width = Percent(33.33, screen.width);
side_panel.height = Percent(100, screen.height);
blur = Blur(side_panel.background_src, side_panel.foreground_src, side_panel.x, side_panel.y, side_panel.z, side_panel.width, side_panel.height, screen.width, screen.height); side_background.width = side_background.image.GetWidth();
side_background.height = side_background.image.GetHeight();
// MESSAGES BOX side_background.x = x0;
messages_box.image = Image("MESSAGES_BOX.png"); side_background.y = y0;
messages_box.image = messages_box.image.Scale(Percent(80, side_panel.width), Percent(40, side_panel.height));
messages_box.width = messages_box.image.GetWidth(); side_background.sprite = Sprite(side_background.image);
messages_box.height = messages_box.image.GetHeight(); side_background.sprite.SetPosition(side_background.x, side_background.y, 1);
side_background.sprite.SetOpacity(1);
messages_box.x = Percent(50, side_panel.width) - messages_box.width / 2;
messages_box.y = Percent(45, side_panel.height) - messages_box.height;
messages_box.sprite = Sprite(messages_box.image);
messages_box.sprite.SetOpacity(1);
messages_box.sprite.SetPosition(messages_box.x, messages_box.y, 12);
// Sise Logo // Sise Logo
side_logo.image = Image("Melawy_Linux_640x320.png"); side_logo.image = Image("Melawy_Linux_640x320.png");
side_logo.image = ScaleImage(side_logo.image, Limit(screen.width, screen.height, 20)); side_logo.image = ScaleImage(side_logo.image, Limit(screen.width, screen.height, 20));
// side_logo.image = side_logo.image.Scale(Percent(25, screen.width), Percent(25, screen.height));
side_logo.width = side_logo.image.GetWidth(); side_logo.width = side_logo.image.GetWidth();
side_logo.height = side_logo.image.GetHeight(); side_logo.height = side_logo.image.GetHeight();
side_logo.x = (side_panel.width - side_logo.width) / 2; side_logo.x = (side_background.width - side_logo.width) / 2;
side_logo.y = side_panel.height - side_panel.height * 0.25; side_logo.y = screen.height - screen.height * 0.25;
side_logo.sprite = Sprite(side_logo.image); side_logo.sprite = Sprite(side_logo.image);
side_logo.sprite.SetPosition(side_logo.x, side_logo.y, 2);
side_logo.sprite.SetOpacity(1); side_logo.sprite.SetOpacity(1);
side_logo.sprite.SetPosition(side_logo.x, side_logo.y, 12);
// **************************************** // // **************************************** //
project_link.image = Image.Text("https://Melawy.ru", 0.5, 0.5, 0.5, 1, link_font); project_link.image = Image.Text("https://github.com/Melawy", 0.5, 0.5, 0.5, 1, link_font);
project_link.width = project_link.image.GetWidth(); project_link.width = project_link.image.GetWidth();
project_link.height = project_link.image.GetHeight(); project_link.height = project_link.image.GetHeight();
project_link.sprite = Sprite(project_link.image); project_link.sprite = Sprite(project_link.image);
project_link.x = (side_panel.width - project_link.width) / 2; project_link.x = (side_background.width - project_link.width) / 2;
project_link.y = side_logo.y + side_logo.height; project_link.y = side_logo.y + side_logo.height;
project_link.sprite.SetPosition(project_link.x, project_link.y, 2);
project_link.sprite.SetOpacity(1); project_link.sprite.SetOpacity(1);
project_link.sprite.SetPosition(project_link.x, project_link.y, 12);
// **************************************** // // **************************************** //
@ -255,22 +195,22 @@ logo.image = FitIntoDimensions(logo.image, Limit(screen.width, screen.height, 35
logo.sprite = Sprite(logo.image); logo.sprite = Sprite(logo.image);
logo.x = screen.width / 2 - logo.image.GetWidth() / 2; // позиция логотипа X logo.x = screen.width / 2 - logo.image.GetWidth() / 2; // позиция логотипа X
logo.y = Percent(10, screen.height); // позиция логотипа Y logo.y = Percent(10, screen.height); // позиция логотипа Y
logo.sprite.SetPosition(logo.x, logo.y, 2);
logo.sprite.SetOpacity(1); logo.sprite.SetOpacity(1);
logo.sprite.SetPosition(logo.x, logo.y, 12);
// PROGRESS FORM // PROGRESS FORM
progress_form.image = Image("PROGRESS_FORM.png"); progress_form.image = Image("PROGRESS_FORM.png");
progress_form.image = progress_form.image.Scale(Percent(80, side_panel.width), Percent(10, side_panel.height)); progress_form.image = progress_form.image.Scale(Percent(20, screen.width), Percent(10, screen.height));
progress_form.width = progress_form.image.GetWidth(); progress_form.width = progress_form.image.GetWidth();
progress_form.height = progress_form.image.GetHeight(); progress_form.height = progress_form.image.GetHeight();
progress_form.x = Percent(50, side_panel.width) - progress_form.width / 2; progress_form.x = Percent(50, side_background.width) - progress_form.width / 2;
progress_form.y = Percent(75, side_panel.height) - progress_form.height; progress_form.y = Percent(75, side_background.height) - progress_form.height;
progress_form.sprite = Sprite(progress_form.image); progress_form.sprite = Sprite(progress_form.image);
progress_form.sprite.SetPosition(progress_form.x, progress_form.y, 2);
progress_form.sprite.SetOpacity(1); progress_form.sprite.SetOpacity(1);
progress_form.sprite.SetPosition(progress_form.x, progress_form.y, 12);
// SPINNER // SPINNER
spinner.image = Image("SPINNER.png"); spinner.image = Image("SPINNER.png");
@ -283,11 +223,11 @@ spinner.x = progress_form.x + progress_form.width - Percent(10, progress_form.wi
spinner.y = progress_form.y + Percent(10, progress_form.height); spinner.y = progress_form.y + Percent(10, progress_form.height);
spinner.sprite = Sprite(spinner.image); spinner.sprite = Sprite(spinner.image);
spinner.sprite.SetPosition(spinner.x, spinner.y, 13); // позиция за или перед spinner.sprite.SetPosition(spinner.x, spinner.y, 3); // позиция за или перед
// PROGRESS TEXT // PROGRESS TEXT
progress_text.image = Image.Text(progress_t + "%", 0.5, 0.5, 0.5, 1, progress_font); progress_text.image = Image.Text(progress_t + "%", 255, 255, 255, 1, progressfont);
progress_text.width = progress_text.image.GetWidth(); progress_text.width = progress_text.image.GetWidth();
progress_text.height = progress_text.image.GetHeight(); progress_text.height = progress_text.image.GetHeight();
@ -296,7 +236,7 @@ progress_text.x = progress_form.x + Percent(5, progress_form.width); // пози
progress_text.y = progress_form.y + Percent(10, progress_form.height); // позиция % по Y progress_text.y = progress_form.y + Percent(10, progress_form.height); // позиция % по Y
progress_text.sprite = SpriteNew(); progress_text.sprite = SpriteNew();
progress_text.sprite.SetPosition(progress_text.x, progress_text.y, 13); progress_text.sprite.SetPosition(progress_text.x, progress_text.y, 3);
// PROGRESS BOX // PROGRESS BOX
progress_box.image = Image("PROGRESS_BOX.png"); progress_box.image = Image("PROGRESS_BOX.png");
@ -309,7 +249,7 @@ progress_box.x = progress_form.x + (progress_form.width - progress_box.width) /
progress_box.y = progress_form.y + (progress_form.height - progress_box.height) / 2; progress_box.y = progress_form.y + (progress_form.height - progress_box.height) / 2;
progress_box.sprite = Sprite(progress_box.image); progress_box.sprite = Sprite(progress_box.image);
progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 13); progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 3);
// PROGRESS BAR // PROGRESS BAR
progress_bar.original_image = Image("PROGRESS_BAR.png"); progress_bar.original_image = Image("PROGRESS_BAR.png");
@ -322,7 +262,7 @@ progress_bar.x = progress_form.x + (progress_form.width - progress_bar.original_
progress_bar.y = progress_form.y + (progress_form.height - progress_bar.original_image.GetHeight()) / 2; progress_bar.y = progress_form.y + (progress_form.height - progress_bar.original_image.GetHeight()) / 2;
progress_bar.sprite = Sprite(); progress_bar.sprite = Sprite();
progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 14); progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 4);
// PROGRESS FADE // PROGRESS FADE
progress_fade.image = Image("PROGRESS_FADE.png"); progress_fade.image = Image("PROGRESS_FADE.png");
@ -344,19 +284,17 @@ function progress_callback(duration, progress) {
progress_bar.sprite.SetImage(progress_bar.image); progress_bar.sprite.SetImage(progress_bar.image);
f = Math.Int(progress_bar.image.GetWidth() /progress_bar.original_image.GetWidth() * 100); f = Math.Int(progress_bar.image.GetWidth() /progress_bar.original_image.GetWidth() * 100);
progress_t.image = Image.Text(f + "%", 0.5, 0.5, 0.5, 1, progress_font); progress_t.image = Image.Text(f + "%", 255, 255, 255, 1, progressfont);
progress_text.sprite.SetImage(progress_t.image); progress_text.sprite.SetImage(progress_t.image);
} }
} }
Plymouth.SetBootProgressFunction(progress_callback); Plymouth.SetBootProgressFunction(progress_callback);
// DIALOG // DIALOG
status = "normal"; status = "normal";
//count = 0; //count = 0;
function dialog_setup() { function dialog_setup() {
local.box_form; local.box_form;
local.lock; local.lock;
@ -365,27 +303,27 @@ function dialog_setup() {
local.bullet_i; local.bullet_i;
box_form.image = Image("BOX.png"); box_form.image = Image("BOX.png");
box_form.image = box_form.image.Scale(Percent(80, side_panel.width), Percent(18, side_panel.height)); box_form.image = box_form.image.Scale(Percent(20, screen.width), Percent(10, screen.height));
box_form.width = box_form.image.GetWidth(); box_form.width = box_form.image.GetWidth();
box_form.height = box_form.image.GetHeight(); box_form.height = box_form.image.GetHeight();
box_form.x = progress_form.x; box_form.x = progress_form.x;
box_form.y = progress_form.y - box_form.height - Percent(1, side_panel.height); box_form.y = progress_form.y - box_form.height - Percent(1, screen.height);
box_form.z = 10000; box_form.z = 10000;
box_form.sprite = Sprite(box_form.image); box_form.sprite = Sprite(box_form.image);
box_form.sprite.SetOpacity(1);
box_form.sprite.SetPosition(box_form.x, box_form.y, box_form.z); box_form.sprite.SetPosition(box_form.x, box_form.y, box_form.z);
box_form.sprite.SetOpacity(1);
entry.image = Image("ENTRY.png"); entry.image = Image("ENTRY.png");
entry.image = entry.image.Scale(Percent(90, box_form.width), Percent(20, box_form.height)); entry.image = entry.image.Scale(Percent(90, box_form.width), Percent(33, box_form.height));
entry.width = entry.image.GetWidth(); entry.width = entry.image.GetWidth();
entry.height = entry.image.GetHeight(); entry.height = entry.image.GetHeight();
entry.x = box_form.x + box_form.width/2 - entry.width/2; entry.x = box_form.x + box_form.width/2 - entry.width/2;
entry.y = box_form.y + (box_form.height/3 * 2) - entry.height/2; entry.y = box_form.y + box_form.height/2 - entry.height/2;
entry.z = box_form.z + 1; entry.z = box_form.z + 1;
entry.sprite = Sprite(entry.image); entry.sprite = Sprite(entry.image);
@ -423,7 +361,6 @@ function dialog_setup() {
dialog_opacity(1); dialog_opacity(1);
} }
function dialog_opacity(opacity) { function dialog_opacity(opacity) {
if (opacity == 0) { if (opacity == 0) {
dialog.box_form.sprite.SetOpacity(opacity); dialog.box_form.sprite.SetOpacity(opacity);
@ -437,7 +374,7 @@ function dialog_opacity(opacity) {
dialog.hint.sprite.SetOpacity(opacity); dialog.hint.sprite.SetOpacity(opacity);
for (index = 0; dialog.bullet[index]; index++) { for(index = 0; dialog.bullet[index]; index++) {
dialog.bullet[index].sprite.SetOpacity(opacity); dialog.bullet[index].sprite.SetOpacity(opacity);
} }
} }
@ -461,57 +398,10 @@ function display_password_callback(prompt_text, bullets) {
else else
dialog_opacity(1); dialog_opacity(1);
padding_top_bottom = Percent(10, dialog.box_form.height); // отступы сверху и снизу dialog.hint.image = Image.Text(prompt_text, 1.0, 1.0, 1.0, 1, common_font);
padding_left_right = Percent(5, dialog.box_form.width); // отступы слева и справа
LINE_WIDTH = 100;
for (index = LINE_WIDTH; index > 0; index--) {
if ((LINE_WIDTH * common_symbol.width) > (dialog.box_form.width - (padding_left_right * 2))) {
LINE_WIDTH = LINE_WIDTH - 1;
}
else {
break;
}
}
str_len = StringLength(prompt_text);
for (i = 1; LINE_WIDTH * i <= str_len; i++) {
line_count = i;
}
if (str_len > LINE_WIDTH) {
if (str_len % LINE_WIDTH > 0) {
line_count = line_count + 1;
}
}
i = 1;
start = 0;
end = LINE_WIDTH;
text = "";
for (i = 1; i <= line_count; i++) {
text += prompt_text.SubString(start, end);
text += "\n";
start = end;
if (LINE_WIDTH * i < str_len) {
end = end + LINE_WIDTH;
}
else {
end = str_len - 1;
}
}
prompt_text = text;
dialog.hint.image = Image.Text(prompt_text, 0.5, 0.5, 0.5, 1, common_font);
dialog.hint.sprite.SetImage(dialog.hint.image); dialog.hint.sprite.SetImage(dialog.hint.image);
for (index = 0; dialog.bullet[index] || index < bullets; index++) { for(index = 0; dialog.bullet[index] || index < bullets; index++) {
if (!dialog.bullet[index]) { if (!dialog.bullet[index]) {
dialog.bullet[index].sprite = Sprite(dialog.bullet_i.image); dialog.bullet[index].sprite = Sprite(dialog.bullet_i.image);
dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_i.width / 0.9 - dialog.entry.height * -0.2; // отступ точки от точки и от поля(modified) dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_i.width / 0.9 - dialog.entry.height * -0.2; // отступ точки от точки и от поля(modified)
@ -529,6 +419,7 @@ function display_password_callback(prompt_text, bullets) {
Plymouth.SetDisplayPasswordFunction(display_password_callback); Plymouth.SetDisplayPasswordFunction(display_password_callback);
time = 1; time = 1;
function refreshHandler() { function refreshHandler() {
@ -539,7 +430,7 @@ function refreshHandler() {
text.sprite = Sprite(text.image); text.sprite = Sprite(text.image);
text.x = progress_box.x; text.x = progress_box.x;
text.y = progress_box.y - progress_text.image.GetHeight() * 2; text.y = progress_box.y - progress_text.image.GetHeight() * 2;
text.sprite.SetPosition(text.x, text.y, 13); text.sprite.SetPosition(text.x, text.y, 2);
} }
else { else {
progress_fade.sprite.SetOpacity (1); progress_fade.sprite.SetOpacity (1);
@ -548,12 +439,12 @@ function refreshHandler() {
text_end.sprite = Sprite(text_end.image); text_end.sprite = Sprite(text_end.image);
text_end.x = progress_box.x; text_end.x = progress_box.x;
text_end.y = progress_box.y - progress_text.image.GetHeight() * 2; text_end.y = progress_box.y - progress_text.image.GetHeight() * 2;
text_end.sprite.SetPosition(text_end.x, text_end.y, 13); text_end.sprite.SetPosition(text_end.x, text_end.y, 2);
} }
progress_fade.x = progress_bar.x; progress_fade.x = progress_bar.x;
progress_fade.y = progress_bar.y; progress_fade.y = progress_bar.y;
progress_fade.sprite.SetPosition(counter + progress_fade.x, progress_fade.y, 14); progress_fade.sprite.SetPosition(counter + progress_fade.x, progress_fade.y, 4);
if (fade_dir == 0) { if (fade_dir == 0) {
counter++; counter++;
@ -595,72 +486,30 @@ function refreshHandler() {
Plymouth.SetRefreshFunction(refreshHandler); Plymouth.SetRefreshFunction(refreshHandler);
message_status.sprite = SpriteNew();
// LOG //
NUM_SCROLL_LINES=25; //количество строк лога
LINE_WIDTH=35; //ширина строк лога
message_sprite=SpriteNew();
function message_callback(prompt_text) { function message_callback(prompt_text) {
message_status.image = Image.Text(prompt_text, 0.5, 0.5, 0.5, 1, common_font); message = Image.Text(prompt_text, 0.5, 0.5, 0.5, 1, common_font);
message_status.sprite.SetImage(message_status.image); message_sprite.SetImage(message);
message_status.height = message_status.image.GetHeight(); message_sprite.SetPosition(Percent(2, screen.width), Percent(50, screen.height), 2);
message_status.x = messages_box.x + Percent(5, messages_box.width); message_sprite.SetOpacity(1);
message_status.y = messages_box.y + messages_box.height - Percent(7, messages_box.height);
message_status.sprite.SetOpacity(1);
message_status.sprite.SetPosition(message_status.x, message_status.y, 13);
} }
Plymouth.SetMessageFunction(message_callback); Plymouth.SetMessageFunction(message_callback);
// высота messages_box = screen.height - 40% (1080 * 0,4 = 432)
// высота всех сообщений = NUM_SCROLL_LINES (20) * (LINE_HEIGHT) 17 = 340
// 10 процентов сверху от начала messages_box.x = 432 - 10% (432 * 0,1) = 432 - 43 = 389
// конечная точка, где допустимо показывать сообщения = 389 - 43 (10% от высоты messages_box.x) = 346
// если высота всех сообщений выше, чем высота (messages_box.height - 20%), то уменьшать количество строк, пока высота всех сообщений не быдет меньше (messages_box.height - 20%)
// высота символа = common_font = 10pt, предположим что 10px
// предположим, что ширина символа = 60% от высоты символа = 6px
// ширина side_panel = 25% от screen.width = 1080 * 0.25 = 270
// ширина messages_box = 80 % от side_panel = 270 * 0.8 = 216
// ширина всех сообщений = LINE_WIDTH * ширину символа = 40 * 6 = 240
// необходимо снижать количество LINE_WIDTH пока реальная ширина сообщения не будет меньше или равно ширине messages_box
padding_top_bottom = Percent(10, messages_box.height); // отступы сверху и снизу
padding_left_right = Percent(5, messages_box.width); // отступы слева и справа
message_sprite_.x = messages_box.x + (padding_left_right); // позиция % по X (слева направо)
message_sprite_.y = messages_box.y + (padding_top_bottom); // позиция % по Y (сверху вниз)
// LOG //
NUM_SCROLL_LINES=100; //количество строк лога
LINE_WIDTH=100; //ширина строк лога
LINE_HEIGHT = common_symbol.height * 1.5; // межстрочный интервал x1,5
for (index = NUM_SCROLL_LINES; index > 0; index--) {
if ((NUM_SCROLL_LINES * LINE_HEIGHT) > (messages_box.height - (padding_top_bottom * 2))) {
NUM_SCROLL_LINES=NUM_SCROLL_LINES-1;
}
else {
break;
}
}
for (index = LINE_WIDTH; index > 0; index--) {
if ((LINE_WIDTH * common_symbol.width) > (messages_box.width - (padding_left_right * 2))) {
LINE_WIDTH=LINE_WIDTH-1;
}
else {
break;
}
}
// Initialising text images and their positions // Initialising text images and their positions
// 20 is the height(including line spacing) of each line // 20 is the height(including line spacing) of each line
for (i=0; i < NUM_SCROLL_LINES; i++) { for(i=0; i < NUM_SCROLL_LINES; i++) {
lines[i]= Image.Text("", 0.5, 0.5, 0.5, 1, common_font); //цвет строк lines[i]= Image.Text("", 0.5, 0.5, 0.5, 1, common_font); //цвет строк
message_sprite[i] = SpriteNew(); message_sprite[i] = SpriteNew();
message_sprite[i].SetPosition(message_sprite_.x, message_sprite_.y + (i * LINE_HEIGHT), 13); message_sprite[i].SetPosition(Percent(2, screen.width), Percent(5, screen.height) + (i * 17), 2);
} //высота строк //отступ строк } //высота строк //отступ строк
function StringLength(string) { function StringLength(string) {
index = 0; index = 0;
str = String(string); str = String(string);
@ -668,7 +517,6 @@ function StringLength(string) {
return index; return index;
} }
function scroll_message_callback(text) { function scroll_message_callback(text) {
// Truncate the message if too long // Truncate the message if too long
if (StringLength(text) > LINE_WIDTH) { if (StringLength(text) > LINE_WIDTH) {
@ -677,7 +525,7 @@ function scroll_message_callback(text) {
} }
// Shift message one up // Shift message one up
for (i = 0; i < NUM_SCROLL_LINES - 1; i++) { for(i = 0; i < NUM_SCROLL_LINES - 1; i++) {
lines[i] = lines[i+1]; lines[i] = lines[i+1];
} }
@ -685,14 +533,13 @@ function scroll_message_callback(text) {
lines[i] = Image.Text(text, 0.5, 0.5, 0.5, 1, common_font); lines[i] = Image.Text(text, 0.5, 0.5, 0.5, 1, common_font);
// Re-positioning the text images // Re-positioning the text images
for (i = 0; i < NUM_SCROLL_LINES; i++) { for(i = 0; i < NUM_SCROLL_LINES; i++) {
message_sprite[i].SetImage(lines[i]); message_sprite[i].SetImage(lines[i]);
} }
} }
Plymouth.SetUpdateStatusFunction(scroll_message_callback); Plymouth.SetUpdateStatusFunction(scroll_message_callback);
// QUIT // QUIT
function quit_callback() { function quit_callback() {
progress_fade.sprite.SetOpacity (1); progress_fade.sprite.SetOpacity (1);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 307 B

View File

@ -28,10 +28,10 @@
inkscape:document-units="mm" inkscape:document-units="mm"
showgrid="false" showgrid="false"
inkscape:zoom="2.9469416" inkscape:zoom="2.9469416"
inkscape:cx="187.31284" inkscape:cx="186.97351"
inkscape:cy="108.41749" inkscape:cy="108.07815"
inkscape:window-width="1920" inkscape:window-width="1920"
inkscape:window-height="1006" inkscape:window-height="1002"
inkscape:window-x="0" inkscape:window-x="0"
inkscape:window-y="0" inkscape:window-y="0"
inkscape:window-maximized="1" inkscape:window-maximized="1"
@ -43,7 +43,7 @@
inkscape:groupmode="layer" inkscape:groupmode="layer"
id="layer1"> id="layer1">
<rect <rect
style="mix-blend-mode:normal;fill:#1c1b20;fill-opacity:1;stroke:#a03d40;stroke-width:0.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" style="mix-blend-mode:normal;fill:#1c1b20;fill-opacity:1;stroke:#a03d40;stroke-width:1;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
id="rect788" id="rect788"
width="100" width="100"
height="50" height="50"

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
dev/src/dark-red-border/ENTRY.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100mm"
height="150mm"
viewBox="0 0 100 150"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="MESSAGGES_BOX.svg"
inkscape:export-filename="MESSAGES_BOX"
inkscape:export-xdpi="93"
inkscape:export-ydpi="93"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="1.0419012"
inkscape:cx="-73.903361"
inkscape:cy="322.0075"
inkscape:window-width="1920"
inkscape:window-height="1006"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Слой 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="mix-blend-mode:normal;fill:#1c1b20;fill-opacity:1;stroke:#a03d40;stroke-width:0.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
id="rect788"
width="100"
height="150"
x="0"
y="0"
ry="0"
inkscape:export-filename="MESSAGES_BOX.png"
inkscape:export-xdpi="25.4"
inkscape:export-ydpi="25.4" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="100mm"
height="10mm"
viewBox="0 0 100 10"
version="1.1"
id="svg5"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="MESSAGGE_STATUS_BOX.svg"
inkscape:export-filename="MESSAGE_STATUS.png"
inkscape:export-xdpi="93"
inkscape:export-ydpi="93"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.9469416"
inkscape:cx="199.52889"
inkscape:cy="45.301203"
inkscape:window-width="1920"
inkscape:window-height="1006"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Слой 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="mix-blend-mode:normal;fill:#1c1b20;fill-opacity:1;stroke:#a03d40;stroke-width:0.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
id="rect788"
width="100"
height="10"
x="0"
y="0"
ry="0"
inkscape:export-filename="MESSAGE_STATUS_BOX.png"
inkscape:export-xdpi="25.4"
inkscape:export-ydpi="25.4" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

0
dev/src/dark-red-border/PROGRESS_BAR.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

0
dev/src/dark-red-border/PROGRESS_BOX.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 307 B

View File

@ -8,7 +8,7 @@
version="1.1" version="1.1"
id="svg5" id="svg5"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="PROGRESS_FORM.svg" sodipodi:docname="BOX.svg"
inkscape:export-filename="BOX.png" inkscape:export-filename="BOX.png"
inkscape:export-xdpi="93" inkscape:export-xdpi="93"
inkscape:export-ydpi="93" inkscape:export-ydpi="93"
@ -28,10 +28,10 @@
inkscape:document-units="mm" inkscape:document-units="mm"
showgrid="false" showgrid="false"
inkscape:zoom="2.9469416" inkscape:zoom="2.9469416"
inkscape:cx="187.31284" inkscape:cx="186.97351"
inkscape:cy="108.41749" inkscape:cy="108.07815"
inkscape:window-width="1920" inkscape:window-width="1920"
inkscape:window-height="1006" inkscape:window-height="1002"
inkscape:window-x="0" inkscape:window-x="0"
inkscape:window-y="0" inkscape:window-y="0"
inkscape:window-maximized="1" inkscape:window-maximized="1"
@ -43,14 +43,14 @@
inkscape:groupmode="layer" inkscape:groupmode="layer"
id="layer1"> id="layer1">
<rect <rect
style="mix-blend-mode:normal;fill:#1c1b20;fill-opacity:1;stroke:#a03d40;stroke-width:0.5;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke" style="mix-blend-mode:normal;fill:#1c1b20;fill-opacity:1;stroke:#a03d40;stroke-width:1;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
id="rect788" id="rect788"
width="100" width="100"
height="50" height="50"
x="0" x="0"
y="0" y="0"
ry="0" ry="0"
inkscape:export-filename="PROGRESS_FORM.png" inkscape:export-filename="BOX.png"
inkscape:export-xdpi="25.4" inkscape:export-xdpi="25.4"
inkscape:export-ydpi="25.4" /> inkscape:export-ydpi="25.4" />
</g> </g>

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

0
dev/src/light-red-border/ENTRY.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

0
dev/src/light-red-border/PROGRESS_BAR.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

0
dev/src/light-red-border/PROGRESS_BOX.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 858 B

After

Width:  |  Height:  |  Size: 858 B

0
dev/src/light/ENTRY.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

0
dev/src/light/PROGRESS_BAR.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

0
dev/src/light/PROGRESS_BOX.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 858 B

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 820 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 307 B

0
melawy-fenek/BULLET.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 376 B

After

Width:  |  Height:  |  Size: 376 B

0
melawy-fenek/ENTRY.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

0
melawy-fenek/LOCK.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

0
melawy-fenek/LOGO_BOX.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

0
melawy-fenek/MAIN_LOGO.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 B

0
melawy-fenek/PROGRESS_BAR.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

0
melawy-fenek/PROGRESS_BOX.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 307 B

View File

@ -0,0 +1,8 @@
[Plymouth Theme]
Name=Melawy: Fenek
Description=Based on Script
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/melawy-fenek
ScriptFile=/usr/share/plymouth/themes/melawy-fenek/script.script

View File

@ -1,8 +0,0 @@
[Plymouth Theme]
Name=Melawy: Fenek
Description=Based on Script
ModuleName=script
[script]
ImageDir=/usr/share/plymouth/themes/melawy
ScriptFile=/usr/share/plymouth/themes/melawy/script.script

267
melawy-fenek/script.script Normal file → Executable file
View File

@ -1,5 +1,5 @@
/* /*
Theme Name: Melawy Theme Name: Melawy Lera Sugar
Version: 1.0 Version: 1.0
Description: My theme Description: My theme
Author: Valeria Fadeeva - https://github.com/Valeria-Fadeeva Author: Valeria Fadeeva - https://github.com/Valeria-Fadeeva
@ -105,62 +105,12 @@ SetSpriteImage = fun(asset, x, y, z) {
return sprite; return sprite;
}; };
Blur = fun(background_src, foreground_src, x, y, z, width, height, scale_width, scale_height) {
index = 0;
local.image[index];
image[index].image = Image(background_src);
image[index].image = ScaleImage(image[index].image, Limit(scale_width, scale_height, 100));
image[index].image = image[index].image.Crop(x, y, width, height);
image[index].image = ScaleImage(image[index].image, Limit(Percent(120, width), Percent(120, height), 100));
image[index].image = image[index].image.Crop(x, y, width, height);
image[index].sprite0 = Sprite(image[index].image);
image[index].sprite1 = Sprite(image[index].image);
image[index].sprite2 = Sprite(image[index].image);
image[index].sprite3 = Sprite(image[index].image);
image[index].sprite4 = Sprite(image[index].image);
image[index].sprite0.SetOpacity(0.25);
image[index].sprite1.SetOpacity(0.25);
image[index].sprite2.SetOpacity(0.25);
image[index].sprite3.SetOpacity(0.25);
image[index].sprite4.SetOpacity(0.25);
image[index].sprite0.SetPosition(x, y, z);
image[index].sprite1.SetPosition(x++, y, z++);
image[index].sprite2.SetPosition(x, y++, z++);
image[index].sprite3.SetPosition(x--, y, z++);
image[index].sprite5.SetPosition(x, y--, z++);
index = 1;
image[index].image = Image(foreground_src);
image[index].image = image[index].image.Scale(width, height);
image[index].sprite = Sprite(image[index].image);
image[index].sprite.SetOpacity(0.75);
image[index].sprite.SetPosition(x, y, z++);
return local.image;
};
// TEXT // TEXT
common_font = "Noto Sans Mono Regular 10"; common_font = "Noto Sans Mono Regular 10";
progress_font = "Noto Sans Mono Regular 12"; progressfont = "Noto Sans Mono Regular 12";
link_font = "Noto Sans Italic 16"; link_font = "Noto Sans Italic 16";
common_symbol.image = Image.Text("M", 0.5, 0.5, 0.5, 1, common_font);
common_symbol.height = common_symbol.image.GetHeight(); // высота символа
common_symbol.width = common_symbol.image.GetWidth(); // ширина символа
progress_symbol.image = Image.Text("M", 0.5, 0.5, 0.5, 1, progress_font);
progress_symbol.height = progress_symbol.image.GetHeight(); // высота символа
progress_symbol.width = progress_symbol.image.GetWidth(); // ширина символа
link_symbol.image = Image.Text("M", 0.5, 0.5, 0.5, 1, link_font);
link_symbol.height = link_symbol.image.GetHeight(); // высота символа
link_symbol.width = link_symbol.image.GetWidth(); // ширина символа
starting_text = "Starting up..."; starting_text = "Starting up...";
bye_text = "System is shutting down"; bye_text = "System is shutting down";
progress_t= 0; progress_t= 0;
@ -190,61 +140,51 @@ background.y = y0 + screen.height / 2 - background.height / 2;
background.sprite = SpriteNew(); background.sprite = SpriteNew();
background.sprite.SetImage(background.image); background.sprite.SetImage(background.image);
background.sprite.SetOpacity(1);
background.sprite.SetPosition(background.x, background.y, 0); background.sprite.SetPosition(background.x, background.y, 0);
background.sprite.SetOpacity(1);
// SIDE BACKGROUND // MESSAGE BACKGROUND
side_panel.background_src = "BACKGROUND.png"; side_background.image = Image("SIDE_BACKGROUND2.png");
side_panel.foreground_src = "SIDE_BACKGROUND2.png"; side_background.image = side_background.image.Scale(Percent(25, screen.width), Percent(100, screen.height));
side_panel.x = x0;
side_panel.y = y0;
side_panel.z = 1;
side_panel.width = Percent(33.33, screen.width);
side_panel.height = Percent(100, screen.height);
blur = Blur(side_panel.background_src, side_panel.foreground_src, side_panel.x, side_panel.y, side_panel.z, side_panel.width, side_panel.height, screen.width, screen.height); side_background.width = side_background.image.GetWidth();
side_background.height = side_background.image.GetHeight();
// MESSAGES BOX side_background.x = x0;
messages_box.image = Image("MESSAGES_BOX.png"); side_background.y = y0;
messages_box.image = messages_box.image.Scale(Percent(80, side_panel.width), Percent(40, side_panel.height));
messages_box.width = messages_box.image.GetWidth(); side_background.sprite = Sprite(side_background.image);
messages_box.height = messages_box.image.GetHeight(); side_background.sprite.SetPosition(side_background.x, side_background.y, 1);
side_background.sprite.SetOpacity(1);
messages_box.x = Percent(50, side_panel.width) - messages_box.width / 2;
messages_box.y = Percent(45, side_panel.height) - messages_box.height;
messages_box.sprite = Sprite(messages_box.image);
messages_box.sprite.SetOpacity(1);
messages_box.sprite.SetPosition(messages_box.x, messages_box.y, 12);
// Sise Logo // Sise Logo
side_logo.image = Image("Melawy_Linux_640x320.png"); side_logo.image = Image("Melawy_Linux_640x320.png");
side_logo.image = ScaleImage(side_logo.image, Limit(screen.width, screen.height, 20)); side_logo.image = ScaleImage(side_logo.image, Limit(screen.width, screen.height, 20));
// side_logo.image = side_logo.image.Scale(Percent(25, screen.width), Percent(25, screen.height));
side_logo.width = side_logo.image.GetWidth(); side_logo.width = side_logo.image.GetWidth();
side_logo.height = side_logo.image.GetHeight(); side_logo.height = side_logo.image.GetHeight();
side_logo.x = (side_panel.width - side_logo.width) / 2; side_logo.x = (side_background.width - side_logo.width) / 2;
side_logo.y = side_panel.height - side_panel.height * 0.25; side_logo.y = screen.height - screen.height * 0.25;
side_logo.sprite = Sprite(side_logo.image); side_logo.sprite = Sprite(side_logo.image);
side_logo.sprite.SetPosition(side_logo.x, side_logo.y, 2);
side_logo.sprite.SetOpacity(1); side_logo.sprite.SetOpacity(1);
side_logo.sprite.SetPosition(side_logo.x, side_logo.y, 12);
// **************************************** // // **************************************** //
project_link.image = Image.Text("https://Melawy.ru", 0.5, 0.5, 0.5, 1, link_font); project_link.image = Image.Text("https://github.com/Melawy", 0.5, 0.5, 0.5, 1, link_font);
project_link.width = project_link.image.GetWidth(); project_link.width = project_link.image.GetWidth();
project_link.height = project_link.image.GetHeight(); project_link.height = project_link.image.GetHeight();
project_link.sprite = Sprite(project_link.image); project_link.sprite = Sprite(project_link.image);
project_link.x = (side_panel.width - project_link.width) / 2; project_link.x = (side_background.width - project_link.width) / 2;
project_link.y = side_logo.y + side_logo.height; project_link.y = side_logo.y + side_logo.height;
project_link.sprite.SetPosition(project_link.x, project_link.y, 2);
project_link.sprite.SetOpacity(1); project_link.sprite.SetOpacity(1);
project_link.sprite.SetPosition(project_link.x, project_link.y, 12);
// **************************************** // // **************************************** //
@ -255,22 +195,22 @@ logo.image = FitIntoDimensions(logo.image, Limit(screen.width, screen.height, 35
logo.sprite = Sprite(logo.image); logo.sprite = Sprite(logo.image);
logo.x = screen.width / 2 - logo.image.GetWidth() / 2; // позиция логотипа X logo.x = screen.width / 2 - logo.image.GetWidth() / 2; // позиция логотипа X
logo.y = Percent(10, screen.height); // позиция логотипа Y logo.y = Percent(10, screen.height); // позиция логотипа Y
logo.sprite.SetPosition(logo.x, logo.y, 2);
logo.sprite.SetOpacity(1); logo.sprite.SetOpacity(1);
logo.sprite.SetPosition(logo.x, logo.y, 12);
// PROGRESS FORM // PROGRESS FORM
progress_form.image = Image("PROGRESS_FORM.png"); progress_form.image = Image("PROGRESS_FORM.png");
progress_form.image = progress_form.image.Scale(Percent(80, side_panel.width), Percent(10, side_panel.height)); progress_form.image = progress_form.image.Scale(Percent(20, screen.width), Percent(10, screen.height));
progress_form.width = progress_form.image.GetWidth(); progress_form.width = progress_form.image.GetWidth();
progress_form.height = progress_form.image.GetHeight(); progress_form.height = progress_form.image.GetHeight();
progress_form.x = Percent(50, side_panel.width) - progress_form.width / 2; progress_form.x = Percent(50, side_background.width) - progress_form.width / 2;
progress_form.y = Percent(75, side_panel.height) - progress_form.height; progress_form.y = Percent(75, side_background.height) - progress_form.height;
progress_form.sprite = Sprite(progress_form.image); progress_form.sprite = Sprite(progress_form.image);
progress_form.sprite.SetPosition(progress_form.x, progress_form.y, 2);
progress_form.sprite.SetOpacity(1); progress_form.sprite.SetOpacity(1);
progress_form.sprite.SetPosition(progress_form.x, progress_form.y, 12);
// SPINNER // SPINNER
spinner.image = Image("SPINNER.png"); spinner.image = Image("SPINNER.png");
@ -283,11 +223,11 @@ spinner.x = progress_form.x + progress_form.width - Percent(10, progress_form.wi
spinner.y = progress_form.y + Percent(10, progress_form.height); spinner.y = progress_form.y + Percent(10, progress_form.height);
spinner.sprite = Sprite(spinner.image); spinner.sprite = Sprite(spinner.image);
spinner.sprite.SetPosition(spinner.x, spinner.y, 13); // позиция за или перед spinner.sprite.SetPosition(spinner.x, spinner.y, 3); // позиция за или перед
// PROGRESS TEXT // PROGRESS TEXT
progress_text.image = Image.Text(progress_t + "%", 0.5, 0.5, 0.5, 1, progress_font); progress_text.image = Image.Text(progress_t + "%", 255, 255, 255, 1, progressfont);
progress_text.width = progress_text.image.GetWidth(); progress_text.width = progress_text.image.GetWidth();
progress_text.height = progress_text.image.GetHeight(); progress_text.height = progress_text.image.GetHeight();
@ -296,7 +236,7 @@ progress_text.x = progress_form.x + Percent(5, progress_form.width); // пози
progress_text.y = progress_form.y + Percent(10, progress_form.height); // позиция % по Y progress_text.y = progress_form.y + Percent(10, progress_form.height); // позиция % по Y
progress_text.sprite = SpriteNew(); progress_text.sprite = SpriteNew();
progress_text.sprite.SetPosition(progress_text.x, progress_text.y, 13); progress_text.sprite.SetPosition(progress_text.x, progress_text.y, 3);
// PROGRESS BOX // PROGRESS BOX
progress_box.image = Image("PROGRESS_BOX.png"); progress_box.image = Image("PROGRESS_BOX.png");
@ -309,7 +249,7 @@ progress_box.x = progress_form.x + (progress_form.width - progress_box.width) /
progress_box.y = progress_form.y + (progress_form.height - progress_box.height) / 2; progress_box.y = progress_form.y + (progress_form.height - progress_box.height) / 2;
progress_box.sprite = Sprite(progress_box.image); progress_box.sprite = Sprite(progress_box.image);
progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 13); progress_box.sprite.SetPosition(progress_box.x, progress_box.y, 3);
// PROGRESS BAR // PROGRESS BAR
progress_bar.original_image = Image("PROGRESS_BAR.png"); progress_bar.original_image = Image("PROGRESS_BAR.png");
@ -322,7 +262,7 @@ progress_bar.x = progress_form.x + (progress_form.width - progress_bar.original_
progress_bar.y = progress_form.y + (progress_form.height - progress_bar.original_image.GetHeight()) / 2; progress_bar.y = progress_form.y + (progress_form.height - progress_bar.original_image.GetHeight()) / 2;
progress_bar.sprite = Sprite(); progress_bar.sprite = Sprite();
progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 14); progress_bar.sprite.SetPosition(progress_bar.x, progress_bar.y, 4);
// PROGRESS FADE // PROGRESS FADE
progress_fade.image = Image("PROGRESS_FADE.png"); progress_fade.image = Image("PROGRESS_FADE.png");
@ -344,19 +284,17 @@ fun progress_callback(duration, progress) {
progress_bar.sprite.SetImage(progress_bar.image); progress_bar.sprite.SetImage(progress_bar.image);
f = Math.Int(progress_bar.image.GetWidth() /progress_bar.original_image.GetWidth() * 100); f = Math.Int(progress_bar.image.GetWidth() /progress_bar.original_image.GetWidth() * 100);
progress_t.image = Image.Text(f + "%", 0.5, 0.5, 0.5, 1, progress_font); progress_t.image = Image.Text(f + "%", 255, 255, 255, 1, progressfont);
progress_text.sprite.SetImage(progress_t.image); progress_text.sprite.SetImage(progress_t.image);
} }
} }
Plymouth.SetBootProgressFunction(progress_callback); Plymouth.SetBootProgressFunction(progress_callback);
// DIALOG // DIALOG
status = "normal"; status = "normal";
//count = 0; //count = 0;
fun dialog_setup() { fun dialog_setup() {
local.box_form; local.box_form;
local.lock; local.lock;
@ -365,27 +303,27 @@ fun dialog_setup() {
local.bullet_i; local.bullet_i;
box_form.image = Image("BOX.png"); box_form.image = Image("BOX.png");
box_form.image = box_form.image.Scale(Percent(80, side_panel.width), Percent(18, side_panel.height)); box_form.image = box_form.image.Scale(Percent(20, screen.width), Percent(10, screen.height));
box_form.width = box_form.image.GetWidth(); box_form.width = box_form.image.GetWidth();
box_form.height = box_form.image.GetHeight(); box_form.height = box_form.image.GetHeight();
box_form.x = progress_form.x; box_form.x = progress_form.x;
box_form.y = progress_form.y - box_form.height - Percent(1, side_panel.height); box_form.y = progress_form.y - box_form.height - Percent(1, screen.height);
box_form.z = 10000; box_form.z = 10000;
box_form.sprite = Sprite(box_form.image); box_form.sprite = Sprite(box_form.image);
box_form.sprite.SetOpacity(1);
box_form.sprite.SetPosition(box_form.x, box_form.y, box_form.z); box_form.sprite.SetPosition(box_form.x, box_form.y, box_form.z);
box_form.sprite.SetOpacity(1);
entry.image = Image("ENTRY.png"); entry.image = Image("ENTRY.png");
entry.image = entry.image.Scale(Percent(90, box_form.width), Percent(20, box_form.height)); entry.image = entry.image.Scale(Percent(90, box_form.width), Percent(33, box_form.height));
entry.width = entry.image.GetWidth(); entry.width = entry.image.GetWidth();
entry.height = entry.image.GetHeight(); entry.height = entry.image.GetHeight();
entry.x = box_form.x + box_form.width/2 - entry.width/2; entry.x = box_form.x + box_form.width/2 - entry.width/2;
entry.y = box_form.y + (box_form.height/3 * 2) - entry.height/2; entry.y = box_form.y + box_form.height/2 - entry.height/2;
entry.z = box_form.z + 1; entry.z = box_form.z + 1;
entry.sprite = Sprite(entry.image); entry.sprite = Sprite(entry.image);
@ -423,7 +361,6 @@ fun dialog_setup() {
dialog_opacity(1); dialog_opacity(1);
} }
fun dialog_opacity(opacity) { fun dialog_opacity(opacity) {
if (opacity == 0) { if (opacity == 0) {
dialog.box_form.sprite.SetOpacity(opacity); dialog.box_form.sprite.SetOpacity(opacity);
@ -437,7 +374,7 @@ fun dialog_opacity(opacity) {
dialog.hint.sprite.SetOpacity(opacity); dialog.hint.sprite.SetOpacity(opacity);
for (index = 0; dialog.bullet[index]; index++) { for(index = 0; dialog.bullet[index]; index++) {
dialog.bullet[index].sprite.SetOpacity(opacity); dialog.bullet[index].sprite.SetOpacity(opacity);
} }
} }
@ -461,57 +398,10 @@ fun display_password_callback(prompt_text, bullets) {
else else
dialog_opacity(1); dialog_opacity(1);
padding_top_bottom = Percent(10, dialog.box_form.height); // отступы сверху и снизу dialog.hint.image = Image.Text(prompt_text, 1.0, 1.0, 1.0, 1, common_font);
padding_left_right = Percent(5, dialog.box_form.width); // отступы слева и справа
LINE_WIDTH = 100;
for (index = LINE_WIDTH; index > 0; index--) {
if ((LINE_WIDTH * common_symbol.width) > (dialog.box_form.width - (padding_left_right * 2))) {
LINE_WIDTH = LINE_WIDTH - 1;
}
else {
break;
}
}
str_len = StringLength(prompt_text);
for (i = 1; LINE_WIDTH * i <= str_len; i++) {
line_count = i;
}
if (str_len > LINE_WIDTH) {
if (str_len % LINE_WIDTH > 0) {
line_count = line_count + 1;
}
}
i = 1;
start = 0;
end = LINE_WIDTH;
text = "";
for (i = 1; i <= line_count; i++) {
text += prompt_text.SubString(start, end);
text += "\n";
start = end;
if (LINE_WIDTH * i < str_len) {
end = end + LINE_WIDTH;
}
else {
end = str_len - 1;
}
}
prompt_text = text;
dialog.hint.image = Image.Text(prompt_text, 0.5, 0.5, 0.5, 1, common_font);
dialog.hint.sprite.SetImage(dialog.hint.image); dialog.hint.sprite.SetImage(dialog.hint.image);
for (index = 0; dialog.bullet[index] || index < bullets; index++) { for(index = 0; dialog.bullet[index] || index < bullets; index++) {
if (!dialog.bullet[index]) { if (!dialog.bullet[index]) {
dialog.bullet[index].sprite = Sprite(dialog.bullet_i.image); dialog.bullet[index].sprite = Sprite(dialog.bullet_i.image);
dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_i.width / 0.9 - dialog.entry.height * -0.2; // отступ точки от точки и от поля(modified) dialog.bullet[index].x = dialog.entry.x + index * dialog.bullet_i.width / 0.9 - dialog.entry.height * -0.2; // отступ точки от точки и от поля(modified)
@ -529,6 +419,7 @@ fun display_password_callback(prompt_text, bullets) {
Plymouth.SetDisplayPasswordFunction(display_password_callback); Plymouth.SetDisplayPasswordFunction(display_password_callback);
time = 1; time = 1;
fun refreshHandler() { fun refreshHandler() {
@ -539,7 +430,7 @@ fun refreshHandler() {
text.sprite = Sprite(text.image); text.sprite = Sprite(text.image);
text.x = progress_box.x; text.x = progress_box.x;
text.y = progress_box.y - progress_text.image.GetHeight() * 2; text.y = progress_box.y - progress_text.image.GetHeight() * 2;
text.sprite.SetPosition(text.x, text.y, 13); text.sprite.SetPosition(text.x, text.y, 2);
} }
else { else {
progress_fade.sprite.SetOpacity (1); progress_fade.sprite.SetOpacity (1);
@ -548,12 +439,12 @@ fun refreshHandler() {
text_end.sprite = Sprite(text_end.image); text_end.sprite = Sprite(text_end.image);
text_end.x = progress_box.x; text_end.x = progress_box.x;
text_end.y = progress_box.y - progress_text.image.GetHeight() * 2; text_end.y = progress_box.y - progress_text.image.GetHeight() * 2;
text_end.sprite.SetPosition(text_end.x, text_end.y, 13); text_end.sprite.SetPosition(text_end.x, text_end.y, 2);
} }
progress_fade.x = progress_bar.x; progress_fade.x = progress_bar.x;
progress_fade.y = progress_bar.y; progress_fade.y = progress_bar.y;
progress_fade.sprite.SetPosition(counter + progress_fade.x, progress_fade.y, 14); progress_fade.sprite.SetPosition(counter + progress_fade.x, progress_fade.y, 4);
if (fade_dir == 0) { if (fade_dir == 0) {
counter++; counter++;
@ -595,72 +486,30 @@ fun refreshHandler() {
Plymouth.SetRefreshFunction(refreshHandler); Plymouth.SetRefreshFunction(refreshHandler);
message_status.sprite = SpriteNew();
// LOG //
NUM_SCROLL_LINES=25; //количество строк лога
LINE_WIDTH=35; //ширина строк лога
message_sprite=SpriteNew();
fun message_callback(prompt_text) { fun message_callback(prompt_text) {
message_status.image = Image.Text(prompt_text, 0.5, 0.5, 0.5, 1, common_font); message = Image.Text(prompt_text, 0.5, 0.5, 0.5, 1, common_font);
message_status.sprite.SetImage(message_status.image); message_sprite.SetImage(message);
message_status.height = message_status.image.GetHeight(); message_sprite.SetPosition(Percent(2, screen.width), Percent(50, screen.height), 2);
message_status.x = messages_box.x + Percent(5, messages_box.width); message_sprite.SetOpacity(1);
message_status.y = messages_box.y + messages_box.height - Percent(7, messages_box.height);
message_status.sprite.SetOpacity(1);
message_status.sprite.SetPosition(message_status.x, message_status.y, 13);
} }
Plymouth.SetMessageFunction(message_callback); Plymouth.SetMessageFunction(message_callback);
// высота messages_box = screen.height - 40% (1080 * 0,4 = 432)
// высота всех сообщений = NUM_SCROLL_LINES (20) * (LINE_HEIGHT) 17 = 340
// 10 процентов сверху от начала messages_box.x = 432 - 10% (432 * 0,1) = 432 - 43 = 389
// конечная точка, где допустимо показывать сообщения = 389 - 43 (10% от высоты messages_box.x) = 346
// если высота всех сообщений выше, чем высота (messages_box.height - 20%), то уменьшать количество строк, пока высота всех сообщений не быдет меньше (messages_box.height - 20%)
// высота символа = common_font = 10pt, предположим что 10px
// предположим, что ширина символа = 60% от высоты символа = 6px
// ширина side_panel = 25% от screen.width = 1080 * 0.25 = 270
// ширина messages_box = 80 % от side_panel = 270 * 0.8 = 216
// ширина всех сообщений = LINE_WIDTH * ширину символа = 40 * 6 = 240
// необходимо снижать количество LINE_WIDTH пока реальная ширина сообщения не будет меньше или равно ширине messages_box
padding_top_bottom = Percent(10, messages_box.height); // отступы сверху и снизу
padding_left_right = Percent(5, messages_box.width); // отступы слева и справа
message_sprite_.x = messages_box.x + (padding_left_right); // позиция % по X (слева направо)
message_sprite_.y = messages_box.y + (padding_top_bottom); // позиция % по Y (сверху вниз)
// LOG //
NUM_SCROLL_LINES=100; //количество строк лога
LINE_WIDTH=100; //ширина строк лога
LINE_HEIGHT = common_symbol.height * 1.5; // межстрочный интервал x1,5
for (index = NUM_SCROLL_LINES; index > 0; index--) {
if ((NUM_SCROLL_LINES * LINE_HEIGHT) > (messages_box.height - (padding_top_bottom * 2))) {
NUM_SCROLL_LINES=NUM_SCROLL_LINES-1;
}
else {
break;
}
}
for (index = LINE_WIDTH; index > 0; index--) {
if ((LINE_WIDTH * common_symbol.width) > (messages_box.width - (padding_left_right * 2))) {
LINE_WIDTH=LINE_WIDTH-1;
}
else {
break;
}
}
// Initialising text images and their positions // Initialising text images and their positions
// 20 is the height(including line spacing) of each line // 20 is the height(including line spacing) of each line
for (i=0; i < NUM_SCROLL_LINES; i++) { for(i=0; i < NUM_SCROLL_LINES; i++) {
lines[i]= Image.Text("", 0.5, 0.5, 0.5, 1, common_font); //цвет строк lines[i]= Image.Text("", 0.5, 0.5, 0.5, 1, common_font); //цвет строк
message_sprite[i] = SpriteNew(); message_sprite[i] = SpriteNew();
message_sprite[i].SetPosition(message_sprite_.x, message_sprite_.y + (i * LINE_HEIGHT), 13); message_sprite[i].SetPosition(Percent(2, screen.width), Percent(5, screen.height) + (i * 17), 2);
} //высота строк //отступ строк } //высота строк //отступ строк
fun StringLength(string) { fun StringLength(string) {
index = 0; index = 0;
str = String(string); str = String(string);
@ -668,7 +517,6 @@ fun StringLength(string) {
return index; return index;
} }
fun scroll_message_callback(text) { fun scroll_message_callback(text) {
// Truncate the message if too long // Truncate the message if too long
if (StringLength(text) > LINE_WIDTH) { if (StringLength(text) > LINE_WIDTH) {
@ -677,7 +525,7 @@ fun scroll_message_callback(text) {
} }
// Shift message one up // Shift message one up
for (i = 0; i < NUM_SCROLL_LINES - 1; i++) { for(i = 0; i < NUM_SCROLL_LINES - 1; i++) {
lines[i] = lines[i+1]; lines[i] = lines[i+1];
} }
@ -685,14 +533,13 @@ fun scroll_message_callback(text) {
lines[i] = Image.Text(text, 0.5, 0.5, 0.5, 1, common_font); lines[i] = Image.Text(text, 0.5, 0.5, 0.5, 1, common_font);
// Re-positioning the text images // Re-positioning the text images
for (i = 0; i < NUM_SCROLL_LINES; i++) { for(i = 0; i < NUM_SCROLL_LINES; i++) {
message_sprite[i].SetImage(lines[i]); message_sprite[i].SetImage(lines[i]);
} }
} }
Plymouth.SetUpdateStatusFunction(scroll_message_callback); Plymouth.SetUpdateStatusFunction(scroll_message_callback);
// QUIT // QUIT
fun quit_callback() { fun quit_callback() {
progress_fade.sprite.SetOpacity (1); progress_fade.sprite.SetOpacity (1);

View File

@ -1,5 +1,3 @@
#!/bin/bash #!/bin/bash
git add . && git commit -m "Update" && git push git add . && git commit -m "Update" && git push
echo "Ready"