Monospace font option for display blocks

    Thalanor

    CEO Snataris Colonial Fleetyards
    Joined
    Sep 10, 2013
    Messages
    818
    Reaction score
    708
    • Master Builder Bronze
    • Thinking Positive
    • Legacy Citizen 3
    The advantages are obvious (as long as the monospace font supports all the characters the standard font already does). I think some display engineers might cry of joy at the mere thought of this!
     

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    I support this as well, though it's not a huge deal.
     
    Joined
    Jul 12, 2013
    Messages
    295
    Reaction score
    112
    • Purchased!
    • Legacy Citizen 10
    Would fix some problems I have decorating with displays. I approve.

    Wouldn't mind being able to change font, color, and font size multiple times on the same display either, but I'm not holding my breath.
     
    Joined
    Jul 7, 2013
    Messages
    16
    Reaction score
    5
    Wouldn't mind being able to change font, color, and font size multiple times on the same display either, but I'm not holding my breath.
    Yeah, that's not quite as big, especially when you do have people doing things like this
     

    DukeofRealms

    Count Duku
    Joined
    Sep 4, 2013
    Messages
    1,477
    Reaction score
    1,617
    • Schine
    You're free to change the font of the game if you wish. Are you suggesting only adding a monospace font for display blocks? So two fonts are used in the game?
     
    • Like
    Reactions: DrTarDIS
    Joined
    Jul 7, 2013
    Messages
    16
    Reaction score
    5
    You're free to change the font of the game if you wish. Are you suggesting only adding a monospace font for display blocks? So two fonts are used in the game?
    I would say yes, display blocks only. One font for the game's HUD/menus and one for the display blocks, perhaps toggleable with the <style> tags. Would definitely help with alignment of elements on the display - like borders and such.
     
    Joined
    Jul 7, 2013
    Messages
    16
    Reaction score
    5
    Besides, I need to figure out this regex magic ;)
    It's actually some fairly straight forward regex that one. The regex pattern would be
    Code:
    .{1}(.*)
    . is consume any character and the {1} following it means to do it exactly 1 time.
    ( ) is a capture group, so something you can reuse later, and the .* inside means capture any character zero or more times.

    So the text to put in the display would be this
    Code:
    [REPLACEFIRST].{1}(.*)[WITH]$1
    $1 specifies where you want the first capture group to be placed.

    The above display module will delete the first character from a display. Unlike the [DEL] function which removes the last characters.

    All you need to do then is an [ADD] to the various displays to put in the current percentage.

    This assumes that you have 10 displays purely dedicated for the display of the graph. Which is how I'd do it, for simplicity. Thought it would mean a lot of displays...

    They most likely have done it with a slightly more complicated regex to keep the display count down; I'll get back to you in an hour after I've downloaded it and confirmed.
     
    Last edited:
    Joined
    Jul 12, 2013
    Messages
    295
    Reaction score
    112
    • Purchased!
    • Legacy Citizen 10
    It's actually some fairly straight forward regex that one.
    Lol it might straight forward for you but the last time I did any coding was probably around 18-20 years ago, even then it wasn't anything worth mentioning. Not saying I can't figure it out, it's just been a while :)

    I'll get back to you in an hour with a demo rig of how I think it's been done.
    Buddy, that would be sweet. Can't wait to see it, and maybe learn something :p
     
    Joined
    Jul 7, 2013
    Messages
    16
    Reaction score
    5
    Lol it might straight forward for you but the last time I did any coding was probably around 18-20 years ago, even then it wasn't anything worth mentioning. Not saying I can't figure it out, it's just been a while :)

    Buddy, that would be sweet. Can't wait to see it, and maybe learn something :p
    Ok so downloading the blueprint they've supplied it looks like they've gone for a far simpler approach. Just some replace firsts, achieved with 30 displays... Interesting.

    The trick is that they have patterns like these first 8 displays

    Code:
    [REPLACEFIRST]▌[█▄░][WITH]▌
    [REPLACEFIRST]▐[WITH]█▐
    [REPLACEFIRST]▐[WITH]▄▐
    [REPLACEFIRST]▐[WITH]░▐
    [REPLACEFIRST]▌[█▄░][WITH]▌
    [REPLACEFIRST]▐[WITH]█▐
    [REPLACEFIRST]▐[WITH]▄▐
    [REPLACEFIRST]▐[WITH]░▐
    The 1st and 5th ones above are the trick with how they have the graph move, it replaces exactly 1 of these ▌ that is followed by one of these █ ▄ ░ and replaces it with just the single bar, reducing 2 characters down to 1.

    This pattern continues across all 20 displays in charge of adding the data.

    Not at all how I expected it to work!

    Oh wow, it's lunch time, this will take more than an hour for me to put together something with how I imagined it to work. Give me a couple hours ;)
     
    Joined
    Jul 7, 2013
    Messages
    16
    Reaction score
    5
    Buddy, that would be sweet. Can't wait to see it, and maybe learn something :p
    Apologies, I was out for way longer than expected. Here is what I got, I went a little overboard and made it more precise, it displays in increments of 10% per line, I could make it more compact by doing as the other one and showing it over 5 lines, but I quite liked the gradient that having 10 lines provided.


    Sment download (Dropbox). It is laid out in an easy to understand way, in no way attempting to be compact. It uses the technique I originally described with the regex to remove the first character, it might be easier if you copy/paste the contents of the screens into a text editor, they're a bit hard to read in-game. To see it in action you'll want to place down the shields and start the clock.

    I'll spend a little bit of time making it more compact (and unique in some way) and then maybe release it to the Logic section of the forums.