1

Donnerstag, 8. Februar 2018, 17:10

Hintergrundbild im Menü anzeigen

Hey Leute, habe kürzlich dieses kleine aber feine Script entdeckt:

Spoiler

Quellcode

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
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
#==============================================================================#
#                              Title: Quest Log                                #
#                                Version: 1.2                                  #
#                                 Author: DRS                                  #
#                            Date: August 31, 2014                             #
#==============================================================================#
 
#==============================================================================
#                               Instructions
#------------------------------------------------------------------------------
#        Using the Game_System class you can add, remove, or edit quests
#
# - $game_system::add_active_quest(objective, description, rewards=nil)
#   ex. $game_system::add_quest("Slay Dragon", "The town needs your help.",
#        "Experience: +300, Gold: + 200, Weapon: Dragon Fang")
#
# - $game_system::add_inactive_quest(objective, description, rewards=nil)
#   ex. $game_system::add_quest("Slay Dragon", "The town needs your help."),
#        "Experience: +300, Gold: + 200, Weapon: Dragon Fang")
#
# - $game_system::edit_quest(objective, new_objective=nil, new_description=nil, new_reward=nil)
#   ex. $game_system::edit_quest("Slay Dragon", "2 Dragons", "Now there's two.",
#        Experience: +600, Gold: + 400, Weapon: Dragon Fang x2")
#
# - $game_system::remove_quest(objective, failure=false)
#   ex. $game_system::remove_quest("2 Dragons")       = SUCCESS
#   ex. $game_system::remove_quest("2 Dragons", true) = FAILURE 
#==============================================================================
 
#==============================================================================
#                              Editable Region
#==============================================================================
# ** DRS_QLOG
#------------------------------------------------------------------------------
#  This is a custom module used to store constants.
#==============================================================================
module DRS_QLOG
  QLOG_COMMAND_NAME     = "Aufgaben"     # Name that appears in the menu
  QLOG_ANIMATION_SPEED  = 20              # Speed of transitional screen animations
 
  QLOG_IMAGE_BOOL       = true            # Turn background image off/on
  QLOG_IMAGE            = "qlog_bg_v1_2"  # Background image from Picture folder
  QLOG_IMAGE_X          = 0               # Background image x
  QLOG_IMAGE_Y          = 0               # Background image y
  QLOG_IMAGE_Z          = 25              # Background image z
  QLOG_IMAGE_OPACITY    = 255             # Background image opacity
  QLOG_IMAGE_VISIBLE    = true            # Background image visible
 
  QLOG_OL_BOOL          = false           # Turn overlay off/on
  QLOG_OL_IMAGE         = "qlog_overlay"  # Overlay image from Picture folder
  QLOG_OL_IMAGE_X       = 0               # Overlay image x
  QLOG_OL_IMAGE_Y       = 0               # Overlay image y
  QLOG_OL_IMAGE_Z       = 50              # Overlay image z
  QLOG_OL_IMAGE_OPACITY = 255             # Overlay image opacity
  QLOG_OL_IMAGE_VISIBLE = true            # Overlay image visible
end
#==============================================================================
 
#==============================================================================
# ** DRS_Quest
#------------------------------------------------------------------------------
#  This is a custom class used for the Quest_Lost.
#==============================================================================
class DRS_Quest
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
  attr_accessor  :objective
  attr_accessor  :description
  attr_accessor  :rewards
  attr_accessor  :failure
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------  
  def initialize(objective, description, rewards, failure=false)
    @objective   = objective
    @description = description
    @rewards     = rewards
    @failure     = failure
  end
#--------------------------------------------------------------------------
# * Checking Method
#--------------------------------------------------------------------------
  def size()
    return "DRS"
  end
end
 
#==============================================================================
# ** Quest_Log
#------------------------------------------------------------------------------
#  This is a custom scene that displays current quests in the menu.
#==============================================================================
class Quest_Log < Scene_Base
  include DRS_QLOG
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
  def start
    super()
    if QLOG_IMAGE_BOOL
      # Background image
      @qlog_bg         = Sprite.new()
      @qlog_bg.bitmap  = Cache.picture(QLOG_IMAGE)
      @qlog_bg.x       = QLOG_IMAGE_X
      @qlog_bg.y       = QLOG_IMAGE_Y
      @qlog_bg.z       = QLOG_IMAGE_Z
      @qlog_bg.zoom_x  = Graphics.width.to_f / @qlog_bg.bitmap.width
      @qlog_bg.zoom_y  = Graphics.height.to_f / @qlog_bg.bitmap.height
      @qlog_bg.opacity = QLOG_IMAGE_OPACITY
      @qlog_bg.visible = QLOG_IMAGE_VISIBLE
    end
 
    if QLOG_OL_BOOL
      # Background overlay
      @qlog_ol         = Sprite.new()
      @qlog_ol.bitmap  = Cache.picture(QLOG_OL_IMAGE)
      @qlog_ol.x       = QLOG_OL_IMAGE_X
      @qlog_ol.y       = QLOG_OL_IMAGE_Y
      @qlog_ol.z       = QLOG_OL_IMAGE_Z
      @qlog_ol.zoom_x  = Graphics.width.to_f / @qlog_ol.bitmap.width
      @qlog_ol.zoom_y  = Graphics.height.to_f / @qlog_ol.bitmap.height
      @qlog_ol.opacity = QLOG_OL_IMAGE_OPACITY
      @qlog_ol.visible = QLOG_OL_IMAGE_VISIBLE
    end
 
    # Quests, objectives, and description windows
    @qlog_questlists_window    = DRS_Quest_Lists.new()
    @qlog_quests_window        = DRS_Quests_Window.new()
    @qlog_objectives_window    = DRS_Objectives_Window.new()
    @qlog_description_window   = DRS_Description_Window.new()
    @qlog_info_window          = DRS_Info_Window.new()
    @qlog_quest_options_window = DRS_Options_Window.new()
 
    # Initialize windows
    set_questlists_handlers()
    @qlog_questlists_window.activate
    @qlog_quests_window.deactivate
  end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
  def post_start
    super()
    while @qlog_questlists_window.x > 0
      @qlog_quests_window.drs_clear()
      @qlog_questlists_window.x -= QLOG_ANIMATION_SPEED
      @qlog_quests_window.x += QLOG_ANIMATION_SPEED
      Graphics.update()
    end
    @qlog_questlists_window.x = 0 if @qlog_questlists_window.x < 0
    @qlog_quests_window.x = 0 if @qlog_quests_window.x > 0
  end
#--------------------------------------------------------------------------
# * Set QuestLists Handlers
#--------------------------------------------------------------------------
    def set_questlists_handlers
      @qlog_questlists_window.set_handler(:active,    method(:drs_deactivate))
      @qlog_questlists_window.set_handler(:inactive,  method(:drs_deactivate))
      @qlog_questlists_window.set_handler(:completed, method(:drs_deactivate))
    end
#--------------------------------------------------------------------------
# * Set Quests Handlers
#--------------------------------------------------------------------------
    def set_quests_handlers
      if $game_system.current_arraylist == 0
        $game_system.active_quests.each do |quest| 
          @qlog_quests_window.set_handler(quest.objective.to_sym, method(:drs_options_menu))
        end
      elsif $game_system.current_arraylist == 1
        $game_system.inactive_quests.each do |quest| 
          @qlog_quests_window.set_handler(quest.objective.to_sym, method(:drs_options_menu))
        end
      end
    end
#--------------------------------------------------------------------------
# * Set Options Handlers
#--------------------------------------------------------------------------
    def set_options_handlers
      @qlog_quest_options_window.set_handler(:select, method(:drs_select))
      @qlog_quest_options_window.set_handler(:switch, method(:drs_switch))
      @qlog_quest_options_window.set_handler(:cancel, method(:drs_cancel))
    end
#--------------------------------------------------------------------------
# * Options Menu
#--------------------------------------------------------------------------
  def drs_options_menu
    @qlog_quest_options_window.index = 0
    @qlog_quest_options_window.y = Graphics.height*0.5-50
    @qlog_quest_options_window.activate()
    @qlog_quests_window.deactivate()
    set_options_handlers()
  end
#--------------------------------------------------------------------------
# * Select Option
#--------------------------------------------------------------------------
  def drs_select
    if $game_system.current_arraylist == 0
      $game_system.main_quest = $game_system.active_quests[$game_system.current_element]
    elsif $game_system.current_arraylist == 1
      $game_system.main_quest = $game_system.inactive_quests[$game_system.current_element]
    end
    @qlog_quest_options_window.deactivate
    @qlog_quests_window.activate
    @qlog_quest_options_window.y = 600
  end
#--------------------------------------------------------------------------
# * Switch Option
#--------------------------------------------------------------------------
  def drs_switch
    cur_element = $game_system.current_element
    if $game_system.current_arraylist == 0
      $game_system.inactive_quests.unshift($game_system.active_quests[cur_element])
      $game_system.active_quests.delete_at(cur_element)
      @qlog_quests_window.index -= 1
      @qlog_quests_window.index = 0 if @qlog_quests_window.index < 0
    elsif $game_system.current_arraylist == 1
      $game_system.active_quests.unshift($game_system.inactive_quests[cur_element])
      $game_system.inactive_quests.delete_at(cur_element)
      @qlog_quests_window.index -= 1
      @qlog_quests_window.index = 0 if @qlog_quests_window.index < 0
    end
    @qlog_quest_options_window.deactivate
    @qlog_quests_window.activate
    @qlog_quest_options_window.y = 600
  end
#--------------------------------------------------------------------------
# * Cancel Option
#--------------------------------------------------------------------------
  def drs_cancel
    @qlog_quest_options_window.deactivate()
    @qlog_quests_window.activate()
    @qlog_quest_options_window.y = 600
  end
#--------------------------------------------------------------------------
# * Deactiveate Questlist Array
#--------------------------------------------------------------------------
  def drs_deactivate
    @qlog_questlists_window.drs_update_arraylist()
    @qlog_questlists_window.deactivate()
    @qlog_quests_window.activate()
    drs_deactivate_animation()
    $game_system.display_quests = true
  end
#--------------------------------------------------------------------------
# * Deactivate Questlist Animation
#--------------------------------------------------------------------------
  def drs_deactivate_animation
    while @qlog_quests_window.width > (Graphics.width*0.5+4)
      @qlog_quests_window.drs_clear()
      @qlog_objectives_window.drs_clear()
      @qlog_description_window.drs_clear()
      @qlog_info_window.drs_clear()
      @qlog_quests_window.width  -= 20
      @qlog_objectives_window.x  -= 20
      @qlog_description_window.x -= 20
      @qlog_info_window.x        -= 20
      Graphics.update()
    end
    @qlog_quests_window.width  = Graphics.width*0.5+4 if @qlog_quests_window.width  < Graphics.width*0.5+4
    @qlog_objectives_window.x  = Graphics.width*0.5-4 if @qlog_objectives_window.x  < Graphics.width*0.5-4
    @qlog_description_window.x = Graphics.width*0.5-4 if @qlog_description_window.x < Graphics.width*0.5-4
    @qlog_info_window.x        = Graphics.width*0.5-4 if @qlog_info_window.x        < Graphics.width*0.5-4
 
    set_quests_handlers()
  end
#--------------------------------------------------------------------------
# * Activate Quest Array
#--------------------------------------------------------------------------
  def drs_activate
    @qlog_questlists_window.activate()
    @qlog_quests_window.deactivate()
    drs_activate_animation()
    @qlog_quests_window.index = 0
    $game_system.display_quests = false
  end
#--------------------------------------------------------------------------
# * Activate Quest Animation 
#--------------------------------------------------------------------------
  def drs_activate_animation()
    while @qlog_quests_window.width < Graphics.width
      @qlog_quests_window.drs_clear()
      @qlog_objectives_window.drs_clear()
      @qlog_description_window.drs_clear()
      @qlog_info_window.drs_clear()
      @qlog_quests_window.width  += 20
      @qlog_objectives_window.x  += 20
      @qlog_description_window.x += 20
      @qlog_info_window.x        += 20
      Graphics.update()
    end
    @qlog_quests_window.width  = Graphics.width if @qlog_quests_window.width  > Graphics.width
    @qlog_objectives_window.x  = Graphics.width if @qlog_objectives_window.x  < Graphics.width
    @qlog_description_window.x = Graphics.width if @qlog_description_window.x < Graphics.width
    @qlog_info_window.x        = Graphics.width if @qlog_info_window.x        < Graphics.width
  end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
  def update
    # Exits scene if escape is pressed
    if Input.trigger?(:B) && @qlog_questlists_window.active
      RPG::SE.new("Cancel2", 80, 100).play
      return_scene() 
    end
 
    # Backs out of current quest list
    if Input.trigger?(:B) && @qlog_questlists_window.active == false
      drs_activate
    end
 
    # Call to original method
    super()
  end  
#--------------------------------------------------------------------------
# * Pre-Termination Processing
#--------------------------------------------------------------------------
  def pre_terminate
    # Terminate Animation
    while @qlog_quests_window.y < Graphics.height
      @qlog_quests_window.drs_clear()
      @qlog_questlists_window.y -= QLOG_ANIMATION_SPEED
      @qlog_quests_window.y     += QLOG_ANIMATION_SPEED
      Graphics.update
    end
    @qlog_questlists_window.y = 0
    @qlog_quests_window.y = 0
 
    # Dispose background and overlay images
    if QLOG_IMAGE_BOOL
      @qlog_bg.bitmap.dispose()
      @qlog_bg.dispose()
    end
    if QLOG_OL_BOOL
      @qlog_ol.bitmap.dispose()
      @qlog_ol.dispose()
    end
  end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
  def terminate
    # Dispose of Quest_Log background, overlay, and windows
    @qlog_questlists_window.dispose    unless @qlog_questlists_window.disposed?
    @qlog_quests_window.dispose        unless @qlog_quests_window.disposed?
    @qlog_objectives_window.dispose    unless @qlog_objectives_window.disposed?
    @qlog_description_window.dispose   unless @qlog_description_window.disposed?
    @qlog_info_window.dispose          unless @qlog_info_window.disposed?
    @qlog_quest_options_window.dispose unless @qlog_quest_options_window.disposed?
 
    # Call to original method
    super()
  end
end
 
#==============================================================================
# ** DRS_Quest_Lists
#------------------------------------------------------------------------------
#  Cycles through active, inactive, and completed quests
#==============================================================================
class DRS_Quest_Lists < Window_HorzCommand
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
  def initialize
    super(Graphics.width, 0) # Call to original method
    @within_quest = false
  end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
  def update
    super
    drs_update_arraylist()
  end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
  def window_width
    return Graphics.width
  end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
  def window_height
    return 48
  end
#--------------------------------------------------------------------------
# * Get Digit Count
#--------------------------------------------------------------------------
  def col_max
    return 3
  end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
  def make_command_list
    add_command("Hauptquest",    :active)
    add_command("Nebenquest",  :inactive)
    add_command("Abgeschlossen", :completed)
  end
#--------------------------------------------------------------------------
# * Update Current Arraylist
#--------------------------------------------------------------------------
  def drs_update_arraylist
    $game_system.current_arraylist = @index
  end
end
 
#==============================================================================
# ** DRS_Quests_Window
#------------------------------------------------------------------------------
#  Displays all quests in current quest list.
#==============================================================================
class DRS_Quests_Window < Window_Command
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
  def initialize
    super(Graphics.width*-1, 42) # Call to original method
  end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
  def window_width
    Graphics.width
  end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
  def window_height
    Graphics.height-42
  end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
  def make_command_list
    @list = []
    if $game_system.current_arraylist == 0 && $game_system.active_quests != []
      $game_system.active_quests.each {|quest| add_command(quest.objective, quest.objective.to_sym)}
    elsif $game_system.current_arraylist == 1 && $game_system.inactive_quests != []
      $game_system.inactive_quests.each {|quest| add_command(quest.objective, quest.objective.to_sym)}
    elsif $game_system.current_arraylist == 2 && $game_system.completed_quests != []
      $game_system.completed_quests.each {|quest| add_command(quest.objective, quest.objective.to_sym)}
    else
      @list = []
    end
  end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
  def update
    super                                 # Call to original method
    contents.clear()                      # Clear previous data
    $game_system.current_element = @index # Update quest objective and description
    make_command_list                     # Call make command list
    draw_quests() 
  end
#--------------------------------------------------------------------------
# * Draw Quests List
#--------------------------------------------------------------------------
  def draw_quests()
    for i in 0...@list.size()
      draw_item(i) if $game_system.display_quests
    end
  end
#--------------------------------------------------------------------------
# * Clear Screens
#--------------------------------------------------------------------------
  def drs_clear()
    contents.clear()
  end
end
 
#==============================================================================
# ** DRS_Objectives_Window
#------------------------------------------------------------------------------
#  This message window is used to display a list of current quests.
#==============================================================================
class DRS_Objectives_Window < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
  def initialize
    #Call to original method
    super(Graphics.width, 42, Graphics.width*0.5+4, 48)
  end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
  def update
    super
    contents.clear
    draw_objective() if $game_system.display_quests
  end
#--------------------------------------------------------------------------
# * Draw Quest Objective
#--------------------------------------------------------------------------
  def draw_objective()
    text = ""
 
    if $game_system.current_arraylist == 0 && $game_system.active_quests != []
      text = $game_system.active_quests[$game_system.current_element].objective
    elsif $game_system.current_arraylist == 1 && $game_system.inactive_quests != []
      text = $game_system.inactive_quests[$game_system.current_element].objective
    elsif $game_system.current_arraylist == 2 && $game_system.completed_quests != []
      text = $game_system.completed_quests[$game_system.current_element].objective
    end
 
    if text != ""
      center_text = (self.width/2.15) - (self.text_size(text).width/2)
      draw_text_ex(center_text,0,text)
    end
  end
#--------------------------------------------------------------------------
# * Clear Screens
#--------------------------------------------------------------------------
  def drs_clear()
    contents.clear()
  end
end
 
#==============================================================================
# ** DRS_Description_Window
#------------------------------------------------------------------------------
#  This message window is used to display quest description.
#==============================================================================
class DRS_Description_Window < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
  def initialize
    #Call to original method
    super(Graphics.width, 82, Graphics.width*0.5+4, Graphics.height-48)
  end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
  def update
    super
    contents.clear
    draw_description() if $game_system.display_quests
  end
#--------------------------------------------------------------------------
# * Draw Quest Description
#--------------------------------------------------------------------------
  def draw_description()
    text = ""
 
    if $game_system.current_arraylist == 0 && $game_system.active_quests != []
      text = $game_system.active_quests[$game_system.current_element].description
    elsif $game_system.current_arraylist == 1 && $game_system.inactive_quests != []
      text = $game_system.inactive_quests[$game_system.current_element].description
    elsif $game_system.current_arraylist == 2 && $game_system.completed_quests != []
      text = $game_system.completed_quests[$game_system.current_element].description
    end
 
    if text != ""
      text = wordwrapper(text)
      draw_text_ex(20,0,text)
    end
  end
#--------------------------------------------------------------------------
# * Wrap Window Text
#--------------------------------------------------------------------------
  def wordwrapper(text)
    if text != nil
      temp_text        = ""        # Temporary text var
      current_text_pos = 10        # Current text position
      average = 0
      average_index = 0
 
      for i in 0...text.size
        # Update text position
        temp_text += text[i]
        text_size_width = text_size(text[i]).width
        current_text_pos += text_size_width
        average += text_size_width
        average_index += 1
 
        # Check if text has reached end of the screen
        if current_text_pos > self.width - 50
          # Reverse through string and check for a " "
          index = i
          while index > 0
            if text[index] == " "
              temp_text[index] = "\n"
              current_text_pos = 10
              break
            else
              index -= 1
            end # if
          end # while
        end # if
      end # for
 
      text = temp_text
 
    end # if  
    return text
  end # def
#--------------------------------------------------------------------------
# * Clear Screens
#--------------------------------------------------------------------------
  def drs_clear()
    contents.clear()
  end
end
 
#==============================================================================
# ** DRS_Info_Window
#------------------------------------------------------------------------------
#  This message window is used to display quest description.
#==============================================================================
class DRS_Info_Window < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
  def initialize
    #Call to original method
    super(Graphics.width, Graphics.height-48, Graphics.width*0.5+4, 48)
    @frame_index = 0
    @frame_time  = 0
    @frame_end   = 60
  end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
  def update
    super
    contents.clear
    draw_info() if $game_system.display_quests
  end
#--------------------------------------------------------------------------
# * Draw Quest Description
#--------------------------------------------------------------------------
  def draw_info()
    # Check if list is empty
    temp_bool = true
    temp_bool = false if $game_system.active_quests    == [] && $game_system.current_arraylist == 0
    temp_bool = false if $game_system.inactive_quests  == [] && $game_system.current_arraylist == 1
    temp_bool = false if $game_system.completed_quests == [] && $game_system.current_arraylist == 2
 
    if temp_bool
      # Collect rewards data
      temp_rewards = $game_system.active_quests[$game_system.current_element]    if $game_system.current_arraylist == 0  
      temp_rewards = $game_system.inactive_quests[$game_system.current_element]  if $game_system.current_arraylist == 1
      temp_rewards = $game_system.completed_quests[$game_system.current_element] if $game_system.current_arraylist == 2
 
      # Utilize frame index
      @frame_time += 1
      if @frame_time > @frame_end
        @frame_time   = 0
        @frame_index += 1
        @frame_index = 0 if @frame_index >= temp_rewards.rewards.size().to_i()
      end
 
      # Declare text
      text = temp_rewards.rewards[@frame_index]
 
      # Draw text
      center_text = (self.width/2.15) - (self.text_size(text).width/2)
      draw_text_ex(center_text,0,text)
    end
  end
#--------------------------------------------------------------------------
# * Clear Screens
#--------------------------------------------------------------------------
  def drs_clear()
    contents.clear()
  end
end
 
#==============================================================================
# ** DRS_Options_Window
#------------------------------------------------------------------------------
#  Displays all quests in current quest list.
#==============================================================================
class DRS_Options_Window < Window_Command
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
  def initialize
    super((Graphics.width*0.5)-70, 600) # Call to original method
  end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
  def window_width
    140
  end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
  def window_height
    100
  end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
  def item_max
    3
  end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
  def make_command_list
    add_command("  Quest beginnen  ", :select)
    add_command(" Quest verschieben ", :switch)
    add_command("     zurück       ", :cancel)
  end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
  def update
    super()          # Call to original method
    contents.clear() # Clear previous data   # Call make command list
    draw_options()   # Draw ques
  end
#--------------------------------------------------------------------------
# * Draw Quests List
#--------------------------------------------------------------------------
  def draw_options()
    for i in 0...@list.size()
      draw_item(i)
    end
  end
#--------------------------------------------------------------------------
# * Clear Screens
#--------------------------------------------------------------------------
  def drs_clear()
    contents.clear()
  end
end
 
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles system data. It saves the disable state of saving and 
#  menus. Instances of this class are referenced by $game_system.
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
  attr_accessor :active_quests 
  attr_accessor :inactive_quests
  attr_accessor :completed_quests
  attr_accessor :current_arraylist
  attr_accessor :current_element
  attr_accessor :display_quests
  attr_accessor :display_info
  attr_accessor :main_quest
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
  alias drs_questlog_gamesystem_initialize initialize
#--------------------------------------------------------------------------
  def initialize
    # Initializing instance variables
    @active_quests     = []
    @inactive_quests   = []
    @completed_quests  = []
    @current_arraylist = 0
    @current_element   = 0
    @display_quests    = false
    @display_info      = false
    @main_quest        = nil
 
    # Call original method
    drs_questlog_gamesystem_initialize()
  end
#--------------------------------------------------------------------------
# * Add Active Quest
#--------------------------------------------------------------------------
  def add_active_quest(objective, description, reward=nil)
    @active_quests.unshift(DRS_Quest.new(objective, description, drs_decypher(reward)))
  end
#--------------------------------------------------------------------------
# * Add Inactive Quest
#--------------------------------------------------------------------------
  def add_inactive_quest(objective, description, reward=nil)
    @inactive_quests.unshift(DRS_Quest.new(objective, description, drs_decypher(reward)))
  end
#--------------------------------------------------------------------------
# * Edit Quest
#--------------------------------------------------------------------------
  def edit_quest(objective, new_objective=nil, new_description=nil, new_reward=nil)
    # Check active quests
    @active_quests.each do |quest|
      if quest.objective == objective
        quest.objective   = new_objective   if new_objective   != nil
        quest.description = new_description if new_description != nil
        quest.rewards     = drs_decypher(new_reward)
        break
      end
    end
    # Check inactive quests
    @inactive_quests.each do |quest|
      if quest.objective == objective
        quest.objective   = new_objective   if new_objective   != nil
        quest.description = new_description if new_description != nil
        quest.rewards     = drs_decypher(new_reward)
        break
      end 
    end
  end    
#--------------------------------------------------------------------------
# * Remove A Quest
#--------------------------------------------------------------------------
  def remove_quest(objective, failure=false)
    # Check active quests
    for i in 0...@active_quests.size
      if @active_quests[i].objective == objective
        @completed_quests.unshift(@active_quests[i])
        @completed_quests[0].failure = failure
        if failure
          @completed_quests[0].description = "FAILURE: " + @completed_quests[0].description
        else
          @completed_quests[0].description = "SUCCESS: " + @completed_quests[0].description
        end
        @active_quests.delete_at(i)
        break
      end
    end
    # Check inactive quests
    for i in 0...@inactive_quests.size
      if @inactive_quests[i].objective == objective
        @completed_quests.unshift(@inactive_quests[i])
        @completed_quests[0].failure = failure
        if failure == false
          @completed_quests[0].description = "FAILURE: " + @completed_quests[0].description
        else
          @completed_quests[0].description = "SUCCESS: " + @completed_quests[0].description
        end
        @inactive_quests.delete_at(i)
        break
      end
    end
  end
#--------------------------------------------------------------------------
# * Decypher Info
#--------------------------------------------------------------------------
  def drs_decypher(string)
    # Temporary variables
    temp_array = []
    temp_word  = ""
 
    # Returns empty arraylist if 
    return ["No Reward!"] if string == nil
 
    # Decypher array_list
    for i in 0...string.length()
      # Add current letter to temp_word
      temp_word += string[i] if string[i] != "," && string[i] != "\n"
 
      # Add temp_word to temp_array
      if string[i] == "," && temp_word != ""
        temp_array.push(temp_word)
        temp_word = ""
        next
      end
 
      # Add temp_word to temp_array
      if i >= string.length() - 1 && temp_word != ""
        temp_array.push(temp_word)
        temp_word = ""
      end
    end
    return temp_array
  end
end
 
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
#  This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
  include DRS_QLOG
#--------------------------------------------------------------------------
# * Add Quest Log Command to Menu
#--------------------------------------------------------------------------
  alias drs_questlog_windowmenucommand_addoriginalcommands add_original_commands
#--------------------------------------------------------------------------
  def add_original_commands
    drs_questlog_windowmenucommand_addoriginalcommands  # Call original method
    add_command(QLOG_COMMAND_NAME,   :questlog,   true) # Menu 'Quest Log' command 
  end
end
 
#==============================================================================
# ** Scene_MenuBase
#------------------------------------------------------------------------------
#  This class performs basic processing related to the menu screen.
#==============================================================================
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
  alias drs_questlog_scenemenu_createcommandwindow create_command_window
#--------------------------------------------------------------------------
  def create_command_window
    drs_questlog_scenemenu_createcommandwindow()
    @command_window.set_handler(:questlog,    method(:questlog))
  end
#--------------------------------------------------------------------------
# * Create Quest_Log Scene
#--------------------------------------------------------------------------
  def questlog
    SceneManager.call(Quest_Log)
  end
end
zum Lesen den Text mit der Maus markieren


Dieses fügt mir ein Questbuch hinzu in dem man gleichzeitig ein Bild im Hintergrund einbauen kann.
Nun wäre meine Frage ob oder bzw. wie man auch ein Bild fürs Inventar oder die Formation in den Hintergrund setzen kann?!
Danke schon mal für die Hilfe im voraus.

2

Donnerstag, 8. Februar 2018, 17:29

Klar kann man das tun. In welchen Menüs brauchst Du es denn? Hier habe ich ein paar Miniscripte. Jedes fügt für eine andere Scene ein frei wählbares Picture im Hintergrund ein. Füg einfach die Miniscripte ein, die Du brauchst.
Spoiler

Ruby Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#==============================================================================
#  Füge im Inventar einen anderen Hintergrund ein.
#  Die Grafik muss im Spielordner unter /Graphics/Pictures/ liegen, der genaue
#  Dateiname wird in Zeile 12 angegeben.
#==============================================================================
class Scene_Item
  #--------------------------------------------------------------------------
  # * Create Background
  #--------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = Cache.picture('Inventar Hintergrund')
    @background_sprite.color.set(16, 16, 16, 128)
  end
end


Ruby Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#==============================================================================
#  Füge im Fähigkeitenmenü einen anderen Hintergrund ein.
#  Die Grafik muss im Spielordner unter /Graphics/Pictures/ liegen, der genaue
#  Dateiname wird in Zeile 12 angegeben.
#==============================================================================
class Scene_Skill
  #--------------------------------------------------------------------------
  # * Create Background
  #--------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = Cache.picture('Skill Hintergrund')
    @background_sprite.color.set(16, 16, 16, 128)
  end
end


Ruby Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#==============================================================================
#  Füge im Spielmenü einen anderen Hintergrund ein.
#  Die Grafik muss im Spielordner unter /Graphics/Pictures/ liegen, der genaue
#  Dateiname wird in Zeile 12 angegeben.
#==============================================================================
class Scene_Menu
  #--------------------------------------------------------------------------
  # * Create Background
  #--------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = Cache.picture('Menü Hintergrund')
    @background_sprite.color.set(16, 16, 16, 128)
  end
end
zum Lesen den Text mit der Maus markieren

Du musst dann bei jedem Script natürlich noch den tatsächlichen Dateinamen in einfachen 'Anführungszeichen' einfügen. Da stehen im Moment nur Platzhalter Dateinamen drinnen.

3

Donnerstag, 8. Februar 2018, 17:40

Hey danke, das ist ja Klasse.
Für meine Gegenstände nehme ich scene_Item.
Für Fähigkeiten scene_Skill.
Nur welche Begriffe nehme ich dann für Ausrüstung, Status und Formation?

4

Donnerstag, 8. Februar 2018, 17:43

Ausrüstung erfolgt in Scene_Equip und der Status ist tatsächlich einfach Scene_Status.
Die Formation wird doch im normalen Spielmenü gemacht - dafür gibt es doch keine eigene Szene, oder?

5

Donnerstag, 8. Februar 2018, 17:48

Sorry verstehe die Frage nicht ganz^^
Das Inventar, der Status und alle anderen sind doch auch im normalen Spielmenü.
Sobald ich im Test ESC drücke komme ich ins Menü das die Auflistung enthält, darunter genauso die Formation wie auch das Inventar.

6

Donnerstag, 8. Februar 2018, 18:03

AAAhhh, stimmt habs mir angeschaut. Da gibts keine extra Scene.
Das heißt da ist es gar nicht möglich ein Bild zu setzen.
Ohman schade

7

Donnerstag, 8. Februar 2018, 18:06

Ach doch, mit Menü, sorry ich steh heute etwas auf den Schlauch.
Sorry......aber vielen dank für die Hilfe, das ist Klasse Arbeit.

Social Bookmarks