From cccaad0e58d1dba0915e193e1ddba0f5808e2d76 Mon Sep 17 00:00:00 2001 From: JonBooth78 Date: Sat, 28 Oct 2023 21:54:42 +1300 Subject: [PATCH 1/2] Show the system security (lawlessness) in the map sector view --- data/lang/core/en.json | 32 ++++++++++++++++++++++ data/pigui/views/map-sector-view.lua | 41 ++++++++++++++++++++++++++-- 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/data/lang/core/en.json b/data/lang/core/en.json index da1ecb577ea..09d654fa164 100644 --- a/data/lang/core/en.json +++ b/data/lang/core/en.json @@ -1627,6 +1627,38 @@ "description": "", "message": "System orbit view" }, + "SYSTEM_SECURITY_TOOLTIP": { + "description": "Describes how safe or dangerous a star system is", + "message": "System security:" + }, + "SYSTEM_SECURITY_1": { + "description": "Describes how safe or dangerous a star system is", + "message": "Safe" + }, + "SYSTEM_SECURITY_2": { + "description": "Describes how safe or dangerous a star system is", + "message": "Harmless" + }, + "SYSTEM_SECURITY_3": { + "description": "Describes how safe or dangerous a star system is", + "message": "Mostly Harmless" + }, + "SYSTEM_SECURITY_4": { + "description": "Describes how safe or dangerous a star system is", + "message": "Somewhat Dangerous" + }, + "SYSTEM_SECURITY_5": { + "description": "Describes how safe or dangerous a star system is", + "message": "Dangerous" + }, + "SYSTEM_SECURITY_6": { + "description": "Describes how safe or dangerous a star system is", + "message": "Very Dangerous" + }, + "SYSTEM_SECURITY_7": { + "description": "Describes how safe or dangerous a star system is", + "message": "Deadly" + }, "SYSTEM_TYPE": { "description": "", "message": "System type:" diff --git a/data/pigui/views/map-sector-view.lua b/data/pigui/views/map-sector-view.lua index 17fb940e79e..8a6d76e3574 100644 --- a/data/pigui/views/map-sector-view.lua +++ b/data/pigui/views/map-sector-view.lua @@ -18,6 +18,7 @@ local ui = require 'pigui' local layout = require 'pigui.libs.window-layout' local player = nil +local sytleColors = ui.theme.styleColors local colors = ui.theme.colors local icons = ui.theme.icons @@ -44,8 +45,10 @@ local draw_out_range_labels = false local draw_uninhabited_labels = true local automatic_system_selection = true -local function textIcon(icon, tooltip) - ui.icon(icon, Vector2(ui.getTextLineHeight()), svColor.FONT, tooltip) +local function textIcon(icon, tooltip, color) + if nil == color then color = svColor.FONT end + + ui.icon(icon, Vector2(ui.getTextLineHeight()), color, tooltip) ui.sameLine() end @@ -123,6 +126,28 @@ local function calc_star_dist(star) return dist end +local function rate_lawlessness(system) + if system.lawlessness < 1.0/7.0 then + return icons.empty, lc.SYSTEM_SECURITY_1, sytleColors.success_500 + end + if system.lawlessness < 2.0/7.0 then + return icons.empty, lc.SYSTEM_SECURITY_2, sytleColors.success_500 + end + if system.lawlessness < 3.0/7.0 then + return icons.empty, lc.SYSTEM_SECURITY_3, sytleColors.success_500 + end + if system.lawlessness < 4.0/7.0 then + return icons.alert1, lc.SYSTEM_SECURITY_4, sytleColors.danger_100 + end + if system.lawlessness < 5.0/7.0 then + return icons.alert1, lc.SYSTEM_SECURITY_5, sytleColors.danger_500 + end + if system.lawlessness < 6.0/7.0 then + return icons.alert1, lc.SYSTEM_SECURITY_6, sytleColors.danger_500 + end + return icons.alert1, lc.SYSTEM_SECURITY_7, sytleColors.danger_500 +end + function Windows.systemInfo:Show() local label = lc.SELECTED_SYSTEM local current_systempath = sectorView:GetCurrentSystemPath() @@ -170,6 +195,18 @@ function Windows.systemInfo:Show() ui.textWrapped(starsystem.shortDescription) ui.spacing() + + ui.withTooltip(lc.SYSTEM_SECURITY_TOOLTIP, function() + local icon, desc, color = rate_lawlessness(starsystem) + textIcon(icon, nil, color) + if nil == color then + ui.textWrapped( desc ) + else + ui.textColored( color, desc ) + end +-- ui.textWrapped( "lln: " .. starsystem.lawlessness) + end) + ui.withTooltip(lc.GOVERNMENT_TYPE, function() textIcon(icons.language) ui.textWrapped(starsystem.govDescription) From 896aeb8144a3a16ac331325a7b8cc5140b2bde06 Mon Sep 17 00:00:00 2001 From: JonBooth78 Date: Sun, 5 Nov 2023 18:48:43 +1300 Subject: [PATCH 2/2] Reduce to 5 categories of system security/lawlessness and add icons --- data/icons/icons.svg | 22179 +++++++++++-------------- data/lang/core/en.json | 14 +- data/pigui/themes/default.lua | 10 +- data/pigui/views/map-sector-view.lua | 24 +- 4 files changed, 9584 insertions(+), 12643 deletions(-) diff --git a/data/icons/icons.svg b/data/icons/icons.svg index 75194df965a..e9094579a75 100644 --- a/data/icons/icons.svg +++ b/data/icons/icons.svg @@ -6,7 +6,8 @@ viewBox="0 0 3628.4701 4308.7699" id="svg7553" sodipodi:docname="icons.svg" - inkscape:version="1.1 (c68e22c387, 2021-05-23)" + inkscape:version="1.3 (0e150ed6c4, 2023-07-21)" + xml:space="preserve" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" @@ -15,8 +16,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:serif="http://www.serif.com/"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Icon - - - - - - - Icon - - - - - - - - - - Icon - - - - Icon - - - - - - - - - - - Icon - - - - - - - - - - - - - - Icon - - - - - - - - - - - - - - - - - - - - Icon - - - - Icon - - - - - - - - - - - Icon - - - - - - - - - - Icon - - - - - - - - - Icon - - - - - Icon - - - - - - - - - - Icon - - - - - - - - - - ! - - - - - ! - ! - - - - ! - - ! - ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IconIcon - - - - - - - - - - - IconIcon - - - - - Icon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Icon - IconIcon - - - Icon - - - IconIconIcon - Icon - - - - ! - - ! - - !! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - !!!! - - - - Icon Medium Courier - - - - - - - - - Icon Light courier - - - - - - - - Icon Medium Passegner Shuttle - - - - - Icon Light Passegner Shuttle - !! - Icon Medium Courier - - - - - - - Icon Heavy Courier - Icon Light courier - - - - - - - - Icon Heavy Passegner Shuttle - - Icon Medium Passegner ShuttleIcon Light Passegner ShuttleIcon Heavy Courier - - - Icon Medium Passegner Transport - - - - - Icon Heavy Passegner Transport - Icon Heavy Passegner ShuttleIcon Medium Passegner TransportIcon Heavy Passegner TransportIcon Light Passegner TransportIcon Medium Cargo Shuttle - - - - Icon Light Passegner Transport - - - - - Icon Medium Cargo Shuttle - - - - - - - - Icon Light Cargo Shuttle - - - - - - - - Icon Heavy Cargo Shuttle - Icon Light Cargo Shuttle - - - - - Icon Medium Cargo Transport - - - - - - - - Icon Light Cargo Transport - - - - - - - - Icon Heavy Cargo Transport - Icon Heavy Cargo ShuttleIcon Medium Cargo Transport - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Icon Light Cargo Transport - - - Icon - - - - - - - - - - - - - - - - - - Icon Heavy Cargo Transport - - - - - - - - - - - - - Icon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Icon - - - - - Icon - - - - - - - - - - - - - - - - - - - - - - - - - - - - IconIcon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - follow-orifollow-posfollow-icon-circle - - - - - - - - - - - - - - - - - - follow-ori - - - - - - - follow-pos - - - - - - - follow-icon-circle - - - - - - - follow-icon-circle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - follow-icon-circle - - - - - - - - - - - - - - - - - - - - - - - - follow-icon-filled-circle - - - - - - - manual-flight - follow-icon-filled-circlemanual-flight - manual-flight - - - - - - - - manual-flight - follow-icon-circle - - - - - - - - - follow-icon-circle - - - - follow-icon-circle - - - - - - - - - follow-icon-circle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Icon - - - - - - - - - - - - - - - - Icon - - - - + stroke-width="18.3762" + id="path6485-6-4" + sodipodi:nodetypes="ccc" /> diff --git a/data/lang/core/en.json b/data/lang/core/en.json index 09d654fa164..61e1f2aee07 100644 --- a/data/lang/core/en.json +++ b/data/lang/core/en.json @@ -1636,26 +1636,18 @@ "message": "Safe" }, "SYSTEM_SECURITY_2": { - "description": "Describes how safe or dangerous a star system is", - "message": "Harmless" - }, - "SYSTEM_SECURITY_3": { "description": "Describes how safe or dangerous a star system is", "message": "Mostly Harmless" }, - "SYSTEM_SECURITY_4": { - "description": "Describes how safe or dangerous a star system is", - "message": "Somewhat Dangerous" - }, - "SYSTEM_SECURITY_5": { + "SYSTEM_SECURITY_3": { "description": "Describes how safe or dangerous a star system is", "message": "Dangerous" }, - "SYSTEM_SECURITY_6": { + "SYSTEM_SECURITY_4": { "description": "Describes how safe or dangerous a star system is", "message": "Very Dangerous" }, - "SYSTEM_SECURITY_7": { + "SYSTEM_SECURITY_5": { "description": "Describes how safe or dangerous a star system is", "message": "Deadly" }, diff --git a/data/pigui/themes/default.lua b/data/pigui/themes/default.lua index df8379221d8..25fc4c71642 100644 --- a/data/pigui/themes/default.lua +++ b/data/pigui/themes/default.lua @@ -532,9 +532,9 @@ theme.icons = { circ_clear_flwtarget = 266, speed_limiter = 267, deltav = 268, - paintspray = 269, - -- EMPTY = 270, - -- EMPTY = 271, + security_shield = 269, + security_towel = 270, + security_thumb_down = 271, -- eighteenth row equip_cargo_scoop = 272, equip_fuel_scoop = 273, @@ -549,8 +549,8 @@ theme.icons = { equip_dual_pulsecannon = 282, equip_dual_pulsecannon_rapid = 283, equip_dual_mining_laser = 284, - -- EMPTY = 285, - -- EMPTY = 286, + security_pistol = 285, + security_skull = 286, -- EMPTY = 287, -- nineteenth row equip_missile_unguided = 288, diff --git a/data/pigui/views/map-sector-view.lua b/data/pigui/views/map-sector-view.lua index 8a6d76e3574..88cccc0b13b 100644 --- a/data/pigui/views/map-sector-view.lua +++ b/data/pigui/views/map-sector-view.lua @@ -127,25 +127,19 @@ local function calc_star_dist(star) end local function rate_lawlessness(system) - if system.lawlessness < 1.0/7.0 then - return icons.empty, lc.SYSTEM_SECURITY_1, sytleColors.success_500 + if system.lawlessness < 1.0/5.0 then + return icons.security_shield, lc.SYSTEM_SECURITY_1, sytleColors.success_500 end - if system.lawlessness < 2.0/7.0 then - return icons.empty, lc.SYSTEM_SECURITY_2, sytleColors.success_500 + if system.lawlessness < 2.0/5.0 then + return icons.security_towel, lc.SYSTEM_SECURITY_2, sytleColors.success_500 end - if system.lawlessness < 3.0/7.0 then - return icons.empty, lc.SYSTEM_SECURITY_3, sytleColors.success_500 + if system.lawlessness < 3.0/5.0 then + return icons.security_thumb_down, lc.SYSTEM_SECURITY_3, sytleColors.danger_300 end - if system.lawlessness < 4.0/7.0 then - return icons.alert1, lc.SYSTEM_SECURITY_4, sytleColors.danger_100 + if system.lawlessness < 4.0/5.0 then + return icons.security_pistol, lc.SYSTEM_SECURITY_4, sytleColors.danger_500 end - if system.lawlessness < 5.0/7.0 then - return icons.alert1, lc.SYSTEM_SECURITY_5, sytleColors.danger_500 - end - if system.lawlessness < 6.0/7.0 then - return icons.alert1, lc.SYSTEM_SECURITY_6, sytleColors.danger_500 - end - return icons.alert1, lc.SYSTEM_SECURITY_7, sytleColors.danger_500 + return icons.security_skull, lc.SYSTEM_SECURITY_5, sytleColors.danger_500 end function Windows.systemInfo:Show()