Declaratively add custom information to default save menu

● ARCHIVED · READ-ONLY
Started by Tsukihime 2 posts View original ↗
  1. This is a common request: some people want to see actors' faces in their save slots, others wants to see character sprites. Some people want a map preview. Some people want to have a tiled grid layout.


    Can Luna Engine make this simple?


    The way I see it, there are two aspects to consider


    1. The layout of the windows


    2. The contents of the windows


    How does this fit into the Luna workflow?


    Example request: http://www.rpgmakervxace.net/topic/26847-more-information-in-save-slots/
  2. Hey Tsuki, you can do this either with CP's Save Menu (which follow standard Luna Layout) or the Luna Engine Lunatic Save Menu.

    In one of the Luna Engine Sample's (Factory), you should be able to see this:

    Code:
    #==============================================================================# ■ MenuLuna#============================================================================== module MenuLuna  module SaveMenu    # return array contains text/bitmap data          # result = [    #  # latter R, G, B, A is for Outline color.    #  [Text, [X, Y], [Width, Align], [R, G, B(, A)], [FontName, FontSize, FontBold, FontItalic], [R, G, B(, A)]],    # ]        # replace text with $bitmap[Folder, Filename] for draw bitmap.    # Folder must be in Graphics and Filename must be in Folder.    # For example: $bitmap[System, GoldIcon] for Graphics/System/GoldIcon.png    # Bitmap doesn't need [FontName, FontSize, FontBold, FontItalic] & [R, G, B(, A)]    # & [Width, Align] but has an opacity option.            # For source rect, use bw for bitmap width, bh for bitmap height.    # If Opacity and/or Src_rect, it will take opacity of 255 and bitmap original    # rect as values.    # ["$bitmap[Folder, FileName]", [X, Y], Opacity, Src_rect]    # ["$bitmap[System, GoldIcon]", [128, 0], 255, [0, 0, "bw * 0.5", "bh"]]    # ["$bitmap[System, GoldIcon]", [128, 0], 255, [0, 0, 128, 42]]                  # replace $bitmap[Folder, "Filename"] with $color[R, G, B]    # for solid color background.              # replace $bitmap[Folder, "Filename"] with $horgrad[R1, G1, B1, R2, G2, B2]    # for gradient color background horizontal.              # replace $bitmap[Folder, "Filename"] with $vergrad[R1, G1, B1, R2, G2, B2]    # for gradient color background vertical.        # replace text with $icon[index] for draw icon    # icon doesn't need [FontName, FontSize, FontBold, FontItalic] & [R, G, B(, A)]    # & [Width, Align] but has an opacity option.    # ["$icon[Index]", [X, Y], Opacity]    # ["$icon[10]", [128, 0], 255]        # contents refers to window's contents bitmap.     # Text for Status Window    def self.user_save_text(index, contents, enable)      result = []      alpha = enable ? 255 : 128      header = DataManager.load_header(index)      result = [        ["#{index+1}",           [164, 4], [120, 0], [255, 255, 255], ["VL Gothic", 20, false, false], [66, 33, 49,alpha]],      ]      return result unless header      header[:characters].each_with_index do |data, i|        x = 356        y = 48        bitmap = Cache.character(data[0])        cw = bitmap.width / 12        ch = bitmap.height / 8        n  = data[1]        result.push(          ["$bitmap[Characters, #{data[0]}]", [x+i*47, y+1], 255, [(n%4*3+1)*cw - 10, (n/4*4)*ch, cw + 20, ch + 20]]        )      end      result    end  endend #==============================================================================# ■ DataManager#============================================================================== module DataManager    #--------------------------------------------------------------------------  # new method: load_savefile_data  #--------------------------------------------------------------------------  def self.load_savefile_data(index)    File.open(make_filename(index), "rb") { |file|      Marshal.load(file)      return Marshal.load(file)    }    return nil  end    #--------------------------------------------------------------------------  # new method: get_savefile_data  #--------------------------------------------------------------------------  def self.get_savefile_data(index)    load_savefile_data(index) rescue nil  end  end # DataManager