Merge text0

[?]
Jul 11, 2023, 2:07 AM
QW7YRY25MDAIA2IZULYIDHEXTI5AHAKNXH4NPQB5W5VMVXJZPQCAC

Dependencies

  • [2] TKRVYAVO bugfix for merge commit
  • [3] UFOVVX3Z Merge text0
  • [4] NVTUHXC4 maintain the initial font size in a global
  • [5] FM5LDKGT Merge text.love
  • [6] PTOMKY7C Merge text0
  • [7] BF2R2ETD include Current_time in reference
  • [8] X43ZIKR3 Merge text.love
  • [9] 7RDQRRP5 Merge text0
  • [10] KKMFQDR4 editing source code from within the app
  • [11] W3UFZ4FO run on.load_settings after loading defaults
  • [12] UHB4GARJ left/right margin -> left/right coordinates
  • [13] 5RLCALX5 Merge text0
  • [14] G2SVT3RO Merge text0
  • [15] AVQ5MC5D finish uppercasing all globals
  • [16] LRDM35CE app running again
  • [17] DD5K2FU2 Merge text0
  • [18] 2CTN2IEF Merge lines.love
  • [19] RXNR3U5E Merge text.love
  • [20] YCYCQOFC bugfix: on.load_settings when there are none
  • [21] SDRXK4X5 move
  • [22] R6GUSTBY default font size and line-height
  • [23] 4NUCYNB4 Merge text0
  • [24] DUHVCYW5 Merge text.love
  • [25] XSLCFVFH .
  • [26] OI4FPFIN support drawings in the source editor
  • [27] MPETAKZ2 insert space for loading settings
  • [28] Z4KNS42N to open a file without a terminal, drag it on!
  • [29] AVTNUQYR basic test-enabled framework
  • [30] NEXUNNCF extract a function
  • [31] 36Z442IV back to commit 8123959e52f without code editing
  • [32] HFI2YR2C rip out geometry commandline arg
  • [33] JOPVPUSA editing source code from within the app
  • [34] G4FCGDN6 rename
  • [35] HNRU45ZM inline a function
  • [36] EADS554A fix previous merge
  • [37] DSDKFEUK persist window geometry to disk across restart
  • [38] YGCT2D2O start loading settings as applicable
  • [39] QF3HGULO Merge text.love
  • [40] AJB4LFRB try to maintain a reasonable line width
  • [41] YJ6ASFBG yet another fork trying to integrate my live framework with everything else
  • [42] WQOSZSUE warn on unused commandline args
  • [43] JCXL74WV bring back everything from commit a68647ae22
  • [44] FRXBX5FC create space for app-specific settings
  • [45] 46ASCE5K first commandline arg: window dimensions
  • [46] N2NUGNN4 include a brief reference enabling many useful apps
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • edit in reference.md at line 23
    [6.508][4.8:227]()
    * `Font_height` -- remembers the current font height on initialization. But
    you're responsible for setting it when updating font height. (Think of this
    as the body font, but apps so far assume a single font size.)
  • edit in main.lua at line 38
    [6.2321][4.328:348]()
    Font_height = 20
  • replacement in main.lua at line 56
    [6.1320][6.7:25]()
    load_settings()
    [6.1320]
    [6.11]
    if love.filesystem.getInfo('config') then
    load_settings()
    else
    initialize_default_settings()
    end
  • replacement in main.lua at line 105
    [6.51][6.7:51](),[6.51][6.253:318](),[6.318][6.10:61](),[6.61][6.373:593](),[6.373][6.373:593](),[6.593][6.62:206](),[6.206][6.8:72](),[6.747][6.8:72](),[6.72][6.51:58](),[6.123][6.51:58](),[6.747][6.51:58](),[6.51][6.51:58](),[6.58][4.349:432](),[4.432][6.10:597](),[6.147][6.10:597](),[6.597][2.10:53](),[2.53][6.678:939](),[6.678][6.678:939](),[6.404][6.73:125](),[6.939][6.73:125](),[6.729][6.73:125](),[6.125][6.729:735](),[6.729][6.729:735]()
    if love.filesystem.getInfo('config') then
    local settings = json.decode(love.filesystem.read('config'))
    local width, height, flags = App.screen.size()
    flags.resizable = true
    flags.minwidth = math.min(width, 200)
    flags.minheight = math.min(height, 200)
    App.screen.flags = flags
    App.screen.width = settings.width
    App.screen.height = settings.height
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    App.screen.move(settings.x, settings.y, settings.displayindex)
    if on.load_settings then on.load_settings(settings.app) end
    else
    Font_height = 20
    love.graphics.setFont(love.graphics.newFont(Font_height))
    local os = love.system.getOS()
    if os == 'Android' or os == 'iOS' then
    -- maximizing on iOS breaks text rendering: https://github.com/deltadaedalus/vudu/issues/7
    -- no point second-guessing window dimensions on mobile
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    else
    -- maximize window
    App.screen.resize(0, 0) -- maximize
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    -- shrink height slightly to account for window decoration
    App.screen.height = App.screen.height-100
    App.screen.width = 40*App.width('m')
    App.screen.flags.resizable = true
    App.screen.flags.minwidth = math.min(App.screen.width, 200)
    App.screen.flags.minheight = math.min(App.screen.height, 200)
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    end
    if on.load_settings then on.load_settings() end
    end
    [6.51]
    [3.251]
    local settings = json.decode(love.filesystem.read('config'))
    _, _, App.screen.flags = App.screen.size()
    App.screen.flags.resizable = true
    App.screen.width, App.screen.height = settings.width, settings.height
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    set_window_position_from_settings(settings)
    if on.load_settings then on.load_settings(settings.app) end
  • edit in main.lua at line 114
    [6.3241][5.10:119](),[6.3241][5.10:119](),[6.160][5.120:166](),[6.160][5.120:166](),[6.160][5.120:166]()
    -- set up desired window dimensions and make window resizable
    _, _, App.screen.flags = App.screen.size()
    set_window_position_from_settings(settings)
  • resurrect zombie in main.lua at line 114
    [6.4099][5.167:518](),[6.4099][5.167:518](),[6.4099][5.167:518](),[6.4589][5.519:998](),[6.4589][5.519:998](),[6.4589][5.519:998]()
    function set_window_position_from_settings(settings)
    local os = love.system.getOS()
    if os == 'Linux' then
    -- love.window.setPosition doesn't quite seem to do what is asked of it on Linux.
    App.screen.move(settings.x, settings.y-37, settings.displayindex)
    else
    App.screen.move(settings.x, settings.y, settings.displayindex)
    end
    end
    -- Initialize window width/height and make window resizable.
    --
    -- I get tempted to have opinions about window dimensions here, but they're
    -- non-portable:
    -- - maximizing doesn't work on mobile and messes things up
    -- - maximizing keeps the title bar on screen in Linux, but off screen on
    -- Windows. And there's no way to get the height of the title bar.
    -- It seems more robust to just follow LÖVE's default window size until
    -- someone overrides it.
  • edit in main.lua at line 122
    [5.513]
    [5.513]
    end
    function initialize_default_settings()
    local font_height = 20
    love.graphics.setFont(love.graphics.newFont(font_height))
    initialize_window_geometry(App.width('m'))
  • edit in main.lua at line 130
    [5.518]
    [5.519]
    function initialize_window_geometry(em_width)
  • edit in main.lua at line 140
    [5.998]
    [6.5112]
    App.screen.width, App.screen.height, App.screen.flags = App.screen.size()
    App.screen.flags.resizable = true
    App.screen.resize(App.screen.width, App.screen.height, App.screen.flags)
    end