Lieber Besucher, herzlich willkommen bei: RPG Studio - Make your World real. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

Snugglebit

Krieger

  • »Snugglebit« ist der Autor dieses Themas

Motto: Menschen sind doof, Tiere sind doof, Pflanzen sind doof... Steine sind okay.

  • Nachricht senden

1

Sonntag, 21. Oktober 2018, 14:00

Galv's Menu Script - Menüpunkt hinzufügen

Hi, ich bins wieder.
Ich verwende in meinem Spiel folgenden Script, um das Menü etwas schicker zu haben:
Spoiler

Ruby 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
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
#------------------------------------------------------------------------------#
#  Galv's Menu Themes Engine
#------------------------------------------------------------------------------#
#  For: RPGMAKER VX ACE
#  Version 1.6
#------------------------------------------------------------------------------#
#  NOTICE: This script is NOT free for commercial use.
#  Contact Galv via PM at one of the following forums:
#  http://www.rpgmakervxace.net/
#  http://forums.rpgmakerweb.com/
#------------------------------------------------------------------------------#
 
#------------------------------------------------------------------------------#
#  2013-06-27 - Version 1.6 - compatibility fix for xp rate
#  2013-06-11 - Version 1.5 - bug fixed with help menu text on incorrect menu
#  2013-06-09 - Version 1.4 - bug missed with last fix... now fixed. I hope.
#  2013-06-08 - Version 1.3 - fixed bug with hidden menu items
#                           - made disabled buttons text transparent
#  2013-04-16 - Version 1.2 - fixed a graphic object bug. Also included
#                           - Killozappit's Cache Back script in the demo to
#                           - help with lag on slower computers.
#  2013-04-15 - Version 1.1 - fixed a bug with using items/skills on actors
#  2013-04-15 - Version 1.0 - release
#------------------------------------------------------------------------------#
#  This script replaces the default menu and thus will not be compatible with
#  other scripts that do the same. The new changes to the menu offer a few
#  things such as:
#  - Image controlled menu scenes (including moving backgrounds)
#  - 'Themes' allow you to customize the look of the menu and change it in game
#  - Other scenes can change with theme (eg. item, equip, custom scenes, etc.)
#  - Customisable menu commands (icons, visibility switches, order, vocab)
#  - Animated (sliding) commands
#  - Help window for selected command
#  - Information bar with gold, current location and play time
#  - Modified actor status to include exp and tp (for actors with preserve tp)
#------------------------------------------------------------------------------#
 
#-------------------------------------------------------------------------------
#  SCRIPT CALL
#-------------------------------------------------------------------------------
#
#  theme("Theme_Name")      # Changes your menu theme to use the specified one.
#
#-------------------------------------------------------------------------------
 
($imported ||= {})["Galv_Menu_Themes"] = true
module GMENU
    COMMAND_LIST = [ # don't touch
 
#-------------------------------------------------------------------------------
#
#  *  MENU - COMMAND SETUP
#
#-------------------------------------------------------------------------------
#  Below list is your in-game menu commands. This replaces the database vocab
#  names and adds more control over customizing your game menu.
#-------------------------------------------------------------------------------
 
# ["Menu Text", :command_type, :Scene, switch1, switch2, help txt, icon]
  ["Tasche",      :cmd, :Scene_Item,   0, 0, "Öffnet das Inventar und zeigt deine erhaltenen Items.",118],
  ["Fähigkeiten",     :sel, :Scene_Skill,  0, 0, "Zeigt die erlernten Zauber und Techniken.",128],
  ["Ausrüstung",  :sel, :Scene_Equip,  0, 0, "Rüste dich mit Waffen und Schutz aus.",129],
  ["Status",     :sel, :Scene_Status, 0, 0, "Sieh dir deinen Status genauer an.",130],
  ["Optionen",     :cmd, :Scene_VolConfig, 0, 0, "Nehme Einstellungen vor.",4],
  ["Formation",  :sel, :Formation,    74, 75, "Ändert die Reihenfolgt des Teams.",12],
  ["Speichern",  :cmd, :Scene_Save,   74, 75, "Speichere deinen Spielstand regelmäßig.",117],
  ["Beenden",    :cmd, :Scene_End,    0, 0, "Beendet das Spiel oder startet es neu.",131],
 
  ["Example1",:cmd, 1, 42, 43, "Example command - calls common event 1",278],
  ["Example2",:cmd, 1, 42, 43, "Example command - calls common event 1",278],
 
 
 
  # Here are examples of adding functionality via script. The script code for
  # these examples is in the "Example Script Commands" script in the list.
  #["Gold!",  :cmd, :custom1, 0, 0, "Scripted custom symbol example",280],
  #["Levelup!",  :sel, :custom2, 0, 0, "Scripted custom symbol on actor select example",290],
 
#-------------------------------------------------------------------------------
    ] # don't touch
#-------------------------------------------------------------------------------
#  INSTRUCTIONS
#-------------------------------------------------------------------------------
#  "Menu Text"........ the text used for the menu item
#  :command_type...... :cmd - goes to the scene when menu item accessed.
#                      :sel - select actor before going to the scene.
#  scene.............. name of the scene as a symbol. eg. :Scene_Item  (*)
#                      make this a number instead to call a common event.
#  switch1............ if switch is OFF, item is disabled. 0 to not use
#  switch2............ if switch is OFF, item will not appear. 0 to not use
#  help txt........... text that appears at the top of the menu screen
#  icon............... the icon id to use an icon next to your menu command
#-------------------------------------------------------------------------------
#  (*) Scripters can use a custom symbol here to do other functions by aliasing
#  or overwriting methods found on
#-------------------------------------------------------------------------------
 
 
#-------------------------------------------------------------------------------
#
#  *  MENU SETTINGS
#
#-------------------------------------------------------------------------------
 
 
    SHOW_TP = true    # Show TP if actor has 'preserve tp' feature true or false
 
    ACTORS_SHOWN = 4  # Number of actors visible in the menu before scrolling
 
    DEFAULT_THEME = "Theme_Default"  # The theme your game will use to begin.
 
 
#-------------------------------------------------------------------------------
#  THEME SETUP - DEFAULT THEME
#-------------------------------------------------------------------------------
    module Theme_Default
 
      # Gerenal Options
      FONT = "Chewy"           # Font used throughout theme.
      FONT_SIZE = 21             # Font size used throughout theme.
      WINDOW_TONE = [0,0,0,0] # Color tone of scenes that use windowskins
 
      # Background
      BACK1_XY = [0,0]           # X,Y movement for background1 (default stars)
      BACK1_OPACITY = 0          # Background opacity
 
      BACK2_XY = [0,0]           # X,Y movement for background2 (default top bar)
      BACK2_OPACITY = 255        # Background opacity
 
      BACK3_XY = [0,0]       # X,Y movement for background2 (default bottom bar)
      BACK3_OPACITY = 255    # Background opacity
 
      SCENE_BACK_OPACITY = 0  # Background opacity for other scene background
 
      # Command Menu
      MENU_FONT = "Chewy"        # Different font used for the menu text
      MENU_FONT_SIZE = 21        # Size of menu text
      MENU_TXT_COLOR = Color.new(255, 255, 255, 255)   # Color of menu text
      MENU_TXT_OUT = Color.new(27, 57, 97, 255)     # Color of menu text outline
      MENU_TXT_XY = [0,-2]      # X,Y offset for text in command menu
      MENU_ICON_XY = [35,1]     # X,Y offset for icons in command menu
      SLIDE_ICON = true         # true or false to slide icon with menu text
      SLIDE_SPEED = 5           # Speed the menu buttons slide in and out
      SLIDE_OFF = -30           # X Position of button when cursor not on it
      SLIDE_ON = 0            # X Position of button when cursor is on it
      MENU_Y_OFFSET = 45        # Distance Y from top of screen
      MENU_WIDTH = 170          # Width reserved for the main menu.
 
      # Help Window
      HELP_XY = [44,2]          # X,Y offset for help text
      HELP_TEXT_COLOR = Color.new(255, 255, 255, 255) # Color of help text
 
      # Game Info Window
      INFO_XY = [0,0]          # X,Y offset for info text
      GAME_INFO_TXT_COLOR = Color.new(119, 177, 214, 255) # Game Info text color
      CURRENCY_ICON = 119       # Icon used instead of currency vocab. 0 = vocab
 
      # Actor Status
      STAT_COLOR = Color.new(119, 177, 214, 255) # Color used for lvl,hp,mp
      GAUGEB_COLOR = Color.new(50, 50, 50, 255) # Color of gauge backs
      HP_COLOR1 = Color.new(0, 255, 0, 255) # Color for hp gauge gradient
      HP_COLOR2 = Color.new(0, 255, 0, 255)# Color for hp gauge gradient
      MP_COLOR1 = Color.new(0, 114, 255, 255) # Color for mp gauge gradient
      MP_COLOR2 = Color.new(0, 114, 255, 255)# Color for mp gauge gradient
      XP_COLOR1 = Color.new(0, 255, 255, 255) # Color for xp gauge gradient
      XP_COLOR2 = Color.new(0, 255, 255, 255)# Color for xp gauge gradient
      TP_COLOR1 = Color.new(255, 255, 0, 255) # Color for tp gauge gradient
      TP_COLOR2 = Color.new(255, 255, 0, 255)# Color for tp gauge gradient
      GAUGE_FONT = "Chewy"  # Font used for hp/mp and amounts.
    end
 
#-------------------------------------------------------------------------------
#  CUSTOM THEMES
#-------------------------------------------------------------------------------
#  You can make your own custom menu themes and swap between them during the
#  game or make them available for others to use. Each theme has it's own folder
#  in your project located in /Graphics/GMenu/Theme_Name/
#  For example the default theme is:
#  /Graphics/GMenu/Theme_Default/
#
#  HOW TO MAKE A THEME:
#  1. Make a duplicate of the /Theme_Default/ folder and rename it.
#  2. Modify the graphics how you see fit, using the default as templates
#  3. (Optional) You can use the theme_settings.txt file found in the template
#     folder to create new settings for the theme. Copy the script from the
#     file and paste it a new script position below this menu script. Change
#     "Theme_Default" at the top to the name of your theme's folder.
#  4. If you did that right, now in your game, you can use the script call:
#     theme("Theme_Name")
#     To change your menu theme during the game to any theme you have installed.
#
#  If you do not create your own settings script (step 3) for your custom theme,
#  it will use the settings from Theme_Default.
#-------------------------------------------------------------------------------
 
#-------------------------------------------------------------------------------
#  THEME SETUP - INNER SCENES
#-------------------------------------------------------------------------------
#  Inner scenes (such as item, equip, skills etc) can use the same Background
#  (using BACK1 setting) as well as windowskin used in the current theme.
#  List scenes below that you wish for this to occur.
#-------------------------------------------------------------------------------
    SCENE_THEMES = [ # don't touch
#-------------------------------------------------------------------------------
 
      "Scene_Item",
      "Scene_Skill",
      "Scene_Equip",
      "Scene_Status",
      "Scene_Save",
      "Scene_End",
      "Scene_Party",
      "Scene_System",
      "Scene_Load",
 
      #"Scene_File",
      #"Scene_Load",
      #"Scene_Shop",
      #"Scene_Name",
      #"Scene_Gameover",
      #"Scene_Title",
 
#-------------------------------------------------------------------------------
      ] # don't touch
#-------------------------------------------------------------------------------
#  In addition to this, the script will check the theme folder for any images.
#  with the scene name (above) followed by "_Background" and "_Background2".
#  For example if the following file is found in the theme folder:
#  Scene_Item_Background.png (or jpg)
#  It will use that image INSTEAD of Background.jpg for Background1. It will
#  also look for Scene_Item_Background2.png (or jpg) which will appear above
#  the first background. This background is static and does not move.
#-------------------------------------------------------------------------------
 
#-------------------------------------------------------------------------------
#
#  * END SETTINGS
#
#-------------------------------------------------------------------------------
 
end # GMENU
 
 
module Check_Theme
  def mtheme
    Object.const_get("GMENU").const_get($game_system.menu_theme) rescue
      GMENU::Theme_Default
  end
end # Check_Theme
 
 
    #----------------------#
#---|   GAME_INTERPERTER   |----------------------------------------------------
    #----------------------#
 
class Game_Interpreter
  def theme(name)
    $game_system.menu_theme = name
  end
end # Game_Interpreter
 
 
    #-----------#
#---|   CACHE   |---------------------------------------------------------------
    #-----------#
 
module Cache
  def self.gmenu(filename,theme)
    load_bitmap("Graphics/GMenu/" + theme + "/", filename)
  end
end # Cache
 
 
    #-----------------#
#---|   GAME_SYSTEM   |---------------------------------------------------------
    #-----------------#
 
class Game_System
  attr_accessor :menu_theme
 
  alias gmenu_engine_gs_initialize initialize
  def initialize
    @menu_theme = GMENU::DEFAULT_THEME
    gmenu_engine_gs_initialize
  end
end # Game_System
 
 
    #---------------#
#---|   GAME_TEMP   |-----------------------------------------------------------
    #---------------#
 
class Game_Temp
  attr_accessor :themed_scene
  attr_accessor :menuindexes
 
  alias gmenu_engine_gt_initialize initialize
  def initialize
    @themed_scene = false
    gmenu_engine_gt_initialize
  end
end # Game_Temp
 
 
    #----------------#
#---|   GAME_ACTOR   |----------------------------------------------------------
    #----------------#
 
class Game_Actor < Game_Battler
  def xp_rate
    a = (exp.to_f - current_level_exp.to_f)
    b = (next_level_exp.to_f - current_level_exp.to_f)
    if exp > 0 && b > 0
      return a / b
    else
      return 0
    end
  end
end # Game_Actor < Game_Battler
 
 
    #----------------#
#---|   SCENE_MENU   |----------------------------------------------------------
    #----------------#
 
class Scene_Menu < Scene_MenuBase
  attr_accessor :command_window
  include Check_Theme
 
  # OVERWRITE
  def start
    super
    create_graphics
    create_help_window
    create_new_command_window
    create_gameinfo_window
    create_status_window
  end
 
#---|   CREATE WINDOWS   |
 
  def create_help_window
    @help_window = Window_MenuHelp.new
  end
 
  # OVERWRITE
  def create_status_window
    @status_window = Window_MainMenuStatus.new(@command_window.width,
      @help_window.height,Graphics.height - @help_window.height -
      @gameinfo_window.height)
  end
 
  # OVERWRITE
  def create_new_command_window
    @command_window = Window_MenuCommand.new(0,@help_window.height)
    @command_window.help_window = @help_window
    menu_array = Array.new(GMENU::COMMAND_LIST)
    menu_array.each { |cmd|
      handle = cmd[0].delete(' ').downcase.to_sym
      @command_window.set_handler(handle, method(cmd[1]))
    }
    @command_window.set_handler(:cancel, method(:return_scene))
  end
 
  def create_gameinfo_window
    @gameinfo_window = Window_GameInfo.new
    @gameinfo_window.x = 0
    @gameinfo_window.y = Graphics.height - @gameinfo_window.height
  end
 
#---|   CREATE GRAPHICS   |
 
  def create_graphics
    create_background2
    create_background3
  end
 
  def create_background2
    @background2 = Plane.new
    @background2.bitmap = Cache.gmenu("Background2",$game_system.menu_theme)
    @background2.opacity = mtheme::BACK2_OPACITY
  end
 
  def create_background3
    @background3 = Plane.new
    @background3.bitmap = Cache.gmenu("Background3",$game_system.menu_theme)
    @background3.opacity = mtheme::BACK3_OPACITY
    @background3.oy = -Graphics.height
  end
 
#---|   UPDATING   |
 
  def update
    super
    update_background2
    update_background3
    update_gameinfo
  end
 
  def update_background2
    @background2.ox -= mtheme::BACK2_XY[0]
    @background2.oy -= mtheme::BACK2_XY[1]
  end
  def update_background3
    @background3.ox -= mtheme::BACK3_XY[0]
    @background3.oy -= mtheme::BACK3_XY[1]
  end
  def update_gameinfo
    @gameinfo_window.refresh
  end
 
#---|   FUNCTIONALITY   |
 
  alias gmenu_engine_sm_dispose_background dispose_background
  def dispose_background
    gmenu_engine_sm_dispose_background
    if @background2
      @background2.bitmap.dispose
      @background2.dispose
    end
    if @background3
      @background3.bitmap.dispose
      @background3.dispose
    end
  end
 
  def cmd
    cmd = $game_temp.menuindexes[@command_window.index]
    symbol = GMENU::COMMAND_LIST[cmd][2]
    if GMENU::COMMAND_LIST[cmd][2].is_a?(Integer)
      common_event_command(GMENU::COMMAND_LIST[cmd][2])
    elsif custom_symbol(symbol)
      custom_on_command_ok(symbol)
    else
      SceneManager.call(GMENU::COMMAND_LIST[cmd][2])
    end
  end
 
  def common_event_command(id)
    $game_temp.reserve_common_event(id)
    SceneManager.return
  end
 
  def sel
    command_personal
  end
 
  # OVERWRITE
  def command_personal
    @status_window.select_last
    @status_window.activate
    @status_window.set_handler(:ok,     method(:on_personal_ok))
    @status_window.set_handler(:cancel, method(:on_personal_cancel))
  end
 
  # OVERWRITE
  def on_personal_ok
    cmd = $game_temp.menuindexes[@command_window.index]
    symbol = GMENU::COMMAND_LIST[cmd][2]
    if symbol == :Formation
      on_formation_ok
    elsif custom_symbol(symbol)
      custom_on_personal_ok(symbol)
    else
      SceneManager.call(symbol)
    end
  end
 
  def custom_symbol(symbol)
    # Alias/overwrite this method for custom symbols.
    # Make this method return true if symbol equals your custom symbol.
  end
 
  def custom_on_command_ok(symbol)
    # Alias/overwrite this method for custom symbols. (For 'ok' on command)
    # Add your functionality here including if symbol equals your custom symbol.
  end
 
  def custom_on_personal_ok(symbol)
    # Alias/overwrite this method for custom symbols. (For 'ok' on actor)
    # Add your functionality here including if symbol equals your custom symbol.
  end
 
  def custom_on_personal_cancel(symbol)
    # Alias/overwrite this method for custom symbols. (Cancelling on actor)
    # Add your cancel code here including if symbol equals your custom symbol.
  end
 
  # OVERWRITE
  def on_personal_cancel
    cmd = @command_window.index
    symbol = GMENU::COMMAND_LIST[cmd][2]
    if symbol == :Formation
      on_formation_cancel
    elsif custom_symbol(symbol)
      custom_on_personal_cancel(symbol)
    else
      @status_window.unselect
      @command_window.activate
    end
  end
end # Scene_Menu < Scene_MenuBase
 
 
    #------------------------#
#---|   WINDOW_MENUCOMMAND   |--------------------------------------------------
    #------------------------#
 
class Window_MenuCommand < Window_Command
 
  #OVERWRITE
  def initialize(x,y)
    @menu_buttons = []
    super(x, y)
    select_last
    self.opacity = 0
  end
 
  def draw_item(index)
    @menu_buttons << MenuBtn.new(@viewport,index)
  end
 
  def visible_line_number
    item_max
  end
 
  def window_width
    return mtheme::MENU_WIDTH
  end
 
  def update
    super
    @menu_buttons.each { |btn| btn.update(index) }
  end
 
  def dispose
    @menu_buttons.each { |btn| btn.dispose }
    super
  end
 
  def update_cursor
    if @cursor_all
      cursor_rect.empty
      self.top_row = 0
    elsif @index < 0
      cursor_rect.empty
    else
      ensure_cursor_visible
      cursor_rect.empty
    end
  end
 
  def add_new_main_commands
    $game_temp.menuindexes = []
    menu_array = Array.new(GMENU::COMMAND_LIST)
    menu_array.each_with_index { |cmd,i|
      next if cmd[4] > 0 && !$game_switches[cmd[4]]
      $game_temp.menuindexes << i
      text = cmd[0]
      active = get_active(cmd[2],cmd[3])
      handle = cmd[0].delete(' ').downcase.to_sym
      add_command(text, handle, active)
    }
  end
 
  def get_active(symbol,switch)
    return false if switch > 0 && !$game_switches[switch]
    case symbol
    when :Formation
      formation_enabled
    when :Scene_Save
      save_enabled
    else
      main_commands_enabled
    end
  end
 
  def make_command_list
    add_new_main_commands
  end
 
end # Window_MenuCommand < Window_Command
 
 
    #----------------------#
#---|   WINDOW_MENUSTATUS  |----------------------------------------------------
    #----------------------#
 
class Window_MainMenuStatus < Window_MenuStatus
  include Check_Theme
 
  def initialize(x, y, h = 0)
    @height = h
    super(x, y)
    self.opacity = 0
  end
 
  def window_width
    Graphics.width - mtheme::MENU_WIDTH
  end
 
  def standard_padding
    return 6
  end
 
  def window_height
    @height
  end
 
  def item_height
    (@height - 12) / GMENU::ACTORS_SHOWN
  end
 
  def draw_item(index)
    actor = $game_party.members[index]
    enabled = $game_party.battle_members.include?(actor)
    rect = item_rect(index)
    draw_item_background(index)
    draw_back_graphics(index,item_height,item_width,enabled)
    draw_gface(actor.face_name,actor.face_index,rect.x + 1,rect.y + 1,
      item_height - 2,enabled)
    draw_gsimple_status(actor, rect.x + 108, rect.y, item_height)
  end
end
 
 
    #--------------------#
#---|   WINDOW_MENUHELP  |------------------------------------------------------
    #--------------------#
 
class Window_MenuHelp < Window_Help
  include Check_Theme
 
  def initialize
    super(1)
    self.opacity = 0
  end
 
  def standard_padding
    return 6
  end
 
  def clear
    ind = $game_temp.menuindexes[SceneManager.scene.command_window.index]
    set_text(GMENU::COMMAND_LIST[ind][5])
  end
 
  def refresh
    contents.clear
    draw_text_ex(mtheme::HELP_XY[0], mtheme::HELP_XY[1], @text)
  end
 
  def draw_text_ex(x, y, text)
    reset_font_settings
    change_color(mtheme::HELP_TEXT_COLOR)
    self.contents.font.name = mtheme::FONT
    self.contents.font.size = mtheme::FONT_SIZE
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    process_character(text.slice!(0, 1), text, pos) until text.empty?
  end
end
 
 
    #---------------------#
#---|   WINDOW_GAMEINFO   |-----------------------------------------------------
    #---------------------#
 
class Window_GameInfo < Window_Base
  include Check_Theme
 
  def initialize
    super(0, 0, Graphics.width, fitting_height(1))
    self.opacity = 0
    refresh
  end
 
  def standard_padding
    return 6
  end
 
  def refresh
    contents.clear
    self.contents.font.name = mtheme::FONT
    self.contents.font.size = mtheme::FONT_SIZE
    draw_gld
    draw_location
    draw_playtime
  end
 
  def draw_gld
    value = $game_party.gold
    if mtheme::CURRENCY_ICON > 0
      i = draw_icon(mtheme::CURRENCY_ICON, contents.width / 4 - 43, -1, true)
      draw_currency_value(value,i,tx+4,ty,contents.width / 4 - 45)
    else
      draw_currency_value(value,Vocab::currency_unit,tx+4,ty,contents.width / 4 - 18)
    end
  end
 
  def tx
    mtheme::INFO_XY[0]
  end
  def ty
    mtheme::INFO_XY[1]
  end
 
  def draw_location
    change_color(mtheme::GAME_INFO_TXT_COLOR)
    draw_text(tx,ty,Graphics.width,line_height,$game_map.display_name,1)
  end
 
  def draw_playtime
    draw_text(tx,ty,Graphics.width - 20,line_height,time_text,2)
  end
 
  def time_text
    sprintf("%02d:%02d:%02d", (Graphics.frame_count / 60**2) / 60,
      Graphics.frame_count / 60**2 % 60, 
      Graphics.frame_count / 60 % 60)
  end
 
  def draw_currency_value(value, unit, x, y, width)
    cx = text_size(unit).width
    change_color(mtheme::GAME_INFO_TXT_COLOR)
    draw_text(x, y, width - cx - 2, line_height, value, 2)
    change_color(system_color)
    draw_text(x, y, width, line_height, unit, 2)
  end
 
  def open
    refresh
    super
  end
end
 
 
    #-----------------#
#---|   WINDOW_BASE   |---------------------------------------------------------
    #-----------------#
 
class Window_Base < Window
  include Check_Theme
 
  alias galv_gmenu_engine_wb_initialize initialize
  def initialize(x, y, width, height)
    galv_gmenu_engine_wb_initialize(x, y, width, height)
    if $game_temp.themed_scene
      self.windowskin = Cache.gmenu("Windowskin",$game_system.menu_theme) rescue
        Cache.system("Window")
        set_theme_tone
    end
  end
 
  alias galv_gmenu_engine_wb_system_color system_color
  def system_color
    if $game_temp.themed_scene
      mtheme::STAT_COLOR
    else
      galv_gmenu_engine_wb_system_color
    end
  end
 
  alias galv_gmenu_engine_wb_gauge_back_color gauge_back_color
  def gauge_back_color
    if $game_temp.themed_scene
      mtheme::GAUGEB_COLOR
    else
      galv_gmenu_engine_wb_gauge_back_color
    end
  end
 
  def set_theme_tone
    a,b,c,d = mtheme::WINDOW_TONE
    self.tone.set(a,b,c,d)
  end
 
  alias galv_gmenu_engine_wb_update_tone update_tone
  def update_tone
    if $game_temp.themed_scene
      set_theme_tone
    else
      galv_gmenu_engine_wb_update_tone
    end
  end
 
  def draw_back_graphics(ind,height,width,enabled = true)
    if enabled
      bitmap = Cache.gmenu("ActorBackground",$game_system.menu_theme)
    else
      bitmap = Cache.gmenu("ActorBackgroundDisabled",$game_system.menu_theme)
    end
    rect = Rect.new(1,0,width - 2,bitmap.height + 2)
    y = (rect.y + height) * ind - (bitmap.height - height) - 2
    contents.blt(rect.x, y, bitmap, rect, 255)
    bitmap.dispose
  end
 
  def draw_gsimple_status(actor, x, y, height)
    contents.font.name = mtheme::FONT
    contents.font.size = mtheme::FONT_SIZE
    draw_actor_name(actor, x, y + height - 30)
    draw_glevel(actor, x, y + height - 30 - line_height * 1)
    draw_gicons(actor, x - 108, y + line_height * 2 + 3)
    draw_gclass(actor, x, y + height - 30)
    contents.font.size = 20
    contents.font.name = mtheme::GAUGE_FONT
    w = contents.width - 260
    h = (height - 80) / 2
    draw_ghp(actor, x + 140, y + h / 2 , w)
    draw_gmp(actor, x + 140, y + line_height - 4 + h,w)
    if actor.preserve_tp? && GMENU::SHOW_TP
      draw_gtp(actor, x + 75, y + line_height - 4 + h,40)
    end
    draw_gxp(actor, x + 6, y + height - 23, contents.width - 120)
  end
 
  def draw_gtp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.tp_rate,mtheme::TP_COLOR1,mtheme::TP_COLOR1)
    change_color(system_color)
    draw_text(x - 30, y + 7, 30, line_height, Vocab::tp_a,2)
    change_color(tp_color(actor))
    draw_text(x + width - 42, y + 3, 42, line_height, actor.tp.to_i, 2)
  end
 
  def draw_gxp(actor,x,y,width = 124)
    draw_xpgauge(x, y, width, actor.xp_rate, mtheme::XP_COLOR1, mtheme::XP_COLOR2)
  end
 
  def draw_xpgauge(x, y, width, rate, color1, color2)
    fill_w = (width * rate).to_i
    gauge_y = y + line_height - 8
    contents.fill_rect(x, gauge_y, width, 4, gauge_back_color)
    contents.gradient_fill_rect(x, gauge_y, fill_w, 4, color1, color2)
  end
 
  def draw_ghp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, mtheme::HP_COLOR1, mtheme::HP_COLOR2)
    change_color(system_color)
    draw_text(x - 30, y + 7, 30, line_height, Vocab::hp_a,2)
    draw_current_and_max_values(x, y + 3, width, actor.hp, actor.mhp,
      hp_color(actor), normal_color)
  end
 
  def draw_gmp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.mp_rate, mtheme::MP_COLOR1, mtheme::MP_COLOR2)
    change_color(system_color)
    draw_text(x - 30, y + 7, 30, line_height, Vocab::mp_a,2)
    draw_current_and_max_values(x, y + 3, width, actor.mp, actor.mmp,
      mp_color(actor), normal_color)
  end
 
  def draw_gicons(actor, x, y, width = 96)
    icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
    icons.each_with_index {|n, i| draw_icon(n, x, y - 16 * i) }
  end
 
  def draw_gface(face_name, face_index, x, y, height, enabled = true)
    bitmap = Cache.face(face_name)
    h = [height,96].min - 1
    y_offset = GMENU::ACTORS_SHOWN > 4 ? 1.25 : 1
    h2 = 96 - h * y_offset
    rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96 + h2, 96, h)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    bitmap.dispose
  end
 
  def draw_glevel(actor, x, y)
    wid = Graphics.width - 300
    change_color(system_color)
    draw_text(x, y, wid, line_height, Vocab::level_a + " " + actor.level.to_s, 0)
  end
 
  def draw_gclass(actor, x, y)
    change_color(normal_color)
    draw_text(x, y, Graphics.width - 290, line_height, actor.class.name,2)
  end
end # Window_Base < Window
 
 
    #-----------------#
#---|   SCENEMANAGER  |---------------------------------------------------------
    #-----------------#
 
module SceneManager
  class << self
    alias gmenu_engine_sm_call call
  end
 
  def self.call(scene_class)
    if scene_class.is_a?(Symbol)
      @stack.push(@scene)
      @scene = Kernel.const_get(scene_class).new
    else
      gmenu_engine_sm_call(scene_class)
    end
  end
 
  def self.themed_scene
    array = ["Scene_Menu"] + GMENU::SCENE_THEMES
    return true if array.include?(@scene.name)
    return false
  end
end # SceneManager
 
 
class Scene_MenuBase < Scene_Base
  include Check_Theme
 
  alias gmenu_engine_sb_start start
  def start
    gmenu_engine_sb_start
    if SceneManager.themed_scene
      $game_temp.themed_scene = true
      create_theme_backgrounds
    end
  end
 
  def create_theme_backgrounds
    create_background1
    create_themebg2
  end
 
  def create_background1
    @background1 = Plane.new
    @background1.bitmap = Cache.gmenu(name + "_Background",$game_system.menu_theme) rescue
      Cache.gmenu("Background",$game_system.menu_theme)
    @background1.opacity = mtheme::BACK1_OPACITY
    @background1.z = -1
    @background_sprite.z = -2
  end
 
  def create_themebg2
    @themebg2 = Sprite.new
    if !SceneManager.scene_is?(Scene_Menu)
      @themebg2.bitmap = Cache.gmenu(name + "_Background2",$game_system.menu_theme) rescue
      Cache.gmenu("Scene_Generic_Background2",$game_system.menu_theme) rescue
      nil
    end
    @themebg2.opacity = mtheme::SCENE_BACK_OPACITY
    if @themebg2.bitmap
      @themebg2.x = [(Graphics.width - @themebg2.bitmap.width) / 2,0].max
    end
    @themebg2.z = 0
  end
 
  alias gmenu_engine_sb_update update
  def update
    gmenu_engine_sb_update
    if @background1
      @background1.ox -= mtheme::BACK1_XY[0]
      @background1.oy -= mtheme::BACK1_XY[1]
    end
  end
 
  alias gmenu_engine_sb_terminate terminate
  def terminate
    gmenu_engine_sb_terminate
    $game_temp.themed_scene = false
    @background1.dispose if @background1
    @themebg2.dispose if @themebg2
  end
 
  def name
    if self.to_s =~ /#<(.*):/i
      return $1
    else
      return ""
    end
  end
end # Scene_Base
 
 
    #--------------------#
#---|   SPRITE_MENUBTN   |------------------------------------------------------
    #--------------------#
 
class MenuBtn
  include Check_Theme
 
  def initialize(viewport,index)
    @index1 = index
    @index = 0
    create_bitmap
    create_text
    create_icon
  end
 
  def dispose
    @text.dispose
    @icon.dispose
    @btn.dispose
    @text.bitmap.dispose
    @icon.bitmap.dispose
    @btn.bitmap.dispose
  end
 
  def update(index)
    @index = $game_temp.menuindexes[index]
    update_position
  end
 
  def menuitem
    GMENU::COMMAND_LIST[$game_temp.menuindexes[@index1]]
  end
 
  def create_bitmap
    if SceneManager.scene.command_window
      cmd_index = SceneManager.scene.command_window.index
    else
      cmd_index = 0
    end
    @btn = Sprite.new
    @btn.bitmap = Cache.gmenu("MenuButton",$game_system.menu_theme)
    @btn.y = mtheme::MENU_Y_OFFSET + @index1 * @btn.bitmap.height
    @btn.x = @index1 == cmd_index ? mtheme::SLIDE_ON : mtheme::SLIDE_OFF
    @btn.opacity = @index1 == cmd_index ? 255 : 160
  end
 
  def create_icon
    @icon = Sprite.new
    @icon.bitmap = Bitmap.new(800,800)
    @tempicon = Sprite.new
    @tempicon.bitmap = Cache.system("Iconset")
    icon_index = menuitem[6]
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    @icon.bitmap.blt(mtheme::MENU_ICON_XY[0], mtheme::MENU_ICON_XY[1],
      @tempicon.bitmap, rect, 255)
    @tempicon.bitmap.dispose if @tempicon.bitmap
    @tempicon.dispose
    @icon.x = @btn.x if mtheme::SLIDE_ICON
    @icon.y = @btn.y
    @icon.z = 100
  end
 
  def create_text
    @text = Sprite.new
    @text.bitmap = Bitmap.new(180,35)
    @text.bitmap.font.name = mtheme::MENU_FONT
    @text.bitmap.font.color = mtheme::MENU_TXT_COLOR
    @text.bitmap.font.out_color = mtheme::MENU_TXT_OUT
    @text.bitmap.font.size = mtheme::MENU_FONT_SIZE
    text = menuitem[0]
    @text.bitmap.draw_text(mtheme::MENU_TXT_XY[0],
      mtheme::MENU_TXT_XY[1],150,35, text,2)
    @text.x = @btn.x
    @text.y = @btn.y
    @text.opacity = 100 if menuitem[3] > 0 && !$game_switches[menuitem[3]]
  end
 
  def update_position
    if $game_temp.menuindexes[@index1] == @index
      @btn.opacity = 255
      return if @btn.x >= mtheme::SLIDE_ON
      @btn.x += mtheme::SLIDE_SPEED
      @text.x += mtheme::SLIDE_SPEED
      @icon.x += mtheme::SLIDE_SPEED if mtheme::SLIDE_ICON
    else
      @btn.opacity = 160
      return if @btn.x <= mtheme::SLIDE_OFF
      @btn.x -= mtheme::SLIDE_SPEED
      @text.x -= mtheme::SLIDE_SPEED
      @icon.x -= mtheme::SLIDE_SPEED if mtheme::SLIDE_ICON
    end
  end
end # Sprite_MenuBtn < Sprite_Base
zum Lesen den Text mit der Maus markieren


Zusätzlich verwende ich einen Script, mit dem man die Lautstärke der Musik, Effekte, etc. verändern kann:
Spoiler

Ruby 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
# coding: utf-8
#===============================================================================
# ■ Master Volume Control for RGSS3
#-------------------------------------------------------------------------------
# 2016/04/23 By Ru/むっくRu (Rutan) | English translation by tale 2017/02/10
# License - Public Domain
#-------------------------------------------------------------------------------
# Add functions related to volume adjustment
#
# ● Volume adjustment - items are added to the title screen and main menu
#
# ● Audio - The following items are added to the module
# Audio.bgm_vol …… BGM
# Audio.bgs_vol …… BGS
# Audio.se_vol  …… SE
# Audio.me_vol  …… ME
# Audio.bgm_vol=Numerical variable …… BGM(0~100)
# Audio.bgs_vol=Numerical variable …… BGS(0~100)
# Audio.se_vol=Numerical variable  …… SE(0~100)
# Audio.me_vol=Numerical variable  …… ME(0~100)
#
#-------------------------------------------------------------------------------
# 【Changelogs】
# 2016/04/23 Code reorganized
# 2013/05/25 Fixed error drop when changing type of volume change item
# 2012/12/17 Allows the volume to be saved without the base script. (Script organization)
# 2012/06/13 Redesign layout. Added setting item. (Organizing scripts)
# 2012/01/02 Ini changed reading HZM_VXA base script for RGSS3 (Change to dependent)
# 2011/12/29 BGS Fixed a bug that causes error during playback
# 2011/12/26 BGM Fixed a bug that causes the volume to be adjusted when mute
# 2011/12/13 ini Allows cooperation with reading
# 2011/12/01 Released
#-------------------------------------------------------------------------------
 
#===============================================================================
# ● Item settings
#===============================================================================
module HZM_VXA
  module AudioVol
    # ● Do you want to display the volume adjustment on the title screen?
    #    ※To redefine the menu items on the title screen,
    #      If you introduce another script that tamper with the menu titles
    #      There's a possibility of conflict.
    #  true  …… Display
    #  false …… Don't display
    TITLE_FLAG = true
    # Item name to be displayed on title screen
    TITLE_NAME        = "Volume Control"
 
    # ● Do you want the volume adjustment displayed on the menu screen?
    #  true  …… Display
    #  false …… Don't display
    MENU_FLAG = true
    # Name of the setting in Main Menu.
    MENU_NAME        = "Volume Control"
 
    # ● Types of Volume arrangement
    #  0 …… BGM/BGS/SE/ME Set all at once
    #   1 …… BGM+BGS と SE+ME Set with 2 kinds of
    #   2 …… BGM/BGS/SE/ME Set by each of 4 types
    TYPE = 2
 
    # ● Volume Control Settings Name.
    CONFIG_ALL_NAME  = "Volume"        # Used when type "0" is selected
    CONFIG_BGM_NAME  = "BGM"         # Used when type "1" "2" is selected
    CONFIG_BGS_NAME  = "BGS"         # Used when type "2" is selected
    CONFIG_SE_NAME   = "SE"          # Used when type "1" "2" is selected
    CONFIG_ME_NAME   = "ME"          # Used when type "2" is selected
    CONFIG_EXIT_NAME = "Exit"
 
    # ● Volume adjustment by Increments
    ADD_VOL_NORMAL =  5              # Amount of increment of left and right keys
    ADD_VOL_HIGH   = 25              # LR Variation amount of key
 
    # ● Window width of volume setting screen
    WINDOW_WIDTH   = 200
 
    # ● Volume gauge color from the menu interface
    COLOR1 = Color.new(255, 255, 255)
    COLOR2 = Color.new( 64,  64, 255)
 
    # ● Save function of volume setting
    #    Game.ini, By storing volume information in
    #    You can also adjust the volume when you start up
    #    true  …… Save
    #    false …… Don't save
    USE_INI = true
  end
end
 
#===============================================================================
# ↑ Set up here ↑
# ↓ or less, script part ↓
#===============================================================================
 
module Audio
  #-----------------------------------------------------------------------------
  # ● Volume setting: BGM
  #-----------------------------------------------------------------------------
  def self.bgm_vol=(vol)
    @hzm_vxa_audioVol_bgm = self.vol_range(vol)
  end
  #-----------------------------------------------------------------------------
  # ● Volume setting: BGS
  #-----------------------------------------------------------------------------
  def self.bgs_vol=(vol)
    @hzm_vxa_audioVol_bgs = self.vol_range(vol)
  end
  #-----------------------------------------------------------------------------
  # ● Volume setting: SE
  #-----------------------------------------------------------------------------
  def self.se_vol=(vol)
    @hzm_vxa_audioVol_se = self.vol_range(vol)
  end
  #-----------------------------------------------------------------------------
  # ● Volume setting: ME
  #-----------------------------------------------------------------------------
  def self.me_vol=(vol)
    @hzm_vxa_audioVol_me = self.vol_range(vol)
  end
  #-----------------------------------------------------------------------------
  # ● Volume range specification
  #-----------------------------------------------------------------------------
  def self.vol_range(vol)
    vol = vol.to_i
    vol < 0 ? 0 : vol < 100 ? vol : 100
  end
  #-----------------------------------------------------------------------------
  # ● Volume acquisition: BGM
  #-----------------------------------------------------------------------------
  def self.bgm_vol
    @hzm_vxa_audioVol_bgm ||= 100
  end
  #-----------------------------------------------------------------------------
  # ● Volume acquisition: BGS
  #-----------------------------------------------------------------------------
  def self.bgs_vol
    @hzm_vxa_audioVol_bgs ||= 100
  end
  #-----------------------------------------------------------------------------
  # ● Volume acquisition: SE
  #-----------------------------------------------------------------------------
  def self.se_vol
    @hzm_vxa_audioVol_se ||= 100
  end
  #-----------------------------------------------------------------------------
  # ● Volume acquisition: ME
  #-----------------------------------------------------------------------------
  def self.me_vol
    @hzm_vxa_audioVol_me ||= 100
  end
end
 
class << Audio
  #-----------------------------------------------------------------------------
  # ● Playback: BGM
  #-----------------------------------------------------------------------------
  alias hzm_vxa_audioVol_bgm_play bgm_play
  def bgm_play(filename, volume = 100, pitch = 100, pos = 0)
    hzm_vxa_audioVol_bgm_play(filename, self.bgm_vol * volume / 100, pitch, pos)
  end
  #-----------------------------------------------------------------------------
  # ● Playback: BGS
  #-----------------------------------------------------------------------------
  alias hzm_vxa_audioVol_bgs_play bgs_play
  def bgs_play(filename, volume = 100, pitch = 100, pos = 0)
    hzm_vxa_audioVol_bgs_play(filename, self.bgs_vol * volume / 100, pitch, pos)
  end
  #-----------------------------------------------------------------------------
  # ● Playback: SE
  #-----------------------------------------------------------------------------
  alias hzm_vxa_audioVol_se_play se_play
  def se_play(filename, volume = 100, pitch = 100)
    hzm_vxa_audioVol_se_play(filename, self.se_vol * volume / 100, pitch)
  end
  #-----------------------------------------------------------------------------
  # ● Playback: ME
  #-----------------------------------------------------------------------------
  alias hzm_vxa_audioVol_me_play me_play
  def me_play(filename, volume = 100, pitch = 100)
    hzm_vxa_audioVol_me_play(filename, self.me_vol * volume / 100, pitch)
  end
  #-----------------------------------------------------------------------------
  # ● Old Version Compatibility
  #-----------------------------------------------------------------------------
  if true
    alias volBGM bgm_vol
    alias volBGS bgs_vol
    alias volSE se_vol
    alias volME me_vol
    alias volBGM= bgm_vol=
    alias volBGS= bgs_vol=
    alias volSE= se_vol=
    alias volME= me_vol=
  end
end
 
# For the title screen
if HZM_VXA::AudioVol::TITLE_FLAG
  class Window_TitleCommand < Window_Command
    if true
      # ↑ If you change true to false,
      #    This makes the menu items on title screen aliased instead of redefining
      #    It will be implemented.
      #    Conflicting with other menu titles extended scripts would be unlikely to happen,
      #    As a side effect, the volume setting item is added under shutdown.
      #    According to your needs……(・x・)
      #---------------------------------------------------------------------------
      # ● Create command list (redefinition)
      #---------------------------------------------------------------------------
      def make_command_list
        add_command(Vocab::new_game, :new_game)
        add_command(Vocab::continue, :continue, continue_enabled)
        add_command(HZM_VXA::AudioVol::TITLE_NAME, :hzm_vxa_audioVol)
        add_command(Vocab::shutdown, :shutdown)
      end
    else
      #---------------------------------------------------------------------------
      # ● Creating command list
      #---------------------------------------------------------------------------
      alias hzm_vxa_audioVol_make_command_list make_command_list
      def make_command_list
        hzm_vxa_audioVol_make_command_list
        add_command(HZM_VXA::AudioVol::TITLE_NAME, :hzm_vxa_audioVol)
      end
    end
  end
  class Scene_Title < Scene_Base
    #---------------------------------------------------------------------------
    # ● Creating Command Window
    #---------------------------------------------------------------------------
    alias hzm_vxa_audioVol_create_command_window create_command_window
    def create_command_window
      hzm_vxa_audioVol_create_command_window
      @command_window.set_handler(:hzm_vxa_audioVol, method(:hzm_vxa_audioVol_command_config))
    end
    #---------------------------------------------------------------------------
    # ● Command [Volume adjustment]
    #---------------------------------------------------------------------------
    def hzm_vxa_audioVol_command_config
      close_command_window
      SceneManager.call(HZM_VXA::AudioVol::Scene_VolConfig)
    end
  end
end
 
# メニューに追加
if HZM_VXA::AudioVol::MENU_FLAG
  class Window_MenuCommand
    #---------------------------------------------------------------------------
    # ● For adding a custom command
    #---------------------------------------------------------------------------
    alias hzm_vxa_audioVol_add_original_commands add_original_commands
    def add_original_commands
      hzm_vxa_audioVol_add_original_commands
      add_command(HZM_VXA::AudioVol::MENU_NAME, :hzm_vxa_audioVol)
    end
  end
  class Scene_Menu
    #---------------------------------------------------------------------------
    # ● Creating Command Window
    #---------------------------------------------------------------------------
    alias hzm_vxa_audioVol_create_command_window create_command_window
    def create_command_window
      hzm_vxa_audioVol_create_command_window
      @command_window.set_handler(:hzm_vxa_audioVol, method(:hzm_vxa_audioVol_command_config))
    end
    #---------------------------------------------------------------------------
    # ● Call volume from the setting screen
    #---------------------------------------------------------------------------
    def hzm_vxa_audioVol_command_config
      SceneManager.call(HZM_VXA::AudioVol::Scene_VolConfig)
    end
  end
end
 
# Volume Configuration Window
module HZM_VXA
  module AudioVol
    class Window_VolConfig < Window_Command
      #-------------------------------------------------------------------------
      # ● Generate
      #-------------------------------------------------------------------------
      def initialize
        @mode = HZM_VXA::AudioVol::TYPE.to_i
        super(0, 0)
        self.x = (Graphics.width  - self.window_width ) / 2
        self.y = (Graphics.height - self.window_height) / 2
      end
      #-------------------------------------------------------------------------
      # ● Acquire command symbol
      #-------------------------------------------------------------------------
      def command_symbol(index)
        @list[index][:symbol]
      end
      #-------------------------------------------------------------------------
      # ● Command extend data
      #-------------------------------------------------------------------------
      def command_ext(index)
        @list[index][:ext]
      end
      #-------------------------------------------------------------------------
      # ● Window width
      #-------------------------------------------------------------------------
      def window_width
        HZM_VXA::AudioVol::WINDOW_WIDTH
      end
      #--------------------------------------------------------------------------
      # ● Acquire alignment
      #--------------------------------------------------------------------------
      def alignment
        command_symbol(@now_drawing_index) == :cancel ? 1 : 0
      end
      #-------------------------------------------------------------------------
      # ● Command generate
      #-------------------------------------------------------------------------
      def make_command_list
        make_command_list_actions
        make_command_list_exit
      end
      #-------------------------------------------------------------------------
      # ● Command: action
      #-------------------------------------------------------------------------
      def make_command_list_actions
        case @mode
        when 0
          add_command(HZM_VXA::AudioVol::CONFIG_ALL_NAME,  :all)
        when 1
          add_command(HZM_VXA::AudioVol::CONFIG_BGM_NAME,  :bgm)
          add_command(HZM_VXA::AudioVol::CONFIG_SE_NAME,   :se)
        else
          add_command(HZM_VXA::AudioVol::CONFIG_BGM_NAME,  :bgm)
          add_command(HZM_VXA::AudioVol::CONFIG_BGS_NAME,  :bgs)
          add_command(HZM_VXA::AudioVol::CONFIG_SE_NAME,   :se)
          add_command(HZM_VXA::AudioVol::CONFIG_ME_NAME,   :me)
        end
      end
      #-------------------------------------------------------------------------
      # ● Command: cancel
      #-------------------------------------------------------------------------
      def make_command_list_exit
        add_command(HZM_VXA::AudioVol::CONFIG_EXIT_NAME, :cancel)
      end
      #-------------------------------------------------------------------------
      # ● Drawing items
      #-------------------------------------------------------------------------
      def draw_item(index)
        @now_drawing_index = index
        super
        case command_symbol(index)
        when :all, :bgm, :bgs, :se, :me
          draw_item_volume_guage(index)
        end
      end
      #-------------------------------------------------------------------------
      # ● Drawing items: volume gauge
      #-------------------------------------------------------------------------
      def draw_item_volume_guage(index)
        vol =
          case command_symbol(index)
          when :all, :bgm
            Audio.bgm_vol
          when :bgs
            Audio.bgs_vol
          when :se
            Audio.se_vol
          when :me
            Audio.me_vol
          end
        draw_gauge(item_rect_for_text(index).x + 96 - 8, item_rect_for_text(index).y, contents_width - 96, vol/100.0, HZM_VXA::AudioVol::COLOR1, HZM_VXA::AudioVol::COLOR2)
        draw_text(item_rect_for_text(index), vol, 2)
      end
      #-------------------------------------------------------------------------
      # ● Increase volume
      #-------------------------------------------------------------------------
      def vol_add(index, val)
        call_flag = false
 
        case command_symbol(index)
        when :all
          call_flag = add_vol_bgm(val)
          Audio.bgs_vol = Audio.bgm_vol
          Audio.se_vol = Audio.bgm_vol
          Audio.me_vol = Audio.bgm_vol
        when :bgm
          call_flag = add_vol_bgm(val)
          Audio.bgs_vol = Audio.bgm_vol if @mode == 1
        when :bgs
          call_flag = add_vol_bgs(val)
        when :se
          call_flag = add_vol_se(val)
          Audio.me_vol = Audio.se_vol if @mode == 1
        when :me
          call_flag = add_vol_me(val)
        end
 
        if call_flag
          Sound.play_cursor
          redraw_item(index)
        end
      end
      def add_vol_bgm(val)
        old = Audio.bgm_vol
        Audio.bgm_vol += val
        if music = RPG::BGM.last and music.name.size > 0
          Audio.bgm_play("Audio/BGM/#{music.name}", music.volume, music.pitch, music.pos)
        end
        Audio.bgm_vol != old
      end
      def add_vol_bgs(val)
        old = Audio.bgs_vol
        Audio.bgs_vol += val
        Audio.bgs_vol != old
      end
      def add_vol_se(val)
        old = Audio.se_vol
        Audio.se_vol += val
        Audio.se_vol != old
      end
      def add_vol_me(val)
        old = Audio.me_vol
        Audio.me_vol += val
        Audio.me_vol != old
      end
      #--------------------------------------------------------------------------
      # ● Process when the button is pressed
      #    ※Ignore if it's on the volume setting
      #--------------------------------------------------------------------------
      def process_ok
        case current_symbol
        when :bgm, :bgs, :se, :me
          return
        else
          super
        end
      end
      #-------------------------------------------------------------------------
      # ● Key operation
      #-------------------------------------------------------------------------
      def cursor_left(wrap = false)
        vol_add(@index, -HZM_VXA::AudioVol::ADD_VOL_NORMAL)
      end
      def cursor_right(wrap = false)
        vol_add(@index,  HZM_VXA::AudioVol::ADD_VOL_NORMAL)
      end
      def cursor_pageup
        vol_add(@index, -HZM_VXA::AudioVol::ADD_VOL_HIGH)
      end
      def cursor_pagedown
        vol_add(@index,  HZM_VXA::AudioVol::ADD_VOL_HIGH)
      end
    end
    class Scene_VolConfig < Scene_MenuBase
      #-------------------------------------------------------------------------
      # ● Start processing
      #-------------------------------------------------------------------------
      def start
        super
        create_help_window
        @command_window = Window_VolConfig.new
        @command_window.viewport = @viewport
        @command_window.set_handler(:cancel,   method(:return_scene))
        @help_window.set_text("You can adjust the volume(0:Mute~100:Max)\n← Decrease / Increase →")
      end
      #-------------------------------------------------------------------------
      # ● End processing
      #-------------------------------------------------------------------------
      def terminate
        super
        @command_window.dispose
        if HZM_VXA::AudioVol::USE_INI
          HZM_VXA::Ini.save('AudioVol', 'BGM', Audio.bgm_vol)
          HZM_VXA::Ini.save('AudioVol', 'BGS', Audio.bgs_vol)
          HZM_VXA::Ini.save('AudioVol', 'SE', Audio.se_vol)
          HZM_VXA::Ini.save('AudioVol', 'ME', Audio.me_vol)
        end
      end
    end
  end
end
 
if HZM_VXA::AudioVol::USE_INI
  # If the base script is not installed, it will work with the simplified version
  unless defined?(HZM_VXA::Ini)
    module HZM_VXA
      module Base
        GetPrivateProfileInt = Win32API.new('kernel32', 'GetPrivateProfileInt', %w(p p i p), 'i')
        WritePrivateProfileString = Win32API.new('kernel32', 'WritePrivateProfileString', %w(p p p p), 'i')
      end
      class Ini
        INI_FILENAME = './Game.ini'
        def self.load(section, key)
          HZM_VXA::Base::GetPrivateProfileInt.call(section, key, 100, INI_FILENAME).to_i
        end
        def self.save(section, key, value)
          HZM_VXA::Base::WritePrivateProfileString.call(section, key, value.to_i.to_s, INI_FILENAME) != 0
        end
      end
    end
  end
  # Read volume initial value
  Audio.bgm_vol = (HZM_VXA::Ini.load('AudioVol', 'BGM') or 100)
  Audio.bgs_vol = (HZM_VXA::Ini.load('AudioVol', 'BGS') or 100)
  Audio.se_vol  = (HZM_VXA::Ini.load('AudioVol', 'SE') or 100)
  Audio.me_vol  = (HZM_VXA::Ini.load('AudioVol', 'ME') or 100)
end
zum Lesen den Text mit der Maus markieren


Nun würde ich gern, dass man vom Menü aus einen Punkt hat, von dem man in diese Optionen kommt. Wenn ihr meinen Menü-Script anschaut, könnt ihr diesen Punkt auch schon in Zeile 64 sehen. Leider erscheint aber noch ein Fehler, wenn man diesen Punk anwählt.

Was muss ich in Galv's Script ändern, damit ich diesen Menüpunkt zum laufen kriege?
Was lebt, das kann man töten. Was tot ist, das kann man essen.
--------------------------------------------------------------------------
:map: Mapping: :star::star::star::star::star:
:compile: Scripting: :star-empty::star-empty::star-empty::star-empty::star-empty:
:system-monitor: Event: :star::star::star::star::star:
:doc: Story: :star::star::star::star::star-empty:
:pencil: Zeichnen: :star::star::star::star::star:
:palette: Pixeln: :star::star::star-half::star-empty::star-empty:
:music-beam-16: Musik & Sounds: :star::star::star::star-empty::star-empty:
--------------------------------------------------------------------------
Bevorzugter Maker: :ace:
Ebenfalls im Besitzt: :rmxp: :rmvx: :rmmv:

Snugglebit

Krieger

  • »Snugglebit« ist der Autor dieses Themas

Motto: Menschen sind doof, Tiere sind doof, Pflanzen sind doof... Steine sind okay.

  • Nachricht senden

2

Donnerstag, 25. Oktober 2018, 20:21

Update:
Tatsächlich habe ich herausgefunden, wie ich einen Menüpunkt für die Optionen erstellen kann.
Nur habe ich nach wie vor einen Fehler, wenn ich das Options-Menü öffnen will (siehe Anhang).

Laut Scriptbeschreibung ruft man das Menü mit folgendem Befehl auf:

Ruby Quellcode

1
2
3
 SceneManager. Call (
HZM_VXA :: AudioVol :: Scene_VolConfig
)


Allerdings ruft das den Fehler hervor. Kann mir jemand sagen, warum?
»Snugglebit« hat folgende Datei angehängt:
Was lebt, das kann man töten. Was tot ist, das kann man essen.
--------------------------------------------------------------------------
:map: Mapping: :star::star::star::star::star:
:compile: Scripting: :star-empty::star-empty::star-empty::star-empty::star-empty:
:system-monitor: Event: :star::star::star::star::star:
:doc: Story: :star::star::star::star::star-empty:
:pencil: Zeichnen: :star::star::star::star::star:
:palette: Pixeln: :star::star::star-half::star-empty::star-empty:
:music-beam-16: Musik & Sounds: :star::star::star::star-empty::star-empty:
--------------------------------------------------------------------------
Bevorzugter Maker: :ace:
Ebenfalls im Besitzt: :rmxp: :rmvx: :rmmv:

Social Bookmarks