-50%
Le deal à ne pas rater :
-50% sur les sacs à dos pour ordinateur portable Urban Factory ...
19.99 € 39.99 €
Voir le deal

Aller en bas
Dudu'
Dudu'
Staffeux retraité

Nombre de messages : 2060
Age : 33
Distinction : Apprenti KGB-boy en avenir
[Coco' Smile]
Hamsterphile de service ^^
[Balby' le Fake]
Grand prof de la MA
[Skillo]
Ce grand programmateur, mon coeur, ma vie ! [Hamu']
Date d'inscription : 22/06/2009

encore un menu à Dudu' Empty encore un menu à Dudu'

Mer 2 Juin 2010 - 21:01
bon bah s'est un ptit menu quoi
pour l'utilisation s'est comme d'ab

bon allé:
Auteur: Adurna
créé le: 02/06/2010
version:1.2


Code:


#==============================================================================
# ** Scene_Menu
#By Adurna                        02/06/2010
#        rpgmakervx.1fr1.net
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================
module Adurna

  Commandes=[
  "Objets",
  "Compétences",
  "Équipement",
  "Statut",
  "Sauvegarder",
  "Charger",
  "Quitter"]
 
    Help_txt=[
    "Utiliser des objets?",
    "Utiliser une compétences?",
    "modifier l'équipement de l'équipe?",
    "Voir le statut des Héro?",
    "Sauvegarder la progrétion?",
    "Charger une partie?",
    "Quitter le jeu?"
    ]
   
  Icon = {
  "or"=>147 ,
  "pas"=>48 ,
  "lieu"=>153
  }
end

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 364)
    @status_window = Window_MenuStatus.new(0, 56)
    @help_window=Window_Help.new
    @help_window.width=544-160
    @help_window.height=56
    @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32)
    @temp=Window_Temp.new(544-160,364-54)
    @loc=Window_lieu.new(544-250,364)
    @step=Window_Step.new(160,364)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @temp.dispose
    @status_window.dispose
    @help_window.dispose
    @step.dispose
    @loc.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    update_help_window
    @temp.update
    @step.update
    @command_window.update
    @gold_window.update
  @loc.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
 
  #---------------------------------------------------------
  #window_help
  #---------------------------------------------------------
 
def update_help_window
  if @command_window .active
    @help_window.set_text(Adurna::Help_txt[@command_window.index],1)
  end
end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_Command2.new(160, Adurna::Commandes ,1,11)
    @command_window .x=544-160
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)    # Disable item
      @command_window.draw_item(1, false)    # Disable skill
      @command_window.draw_item(2, false)    # Disable equipment
      @command_window.draw_item(3, false)    # Disable status
    end
    if $game_system.save_disabled            # If save is forbidden
      @command_window.draw_item(4, false)    # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # Save
        $scene = Scene_File.new(true, false, false)
      when 5
        $scene = Scene_File.new(false, false, false, 5)
      when 6      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end







#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  HAUTEUR = 96
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    x : window X coordinate
  #    y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 384, 96*3+20)
    taille=$game_party.members.size
    self.contents = Bitmap.new(width - 32, 20+96*taille)
    refresh
    self.active = false
    self.index = -1
  end
 
  def create_contents
    self.contents.dispose
    self.contents = Bitmap.new(width - 32, [height - 32, row_max * HAUTEUR].max)
  end

  #--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------
  def top_row
    return self.oy / HAUTEUR
  end

  #--------------------------------------------------------------------------
  # * Set Top Row
  #    row : row shown on top
  #--------------------------------------------------------------------------
  def top_row=(row)
    super(row)
    self.oy = self.oy / WLH * HAUTEUR
  end

  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_row_max
    return (self.height - 32) / HAUTEUR
  end

  #--------------------------------------------------------------------------
  # * Get rectangle for displaying items
  #    index : item number
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super(index)
    rect.height = HAUTEUR
    rect.y = index / @column_max * HAUTEUR
    return rect
  end

  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
      x = 104
      y = actor.index * 96 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_exp(actor, x, y+48)
      draw_actor_level(actor, x, y +24)
      draw_actor_state(actor, x+120, y)
      draw_actor_hp(actor, x + 120, y + WLH * 1)
      draw_actor_mp(actor, x + 120, y + WLH * 2)
    end
  end
 
  #--------------------------------------------------------------------------
  # * Update cursor
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    elsif @index < @item_max
      super
    elsif @index >= 100
      self.cursor_rect.set(0, (@index - 100) * HAUTEUR,contents.width, HAUTEUR)
    else
      self.cursor_rect.set(0, 0, contents.width, @item_max * HAUTEUR)
    end
  end
