Day.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / News: Quoi de neuf sur Oniromancie (...) / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

409 connectés actuellement

29376803 visiteurs
depuis l'ouverture

6170 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

RPG Maker - La Communauté

Kingdom Ultimate

ConsoleFun

Guelnika & E-magination

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > [RPG MAKER XP] Mélange de scripts


yuri - posté le 31/05/2013 à 15:03:20 (3801 messages postés)

❤ 0

Humeur Nutella

Domaine concerné: Scripts
Logiciel utilisé: RPG MAKER XP
Voilà, j'ai deux scripts et je veux les mixer.

C'est pour le menut inventaire.

D'abord, j'ai un script qui permet d'aligner des classes d'objets, de les sélectionner, comme ça le menu est rangé.

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
#===============================================================================
# Organizar Inventário
# por XRXS
#===============================================================================
# Este script permite que você organize o inventário, separando os
# itens por categorias.
# Para criar seu próprio estilo de organização você deve ir até o
# modulo XRXS_MP2_Fixed_Variable.
# Você define o nome de cada categoria em "KIND_NAMES", 
# e em "KIND_KINDS" você define o tipo de item que cada categoria mostra.
#===============================================================================
 
#==============================================================================
# XRXS_MP2_Fixed_Variable
#==============================================================================
module XRXS_MP2_Fixed_Variable
  #Definição dos nomes dos comandos de menu.
  KIND_NAMES = ["Itens", "Armas", "Escudos ", "Elmos","Armaduras", "Acessórios"]
  # Tipos de itens exibidos em cada função
  KIND_KINDS = [0, 1, 3, 4, 5, 6]
  #nil = todos os itens (inv
  #0 = Itens
  #1 = Armas
  #2 = Equipamentos de Defesa de todos os tipos
  #3 = Escudos
  #4 = Elmos
  #5 = Armaduras
  #6 = Acessórios
  #7 = Itens que não afetam nenhum alvo
  #8 = Itens que só podem ser usados em batalha
  #9 = Itens que só podem ser usados no menu
  #10= Itens que não podem ser usados
  #11= Itens que ao ser usados chamam eventos comuns
  #12= Itens de preço zero
  #13= Itens de aumento de atributo
  #14= Itens de cura
  #15= Itens com elemento
  
  # IMPORTANTE:
  # A ordem que você define em "KIND_KINDS" deve ser a mesma ordem
  # do tipo do item que vc definiu em "KIND_NAMES"
  # então se o 3º tipo você definiu como "Acessórios" por exemplo.
  # o 3º Valor em "KIND_KINDS" deve ser 6.
  
end
 
