update stale source X-(

[?]
Mar 26, 2023, 4:55 PM
LIKTH6HMT2XAWJX6WM2ZYUUVDLN2H6SLW42GSRNF3ZUYATSJ2LDAC

Dependencies

  • [2] IX5YTLSV state validation in source editor as well
  • [3] LDFXFRUO bring a few things in sync between run and source
  • [4] G54H3YG2 get rid of all bifold text
  • [5] 2CK5QI7W make love event names consistent
  • [6] KYNGDE2C consistent names in a few more places
  • [7] OI4FPFIN support drawings in the source editor
  • [8] KKMFQDR4 editing source code from within the app

Change contents

  • edit in source_text.lua at line 181
    [5.97835]
    [4.523]
    assert(State.lines[State.cursor1.line].mode == 'text')
  • replacement in source_edit.lua at line 126
    [2.484][2.484:567]()
    return loc1.line > #State.lines
    or loc1.pos > #State.lines[loc1.line].data
    [2.484]
    [2.567]
    if loc1.line > #State.lines then return true end
    local l = State.lines[loc1.line]
    if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
    return loc1.pos > #State.lines[loc1.line].data
  • replacement in source_edit.lua at line 174
    [5.20316][5.20316:20384]()
    button(State, 'draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},
    [5.20316]
    [5.20384]
    button(State, 'draw', {x=State.left-Margin_left+4, y=y+4, w=12,h=12, color={1,1,0},
  • replacement in source_edit.lua at line 230
    [5.157151][3.560:626]()
    --? print('press', State.selection1.line, State.selection1.pos)
    [5.157151]
    [5.157217]
    --? print('press', State.cursor1.line)
  • replacement in source_edit.lua at line 273
    [5.22324][5.22324:22347]()
    --? print('release')
    [5.22324]
    [5.22347]
    --? print('release', State.cursor1.line)
  • edit in source_edit.lua at line 325
    [5.2577]
    [5.157897]
    --? print('text input', t)
  • replacement in source_edit.lua at line 330
    [5.158026][5.22646:22697]()
    elseif State.current_drawing_mode == 'name' then
    [5.158026]
    [5.22697]
    elseif State.lines.current_drawing and State.current_drawing_mode == 'name' then
  • replacement in source_edit.lua at line 483
    [5.23840][5.23840:23891]()
    elseif State.current_drawing_mode == 'name' then
    [5.23840]
    [5.23891]
    elseif State.lines.current_drawing and State.current_drawing_mode == 'name' then
  • replacement in source_edit.lua at line 496
    [5.24453][5.24453:24713]()
    local byte_offset = Text.offset(p.name, len-1)
    if len == 1 then byte_offset = 0 end
    p.name = string.sub(p.name, 1, byte_offset)
    record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
    [5.24453]
    [5.24713]
    if len > 0 then
    local byte_offset = Text.offset(p.name, len-1)
    if len == 1 then byte_offset = 0 end
    p.name = string.sub(p.name, 1, byte_offset)
    record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})
    end