diff --git a/branding/README.md b/branding/README.md index 3bdfffc..bdc627c 100644 --- a/branding/README.md +++ b/branding/README.md @@ -60,10 +60,24 @@ python tools/branding/fancymenu.py <тека config гри або збірки> ## Головне меню -Три ряди кнопок: «Увійти на сервер»; «Гра наодинці» й «Гра в мережі»; мова, «Налаштування» й вихід іконкою. -Сховано: кнопку Create, кнопку спеціальних можливостей (вона є в налаштуваннях), кнопку «Моди» та рядки -Minecraft / NeoForge в лівому нижньому куті — замість них версія збірки. Іконка виходу — `sign-out` із -бібліотеки FD Icons, перемальована на піксельну сітку іконок Minecraft. +Під лого — відступ заввишки з кнопку, далі три ряди: «Грати» з іконкою стану сервера праворуч; «Гра наодинці» +й «Сервери»; ряд іконок — мова, налаштування, вихід. Сховано: кнопку Create, кнопку спеціальних можливостей +(вона є в налаштуваннях), кнопку «Моди» та рядки Minecraft / NeoForge в лівому нижньому куті — замість них +версія збірки. + +Стан сервера меню бере зі звичайного пінгу `create.fulldroper.ks.ua` (раз на 30 секунд): + +| Стан | Як визначається | Іконка | «Грати» | +| --- | --- | --- | --- | +| онлайн | відповідає сам сервер: у першому рядку MOTD є слово `Create` | зелена галочка | активна | +| технічні роботи | відповідає лише проксі своїм MOTD — сервер зупинено (деплой, перезапуск, падіння) | помаранчевий ключ | сіра | +| офлайн | на пінг ніхто не відповідає | червоний хрестик | сіра | + +Тому слово `Create` має лишатися в першому рядку MOTD сервера, а в MOTD проксі його бути не повинно. Щоб +показати гравцям «технічні роботи» при запущеному сервері, досить тимчасово прибрати це слово з MOTD. + +Іконки — з бібліотеки FD Icons (`sign-out`, `settings`, `check-circle`, `close-circle`, `wrench`), +перемальовані на піксельну сітку іконок Minecraft; малює їх `build.py`. ## Прапор держави diff --git a/branding/menu/settings.png b/branding/menu/settings.png new file mode 100644 index 0000000..31fab01 Binary files /dev/null and b/branding/menu/settings.png differ diff --git a/branding/menu/status-maintenance.png b/branding/menu/status-maintenance.png new file mode 100644 index 0000000..dc87e7c Binary files /dev/null and b/branding/menu/status-maintenance.png differ diff --git a/branding/menu/status-offline.png b/branding/menu/status-offline.png new file mode 100644 index 0000000..41bfe5e Binary files /dev/null and b/branding/menu/status-offline.png differ diff --git a/branding/menu/status-online.png b/branding/menu/status-online.png new file mode 100644 index 0000000..2de34e6 Binary files /dev/null and b/branding/menu/status-online.png differ diff --git a/branding/menu/title_screen_layout.txt b/branding/menu/title_screen_layout.txt index 7d47292..bb045c1 100644 --- a/branding/menu/title_screen_layout.txt +++ b/branding/menu/title_screen_layout.txt @@ -405,17 +405,19 @@ element { } element { - button_element_executable_block_identifier = dadf6ab2-797a-4c26-ae60-691ac1a739fd-1778342490749 - [executable_action_instance:a40cd16c-1081-4b52-ab5b-fa99e4a6578c-1778342663873][action_type:joinserver] = create.fulldroper.ks.ua - [executable_block:dadf6ab2-797a-4c26-ae60-691ac1a739fd-1778342490749][type:generic] = [executables:a40cd16c-1081-4b52-ab5b-fa99e4a6578c-1778342663873;] + label = Грати + button_element_executable_block_identifier = c0ffee10-0000-4000-8000-000000000000-1791960000000 + [executable_action_instance:c0ffee10-0000-4000-8000-0000000000ff-1791960000000][action_type:joinserver] = create.fulldroper.ks.ua + [executable_block:c0ffee10-0000-4000-8000-000000000000-1791960000000][type:generic] = [executables:c0ffee10-0000-4000-8000-0000000000ff-1791960000000;] underline_label_on_hover = false transparent_background = false restartbackgroundanimations = true nine_slice_custom_background = false - label = Увійти на сервер navigatable = true - widget_active_state_requirement_container_identifier = adbaccba-22cf-4849-b420-848323ffa1e2-1778342490749 - [loading_requirement_container_meta:adbaccba-22cf-4849-b420-848323ffa1e2-1778342490749] = [groups:][instances:] + widget_active_state_requirement_container_identifier = c0ffee10-0000-4000-8000-000000000002-1791960000000 + [loading_requirement_container_meta:c0ffee10-0000-4000-8000-000000000002-1791960000000] = [groups:][instances:c0ffee-play-a;c0ffee-play-b;] + [loading_requirement:fancymenu_loading_requirement_is_server_online][requirement_mode:if][req_id:c0ffee-play-a] = create.fulldroper.ks.ua + [loading_requirement:fancymenu_visibility_requirement_is_text][requirement_mode:if][req_id:c0ffee-play-b] = ["mode":"contains","text":"{"placeholder":"servermotd","values":{"ip":"create.fulldroper.ks.ua","line":"1"}}","compare_with":"Create"]$ is_template = false template_apply_width = false template_apply_height = false @@ -427,7 +429,7 @@ element { template_share_with = buttons nine_slice_slider_handle = false element_type = custom_button - instance_identifier = fbd07ff8-36a3-4f7b-88c6-e04248b92eee-1778342490749 + instance_identifier = c0ffee10-0000-4000-8000-000000000003-1791960000000 appearance_delay = no_delay disappearance_delay = no_delay fade_in_v2 = no_fading @@ -438,12 +440,334 @@ element { sticky_anchor = false anchor_point = mid-centered x = -100 - y = -36 + y = -24 width = 200 height = 20 stay_on_screen = true - element_loading_requirement_container_identifier = 9f5c61c8-d114-494f-a5fc-d8e9f01a536c-1778342490749 - [loading_requirement_container_meta:9f5c61c8-d114-494f-a5fc-d8e9f01a536c-1778342490749] = [groups:][instances:] + element_loading_requirement_container_identifier = c0ffee10-0000-4000-8000-000000000004-1791960000000 + [loading_requirement_container_meta:c0ffee10-0000-4000-8000-000000000004-1791960000000] = [groups:][instances:] + enable_parallax = false + invert_parallax = false + animated_offset_x = 0 + animated_offset_y = 0 + load_once_per_session = false + layer_hidden_in_editor = false + advanced_rotation_mode = false + advanced_vertical_tilt_mode = false + advanced_horizontal_tilt_mode = false + should_be_affected_by_decoration_overlays = true + in_editor_color = #FFC800FF + advanced_posx = -2147483648 + advanced_posy = -2147483648 + advanced_width = -2147483648 + advanced_height = -2147483648 + stretch_x = false + stretch_y = false + appearance_delay_seconds = 1.0 + disappearance_delay_seconds = 1.0 + fade_in_speed = 1.0 + fade_out_speed = 1.0 + base_opacity = 1.0 + parallax_intensity_x = 0.5 + parallax_intensity_y = 0.5 + rotation_degrees = 0.0 + advanced_rotation_degrees = 0.0 + vertical_tilt_degrees = 0.0 + advanced_vertical_tilt_degrees = 0.0 + horizontal_tilt_degrees = 0.0 + advanced_horizontal_tilt_degrees = 0.0 + label_scale = 1.0 + label_shadow = true + nine_slice_border_x = 5 + nine_slice_border_y = 5 + nine_slice_slider_handle_border_x = 5 + nine_slice_slider_handle_border_y = 5 +} + +element { + iconnormal = [source:local]/config/fancymenu/assets/status-online.png + iconhovered = [source:local]/config/fancymenu/assets/status-online.png + description = Сервер онлайн + button_element_executable_block_identifier = c0ffee11-0000-4000-8000-000000000000-1791960000000 + [executable_block:c0ffee11-0000-4000-8000-000000000000-1791960000000][type:generic] = [executables:] + underline_label_on_hover = false + transparent_background = true + restartbackgroundanimations = true + nine_slice_custom_background = false + navigatable = true + widget_active_state_requirement_container_identifier = c0ffee11-0000-4000-8000-000000000002-1791960000000 + [loading_requirement_container_meta:c0ffee11-0000-4000-8000-000000000002-1791960000000] = [groups:][instances:] + is_template = false + template_apply_width = false + template_apply_height = false + template_apply_posx = false + template_apply_posy = false + template_apply_opacity = false + template_apply_visibility = false + template_apply_label = false + template_share_with = buttons + nine_slice_slider_handle = false + element_type = custom_button + instance_identifier = c0ffee11-0000-4000-8000-000000000003-1791960000000 + appearance_delay = no_delay + disappearance_delay = no_delay + fade_in_v2 = no_fading + fade_out = no_fading + auto_sizing = false + auto_sizing_base_screen_width = 2560 + auto_sizing_base_screen_height = 1355 + sticky_anchor = false + anchor_point = mid-centered + x = 104 + y = -24 + width = 20 + height = 20 + stay_on_screen = true + element_loading_requirement_container_identifier = c0ffee11-0000-4000-8000-000000000004-1791960000000 + [loading_requirement_container_meta:c0ffee11-0000-4000-8000-000000000004-1791960000000] = [groups:][instances:c0ffee-online-a;c0ffee-online-b;] + [loading_requirement:fancymenu_loading_requirement_is_server_online][requirement_mode:if][req_id:c0ffee-online-a] = create.fulldroper.ks.ua + [loading_requirement:fancymenu_visibility_requirement_is_text][requirement_mode:if][req_id:c0ffee-online-b] = ["mode":"contains","text":"{"placeholder":"servermotd","values":{"ip":"create.fulldroper.ks.ua","line":"1"}}","compare_with":"Create"]$ + enable_parallax = false + invert_parallax = false + animated_offset_x = 0 + animated_offset_y = 0 + load_once_per_session = false + layer_hidden_in_editor = false + advanced_rotation_mode = false + advanced_vertical_tilt_mode = false + advanced_horizontal_tilt_mode = false + should_be_affected_by_decoration_overlays = true + in_editor_color = #FFC800FF + advanced_posx = -2147483648 + advanced_posy = -2147483648 + advanced_width = -2147483648 + advanced_height = -2147483648 + stretch_x = false + stretch_y = false + appearance_delay_seconds = 1.0 + disappearance_delay_seconds = 1.0 + fade_in_speed = 1.0 + fade_out_speed = 1.0 + base_opacity = 1.0 + parallax_intensity_x = 0.5 + parallax_intensity_y = 0.5 + rotation_degrees = 0.0 + advanced_rotation_degrees = 0.0 + vertical_tilt_degrees = 0.0 + advanced_vertical_tilt_degrees = 0.0 + horizontal_tilt_degrees = 0.0 + advanced_horizontal_tilt_degrees = 0.0 + label_scale = 1.0 + label_shadow = true + nine_slice_border_x = 5 + nine_slice_border_y = 5 + nine_slice_slider_handle_border_x = 5 + nine_slice_slider_handle_border_y = 5 +} + +element { + iconnormal = [source:local]/config/fancymenu/assets/status-maintenance.png + iconhovered = [source:local]/config/fancymenu/assets/status-maintenance.png + description = Технічні роботи + button_element_executable_block_identifier = c0ffee12-0000-4000-8000-000000000000-1791960000000 + [executable_block:c0ffee12-0000-4000-8000-000000000000-1791960000000][type:generic] = [executables:] + underline_label_on_hover = false + transparent_background = true + restartbackgroundanimations = true + nine_slice_custom_background = false + navigatable = true + widget_active_state_requirement_container_identifier = c0ffee12-0000-4000-8000-000000000002-1791960000000 + [loading_requirement_container_meta:c0ffee12-0000-4000-8000-000000000002-1791960000000] = [groups:][instances:] + is_template = false + template_apply_width = false + template_apply_height = false + template_apply_posx = false + template_apply_posy = false + template_apply_opacity = false + template_apply_visibility = false + template_apply_label = false + template_share_with = buttons + nine_slice_slider_handle = false + element_type = custom_button + instance_identifier = c0ffee12-0000-4000-8000-000000000003-1791960000000 + appearance_delay = no_delay + disappearance_delay = no_delay + fade_in_v2 = no_fading + fade_out = no_fading + auto_sizing = false + auto_sizing_base_screen_width = 2560 + auto_sizing_base_screen_height = 1355 + sticky_anchor = false + anchor_point = mid-centered + x = 104 + y = -24 + width = 20 + height = 20 + stay_on_screen = true + element_loading_requirement_container_identifier = c0ffee12-0000-4000-8000-000000000004-1791960000000 + [loading_requirement_container_meta:c0ffee12-0000-4000-8000-000000000004-1791960000000] = [groups:][instances:c0ffee-maintenance-a;c0ffee-maintenance-b;] + [loading_requirement:fancymenu_loading_requirement_is_server_online][requirement_mode:if][req_id:c0ffee-maintenance-a] = create.fulldroper.ks.ua + [loading_requirement:fancymenu_visibility_requirement_is_text][requirement_mode:if_not][req_id:c0ffee-maintenance-b] = ["mode":"contains","text":"{"placeholder":"servermotd","values":{"ip":"create.fulldroper.ks.ua","line":"1"}}","compare_with":"Create"]$ + enable_parallax = false + invert_parallax = false + animated_offset_x = 0 + animated_offset_y = 0 + load_once_per_session = false + layer_hidden_in_editor = false + advanced_rotation_mode = false + advanced_vertical_tilt_mode = false + advanced_horizontal_tilt_mode = false + should_be_affected_by_decoration_overlays = true + in_editor_color = #FFC800FF + advanced_posx = -2147483648 + advanced_posy = -2147483648 + advanced_width = -2147483648 + advanced_height = -2147483648 + stretch_x = false + stretch_y = false + appearance_delay_seconds = 1.0 + disappearance_delay_seconds = 1.0 + fade_in_speed = 1.0 + fade_out_speed = 1.0 + base_opacity = 1.0 + parallax_intensity_x = 0.5 + parallax_intensity_y = 0.5 + rotation_degrees = 0.0 + advanced_rotation_degrees = 0.0 + vertical_tilt_degrees = 0.0 + advanced_vertical_tilt_degrees = 0.0 + horizontal_tilt_degrees = 0.0 + advanced_horizontal_tilt_degrees = 0.0 + label_scale = 1.0 + label_shadow = true + nine_slice_border_x = 5 + nine_slice_border_y = 5 + nine_slice_slider_handle_border_x = 5 + nine_slice_slider_handle_border_y = 5 +} + +element { + iconnormal = [source:local]/config/fancymenu/assets/status-offline.png + iconhovered = [source:local]/config/fancymenu/assets/status-offline.png + description = Сервер офлайн + button_element_executable_block_identifier = c0ffee13-0000-4000-8000-000000000000-1791960000000 + [executable_block:c0ffee13-0000-4000-8000-000000000000-1791960000000][type:generic] = [executables:] + underline_label_on_hover = false + transparent_background = true + restartbackgroundanimations = true + nine_slice_custom_background = false + navigatable = true + widget_active_state_requirement_container_identifier = c0ffee13-0000-4000-8000-000000000002-1791960000000 + [loading_requirement_container_meta:c0ffee13-0000-4000-8000-000000000002-1791960000000] = [groups:][instances:] + is_template = false + template_apply_width = false + template_apply_height = false + template_apply_posx = false + template_apply_posy = false + template_apply_opacity = false + template_apply_visibility = false + template_apply_label = false + template_share_with = buttons + nine_slice_slider_handle = false + element_type = custom_button + instance_identifier = c0ffee13-0000-4000-8000-000000000003-1791960000000 + appearance_delay = no_delay + disappearance_delay = no_delay + fade_in_v2 = no_fading + fade_out = no_fading + auto_sizing = false + auto_sizing_base_screen_width = 2560 + auto_sizing_base_screen_height = 1355 + sticky_anchor = false + anchor_point = mid-centered + x = 104 + y = -24 + width = 20 + height = 20 + stay_on_screen = true + element_loading_requirement_container_identifier = c0ffee13-0000-4000-8000-000000000004-1791960000000 + [loading_requirement_container_meta:c0ffee13-0000-4000-8000-000000000004-1791960000000] = [groups:][instances:c0ffee-offline-a;] + [loading_requirement:fancymenu_loading_requirement_is_server_online][requirement_mode:if_not][req_id:c0ffee-offline-a] = create.fulldroper.ks.ua + enable_parallax = false + invert_parallax = false + animated_offset_x = 0 + animated_offset_y = 0 + load_once_per_session = false + layer_hidden_in_editor = false + advanced_rotation_mode = false + advanced_vertical_tilt_mode = false + advanced_horizontal_tilt_mode = false + should_be_affected_by_decoration_overlays = true + in_editor_color = #FFC800FF + advanced_posx = -2147483648 + advanced_posy = -2147483648 + advanced_width = -2147483648 + advanced_height = -2147483648 + stretch_x = false + stretch_y = false + appearance_delay_seconds = 1.0 + disappearance_delay_seconds = 1.0 + fade_in_speed = 1.0 + fade_out_speed = 1.0 + base_opacity = 1.0 + parallax_intensity_x = 0.5 + parallax_intensity_y = 0.5 + rotation_degrees = 0.0 + advanced_rotation_degrees = 0.0 + vertical_tilt_degrees = 0.0 + advanced_vertical_tilt_degrees = 0.0 + horizontal_tilt_degrees = 0.0 + advanced_horizontal_tilt_degrees = 0.0 + label_scale = 1.0 + label_shadow = true + nine_slice_border_x = 5 + nine_slice_border_y = 5 + nine_slice_slider_handle_border_x = 5 + nine_slice_slider_handle_border_y = 5 +} + +element { + iconnormal = [source:local]/config/fancymenu/assets/settings.png + iconhovered = [source:local]/config/fancymenu/assets/settings.png + description = Налаштування + button_element_executable_block_identifier = c0ffee14-0000-4000-8000-000000000000-1791960000000 + [executable_action_instance:c0ffee14-0000-4000-8000-0000000000ff-1791960000000][action_type:opengui] = net.minecraft.client.gui.screens.options.OptionsScreen + [executable_block:c0ffee14-0000-4000-8000-000000000000-1791960000000][type:generic] = [executables:c0ffee14-0000-4000-8000-0000000000ff-1791960000000;] + underline_label_on_hover = false + transparent_background = false + restartbackgroundanimations = true + nine_slice_custom_background = false + navigatable = true + widget_active_state_requirement_container_identifier = c0ffee14-0000-4000-8000-000000000002-1791960000000 + [loading_requirement_container_meta:c0ffee14-0000-4000-8000-000000000002-1791960000000] = [groups:][instances:] + is_template = false + template_apply_width = false + template_apply_height = false + template_apply_posx = false + template_apply_posy = false + template_apply_opacity = false + template_apply_visibility = false + template_apply_label = false + template_share_with = buttons + nine_slice_slider_handle = false + element_type = custom_button + instance_identifier = c0ffee14-0000-4000-8000-000000000003-1791960000000 + appearance_delay = no_delay + disappearance_delay = no_delay + fade_in_v2 = no_fading + fade_out = no_fading + auto_sizing = false + auto_sizing_base_screen_width = 2560 + auto_sizing_base_screen_height = 1355 + sticky_anchor = false + anchor_point = mid-centered + x = -10 + y = 24 + width = 20 + height = 20 + stay_on_screen = true + element_loading_requirement_container_identifier = c0ffee14-0000-4000-8000-000000000004-1791960000000 + [loading_requirement_container_meta:c0ffee14-0000-4000-8000-000000000004-1791960000000] = [groups:][instances:] enable_parallax = false invert_parallax = false animated_offset_x = 0 @@ -486,16 +810,16 @@ element { iconnormal = [source:local]/config/fancymenu/assets/quit.png iconhovered = [source:local]/config/fancymenu/assets/quit.png description = Вийти з гри - button_element_executable_block_identifier = c0ffee00-0000-4000-8000-000000000000-1791950000000 - [executable_action_instance:c0ffee00-0000-4000-8000-0000000000ff-1791950000000][action_type:quitgame] = - [executable_block:c0ffee00-0000-4000-8000-000000000000-1791950000000][type:generic] = [executables:c0ffee00-0000-4000-8000-0000000000ff-1791950000000;] + button_element_executable_block_identifier = c0ffee15-0000-4000-8000-000000000000-1791960000000 + [executable_action_instance:c0ffee15-0000-4000-8000-0000000000ff-1791960000000][action_type:quitgame] = + [executable_block:c0ffee15-0000-4000-8000-000000000000-1791960000000][type:generic] = [executables:c0ffee15-0000-4000-8000-0000000000ff-1791960000000;] underline_label_on_hover = false transparent_background = false restartbackgroundanimations = true nine_slice_custom_background = false navigatable = true - widget_active_state_requirement_container_identifier = c0ffee00-0000-4000-8000-000000000002-1791950000000 - [loading_requirement_container_meta:c0ffee00-0000-4000-8000-000000000002-1791950000000] = [groups:][instances:] + widget_active_state_requirement_container_identifier = c0ffee15-0000-4000-8000-000000000002-1791960000000 + [loading_requirement_container_meta:c0ffee15-0000-4000-8000-000000000002-1791960000000] = [groups:][instances:] is_template = false template_apply_width = false template_apply_height = false @@ -507,7 +831,7 @@ element { template_share_with = buttons nine_slice_slider_handle = false element_type = custom_button - instance_identifier = c0ffee00-0000-4000-8000-000000000003-1791950000000 + instance_identifier = c0ffee15-0000-4000-8000-000000000003-1791960000000 appearance_delay = no_delay disappearance_delay = no_delay fade_in_v2 = no_fading @@ -517,13 +841,13 @@ element { auto_sizing_base_screen_height = 1355 sticky_anchor = false anchor_point = mid-centered - x = 80 - y = 12 + x = 14 + y = 24 width = 20 height = 20 stay_on_screen = true - element_loading_requirement_container_identifier = c0ffee00-0000-4000-8000-000000000004-1791950000000 - [loading_requirement_container_meta:c0ffee00-0000-4000-8000-000000000004-1791950000000] = [groups:][instances:] + element_loading_requirement_container_identifier = c0ffee15-0000-4000-8000-000000000004-1791960000000 + [loading_requirement_container_meta:c0ffee15-0000-4000-8000-000000000004-1791960000000] = [groups:][instances:] enable_parallax = false invert_parallax = false animated_offset_x = 0 @@ -889,8 +1213,8 @@ vanilla_button { auto_sizing_base_screen_height = 1355 sticky_anchor = false anchor_point = mid-centered - x = -100 - y = 12 + x = -34 + y = 24 width = 20 height = 20 stay_on_screen = true @@ -1167,10 +1491,11 @@ vanilla_button { nine_slice_slider_handle_border_x = 5 nine_slice_slider_handle_border_y = 5 automated_button_clicks = 0 - is_hidden = false + is_hidden = true } vanilla_button { + label = Сервери button_element_executable_block_identifier = 0b45e69f-c23d-4592-9218-eab071a607ee-1778341927602 [executable_block:0b45e69f-c23d-4592-9218-eab071a607ee-1778341927602][type:generic] = [executables:] underline_label_on_hover = false @@ -1202,7 +1527,7 @@ vanilla_button { sticky_anchor = false anchor_point = mid-centered x = 2 - y = -12 + y = 0 width = 98 height = 20 stay_on_screen = true @@ -1358,7 +1683,7 @@ vanilla_button { sticky_anchor = false anchor_point = mid-centered x = -100 - y = -12 + y = 0 width = 98 height = 20 stay_on_screen = true diff --git a/tools/branding/build.py b/tools/branding/build.py index c2cd101..45b2777 100644 --- a/tools/branding/build.py +++ b/tools/branding/build.py @@ -188,8 +188,15 @@ def fit(im: Image.Image, max_w: int, max_h: int) -> Image.Image: return im.resize((im.width * k, im.height * k), Image.NEAREST) -# The quit button of the title screen: a door frame with an arrow going out — the library's "sign-out" icon redrawn -# on the 13 px grid of Minecraft's own button icons. '#' is white, '+' the light grey Minecraft shades them with. +# Icons of the title screen, drawn on the 13 px grid of Minecraft's own button icons. Each one redraws an icon of the +# FD Icons library (named in the comment). '.' is empty; the other letters are colours from ICON_COLOURS. +ICON_COLOURS = { + '#': (255, 255, 255), '+': (208, 208, 208), # white and the light grey Minecraft shades its icons with + 'G': (58, 200, 18), 'g': (0, 150, 0), # server is online + 'R': (224, 64, 58), 'r': (160, 38, 32), # server is offline + 'A': (249, 168, 37), 'a': (190, 110, 20), # maintenance +} + QUIT_ICON = ''' #######...... #++++++...... @@ -204,16 +211,90 @@ QUIT_ICON = ''' #+........... #######...... +++++++...... -''' +''' # sign-out: a door frame with an arrow going out + +SETTINGS_ICON = ''' +.....###..... +..#..###..#.. +.###########. +..#########.. +..###+++###.. +#####...##### +#####...##### +#####...##### +++###...###++ +..#########.. +.###########. +.+#++###++#+. +.....+++..... +''' # settings: a gear + +ONLINE_ICON = ''' +....GGGGG.... +..GGGGGGGGG.. +.GGGGGGGGGGG. +.GGGGGGGG##G. +GGGGGGGG###GG +GGGGGGG###GGG +GG##GG###GGGG +GG######GGGGG +GGg####GGGGGg +.Ggg##GGGGGg. +.gGGGGGGGGgg. +..ggGGGGGgg.. +....ggggg.... +''' # check-circle + +OFFLINE_ICON = ''' +....RRRRR.... +..RRRRRRRRR.. +.RRRRRRRRRRR. +.RR##RRR##RR. +RRR###R###RRR +RRRR#####RRRR +RRRRR###RRRRR +RRRR#####RRRR +RRr###R###RRr +.Rr##RRR##Rr. +.rRRRRRRRRrr. +..rrRRRRRrr.. +....rrrrr.... +''' # close-circle + +MAINTENANCE_ICON = ''' +........AAA.. +.......AAA... +......AAA.... +......AAA...A +......AAAA.AA +......AAAAAAa +.....AAAAAAa. +....AAAAaaa.. +...AAAAa..... +..AAAAa...... +.AAAAa....... +AAAAa........ +AAAa......... +''' # wrench -def button_icon(rows: str) -> Image.Image: - """A 20x20 picture for a 20x20 button; the drawing starts at (4, 4), where Minecraft puts its own icons.""" +def button_icon(rows: str, outline: bool = False) -> Image.Image: + """A 20x20 picture for a 20x20 button; the drawing starts at (4, 4), where Minecraft puts its own icons. + An icon shown without a button behind it gets a dark outline, so it reads on any background.""" im = Image.new('RGBA', (20, 20), (0, 0, 0, 0)) for y, row in enumerate(rows.split()): for x, c in enumerate(row): if c != '.': - im.putpixel((4 + x, 4 + y), (255, 255, 255, 255) if c == '#' else (208, 208, 208, 255)) + im.putpixel((4 + x, 4 + y), ICON_COLOURS[c] + (255,)) + if outline: + solid = np.asarray(im)[..., 3] > 0 + near = np.zeros_like(solid) + for dy in (-1, 0, 1): + for dx in (-1, 0, 1): + near |= shift(solid, dy, dx) + edge = Image.new('RGBA', im.size, INK + (255,)) + edge.putalpha(Image.fromarray(((near & ~solid) * 255).astype(np.uint8))) + im = Image.alpha_composite(edge, im) return im @@ -280,6 +361,9 @@ def main() -> None: shade(cover(art, 1920, 1080), *((0.95, 1.0) if night else (0.80, 0.92))).convert('RGB').save(OUT / 'menu' / 'background.png') stack([wordmark(8), motto(3)], gap=12).save(OUT / 'menu' / 'logo.png') button_icon(QUIT_ICON).save(OUT / 'menu' / 'quit.png') + button_icon(SETTINGS_ICON).save(OUT / 'menu' / 'settings.png') + for name, rows in (('online', ONLINE_ICON), ('offline', OFFLINE_ICON), ('maintenance', MAINTENANCE_ICON)): + button_icon(rows, outline=True).save(OUT / 'menu' / f'status-{name}.png') print('done:', ', '.join(sorted(str(p.relative_to(OUT)).replace('\\', '/') for p in OUT.rglob('*.png')))) diff --git a/tools/branding/fancymenu.py b/tools/branding/fancymenu.py index 1836d65..4471d51 100644 --- a/tools/branding/fancymenu.py +++ b/tools/branding/fancymenu.py @@ -5,9 +5,10 @@ is the client pack's config/ or a profile's config/. The version is read from pack.toml next to the config dir when it is not given. -Layout: the key art as the background, our logo instead of Minecraft's, one wide button that joins the server, -single player and multiplayer, then language, options and an icon-only quit button in one row. Minecraft's own -lines in the bottom left corner are replaced with the pack version. The layout file itself is +Layout: the key art as the background, our logo instead of Minecraft's, a wide "Грати" button that joins the server +(active only while the server is online) with a status icon beside it, single player and the server list, then a +row of icon buttons: language, options, quit. Minecraft's own lines in the bottom left corner are replaced with +the pack version. The layout file itself is branding/menu/title_screen_layout.txt; this script copies it with the pictures, draws the version label and switches the window title, the window icon and the title-screen customisation on. """ @@ -58,9 +59,8 @@ def main() -> None: version_label = label(Font(jar), f'{WINDOW_TITLE} {version}') (fm / 'assets').mkdir(parents=True, exist_ok=True) (fm / 'customization').mkdir(parents=True, exist_ok=True) - shutil.copyfile(MENU / 'logo.png', fm / 'assets' / 'logo.png') - shutil.copyfile(MENU / 'background.png', fm / 'assets' / 'background.png') - shutil.copyfile(MENU / 'quit.png', fm / 'assets' / 'quit.png') + for picture in MENU.glob('*.png'): # background, logo, button and status icons + shutil.copyfile(picture, fm / 'assets' / picture.name) version_label.save(fm / 'assets' / 'version.png') for icon in ('favicon-16x16.png', 'favicon-32x32.png'): shutil.copyfile(ICONS / icon, fm / 'assets' / icon)