end


class Window_Gold < Window_Base

  def initialize(x, y)
    super(x, y, 160, 52)
    refresh
  end

  def refresh
    self.contents.clear
    draw_icon(Adurna::Icon["or"], 0,-2)
    draw_currency_value2($game_party.gold, 4, 0, 120)
  end
end





class Window_Temp < Window_Base
  def initialize(x, y)
    super(x, y, 160, 54)
    refresh
  end
  def refresh
    self.contents.clear
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.draw_text(0, -3, 110, 32, text, 2)
  end
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end





class Window_lieu< Window_Base
  def initialize(x, y)
    super(x, y, 250, WLH+28)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    draw_icon(Adurna::Icon["lieu"], 0,-2)
    $maps = load_data("Data/MapInfos.rvdata")
    @map_id = $game_map.map_id
    @map_name = $maps[@map_id].name
    self.contents.draw_text(-30, -8, 360, 32, @map_name, 1)
  end
end

class Window_Step<Window_Base
    def initialize(x, y)
    super(x, y, 134, 52)
    refresh
  end
  def refresh
    self.contents.clear
      draw_icon(Adurna::Icon["pas"], 0,-4)
    self.contents.draw_text(5, -8, 100, 32, $game_party.steps, 1)
  end
  end



 class Game_Actor < Game_Battler
  def now_exp
    return @exp - @exp_list[@level]
  end
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end

class Window_Base < Window
  def draw_currency_value2(value, x, y, width)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, width--2, WLH, value, 2)
  end
 
  def draw_actor_level_menu(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 16, y, 24, WLH, actor.level, 2)
  end
  def draw_actor_class_menu(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 85, WLH, actor.class.name)
  end
  def exp_gauge_color1
    return text_color(30)
  end
  def exp_gauge_color2
    return text_color(31)
  end
  def draw_actor_exp(actor, x, y, width = 100)
    if actor.next_exp != 0
      exp = actor.now_exp
    else
      exp = 1
    end
    gw = width * exp / [actor.next_exp, 1].max
    gc1 = exp_gauge_color1
    gc2 = exp_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, "Exp")
    self.contents.font.color = normal_color
    xr = x + width
    self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2)
  end
end

class Window_Command2 < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader  :commands                # command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    width      : window width
  #    commands  : command string array
  #    column_max : digit count (if 2 or more, horizontal selection)
  #    row_max    : row count (0: match command count)
  #    spacing    : blank space when items are arrange horizontally
  #--------------------------------------------------------------------------
  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 25)
    if row_max == 0
      row_max = (commands.size + column_max - 1) / column_max
    end
    super(0, 0, width, row_max * WLH + 22+24, spacing)
    @commands = commands
    @item_max = commands.size
    @column_max = column_max
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index  : item number
  #    enabled : enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @commands[index])
  end
end

class Scene_File
  #--------------------------------------------------------------------------
  #  Initialize
  #--------------------------------------------------------------------------
 def initialize(saving, from_title, from_event,index=4)
    @saving = saving
    @from_title = from_title
    @from_event = from_event
    @index_menu = index
  end
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(@index_menu)
    end
  end
end

et le screen tout à la fin rien que pour faire chier^^
screen:
encore un menu à Dudu' Captur42


Dernière édition par $Adurna le Jeu 3 Juin 2010 - 20:07, édité 1 fois
Naël
Naël
Membre

Nombre de messages : 558
Age : 27
Localisation : n.f. : repérage, dans l'espace ou dans le temps.
Distinction : aucune
Date d'inscription : 07/02/2010

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Jeu 3 Juin 2010 - 19:03
Ce que tu appelles item correspond à quoi ?
Sinon, j'aime beaucoup !
Dudu'
Dudu'
Staffeux retraité

Nombre de messages : 2060
Age : 33
Distinction : Apprenti KGB-boy en avenir
[Coco' Smile]
Hamsterphile de service ^^
[Balby' le Fake]
Grand prof de la MA
[Skillo]
Ce grand programmateur, mon coeur, ma vie ! [Hamu']
Date d'inscription : 22/06/2009

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Jeu 3 Juin 2010 - 20:10
code éditer:
-simplification du code
-ajout d'un module de configuration
et script re passé en français


et sinon Naël item ça veux dire objet^^
Anonymous
Invité
Invité

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Ven 4 Juin 2010 - 6:39
C'est sympa, la disposition fait un peu penser au menu FFVII, mais la fenêtre avec le temps, l'or et tout est plus stylisé à mon goût ^^
giratina1
giratina1
Membre

Nombre de messages : 242
Age : 30
Localisation : Ardèche
Distinction : aucune
Date d'inscription : 01/03/2010

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Ven 4 Juin 2010 - 7:55
Mouais, il est pas mal...faudrait que je test avec mon windowskin....
Naël
Naël
Membre

Nombre de messages : 558
Age : 27
Localisation : n.f. : repérage, dans l'espace ou dans le temps.
Distinction : aucune
Date d'inscription : 07/02/2010

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Ven 4 Juin 2010 - 16:56
Non en fait, j'avais pas compris que ça correspondait à l'"option" choisie dans le menu... ( je savais ce que signifiait item ^^ ).
Final-Maker
Final-Maker
Membre

Nombre de messages : 8
Localisation : Malakoff
Distinction : aucune
Date d'inscription : 14/05/2010

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Dim 6 Juin 2010 - 14:10
C'est pas mal mais il y'a un gros vide en dessous de quitter ^^
Dudu'
Dudu'
Staffeux retraité

Nombre de messages : 2060
Age : 33
Distinction : Apprenti KGB-boy en avenir
[Coco' Smile]
Hamsterphile de service ^^
[Balby' le Fake]
Grand prof de la MA
[Skillo]
Ce grand programmateur, mon coeur, ma vie ! [Hamu']
Date d'inscription : 22/06/2009

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Dim 6 Juin 2010 - 14:23
le gros vide est vite comblé quand tu ajoute des script comme un bestiaire
des option
kgc long party ,...
Black'
Black'
Membre

Nombre de messages : 351
Localisation : Far, far away
Distinction : aucune
Date d'inscription : 19/04/2010

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Mar 22 Juin 2010 - 16:50
Salut, (ET NON, CE N'EST PAS UN NECRO')
je n'arrive pas à insérer le script KGC Large Party de Worantana. Avant, il fonctionnait(sur le menu initial) et désormais, il ne s'applique plus dans ton script. Cependant, il ne bug pas^^...

Entre autre, ton script est génial encore un menu à Dudu' 724130

A++
Dudu'
Dudu'
Staffeux retraité

Nombre de messages : 2060
Age : 33
Distinction : Apprenti KGB-boy en avenir
[Coco' Smile]
Hamsterphile de service ^^
[Balby' le Fake]
Grand prof de la MA
[Skillo]
Ce grand programmateur, mon coeur, ma vie ! [Hamu']
Date d'inscription : 22/06/2009

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Mar 22 Juin 2010 - 18:26
merci bah écoute tu me passe par mp le script que tu veux intégré et je vois ce que je peut faire
mais avent teste en mettant le script kgc large Party en desous de mon script de menu et normalement ça marche^^
Dany
Dany
Membre

Nombre de messages : 784
Age : 27
Distinction : aucune
Date d'inscription : 16/11/2010
http://gamers-studio.forumofficiel.fr/

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Ven 31 Déc 2010 - 17:37
Bonjours vous pouvez essaeyer d'enlever le pédometre(Le conteur de pas)
Merci! Very Happy
Frozen
Frozen
Membre

Nombre de messages : 584
Age : 28
Distinction : Prêt à tout pour aider le staff !
(distinction promise ^^)
Date d'inscription : 20/03/2010

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Ven 31 Déc 2010 - 17:42
Bonjours vous pouvez essaeyer d'enlever le pédometre(Le conteur de pas)
XD Presque, le compteur de pas c'est un podomètre ...
Dany
Dany
Membre

Nombre de messages : 784
Age : 27
Distinction : aucune
Date d'inscription : 16/11/2010
http://gamers-studio.forumofficiel.fr/

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Ven 31 Déc 2010 - 17:43
oui mais pouvais vous l'enlever
si vous plait
Merci Very Happy
Frozen
Frozen
Membre

Nombre de messages : 584
Age : 28
Distinction : Prêt à tout pour aider le staff !
(distinction promise ^^)
Date d'inscription : 20/03/2010

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Ven 31 Déc 2010 - 19:02
J'ai enlevé trois lignes, et apparemment ça s'affiche plus Very Happy
Par contre je sais pas si il va y avoir des effets secondaires ... scratch

Bref:
Code:
#==============================================================================
# ** Scene_Menu
#By Adurna                        02/06/2010
#        rpgmakervx.1fr1.net
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================
module Adurna

  Commandes=[
  "Objets",
  "Compétences",
  "Équipement",
  "Statut",
  "Sauvegarder",
  "Charger",
  "Quitter"]
 
    Help_txt=[
    "Utiliser des objets?",
    "Utiliser une compétences?",
    "modifier l'équipement de l'équipe?",
    "Voir le statut des Héro?",
    "Sauvegarder la progrétion?",
    "Charger une partie?",
    "Quitter le jeu?"
    ]
   
  Icon = {
  "or"=>147 ,
  "lieu"=>153
  }
end

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 364)
    @status_window = Window_MenuStatus.new(0, 56)
    @help_window=Window_Help.new
    @help_window.width=544-160
    @help_window.height=56
    @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32)
    @temp=Window_Temp.new(544-160,364-54)
    @loc=Window_lieu.new(544-250,364)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @temp.dispose
    @status_window.dispose
    @help_window.dispose
    @loc.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    update_help_window
    @temp.update
    @command_window.update
    @gold_window.update
  @loc.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
 
  #---------------------------------------------------------
  #window_help
  #---------------------------------------------------------
 
def update_help_window
  if @command_window .active
    @help_window.set_text(Adurna::Help_txt[@command_window.index],1)
  end
end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = Window_Command2.new(160, Adurna::Commandes ,1,11)
    @command_window .x=544-160
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)    # Disable item
      @command_window.draw_item(1, false)    # Disable skill
      @command_window.draw_item(2, false)    # Disable equipment
      @command_window.draw_item(3, false)    # Disable status
    end
    if $game_system.save_disabled            # If save is forbidden
      @command_window.draw_item(4, false)    # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # Save
        $scene = Scene_File.new(true, false, false)
      when 5
        $scene = Scene_File.new(false, false, false, 5)
      when 6      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end







#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  HAUTEUR = 96
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    x : window X coordinate
  #    y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 384, 96*3+20)
    taille=$game_party.members.size
    self.contents = Bitmap.new(width - 32, 20+96*taille)
    refresh
    self.active = false
    self.index = -1
  end
 
  def create_contents
    self.contents.dispose
    self.contents = Bitmap.new(width - 32, [height - 32, row_max * HAUTEUR].max)
  end

  #--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------
  def top_row
    return self.oy / HAUTEUR
  end

  #--------------------------------------------------------------------------
  # * Set Top Row
  #    row : row shown on top
  #--------------------------------------------------------------------------
  def top_row=(row)
    super(row)
    self.oy = self.oy / WLH * HAUTEUR
  end

  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_row_max
    return (self.height - 32) / HAUTEUR
  end

  #--------------------------------------------------------------------------
  # * Get rectangle for displaying items
  #    index : item number
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = super(index)
    rect.height = HAUTEUR
    rect.y = index / @column_max * HAUTEUR
    return rect
  end

  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
      x = 104
      y = actor.index * 96 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_exp(actor, x, y+48)
      draw_actor_level(actor, x, y +24)
      draw_actor_state(actor, x+120, y)
      draw_actor_hp(actor, x + 120, y + WLH * 1)
      draw_actor_mp(actor, x + 120, y + WLH * 2)
    end
  end
 
  #--------------------------------------------------------------------------
  # * Update cursor
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    elsif @index < @item_max
      super
    elsif @index >= 100
      self.cursor_rect.set(0, (@index - 100) * HAUTEUR,contents.width, HAUTEUR)
    else
      self.cursor_rect.set(0, 0, contents.width, @item_max * HAUTEUR)
    end
  end
end


class Window_Gold < Window_Base

  def initialize(x, y)
    super(x, y, 160, 52)
    refresh
  end

  def refresh
    self.contents.clear
    draw_icon(Adurna::Icon["or"], 0,-2)
    draw_currency_value2($game_party.gold, 4, 0, 120)
  end
end





class Window_Temp < Window_Base
  def initialize(x, y)
    super(x, y, 160, 54)
    refresh
  end
  def refresh
    self.contents.clear
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.draw_text(0, -3, 110, 32, text, 2)
  end
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end





class Window_lieu< Window_Base
  def initialize(x, y)
    super(x, y, 250, WLH+28)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    draw_icon(Adurna::Icon["lieu"], 0,-2)
    $maps = load_data("Data/MapInfos.rvdata")
    @map_id = $game_map.map_id
    @map_name = $maps[@map_id].name
    self.contents.draw_text(-30, -8, 360, 32, @map_name, 1)
  end
end

class Window_Step<Window_Base
    def initialize(x, y)
    super(x, y, 134, 52)
    refresh
  end
  def refresh
    self.contents.clear
      draw_icon(Adurna::Icon["pas"], 0,-4)
    self.contents.draw_text(5, -8, 100, 32, $game_party.steps, 1)
  end
  end



 class Game_Actor < Game_Battler
  def now_exp
    return @exp - @exp_list[@level]
  end
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end

class Window_Base < Window
  def draw_currency_value2(value, x, y, width)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, width--2, WLH, value, 2)
  end
 
  def draw_actor_level_menu(actor, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 16, y, 24, WLH, actor.level, 2)
  end
  def draw_actor_class_menu(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 85, WLH, actor.class.name)
  end
  def exp_gauge_color1
    return text_color(30)
  end
  def exp_gauge_color2
    return text_color(31)
  end
  def draw_actor_exp(actor, x, y, width = 100)
    if actor.next_exp != 0
      exp = actor.now_exp
    else
      exp = 1
    end
    gw = width * exp / [actor.next_exp, 1].max
    gc1 = exp_gauge_color1
    gc2 = exp_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, "Exp")
    self.contents.font.color = normal_color
    xr = x + width
    self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2)
  end
end

class Window_Command2 < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader  :commands                # command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    width      : window width
  #    commands  : command string array
  #    column_max : digit count (if 2 or more, horizontal selection)
  #    row_max    : row count (0: match command count)
  #    spacing    : blank space when items are arrange horizontally
  #--------------------------------------------------------------------------
  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 25)
    if row_max == 0
      row_max = (commands.size + column_max - 1) / column_max
    end
    super(0, 0, width, row_max * WLH + 22+24, spacing)
    @commands = commands
    @item_max = commands.size
    @column_max = column_max
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index  : item number
  #    enabled : enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(rect, @commands[index])
  end
end

class Scene_File
  #--------------------------------------------------------------------------
  #  Initialize
  #--------------------------------------------------------------------------
 def initialize(saving, from_title, from_event,index=4)
    @saving = saving
    @from_title = from_title
    @from_event = from_event
    @index_menu = index
  end
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(@index_menu)
    end
  end
end
Frozen
Frozen
Membre

Nombre de messages : 584
Age : 28
Distinction : Prêt à tout pour aider le staff !
(distinction promise ^^)
Date d'inscription : 20/03/2010

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Dim 2 Jan 2011 - 16:08
J'ai fait comme ça uniquement parce que je sais pas faire autrement ^^"
Je suis plus que nul en script, donc j'essaye de faire ce que je trouve le plus simple.
Par contre en général ça rate, mais pour une fois ça a l'air d'être potable Very Happy

Neko' : Bah, c'est un bon début, faut commencer en bidouillant, ça vient tout seul après avec la pratique Wink
Bonne continuation!
Contenu sponsorisé

encore un menu à Dudu' Empty Re: encore un menu à Dudu'

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum