preserve settings across restart

akkartik
Nov 21, 2023, 8:11 PM
YV2GBDNWXXP5V4YJUSEA5M6A3QWLU4NX42K5FV4RJVHKPFED66IAC

Dependencies

  • [2] JV27LDDK sliders for font size and color settings
  • [3] VAVXKWZV aggregate global state inside a 'pane' object
  • [4] PRE6XPRN responsively increase/decrease font height
  • [5] ZM7NOBRM new fork: carousel shell
  • [6] OE26XIQO bring back syntax highlighting (but so ugly)
  • [7] Y6M77HB4 keep sliders well within settings area
  • [8] 5RUFNRJO start of the visual skeleton
  • [9] VEAVIL4X resize handler
  • [10] ICS45BIL editor widget now takes a bottom margin
  • [11] RK2ASPN7 add lots of buttons to the toolbar
  • [*] R5QXEHUI somebody stop me

Change contents

  • file addition: 0099-on.load_settings (----------)
    [13.2]
    on.load_settings = function(settings)
    Font_height = settings.font_height or font_height
    Background_color = settings.background_color or Background_color
    -- careful not to replace the Foreground_color table instance
    if settings.foreground_color then
    local src = settings.foreground_color
    local dest = Foreground_color
    dest.r, dest.g, dest.b, dest.a = src.r, src.g, src.b, src.a
    end
    end
  • file addition: 0098-on.save_settings (----------)
    [13.2]
    on.save_settings = function()
    return {
    font_height = Font_height,
    foreground_color = Foreground_color,
    background_color = Background_color
    }
    end
  • file addition: 0097-Font_height (----------)
    [13.2]
    Font_height = 20
  • replacement in 0081-draw_settings_menu at line 3
    [2.3056][2.3056:3112]()
    local w,h = 200, love.graphics.getFont():getHeight()*8
    [2.3056]
    [2.3112]
    local w,h = 200, Font_height*8
  • replacement in 0070-code_editor_state at line 7
    [3.2772][3.2772:2825]()
    love.graphics.getFont():getHeight(), Line_height)
    [3.2772]
    [3.2825]
    Font_height, Line_height)
  • replacement in 0069-output_editor_state at line 6
    [3.3102][3.3102:3155]()
    love.graphics.getFont():getHeight(), Line_height)
    [3.3102]
    [3.3155]
    Font_height, Line_height)
  • replacement in 0068-copy_editor at line 7
    [3.3500][3.3500:3552]()
    love.graphics.getFont():getHeight(), Line_height)
    [3.3500]
    [3.3552]
    Font_height, Line_height)
  • edit in 0032-update_font_settings at line 2
    [3.96]
    [3.96]
    Font_height = font_height
  • replacement in 0032-update_font_settings at line 4
    [3.155][3.155:222]()
    Line_height = math.floor(love.graphics.getFont():getHeight()*1.3)
    [3.155]
    [3.222]
    Line_height = math.floor(font_height*1.3)
  • replacement in 0011-on.initialize at line 2
    [3.3103][3.3103:3220]()
    love.graphics.setFont(love.graphics.newFont(20))
    Line_height = math.floor(love.graphics.getFont():getHeight()*1.3)
    [3.3103]
    [3.3220]
    love.graphics.setFont(love.graphics.newFont(Font_height))
    Line_height = math.floor(Font_height*1.3)