기타
2010.01.05 05:39

디버깅 화면 재 구성

조회 수 1834 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
Extra Form
라이센스 RPG만들기XP
출처 타인데이터
강의종류 텍스트

F9 를 눌렀을 때, 훨씬더 간편하게 사용 할 수 있도록 수정되었습니다.
이 디버그는, 스위치, 변수 뿐만 아니라,
도구, 방어구, 무기, 소지금과 플레이타임, 보수 등 까지 수정 할 수 있습니다.
직접 사용해보세요,
Seane_Debug 보다 아래, Main 보다 위에 신규 세션 만들어 주세요.


# 디버그 윈도우 강화 스크립트 v1.00 by tonbi
#
# ·할 수 있는 것
#
# 이 스크립트를 사용하는 것으로, 테스트 플레이시에 F9 눌러 나온다
# 디버그 윈도우의 기능을 강화합니다.
# 구체적으로는, 아이템, 무기, 방어구, 소지금, 보수, 타이머의 조작 기능 추가.
# 게다가 변수의 조작의 조작성 향상(나적으로는(w)
#
#
# ·사용법
#
# 이 스크립트를, Seane_Debug 보다 아래, Main 보다 위에 신규 세션 만들어
# 거기에 붙여 주세요.
#
#


#==============================================================================
# ■ Window_Selectable_tonbi6
# 키 가압시의 동작 변경판
#==============================================================================

class Window_Selectable_tonbi6 < Window_Base
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_reader   :index                    # 커서 위치
  attr_reader   :help_window              # 헬프 윈도우
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     x      : 윈도우의 X 좌표
  #     y      : 윈도우의 Y 좌표
  #     width  : 윈도우의 폭
  #     height : 윈도우의 높이
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item_max = 1
    @column_max = 1
    @index = -1
  end
  #--------------------------------------------------------------------------
  # ● 커서 위치의 설정
  #     index : 새로운 커서 위치
  #--------------------------------------------------------------------------
  def index=(index)
    @index = index
    # 헬프 텍스트를 갱신 (update_help 는 계승처에서 정의된다)
    if self.active and @help_window != nil
      update_help
    end
    # 커서의 구형을 갱신
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # ● 행수의 취득
  #--------------------------------------------------------------------------
  def row_max
    # 항목수와 렬수로부터 행수를 산출
    return (@item_max + @column_max - 1) / @column_max
  end
  #--------------------------------------------------------------------------
  # ● 선두의 행의 취득
  #--------------------------------------------------------------------------
  def top_row
    # 윈도우 내용의 전송원 Y 좌표를, 1 행의 높이 32 로 나눈다
    return self.oy / 32
  end
  #--------------------------------------------------------------------------
  # ● 선두의 행의 설정
  #     row : 선두에 표시하는 행
  #--------------------------------------------------------------------------
  def top_row=(row)
    # row 가 0 미만의 경우는 0 에 수정
    if row < 0
      row = 0
    end
    # row 가 row_max - 1 초의 경우는 row_max - 1 에 수정
    if row > row_max - 1
      row = row_max - 1
    end
    # row 에 1 행의 높이 32 를 걸어 윈도우 내용의 전송원 Y 좌표로 한다
    self.oy = row * 32
  end
  #--------------------------------------------------------------------------
  # ● 1 페이지에 표시할 수 있는 행수의 취득
  #--------------------------------------------------------------------------
  def page_row_max
    # 윈도우의 높이로부터, 프레임의 높이 32 를 빼, 1 행의 높이 32 로 나눈다
    return (self.height - 32) / 32
  end
  #--------------------------------------------------------------------------
  # ● 1 페이지에 표시할 수 있는 항목수의 취득
  #--------------------------------------------------------------------------
  def page_item_max
    # 행수 page_row_max 에 렬수 @column_max 를 건다
    return page_row_max * @column_max
  end
  #--------------------------------------------------------------------------
  # ● 헬프 윈도우의 설정
  #     help_window : 새로운 헬프 윈도우
  #--------------------------------------------------------------------------
  def help_window=(help_window)
    @help_window = help_window
    # 헬프 텍스트를 갱신 (update_help 는 계승처에서 정의된다)
    if self.active and @help_window != nil
      update_help
    end
  end
  #--------------------------------------------------------------------------
  # ● 커서의 구형 갱신
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 커서 위치가 0 미만의 경우
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 현재의 행을 취득
    row = @index / @column_max
    # 현재의 행이, 표시되고 있는 선두의 행보다 전의 경우
    if row < self.top_row
      # 현재의 행이 선두가 되도록(듯이) 스크롤
      self.top_row = row
    end
    # 현재의 행이, 표시되고 있는 최후미의 행부터 뒤의 경우
    if row > self.top_row + (self.page_row_max - 1)
      # 현재의 행이 최후미가 되도록(듯이) 스크롤
      self.top_row = row - (self.page_row_max - 1)
    end
    # 커서의 폭을 계산
    cursor_width = self.width / @column_max - 32
    # 커서의 좌표를 계산
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * 32 - self.oy
    # 커서의 구형을 갱신
    self.cursor_rect.set(x, y, cursor_width, 32)
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    # 커서의 이동이 가능한 상태의 경우
    if self.active and @item_max > 0 and @index >= 0
      # 방향 버튼아래가 밀렸을 경우
      if Input.repeat?(Input::DOWN)
        # 렬수가 1 한편 방향 버튼아래의 압하 상태가 리피트가 아닌 경우인가,
        # 또는 커서 위치가(항목수 - 렬수) 보다 전의 경우
        if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
           @index < @item_max - @column_max
          # 커서를 아래에 이동
          $game_system.se_play($data_system.cursor_se)
          @index = (@index + @column_max) % @item_max
        end
      end
      # 방향 버튼 위가 밀렸을 경우
      if Input.repeat?(Input::UP)
        # 렬수가 1 한편 방향 버튼 위의 압하 상태가 리피트가 아닌 경우인가,
        # 또는 커서 위치가 렬수보다 뒤의 경우
        if (@column_max == 1 and Input.trigger?(Input::UP)) or
           @index >= @column_max
          # 커서를 위에 이동
          $game_system.se_play($data_system.cursor_se)
          @index = (@index - @column_max + @item_max) % @item_max
        end
      end
      # 방향 버튼의 오른쪽이 밀렸을 경우(변경)
      if Input.repeat?(Input::RIGHT)
        # 표시되고 있는 최후미의 행이, 데이터상의 마지막 행보다 전의 경우
        if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
          # 커서를 1 페이지 뒤로 이동
          $game_system.se_play($data_system.cursor_se)
          @index = [@index + self.page_item_max, @item_max - 1].min
          self.top_row += self.page_row_max
        end
      end
      # 방향 버튼의 왼쪽이 밀렸을 경우(변경)
      if Input.repeat?(Input::LEFT)
        # 표시되고 있는 선두의 행이 0 보다 뒤의 경우
        if self.top_row > 0
          # 커서를 1 페이지전에 이동
          $game_system.se_play($data_system.cursor_se)
          @index = [@index - self.page_item_max, 0].max
          self.top_row -= self.page_row_max
        end
      end
    end
    # 헬프 텍스트를 갱신 (update_help 는 계승처에서 정의된다)
    if self.active and @help_window != nil
      update_help
    end
    # 커서의 구형을 갱신
    update_cursor_rect
  end
end

#==============================================================================
# ■ Window_DebugLeft
#------------------------------------------------------------------------------
#  디버그 화면에서, 스윗치나 변수의 블록을 지정하는 윈도우입니다.
#==============================================================================
class Window_DebugLeft < Window_Selectable_tonbi6
  attr_accessor :textlist                  
  attr_accessor :textcnt                   
  attr_accessor :helptext                 
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 192, 480)
    self.index = 0
    @textlist = []
    @textcnt = 0
    @helptext = "표시중···당분간 가져가세요"
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    # 여러가지 데이터의 필요 페이지수취득
    @switch_max = ($data_system.switches.size - 1 + 9) / 10
    @variable_max = ($data_system.variables.size - 1 + 9) / 10
    @items_max = ($data_items.size - 1 + 9) / 10
    @weapons_max = ($data_weapons.size - 1 + 9) / 10
    @armors_max = ($data_armors.size - 1 + 9) / 10
    @systems_max = 1
    @item_max = @switch_max + @variable_max + @items_max
    @item_max +=  @weapons_max + @armors_max + @systems_max
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    # 항목 리스트에 항목 추가
    for i in 0...@switch_max
      @textlist.push(sprintf("스윗치 [%04d-%04d]", i*10+1, i*10+10))
    end
    for i in 0...@variable_max
      @textlist.push(sprintf("변수 [%04d-%04d]", i*10+1, i*10+10))
    end
    for i in 0...@items_max
      @textlist.push(sprintf("도구 [%03d-%03d]", i*10+1, i*10+10))
    end
    for i in 0...@weapons_max
      @textlist.push(sprintf("무기 [%03d-%03d]", i*10+1, i*10+10))
    end
    for i in 0...@armors_max
      @textlist.push(sprintf("방어구 [%03d-%03d]", i*10+1, i*10+10))
    end
    for i in 0...@systems_max
      @textlist.push(sprintf("그 외", i*10+1, i*10+10))
    end
    # 15개만 항목 묘화
    draw_next(15)
  end
  #--------------------------------------------------------------------------
  # ● 업데이트
  #--------------------------------------------------------------------------
  def update
    reverse = draw_next(1)
    super
    return reverse
  end
  #--------------------------------------------------------------------------
  # ● 항목 묘화를 진행시킨다
  #--------------------------------------------------------------------------
  def draw_next(cnt)
    for i in 0...cnt
      if @textcnt < @item_max
        self.contents.draw_text(4, @textcnt * 32, 152, 32,@textlist[@textcnt])
        @textcnt += 1
        if @textcnt == @item_max
          @helptext = ""
          # 끝난 순간만 true 를 돌려준다
          return true
        end
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ● 모드의 취득
  #--------------------------------------------------------------------------
  def mode
    if self.index < list_indent(1)
      return 0  # 스윗치
    elsif self.index < list_indent(2)
      return 1  # 변수
    elsif self.index < list_indent(3)
      return 2  # 아이템
    elsif self.index < list_indent(4)
      return 3  # 무기
    elsif self.index < list_indent(5)
      return 4  # 방어구
    elsif self.index < list_indent(6)
      return 5  # 그 외
    end
  end
  #--------------------------------------------------------------------------
  # ● 선두에 표시하는 ID 의 취득
  #--------------------------------------------------------------------------
  def top_id
    return (self.index - list_indent(self.mode)) * 10 + 1
  end
  #--------------------------------------------------------------------------
  # ● 지정 종류까지의 합계
  #--------------------------------------------------------------------------
  def list_indent(id)
    if id >= 0
      stat = 0
    end
    if id >= 1
      stat += @switch_max
    end
    if id >= 2
      stat += @variable_max
    end
    if id >= 3
      stat += @items_max
    end
    if id >= 4
      stat += @weapons_max
    end
    if id >= 5
      stat += @armors_max
    end
    if id >= 6
      stat += @systems_max
    end
    return stat
  end
end
#==============================================================================
# ■ Window_DebugRight
#------------------------------------------------------------------------------
#  디버그 화면에서, 스윗치나 변수를 개별적으로 표시하는 윈도우입니다.
#==============================================================================

class Window_DebugRight < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_reader   :mode                     # 모드 (0:스윗치,1:변수)
  attr_reader   :top_id                   # 선두에 표시하는 ID
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize
    super(192, 0, 448, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.index = -1
    self.active = false
    @item_max = 10
    @mode = 0
    @top_id = 1
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬(리스트 작성)
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0..9
      case @mode
      when 0
        name = $data_system.switches[@top_id+i]
        status = $game_switches[@top_id+i] ? "[ON]" : "[OFF]"
      when 1
        name = $data_system.variables[@top_id+i]
        status = $game_variables[@top_id+i].to_s
      when 2
        if $data_items[@top_id+i] != nil
          name = $data_items[@top_id+i].name
        else
          name = nil
        end
        status = $game_party.item_number(@top_id+i).to_s
      when 3
        if $data_weapons[@top_id+i] != nil
          name = $data_weapons[@top_id+i].name
        else
          name = nil
        end
        status = $game_party.weapon_number(@top_id+i).to_s
      when 4
        if $data_armors[@top_id+i] != nil
          name = $data_armors[@top_id+i].name
        else
          name = nil
        end
        status = $game_party.armor_number(@top_id+i).to_s
      when 5
        case i
        when 0
          name = "소지금"
          status = $game_party.gold.to_s
        when 1
          name = "보수"
          status = $game_party.steps.to_s
        when 2
          name = "타이머"
          status = $game_system.timer.to_s
        else
          name = nil
          status = ''
        end
      end
      if name == nil
        name = ''
      end
      id_text = sprintf("%04d:", @top_id+i)
      width = self.contents.text_size(id_text).width
      self.contents.draw_text(4, i * 32, width, 32, id_text)
      self.contents.draw_text(12 + width, i * 32, 296 - width, 32, name)
      self.contents.draw_text(312, i * 32, 100, 32, status, 2)
    end
  end
  #--------------------------------------------------------------------------
  # ● 모드의 설정
  #     id : 새로운 모드
  #--------------------------------------------------------------------------
  def mode=(mode)
    if @mode != mode
      @mode = mode
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 선두에 표시하는 ID 의 설정
  #     id : 새로운 ID
  #--------------------------------------------------------------------------
  def top_id=(id)
    if @top_id != id
      @top_id = id
      refresh
    end
  end
end

#==============================================================================
# ■ Scene_Debug
#------------------------------------------------------------------------------
#  디버그 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Debug
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 윈도우를 작성
    @left_window = Window_DebugLeft.new
    @right_window = Window_DebugRight.new
    @help_window = Window_Base.new(192, 352, 448, 128)
    @help_window.contents = Bitmap.new(406, 96)
    # 수치 입력 윈도우 작성 >> 숨긴다
    @input_window = Window_InputNumber_tonbi6.new(8)
    @input_window.visible = false
    @input_window.opacity = 255
    # 전회 선택되고 있던 항목을 복귀
    @left_window.top_row = $game_temp.debug_top_row
    @left_window.index = $game_temp.debug_index
    @right_window.mode = @left_window.mode
    @right_window.top_id = @left_window.top_id
    # 헬프를 표시
    @help_window.contents.clear
    text1 = "좌[전페이지]  우[차페이지]"
    text2 = "L[전의 항목]  R[다음의 항목]"
    text3 = @left_window.helptext
    @help_window.contents.draw_text(4, 0, 406, 32, text1)
    @help_window.contents.draw_text(4, 32, 406, 32, text2)
    @help_window.contents.draw_text(4, 64, 406, 32, text3)
    # 트란지션 실행
    Graphics.transition
    # 메인 루프
    loop do
      # 게임 화면을 갱신
      Graphics.update
      # 입력 정보를 갱신
      Input.update
      # 프레임 갱신
      update
      # 화면이 바뀌면 루프를 중단
      if $scene != self
        break
      end
    end
    # 맵을 리프레쉬
    $game_map.refresh
    # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @left_window.dispose
    @right_window.dispose
    @help_window.dispose
    @input_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 윈도우를 갱신
    @right_window.mode = @left_window.mode
    @right_window.top_id = @left_window.top_id
    if @left_window.update
      if @left_window.active
        @help_window.contents.clear
        text1 = "좌[전페이지]  우[차페이지]"
        text2 = "L[전의 항목]  R[다음의 항목]"
        text3 = @left_window.helptext
        @help_window.contents.draw_text(4, 0, 406, 32, text1)
        @help_window.contents.draw_text(4, 32, 406, 32, text2)
        @help_window.contents.draw_text(4, 64, 406, 32, text3)
      end
    end
    @right_window.update
    # 선택중의 항목을 기억
    $game_temp.debug_top_row = @left_window.top_row
    $game_temp.debug_index = @left_window.index
    # 레프트 윈도우가 액티브의 경우: update_left 를 부른다
    if @left_window.active
      update_left
      return
    end
    # 라이트 윈도우가 액티브의 경우: update_right 를 부른다
    if @right_window.active
      update_right
      return
    end
    # 인풋 윈도우가 액티브의 경우: update_input 를 부른다
    if @input_window.active
      update_input
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (레프트 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_left
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 맵 화면으로 전환해
      $scene = Scene_Map.new
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 결정 SE 를 연주
      $game_system.se_play($data_system.decision_se)
      # 헬프를 표시
      if @left_window.mode == 0
        @help_window.contents.clear
        text1 = "C (Enter) : ON / OFF"
        @help_window.contents.draw_text(4, 0, 406, 32, text1)
      else
        @help_window.contents.clear
        text1 = "결정(C) : 직접 입력"
        text2 = "L버튼 : 최소치"
        text3 = "R버튼 : 최대치"
        @help_window.contents.draw_text(4, 0, 406, 32, text1)
        @help_window.contents.draw_text(4, 32, 406, 32, text2)
        @help_window.contents.draw_text(4, 64, 406, 32, text3)
      end
      # 라이트 윈도우를 액티브화
      @left_window.active = false
      @right_window.active = true
      @right_window.index = 0
      return
    end
    if Input.trigger?(Input::L)
      # 커서 SE 를 연주
      $game_system.se_play($data_system.cursor_se)
      @left_window.index = @left_window.list_indent((@left_window.mode-1+6)%6)
      return
    end
    if Input.trigger?(Input::R)
      # 커서 SE 를 연주
      $game_system.se_play($data_system.cursor_se)
      @left_window.index = @left_window.list_indent((@left_window.mode+1+6)%6)
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (라이트 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_right
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 레프트 윈도우를 액티브화
      @left_window.active = true
      @right_window.active = false
      @right_window.index = -1
      # 헬프를 재표시
      @help_window.contents.clear
      text1 = "좌[전페이지]  우[차페이지]"
      text2 = "L[전의 항목]  R[다음의 항목]"
      text3 = @left_window.helptext
      @help_window.contents.draw_text(4, 0, 406, 32, text1)
      @help_window.contents.draw_text(4, 32, 406, 32, text2)
      @help_window.contents.draw_text(4, 64, 406, 32, text3)
      return
    end
    # 선택되고 있는 스윗치 / 변수의 ID 를 취득
    current_id = @right_window.top_id + @right_window.index
    # 스윗치의 경우
    case @right_window.mode
    when 0
      # C 버튼이 밀렸을 경우
      if Input.trigger?(Input::C)
        # 결정 SE 를 연주
        $game_system.se_play($data_system.decision_se)
        # ON / OFF 를 반전
        $game_switches[current_id] = (not $game_switches[current_id])
        @right_window.refresh
        return
      end
    else
      if Input.trigger?(Input::C)
        # 결정 SE 를 연주
        $game_system.se_play($data_system.decision_se)
        setnumber = nil
        case @right_window.mode
        when 1
          setnumber = $game_variables[current_id]
          needlabel = true
          digits_max = 9
        when 2
          setnumber = $game_party.item_number(current_id)
          needlabel = false
          digits_max = 2
        when 3
          setnumber = $game_party.weapon_number(current_id)
          needlabel = false
          digits_max = 2
        when 4
          setnumber =  $game_party.armor_number(current_id)
          needlabel = false
          digits_max = 2
        when 5
          case current_id
          when 1
            setnumber = $game_party.gold
            needlabel = false
            digits_max = 7
          when 2
            setnumber = $game_party.steps
            needlabel = false
            digits_max = 7
          when 3
            setnumber = $game_system.timer
            needlabel = false
            digits_max = 7
          end
        end
        if setnumber != nil
          # 인풋 윈도우를 액티브하게 한다
          @input_window.dispose
          @input_window = Window_InputNumber_tonbi6.new(digits_max,needlabel)
          @input_window.y = @right_window.index * 32
          @input_window.x = 640 -16- @input_window.width
          @input_window.number = setnumber
          @input_window.active = true
          @input_window.visible = true
          @right_window.active = false
        end
      elsif Input.trigger?(Input::L)
        # 결정 SE 를 연주
        $game_system.se_play($data_system.decision_se)
        # 최대까지 늘린다
        setstat(@right_window.mode,current_id,-999999999)
        @right_window.refresh
      elsif Input.trigger?(Input::R)
        # 결정 SE 를 연주
        $game_system.se_play($data_system.decision_se)
        # 최소까지 줄인다
        setstat(@right_window.mode,current_id,999999999)
        @right_window.refresh
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신 (인풋 윈도우가 액티브의 경우)
  #--------------------------------------------------------------------------
  def update_input
    @input_window.update
    # B 버튼이 밀렸을 경우
    if Input.trigger?(Input::B)
      # 캔슬 SE 를 연주
      $game_system.se_play($data_system.cancel_se)
      # 라이트 윈도우를 액티브화
      @right_window.active = true
      @input_window.active = false
      @input_window.visible = false
      return
    end
    # 선택되고 있는 ID 를 취득
    current_id = @right_window.top_id + @right_window.index
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 결정 SE 를 연주
      $game_system.se_play($data_system.decision_se)
      # 값의 취득
      updown_number = @input_window.number
     
      setstat(@right_window.mode,current_id,updown_number)
     
      @right_window.refresh
      @right_window.active = true
      @input_window.active = false
      @input_window.visible = false
      return
    end
  end
  #--------------------------------------------------------------------------
  # ● 각종 데이터 증감
  #--------------------------------------------------------------------------
  def setstat(mode,current_id,updown_number)
    case mode
    when 1
      # 변수를 증감
      $game_variables[current_id] = 0
      $game_variables[current_id] += updown_number
      # 상한 체크
      if $game_variables[current_id] > 99999999
        $game_variables[current_id] = 99999999
      end
      # 하한 체크
      if $game_variables[current_id] < -99999999
        $game_variables[current_id] = -99999999
      end
    when 2
      # 아이템을 증감
      $game_party.gain_item(current_id,-99999999)
      $game_party.gain_item(current_id,updown_number)
    when 3
      # 무기를 증감
      $game_party.gain_weapon(current_id,-99999999)
      $game_party.gain_weapon(current_id,updown_number)
    when 4
      # 방어구를 증감
      $game_party.gain_armor(current_id,-99999999)
      $game_party.gain_armor(current_id,updown_number)
    when 5
      case current_id
      when 1
        $game_party.gain_gold($game_party.gold*-1)
        $game_party.gain_gold(updown_number)
      when 2
        $game_party.steps = [[0,updown_number].max,9999999].min
      when 3
        $game_system.timer = [[0,updown_number].max,9999999].min
      end
    end
  end
end
#==============================================================================
# ■ Game_Party
#==============================================================================
class Game_Party
  attr_accessor   :steps                    # 보수(외부 조작 가능하게)
end
#==============================================================================
# ■ Window_InputNumber_tonbi6
#------------------------------------------------------------------------------
#  부호 서포트판
#==============================================================================
class Window_InputNumber_tonbi6 < Window_Base
  attr_accessor :index                   # 선택 위치
  attr_accessor :digits_max              # 자리수
  attr_accessor :needlabel                   # 부호 사용 플래그
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     digits_max : 자리수
  #--------------------------------------------------------------------------
  def initialize(digits_max,needlabel = false)
    @digits_max = digits_max
    @number = 0
    # 숫자의 폭으로부터 커서의 폭을 계산 (0~9 는 등폭과 가정)
    dummy_bitmap = Bitmap.new(32, 32)
    @cursor_width = dummy_bitmap.text_size("0").width + 8
    dummy_bitmap.dispose
    super(0, 0, @cursor_width * @digits_max + 32, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.z += 9999
    self.opacity = 255
    @index = digits_max-1
    @needlabel = needlabel
    @label = true
    refresh
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # ● 수치의 취득
  #--------------------------------------------------------------------------
  def number
    if @needlabel == true
      if @label == false
        @number *= -1
      end
    end
    return @number
  end
  #--------------------------------------------------------------------------
  # ● 수치의 설정
  #     number : 새로운 수치
  #--------------------------------------------------------------------------
  def number=(number)
    if @needlabel == true
      @label = true
      if number < 0
        number *= -1
        @label = false
      end
      @number = [[number, 0].max, 10 ** (@digits_max-1) - 1].min
    else
      @number = [[number, 0].max, 10 ** @digits_max - 1].min
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 커서의 구형 갱신
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(@index * @cursor_width, 0, @cursor_width, 32)
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    # 방향 버튼 위나 아래가 밀렸을 경우
    if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
      if @index == 0 and @needlabel == true
        if @label == false
          @label = true
        else
          @label =false
        end
      else
        # 현재의 정도의 숫자를 취득해, 일단 0 으로 한다
        place = 10 ** (@digits_max - 1 - @index)
        n = @number / place % 10
        @number -= n * place
        # 위라면 +1, 아래라면 -1
        n = (n + 1) % 10 if Input.repeat?(Input::UP)
        n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
        # 현재의 정도의 숫자를 재설정
        @number += n * place
      end
      refresh
    end
    # 커서 오른쪽
    if Input.repeat?(Input::RIGHT)
      if @digits_max >= 2
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + 1) % @digits_max
      end
    end
    # 커서왼쪽
    if Input.repeat?(Input::LEFT)
      if @digits_max >= 2
        $game_system.se_play($data_system.cursor_se)
        @index = (@index + @digits_max - 1) % @digits_max
      end
    end
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    s = sprintf("%0*d", @digits_max, @number)
    for i in 0...@digits_max
      if i == 0 and @needlabel == true
        if @label == false
          self.contents.draw_text(i * @cursor_width + 4, 0, 32, 32, "-")
        else
          self.contents.draw_text(i * @cursor_width + 4, 0, 32, 32, "+")
        end
      else
        self.contents.draw_text(i * @cursor_width + 4, 0, 32, 32, s[i,1])
      end
    end
  end
end


  1. 일본어 스크립트를 번역하기 좋은 번역사이트 두곳입니다

    Date2010.01.09 Category공지사항 Byruby Views22086 Votes0
    read more
  2. 스크립트 게시판 관리자' ruby ' 입니다

    Date2010.01.09 Category공지사항 Byruby Views20726 Votes0
    read more
  3. 일본 스크립트/소스 공유 포럼

    Date2010.01.05 Category공지사항 By니오티 Views22257 Votes0
    read more
  4. 게이지바 스크립트!! 최고!!

    Date2011.08.08 Category기타 By코아 코스튬 Views4253 Votes0
    Read More
  5. 이름입력 스크립트

    Date2011.07.16 Category기타 By닉네임이없습니다 Views2211 Votes0
    Read More
  6. 중복일것 같은데;; [한글 이름 입력]

    Date2011.01.05 Category기타 By꼬마쟁이 Views4644 Votes0
    Read More
  7. 상태창표시 스크립투 Ver 6.0

    Date2010.09.21 Category기타 By코아 코스튬 Views2412 Votes2
    Read More
  8. 3d 스크립트 (적용시 바로 실행가능&암호걸림)

    Date2010.06.04 Category기타 Bykjs Views4077 Votes0
    Read More
  9. Staff Roll

    Date2010.03.04 Category기타 By허걱 Views7511 Votes0
    Read More
  10. 게임 화면에 좌표 띄우기

    Date2010.01.25 Category기타 Bywindshy Views1769 Votes1
    Read More
  11. 디버깅 화면 재 구성

    Date2010.01.05 Category기타 By루시아스 Views1834 Votes0
    Read More
  12. 일어 스크립트 한글화 방법 안내

    Date2007.02.01 Category기타 By니오티 Views2572 Votes4
    Read More
  13. 어떤님이 부탁하신 온라인 같은 hud입니다

    Date2007.10.19 Category기타 By루비 Views2594 Votes2
    Read More
  14. 더욱더 간편하게! 에메스엔의 귀차니즘 탈출!

    Date2007.02.20 Category기타 By샤이닉 Views2357 Votes2
    Read More
  15. 몬스터 도감

    Date2007.02.01 Category기타 By니오티 Views2871 Votes3
    Read More
  16. 돈맡기기 시스템

    Date2007.01.31 Category기타 By히카루 Views3340 Votes2
    Read More
  17. 한글입력기

    Date2007.01.31 Category기타 By히카루 Views14281 Votes1
    Read More
  18. 레벨과 능력치 9999까지 만들기

    Date2007.01.31 Category기타 Bywindshy Views2184 Votes0
    Read More
  19. 아이템 보관소 스크립트 (KGC펌)

    Date2005.12.11 Category기타 Byケロロ 님의 ツク-ル Views2673 Votes5
    Read More
Board Pagination Prev 1 Next
/ 1

Copyright ⓒ Nioting All Rights Reserved. (since 1999)    개인정보
        

Fatal error: Cannot access property sessionController::$lifetime in /web/old/xe/modules/session/session.controller.php on line 45