#==============================================================================
# Window_Item
#==============================================================================
class Window_Item < Window_Selectable
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  alias xrxs_mp2_initialize initialize
  alias xrxs_mp2_refresh refresh
  #--------------------------------------------------------------------------
  def initialize
    xrxs_mp2_initialize
    if not $scene.is_a?(Scene_Battle)
      self.y += 64
      self.height -= 64
    end
    @itemkind = KIND_KINDS[0]
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    if @itemkind == nil
      xrxs_mp2_refresh
      return
    end
      if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @item_max = data_sdgs(@itemkind)
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_itemkind_index(itemkind_index)
    @itemkind = KIND_KINDS[itemkind_index]
    refresh
  end
  #--------------------------------------------------------------------------
  def data_sdgs(itemkind)
    @data = []
    if $scene.is_a?(Scene_Battle)
      get_data(0, false)
    elsif itemkind.is_a?(Numeric) or itemkind.nil?
      get_data(itemkind, false)
    elsif itemkind.is_a?(Array)
      for i in 0...itemkind.size
        get_data(itemkind[i], false)
      end
    end
    return @data.size
  end
  #--------------------------------------------------------------------------
  def get_data(itemkind, refresh = false)
    case itemkind
    when nil
      set_own_item_data
      set_own_weapon_data
      set_own_armor_data
    when 0  
      set_own_item_data
    when 1  
      set_own_weapon_data
    when 2  
      set_own_armor_data
    when 3
      set_own_armor_shield_data
    when 4 
      set_own_armor_helm_data
    when 5 
      set_own_armor_mail_data
    when 6 
      set_own_armor_accessory_data
    when 7
      set_own_item_noscope_data
    when 8
      set_own_item_battleonly_data
    when 9 
      set_own_item_menuonly_data
    when 10 
      set_own_item_unusable_data
    when 11
      set_own_item_commonevent_data
    when 12
      set_own_item_zeroprice_data
    when 13 
      set_own_item_parameterup_data
    when 14 
      set_own_item_recovers_data
    when 15
      set_own_item_elements_data
    when -3
      last_data = @data.dup
      @data.clear
      set_own_armor_shield_data
      @data = last_data - @data
    when -4
      last_data = @data.dup
      @data.clear
      set_own_armor_helm_data
      @data = last_data - @data
    when -5
      last_data = @data.dup
      @data.clear
      set_own_armor_mail_data
      @data = last_data - @data
    when -6
      last_data = @data.dup
      @data.clear
      set_own_armor_accessory_data
      @data = last_data - @data
    when -7 
      last_data = @data.dup
      @data.clear
      set_own_item_noscope_data
      @data = last_data - @data
    when -8 
      last_data = @data.dup
      @data.clear
      set_own_item_battleonly_data
      @data = last_data - @data
    when -9 
      last_data = @data.dup
      @data.clear
      set_own_item_menuonly_data
      @data = last_data - @data
    when -10
      last_data = @data.dup
      @data.clear
      set_own_item_unusable_data
      @data = last_data - @data
    when -11 
      last_data = @data.dup
      @data.clear
      set_own_item_commonevent_data
      @data = last_data - @data
    when -12 
      last_data = @data.dup
      @data.clear
      set_own_item_zeroprice_data
      @data = last_data - @data
    when -13 
      last_data = @data.dup
      @data.clear
      set_own_item_parameterup_data
      @data = last_data - @data
    when -14
      last_data = @data.dup
      @data.clear
      set_own_item_recovers_data
      @data = last_data - @data
    when -15
      last_data = @data.dup
      @data.clear
      set_own_item_elements_data
      @data = last_data - @data
    else
      if refresh
        xrxs_mp2_refresh
      else
        @data = []
      end
    end
    return
  end
  #--------------------------------------------------------------------------
  def set_own_item_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_weapon_data
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push($data_weapons[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        @data.push($data_armors[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_shield_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 0 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_helm_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 1 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_mail_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 2 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_accessory_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 3 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_noscope_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].scope == 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_battleonly_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 1 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_menuonly_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 2 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_unusable_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 3 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_commonevent_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].common_event_id > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_zeroprice_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].price == 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_parameterup_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].parameter_type > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_recovers_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if ($data_items[i].recover_hp_rate > 0 or
          $data_items[i].recover_hp > 0 or
          $data_items[i].recover_sp_rate > 0 or
          $data_items[i].recover_sp > 0 or
          $data_items[i].minus_state_set.size > 0) and 
          !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
 
  end
  #--------------------------------------------------------------------------
  def set_own_item_elements_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].element_set.size > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
end
 
#==============================================================================
# Window_Itemkind
#==============================================================================
class Window_Itemkind < Window_Selectable
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @commands = KIND_NAMES
    @item_max = KIND_NAMES.size
    @column_max = KIND_NAMES.size
    @disabled = []
    for i in 0...@item_max
      @disabled[i] = false
    end
    self.active = true
    self.index = 0
    refresh
  end
  #--------------------------------------------------------------------------
  def disable(index)
    @disabled[index] = true
    refresh
  end
  #--------------------------------------------------------------------------
  def disabled?(index)
    return @disabled[index]
  end
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...KIND_NAMES.size
      draw_item(i, (@disabled[i] ? disabled_color : normal_color))
    end
  end
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    x = 304 + (index - KIND_NAMES.size/2.0) * 600/KIND_NAMES.size
    rect = Rect.new(x, 0, 600/KIND_NAMES.size, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if index != -1
      return unless self.active
      x = 304 + (index - KIND_NAMES.size/2.0) * 600/KIND_NAMES.size
      self.cursor_rect.set(x, 0, 600/KIND_NAMES.size, 32)
      update_help
    end
  end
  #--------------------------------------------------------------------------
  def update_help
    return if @help_window.nil?
    @help_window.set_text(KIND_NAMES[self.index] + " - Selecione o item desejado.")
  end
end
 
#==============================================================================
# Scene_Item
#==============================================================================
class Scene_Item
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  alias xrxs_mp2_update update
  alias xrxs_mp2_update_item update_item
  #--------------------------------------------------------------------------
  def main
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    @kind_window = Window_Itemkind.new
    @item_window.help_window = @help_window
    @kind_window.help_window = @help_window
    for i in 0...KIND_NAMES.size
      @kind_window.disable(i) if @item_window.data_sdgs(KIND_KINDS[i]) == 0
    end
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    @kind_window.active = true
    @item_window.active = false
    @item_window.index = -1
    @now_itemkind = nil
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose     
    @kind_window.dispose
  end
  #--------------------------------------------------------------------------
  def update
    xrxs_mp2_update
    if @now_itemkind != @kind_window.index
      @item_window.set_itemkind_index(@kind_window.index)
      @now_itemkind = @kind_window.index
    end
    @kind_window.update
    if @kind_window.active
      update_kind
      return
    end
  end
  #--------------------------------------------------------------------------
  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @kind_window.active = true
      @item_window.active = false
      @item_window.index = -1
      Input.update
      return
    end
    xrxs_mp2_update_item
  end
  #--------------------------------------------------------------------------
  def update_kind
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(0)
      return
    end
    if Input.trigger?(Input::C)
      if @kind_window.disabled?(@kind_window.index)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @item_window.active = true
      @item_window.index = 0
      @kind_window.active = false
      return
    end
  end
end



ET j'ai ce script qui permet d'afficher les détails sur l'objet qui est sélectionné quand le curseur est dessus. La fenêtre s'affiche vers la droite, donc en principe la liste d'objets doit faire une colonne.

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
#==============================================================================
# ** Itens Detalhados
# Criado por arevulopapo (13.11.2006)
# Traduzido por ogrim_dooh (17.11.2006)
#==============================================================================
class Window_Selectable < Window_Base
 
  def details_window=(details_window)
    @details_window = details_window
    if self.active and @details_window != nil
      update_details
    end
  end
 
end
#==============================================================================
class Window_Details < Window_Base
  def initialize
    super(416, 64, 224, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  def set_details(item)
    if icon != @icon
      self.contents.clear
      self.contents.font.color = normal_color
      bitmap = RPG::Cache.icon(icon)
      self.contents.blt(96 - bitmap.width/2 ,96 - bitmap.height/2, bitmap, Rect.new(0,0,192,192))
      @icon = icon
    end
    self.visible = true
  end
  def set_price(price)
    if price != @price
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(0,192,192,32,"Prix  : ",0)
      self.contents.draw_text(0,192,192,32,price.to_s,2)
      @price = price
    end
    self.visible = true
  end
  def set_details(item)
    if item != nil
      self.contents.clear
      #ICONE
      bitmap = RPG::Cache.icon(item.icon_name)
      self.contents.blt(96 - bitmap.width/2 ,96 - bitmap.height/2, bitmap, Rect.new(0,0,192,192))
      #QUANTIDADE
      self.contents.font.color = normal_color
      self.contents.draw_text(0,192,192,32,"Quantité : ",0)
      case item
      when RPG::Item
        number = $game_party.item_number(item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(item.id)
      when RPG::Armor
        number = $game_party.armor_number(item.id)
      end
      self.contents.draw_text(0,192,192,32,number.to_s,2)
      #PREÇO
      self.contents.font.color = normal_color
      self.contents.draw_text(0,224,192,32,"Prix : ",0)
      self.contents.draw_text(0,224,192,32,item.price.to_s,2)
      #DETALHE
      y = 256
      case item
      when RPG::Item
        #ALVO
        case item.scope
        when 0
          scope = "-"
        when 1
          scope = "Ennemi"
        when 2
          scope = "Tous les ennemis"
        when 3
          scope = "Un Allié"
        when 4
          scope = "Tous les Alliés"
        when 5
          scope = "Un Allié (hp0)"
        when 6
          scope = "Tous les Alliés (hp0)"
        when 7
          scope = "Utilisateur"
        end
        if item.parameter_type == 0
          self.contents.draw_text(0,y,192,32,"Cible :",0)
          self.contents.draw_text(0,y,192,32,scope,2)
        else
          self.contents.draw_text(0,y,192,32,"Cible :",0)
          self.contents.draw_text(0,y,192,32,scope,2)
        end
        case item.parameter_type
        when 1
          parameter = "PVmax"
          parameter_color = Color.new(224,64,64)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 2
          parameter = "PMmax"
          parameter_color = Color.new(64,64,224)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 3
          parameter = "Force"
          parameter_color = Color.new(64,224,64)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 4
          parameter = "Défense"
          parameter_color = Color.new(224,64,224)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 5
          parameter = "Agilité"
          parameter_color = Color.new(160,160,160)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 6
          parameter = "Intelligence"
          parameter_color = Color.new(224,224,64)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        end
        self.contents.font.color = Color.new(224,64,64)
        self.contents.draw_text(0,y+32,192,32,"Récupère HP :",0)
        self.contents.font.color = Color.new(64,64,224)
        self.contents.draw_text(0,y+64,192,32,"Récupère SP :",0)
        self.contents.font.color = normal_color
        self.contents.draw_text(0,y+32,192,32,item.recover_hp.to_s,2)
        self.contents.draw_text(0,y+64,192,32,item.recover_sp.to_s,2)
      when RPG::Weapon
        self.contents.draw_text(0,y,192,32,"Attaque :",0)
        self.contents.draw_text(0,y,192,32,item.atk.to_s,2)
        self.contents.draw_text(0,y+32,192,32,"Défense Phy. :",0)
        self.contents.draw_text(0,y+32,192,32,item.pdef.to_s,2)
        self.contents.draw_text(0,y+64,192,32,"Défense Mag. :",0)
        self.contents.draw_text(0,y+64,192,32,item.mdef.to_s,2)
      when RPG::Armor
        case item.kind
        when 0
          kind = "Bouclier"
        when 1
          kind = "Casque"
        when 2
          kind = "Armure"
        when 3
          kind = "Accessoire"
        end
        self.contents.draw_text(0,y,192,32,"Tipo :",0)
        self.contents.draw_text(0,y,192,32,kind,2)
        self.contents.draw_text(0,y+32,192,32," Défense Phy.:",0)
        self.contents.draw_text(0,y+32,192,32,item.pdef.to_s,2)
        self.contents.draw_text(0,y+64,192,32," Défense Mag.:",0)
        self.contents.draw_text(0,y+64,192,32,item.mdef.to_s,2)
        self.contents.draw_text(0,y+96,192,32,"Fuite :",0)
        self.contents.draw_text(0,y+96,192,32,item.eva.to_s,2)
      end
    end
  end
  
end
#==============================================================================
class Window_Item2 < Window_Selectable
  def initialize
    super(0, 64, 416, 416)
    @column_max = 1
    refresh
    self.index = 0
  end
  def item
    return @data[self.index]
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
    unless $game_temp.in_battle
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0
          @data.push($data_weapons[i])
        end
      end
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0
          @data.push($data_armors[i])
        end
      end
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    self.contents.draw_text(x,y,376,32, item.name, 0)
  end
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
  
  def update_details
    @details_window.set_details(self.item)
  end
  
end
#==============================================================================
class Scene_Item
  def main
    @help_window = Window_Help.new
    @item_window = Window_Item2.new
    @details_window = Window_Details.new
    @item_window.help_window = @help_window
    @item_window.details_window = @details_window
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
    @details_window.dispose
  end
  def update
    @help_window.update
    @item_window.update
    @target_window.update
    @item_window.update_details
    if @item_window.active
      update_item
      return
    end
    if @target_window.active
      update_target
      return
    end
  end
  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(0)
      return
    end
    if Input.trigger?(Input::C)
      @item = @item_window.item
      unless @item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(@item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      if @item.scope >= 3
        @item_window.active = false
        @target_window.x = 304
        @target_window.visible = true
        @target_window.active = true
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      else
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $game_system.se_play(@item.menu_se)
          if @item.consumable
            $game_party.lose_item(@item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
  def update_target
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      unless $game_party.item_can_use?(@item.id)
        @item_window.refresh
      end
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.item_number(@item.id) == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if @target_window.index == -1
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      if @target_window.index >= 0
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
      end
      if used
        $game_system.se_play(@item.menu_se)
        if @item.consumable
          $game_party.lose_item(@item.id, 1)
          @item_window.draw_item(@item_window.index)
        end
        @target_window.refresh
        if $game_party.all_dead?
          $scene = Scene_Gameover.new
          return
        end
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $scene = Scene_Map.new
          return
        end
      end
      unless used
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
end



Je me sens sournoise aujourd'hui, hystérique, abominable, agressive, enfin bref...insupportable!!


Wanoklox - posté le 31/05/2013 à 16:10:51 (2211 messages postés)

❤ 0

Et ? Quels sont les problèmes que tu rencontres peut être ?


yuri - posté le 01/06/2013 à 05:05:56 (3801 messages postés)

❤ 0

Humeur Nutella

eh bien, si je mets les deux, un apparaît, l'autre n'apparait pas.
C'est à dire que si je mets le script pour le classement d'objets, je verrai la barre de classements apparaître au dessus des objets.
Mais je verrai pas la fenêtre des détails d'objets censée être à droite.

Donc peut-on combiner ces deux scripts en un seul pour que les deux fonctions de ce menu apparaissent svp?


EDIT: j'ai arrangé le script moi-même ce que je voulais où je voulais, en rajoutant des trucs..
Bref voilà le script modifié par moi:

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
#===============================================================================
# Script modifié par Yuri combinant celui de XRXS et arevulopapo + petits changements persos
# Script orignal de XRXS : Organizar Inventário (por XRXS)
# Pour tout commentaire, rendez vous sur le forum Oniromancie RPG Maker
#===============================================================================
# Este script permite que você organize o inventário, separando os
# itens por categorias.
# Para criar seu próprio estilo de organização você deve ir até o
# modulo XRXS_MP2_Fixed_Variable.
# Você define o nome de cada categoria em "KIND_NAMES", 
# e em "KIND_KINDS" você define o tipo de item que cada categoria mostra.
#===============================================================================
#==============================================================================
 
Font.default_name = "Harrington" 
 
class Window_Selectable < Window_Base
 
  def details_window=(details_window)
    @details_window = details_window
    if self.active and @details_window != nil
      update_details
    end
  end
  def update_details
    @details_window.set_details(self.item)
  end
 
end
#==============================================================================
class Window_Details < Window_Base
  def initialize
    super(416, 128, 226, 352)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  def set_details(item)
    if icon != @icon
      self.contents.clear
      self.contents.font.color = normal_color
      bitmap = RPG::Cache.icon(icon)
      self.contents.blt(96 - bitmap.width/2 ,96 - bitmap.height/2, bitmap, Rect.new(0,0,192,192))
      @icon = icon
    end
    self.visible = true
  end
  def set_price(price)
    if price != @price
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(0,172,192,32,"Prix  : ",0)
      self.contents.draw_text(0,172,192,32,price.to_s,2)
      @price = price
    end
    self.visible = true
  end
  def set_details(item)
    if item != nil
      self.contents.clear
      #ICONE
      bitmap = RPG::Cache.icon(item.icon_name)
      self.contents.blt(96 - bitmap.width/2 ,96 - bitmap.height/2, bitmap, Rect.new(0,0,192,192))
      #QUANTIDADE
      self.contents.font.color = normal_color
      self.contents.draw_text(0,172,192,32,"Quantité : ",0)
      case item
      when RPG::Item
        number = $game_party.item_number(item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(item.id)
      when RPG::Armor
        number = $game_party.armor_number(item.id)
      end
      self.contents.draw_text(0,172,192,32,number.to_s,2)
      #PREÇO
      self.contents.font.color = normal_color
      self.contents.draw_text(0,200,192,32,"Prix : ",0)
      self.contents.draw_text(0,200,192,32,item.price.to_s,2)
      #DETALHE
      y = 230
      case item
      when RPG::Item
        #ALVO
        case item.scope
        when 0
          scope = "-"
        when 1
          scope = "Ennemi"
        when 2
          scope = "Tous les ennemis"
        when 3
          scope = "Un Allié"
        when 4
          scope = "Tous les Alliés"
        when 5
          scope = "Un Allié (hp0)"
        when 6
          scope = "Tous les Alliés (hp0)"
        when 7
          scope = "Utilisateur"
        end
        if item.parameter_type == 0
          self.contents.draw_text(0,y,192,32,"Cible :",0)
          self.contents.draw_text(0,y,192,32,scope,2)
        else
          self.contents.draw_text(0,y,192,32,"Cible :",0)
          self.contents.draw_text(0,y,192,32,scope,2)
        end
        case item.parameter_type
        when 1
          parameter = "PVmax"
          parameter_color = Color.new(224,64,64)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 2
          parameter = "PMmax"
          parameter_color = Color.new(64,64,224)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 3
          parameter = "Force"
          parameter_color = Color.new(64,224,64)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 4
          parameter = "Défense"
          parameter_color = Color.new(224,64,224)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 5
          parameter = "Agilité"
          parameter_color = Color.new(160,160,160)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        when 6
          parameter = "Intelligence"
          parameter_color = Color.new(224,224,64)
          self.contents.font.color = parameter_color
          self.contents.draw_text(0,y+96,192,32,parameter + "+ :",0)
          self.contents.font.color = normal_color
          self.contents.draw_text(0,y+96,192,32,item.parameter_points.to_s,2)
        end
        self.contents.font.color = Color.new(224,64,64)
        self.contents.draw_text(0,y+32,192,32,"Récupère HP :",0)
        self.contents.font.color = Color.new(64,64,224)
        self.contents.draw_text(0,y+64,192,32,"Récupère SP :",0)
        self.contents.font.color = normal_color
        self.contents.draw_text(0,y+32,192,32,item.recover_hp.to_s,2)
        self.contents.draw_text(0,y+64,192,32,item.recover_sp.to_s,2)
      when RPG::Weapon
        self.contents.draw_text(0,y,192,32,"Attaque :",0)
        self.contents.draw_text(0,y,192,32,item.atk.to_s,2)
        self.contents.draw_text(0,y+32,192,32,"Défense Phy. :",0)
        self.contents.draw_text(0,y+32,192,32,item.pdef.to_s,2)
        self.contents.draw_text(0,y+64,192,32,"Défense Mag. :",0)
        self.contents.draw_text(0,y+64,192,32,item.mdef.to_s,2)
      when RPG::Armor
        case item.kind
        when 0
          kind = "Bouclier"
        when 1
          kind = "Casque"
        when 2
          kind = "Armure"
        when 3
          kind = "Accessoire"
        end
        self.contents.draw_text(0,y,192,32,"Type :",0)
        self.contents.draw_text(0,y,192,32,kind,2)
        self.contents.draw_text(0,y+32,192,32," Défense Phy.:",0)
        self.contents.draw_text(0,y+32,192,32,item.pdef.to_s,2)
        self.contents.draw_text(0,y+64,192,32," Défense Mag.:",0)
        self.contents.draw_text(0,y+64,192,32,item.mdef.to_s,2)
        self.contents.draw_text(0,y+96,192,32,"Fuite :",0)
        self.contents.draw_text(0,y+96,192,32,item.eva.to_s,2)
      end
    end
  end
  
end
 
#==============================================================================
# XRXS_MP2_Fixed_Variable
#==============================================================================
module XRXS_MP2_Fixed_Variable
  #Definição dos nomes dos comandos de menu.
  KIND_NAMES = ["Items", "Armes", "Boucliers ", "Casques","Armures", "Accessoires"]
  # Tipos de itens exibidos em cada função
  KIND_KINDS = [0, 1, 3, 4, 5, 6]
  #nil = todos os itens (inv
  #0 = Itens
  #1 = Armas
  #2 = Equipamentos de Defesa de todos os tipos
  #3 = Escudos
  #4 = Elmos
  #5 = Armaduras
  #6 = Acessórios
  #7 = Itens que não afetam nenhum alvo
  #8 = Itens que só podem ser usados em batalha
  #9 = Itens que só podem ser usados no menu
  #10= Itens que não podem ser usados
  #11= Itens que ao ser usados chamam eventos comuns
  #12= Itens de preço zero
  #13= Itens de aumento de atributo
  #14= Itens de cura
  #15= Itens com elemento
  
  # IMPORTANTE:
  # A ordem que você define em "KIND_KINDS" deve ser a mesma ordem
  # do tipo do item que vc definiu em "KIND_NAMES"
  # então se o 3º tipo você definiu como "Acessórios" por exemplo.
  # o 3º Valor em "KIND_KINDS" deve ser 6.
  
end
 
#==============================================================================
# Window_Item
#==============================================================================
class Window_Item < Window_Selectable
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  alias xrxs_mp2_initialize initialize
  alias xrxs_mp2_refresh refresh
  #--------------------------------------------------------------------------
  def initialize
    xrxs_mp2_initialize
    refresh
    self.index = 0
    if not $scene.is_a?(Scene_Battle)
      self.y += 64
      self.height -= 64
    end
    @itemkind = KIND_KINDS[0]
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    if @itemkind == nil
      xrxs_mp2_refresh
      return
    end
      if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @item_max = data_sdgs(@itemkind)
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_itemkind_index(itemkind_index)
    @itemkind = KIND_KINDS[itemkind_index]
    refresh
  end
  #--------------------------------------------------------------------------
  def data_sdgs(itemkind)
    @data = []
    if $scene.is_a?(Scene_Battle)
      get_data(0, false)
    elsif itemkind.is_a?(Numeric) or itemkind.nil?
      get_data(itemkind, false)
    elsif itemkind.is_a?(Array)
      for i in 0...itemkind.size
        get_data(itemkind[i], false)
      end
    end
    return @data.size
  end
  #--------------------------------------------------------------------------
  def get_data(itemkind, refresh = false)
    case itemkind
    when nil
      set_own_item_data
      set_own_weapon_data
      set_own_armor_data
    when 0  
      set_own_item_data
    when 1  
      set_own_weapon_data
    when 2  
      set_own_armor_data
    when 3
      set_own_armor_shield_data
    when 4 
      set_own_armor_helm_data
    when 5 
      set_own_armor_mail_data
    when 6 
      set_own_armor_accessory_data
    when 7
      set_own_item_noscope_data
    when 8
      set_own_item_battleonly_data
    when 9 
      set_own_item_menuonly_data
    when 10 
      set_own_item_unusable_data
    when 11
      set_own_item_commonevent_data
    when 12
      set_own_item_zeroprice_data
    when 13 
      set_own_item_parameterup_data
    when 14 
      set_own_item_recovers_data
    when 15
      set_own_item_elements_data
    when -3
      last_data = @data.dup
      @data.clear
      set_own_armor_shield_data
      @data = last_data - @data
    when -4
      last_data = @data.dup
      @data.clear
      set_own_armor_helm_data
      @data = last_data - @data
    when -5
      last_data = @data.dup
      @data.clear
      set_own_armor_mail_data
      @data = last_data - @data
    when -6
      last_data = @data.dup
      @data.clear
      set_own_armor_accessory_data
      @data = last_data - @data
    when -7 
      last_data = @data.dup
      @data.clear
      set_own_item_noscope_data
      @data = last_data - @data
    when -8 
      last_data = @data.dup
      @data.clear
      set_own_item_battleonly_data
      @data = last_data - @data
    when -9 
      last_data = @data.dup
      @data.clear
      set_own_item_menuonly_data
      @data = last_data - @data
    when -10
      last_data = @data.dup
      @data.clear
      set_own_item_unusable_data
      @data = last_data - @data
    when -11 
      last_data = @data.dup
      @data.clear
      set_own_item_commonevent_data
      @data = last_data - @data
    when -12 
      last_data = @data.dup
      @data.clear
      set_own_item_zeroprice_data
      @data = last_data - @data
    when -13 
      last_data = @data.dup
      @data.clear
      set_own_item_parameterup_data
      @data = last_data - @data
    when -14
      last_data = @data.dup
      @data.clear
      set_own_item_recovers_data
      @data = last_data - @data
    when -15
      last_data = @data.dup
      @data.clear
      set_own_item_elements_data
      @data = last_data - @data
    else
      if refresh
        xrxs_mp2_refresh
      else
        @data = []
      end
    end
    return
  end
  #--------------------------------------------------------------------------
  def set_own_item_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_weapon_data
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push($data_weapons[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        @data.push($data_armors[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_shield_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 0 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_helm_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 1 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_mail_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 2 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_accessory_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 3 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_noscope_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].scope == 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_battleonly_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 1 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_menuonly_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 2 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_unusable_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 3 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_commonevent_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].common_event_id > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_zeroprice_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].price == 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_parameterup_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].parameter_type > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_recovers_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if ($data_items[i].recover_hp_rate > 0 or
          $data_items[i].recover_hp > 0 or
          $data_items[i].recover_sp_rate > 0 or
          $data_items[i].recover_sp > 0 or
          $data_items[i].minus_state_set.size > 0) and 
          !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
 
  end
  #--------------------------------------------------------------------------
  def set_own_item_elements_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].element_set.size > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
end
 
#==============================================================================
# Window_Itemkind
#==============================================================================
class Window_Itemkind < Window_Selectable
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @commands = KIND_NAMES
    @item_max = KIND_NAMES.size
    @column_max = KIND_NAMES.size
    @disabled = []
    for i in 0...@item_max
      @disabled[i] = false
    end
    self.active = true
    self.index = 0
    refresh
  end
  #--------------------------------------------------------------------------
  def disable(index)
    @disabled[index] = true
    refresh
  end
  #--------------------------------------------------------------------------
  def disabled?(index)
    return @disabled[index]
  end
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...KIND_NAMES.size
      draw_item(i, (@disabled[i] ? disabled_color : normal_color))
    end
  end
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    x = 304 + (index - KIND_NAMES.size/2.0) * 600/KIND_NAMES.size
    rect = Rect.new(x, 0, 600/KIND_NAMES.size, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if index != -1
      return unless self.active
      x = 304 + (index - KIND_NAMES.size/2.0) * 600/KIND_NAMES.size
      self.cursor_rect.set(x, 0, 600/KIND_NAMES.size, 32)
      update_help
    end
  end
  #--------------------------------------------------------------------------
  def update_help
    return if @help_window.nil?
    @help_window.set_text(KIND_NAMES[self.index] + " - Selectionne l'objet désiré.")
  end
end
 
#==============================================================================
# ** Window_Target
#------------------------------------------------------------------------------
#  This window selects a use target for the actor on item and skill screens.
#==============================================================================
 
class Window_Target < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(202, 170, 288, 170)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Harrington"
    self.z += 10
    @item_max = $game_party.actors.size
    @column_max = 4
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.contents.clear
    for i in 0...$game_party.actors.size
      x = 10 + i * 60
      y = 0
      actor = $game_party.actors[i]
      draw_actor_name(actor, x, y)
      draw_actor_graphic(actor, x + 20, y + 80)
      draw_actor_level(actor, x, y + 66)
    end
      actor = $game_party.actors[self.index]
      x = 0
      y = 0
      draw_actor_hp(actor, x + 60, y + 86)
      draw_actor_sp(actor, x + 60, y + 106)
    # Cursor position -1 = all choices, -2 or lower = independent choice
    # (meaning the user's own choice)
    if @index <= -2
      self.cursor_rect.set(0, (@index + 10) * 60, 60, 96)
    elsif @index == -1
      self.cursor_rect.set(0, 0, 60, @item_max * 116 - 20)
    else
      self.cursor_rect.set(@index * 60, 0, 60, 96)
    end
  end
end
#==============================================================================
# Scene_Item
#==============================================================================
class Scene_Item
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  alias xrxs_mp2_update update
  alias xrxs_mp2_update_item update_item
  #--------------------------------------------------------------------------
  def main
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    @kind_window = Window_Itemkind.new
    @item_window.help_window = @help_window
    @kind_window.help_window = @help_window
    @details_window = Window_Details.new
    @item_window.details_window = @details_window
 
    for i in 0...KIND_NAMES.size
      @kind_window.disable(i) if @item_window.data_sdgs(KIND_KINDS[i]) == 0
    end
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    @kind_window.active = true
    @details_window.visible = false
    @item_window.active = false
    @item_window.index = -1
    @now_itemkind = nil
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @item_window.dispose
    @details_window.dispose
    @target_window.dispose     
    @kind_window.dispose
  end
  #--------------------------------------------------------------------------
  def update
    xrxs_mp2_update
    if @now_itemkind != @kind_window.index
      @item_window.set_itemkind_index(@kind_window.index)
      @now_itemkind = @kind_window.index
    end
    @item_window.update_details
    if @item_window.active
      update_item
      return
    end
    @kind_window.update
    if @kind_window.active
      update_kind
    end
  end
 
  #--------------------------------------------------------------------------
  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @kind_window.active = true
      @item_window.active = false
      @item_window.index = -1
      @details_window.visible = false
      Input.update
      return
    end
    xrxs_mp2_update_item
  end
  #--------------------------------------------------------------------------
  def update_kind
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(0)
      return
    end
    if Input.trigger?(Input::C)
      @details_window.visible = true
      if @kind_window.disabled?(@kind_window.index)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @item_window.active = true
      @item_window.index = 0
      @kind_window.active = false
      return
    end
  end
end



Je me sens sournoise aujourd'hui, hystérique, abominable, agressive, enfin bref...insupportable!!


GeckoEssence - posté le 02/06/2013 à 10:34:23 (10274 messages postés)

❤ 0

Eeeeet ? Tu l'as testé ? Ca a marché ? Y a eu des bugs ?


arttroy - posté le 02/06/2013 à 18:44:21 (2394 messages postés)

❤ 0

Just working

J'avoue que tu es super vague dans ta demande... As tu un message d'erreur ? Si oui lequel (exactement, au pire tu peux faire un screen du message de RM) ?

Sinon si ça fonctionne tu peux toujours le proposer pour la section script d'Oniro.

Anti-inconstructivité / Pétition pour que le mot making soit inscrit dans le dictionnaire ?


yuri - posté le 02/06/2013 à 20:46:31 (3801 messages postés)

❤ 0

Humeur Nutella

Je l'ai créé/modifié moi- même, tout fonctionne parfaitement, si t'as des bugs dis-moi je peux voir ce que je peux faire.

Sinon, le problème, c'était qu'il y avait beaucoup de bugs qui s'affichaient quand on voulait lancer le menu.
En fait, séparément ça allait, mais grouper les deux ensemble..

Tu vois, c'est deux scripts pour le menu "objets".
Le script 1 mettant des fenêtres et des commandes différentes du script 2, ils ne pouvaient pas fonctionner ensemble.
Le script 2 mettait une fenêtre de détails d'objets sur la droite.
Mais le scirpt 1 classait les objets.
La liste des classes s'affichait en haut en bas de la fenêtre d'aide.
Sauf que du coup, la fenêtre se mêlait avec la fenêtre de détails.
Pour finir, pas possible de sélectionner quoi que ce soit, le curseur était comme bloqué car le jeu ne savait pas si'il fallait commencer par sélectionner une classe ou sélectionner directement l'objet.

Bref, des magouilles dans window_selectable, modifications dans les menus de base (item, entre autre), des modifications sur l'affichage des fenêtres, un ajout pour que l'on voit le charset des héros en sélectionnant une potion, par exemple, et le tour est joué...

Je rajouterai des screenshots.

Je me sens sournoise aujourd'hui, hystérique, abominable, agressive, enfin bref...insupportable!!


arttroy - posté le 03/06/2013 à 12:25:42 (2394 messages postés)

❤ 0

Just working

B..... Bien joué... Ca va tu te débrouille en script, Faut le savoir qu'il fallait chercher dans le Window_Selectable et tout. Je veux bien voir ce que ça donne. Golem GG en tous cas C'est bien si tout le monde règle ses problèmes tout seul comme toi on aura bientôt une communauté de maker d'élite...

Anti-inconstructivité / Pétition pour que le mot making soit inscrit dans le dictionnaire ?

Index du forum > Entraide > [RPG MAKER XP] Mélange de scripts

repondre up

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers