• Anmelden

1

Samstag, 11. Juli 2015, 22:30

Speichern/Laden (oder Menü aufrufen) wärend einer Messagebox.

Nach einem ersten testen der Wassertiefe, hier nun meine konkrete Anfrage.

In einem Satz: Ich brauche ein Script für den XP, das es mir erlaubt wärend einer Messagebox zu speichern/laden.

Etwas ausführlicher:

Für das Projekt mit dem ich an dem Indie Game Maker Contest 2015 teilnehmen möchte würde ich gern ein Script haben, das es dem Spieler erlaubt wärend einer Textbox zu speichern bzw. zu laden und bei einem geladenen Spielstand auch automatisch ab eben dieser Textbox weiterzuspielen.

Bild
Ich verwende DerVVulfmans Maus Script "Mousie". Außerhalb einer Textbox lassen sich damit Events auf der Map aktivieren oder per Rechtsklick das Menü aufrufen. Nut eben nicht IN der Messagebox XD'
Je nachdem was einfacher umzusetzen ist, würde ich dem Spieler gern erlauben auf ein Event Hinter/Neben der Textbox zu klicken was dann z.B. einen Conditional Branch aufruft (der dann etwa so aussehen würde Bild, wobei ich es mir schwierig vorstelle dem Spiel dan zu erklären zu welcher Message Box es zurückkehren muss) oder eben per rechter Maustaste das Menü aufzurufen, welches ich dann noch entsprechend anpassen müsste. Speichern, Laden - und eventuel Beenden - sollten alles sein was ich brauche.

Ich hoffe das dies nicht zu aufwendig ist... ^^'


EDIT: Mir ist gerade noch etwas eingefallen.
Ich werde viel mit dem "Show Picture" befehl Arbeiten. (Ein Bild als Hintergrund der Messagebox anstelle des Windowskins; für Half-Body Grafiken etc.) Die Bilder werden demnahc zusätzlich zur Messagebox angezeigt und müssten ebenfalls entsprechend gespeichert & geladen werden.
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »yamina-chan« (11. Juli 2015, 22:30) aus folgendem Grund: Mit ist noch etwas eingefallen.


2

Samstag, 11. Juli 2015, 22:41

Benutzt Du ein custom message system?

Bei der Lösung via Rechtsklick -> Was ist in ShowChoices, benutzt Du da auch mal Cancle als Option? Was soll bei Rechtsklick dann passieren?

3

Sonntag, 12. Juli 2015, 18:07

Außer dem Mausscript benutze ich bisher nichts weiteres. DerVVulfman meinte bereits das ich vermutlich ein anderes Message System verwenden müsste; eines das mehrere Messageboxen zulässt wie z.B. das UMS. Nur dass das für diesen Wettbewerb z.B. nicht benutzt werden kann. Bisher habe ich in der Richtung nichts das rechtlich gesehen okay wäre.

Wegen dem Rechtskick: In DerVVs Mausskript gibt es die Option das normale scene_menu, das man auch per Escape aufrufen kann mit einem rechtsklick der Maustaste zu öffnen. Das wäre eine Alternative zu dem Aufrufen eines Fensters per klick auf ein Event auf der Map. Zwar brauche ich nicht das ganze Menü mit den Statuswerten etc. nicht, aber wenn es eine Möglichkeit gibt das Menü IN der Textbox aufzurufen, dann gibt es auch die Möglichkeit ein angepasstes Menü aufzurufen, richtig? Ob diese Erlaubnis durch ein klick auf ein Event oder einen rechtsklick mit der Maus machbar gemacht wird ist für den Spieler letztlich egal, solange es grundsätzlich in einer Form machbar ist.
Diese Möglichkeit MÖGLICH zu machen ist das große Problem.

Das Show Choices war nur ein Visuelles Beispiel an den Sachen die ich versuchen würde einzubauen, das ist nicht das fertige event XD' Sollte sich das was ich vor habe scriptlich nicht umsetzen lassen, würde ich die Message Boxen alle als einzelne Bilder speichern [was mehr Speicher brauchen würde, aber es wäre eine Eventbare alternative] und das ganze dann versuchen über Label, Conditional Branch etc. laufen zu lassen.

Bild
So ungefähr. (Nur das ich beim letzten Punkt die Variable auf den nächst höreren Punkt gestellt hätte; Copy-Paste Flüchtigkeitsfehler meinerseits gerade.)
In dem Fall würde ich vor jeder Message Box die Abfrage Variable anpassen und dann zu dem Punkt zurückgehen.

Machbar, aber es würde sehr schnell in sehr viel Chaos im Event enden und unübersichtlich werden XD'
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

4

Sonntag, 12. Juli 2015, 19:23

Es ist einfacher das Speichern-Laden-Beenden Menü über ein Skript zu erstellen, als über ein ShowChoice.

Von der Picture Idee würde ich - soweit es möglich ist - abraten. Das bläht dein Projekt unnötig auf und macht es für dich sehr unübersichtlich.

Das Messagesystem speichert den Text den es anzeigt leider nicht, man würde die Möglichkeit während einem Dialog zu speichern also damit verknüpfen das Messagesystem umzuschreiben. Die zweite Alternative wäre Haltepunkte in den Dialog einzubauen, wobei bei einem Speichern und Laden an den letzten Haltepunkt gesprungen würde. Für letztere Lösung wäre es nicht nötig, das Messagesystem umzuschreiben - stattdessen würde man am Eventinterpreter rumschrauben.
Das tatäschliche Problem ist: Wie setze ich am richtigen Punkt das Spielgeschehen fort, wenn ich einmal die Scene_Map verlassen habe und wieder betrete.

5

Sonntag, 12. Juli 2015, 23:15

Jap, das ist die Frage aller Fragen.
Die Picture Lösung möchte ich nur sehr ungern nehmen; ebenso die Show Choice option. Unschön, unübersichtlich und sehr viel mehr Speicher als nötig. Allerdings ist es bisher die beste Alternative die mir einfällt die ich selbst und mit events zustande bekommen würde, wenn sich scriptlich keine Lösung findet.
Wobei auch das schwierig ist.
Ich weiß es gibt dieses script von Taylor was das Öffnen von Menüs wärend eines Events erlaubt, allerdings ist es weder wirklich 'veröffentlicht', noch in diesem Fall verwendbar, da es offenbar auf das SDK zurückgreift.

Irgendwie...jedes mal wenn ich an einem Projekt arbeite ist es egal wie viele Gedanken ich mir im Vorfeld mache; es taucht immer ein unerwartetes Porblem auf das unerwartet schwer zu lösen ist. XD'
(Ich bin halt doch mehr Schreiber als GameDeveloper)
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

6

Montag, 13. Juli 2015, 22:29

Taylor hat da einen interessanten Ansatz, der geht mir aber ein Stückchen zu weit - es reicht ja nur bei Dialogen das Menü aufrufen zu können und nicht an jeder beliebigen Stelle des Abarbeitens der Eventcommands. Aber ich glaube ich habe jetzt einen Ansatz - ich lass den Eventinterpreter in ruhe und kümmer mich nur um das Erhalten des Messagetextes, wenn man die Scene wechselt.
Benutzt Du das Standardmessagesystem? Dann würde ich meine Lösung nämlich darauf beziehen. Es ist glaub ich nicht so viel zu tun, es reicht bei Window_Message#dispose bzw. Window_Message#terminate_message die globalen Tempvariablen nicht zu leeren, bzw. damit es speicherbar ist, das ganze in Game_System auszulagern, was jetzt noch bei Game_Temp liegt. Die Lösung ist aber stark mit dem Messagesystem verknüpft, deswegen müsste ich wissen, welches Du benutzt.

7

Montag, 13. Juli 2015, 23:56

Es ist kein Message System in dem Sinne, aber...
[RGSS/2/3] Drago - Font Enhance
Da es ja auch irgendwie auf die Messagebox zugreift erwähne ich es lieber mal; zumal ich es erst vor Kurzem hinzugefügt habe, um die Schrift besser lesbar machen zu können.

Wenn sich das zu sehr mit der Lösung für meine Anfrage hier beißen sollte, werd ich mich nach einer anderen alternative für einen Drop Shadow hinter der Schrift umsehen. Ich will dir ja nicht noch mehr Arbeit machen als ich es ohnehin schon tue. ^^'
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

8

Dienstag, 14. Juli 2015, 22:47

Das Skript sollte keinen Einfluss haben.
Ich setz mich am Wochenende dann mal dran. Noch Wünsche für das Messagesystem, wenn ich eh die Finger drin habe?
Oh, und diese Anzeige "Speichern/Laden/Beenden" - wo soll die auf dem Bildschirm erscheinen und wie soll sie aussehen?

9

Mittwoch, 15. Juli 2015, 01:52

Klar gäbe es einige Spielereien für das Message System, um Dinge einfacher/schicker zu machen die ich gern hätte, aber du tust mir ohnehin schon einen großen Gefallen =D
Was mir einfallen würde was villeicht halbwegs einfach zu machen wäre, wäre ein Switch mit dem man das aufrufen des Menüs erlauben/verbieten kann. Ist aber ein muss.

Was die Anzeige angeht...mein Gedanke war, die Protagonisting ihr Smartphone als Menü nutzen zu lassen und diese Auswahl dann innerhalb des Toucscreens darzustellen.
Also...so, in etwa, wenn das machbar ist:
Spoiler
Bild
Work in Progress
zum Lesen den Text mit der Maus markieren
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

10

Mittwoch, 15. Juli 2015, 01:59

Zitat

Was mir einfallen würde was villeicht halbwegs einfach zu machen wäre, wäre ein Switch mit dem man das aufrufen des Menüs erlauben/verbieten kann.
Du meinst das aufrufen des speziellen Menüs?

Zitat

Ist aber ein muss.
Voll fordernd. :3

Dann vermute ich ersetzt das Smartphone nicht das normale Menü, sonder ist ein extra Menü? Ist kein Problem, die Auswahl so darzustellen.


PS: Kannst Du mir noch das verwendete Mausskript verlinken?

11

Mittwoch, 15. Juli 2015, 03:03

AH DERP!
Ich sollte um die Uhrzeit keine Forenbeiträge mehr posten XD'
Sorry, sorry, sorry!
Kein muss, natürlich. *schäm*


Und ja, dafür war der Switch. Um das aufrufen evtl. zu deaktivieren wenn der Spieler eine GameOver entscheidung getroffen hat, so das er oder sie sich nicht versehentlich eine messagebox vorm Ende festspeichert und nur mit einem neuanfang aus der Endlosschleife entkommen könnte.

Das Speichern-Laden-Beenden Smartphone ist das gesammte Menü; mehr gibt's nicht. Du hast also schon recht das es das Normale ersetzt.
Das einzige was mich stört ist das ich da diese vier bunten Knöpfchen habe mit denen man auch etwas anfangen könnte...aber da es für ein Projet mit einer Deadline ist sollte ich besser aufpassen das ganze nicht zu komplex zu machen XD'
Ich verrenn mich so gern in Features und der Story...


EDIT: Ach so, das Mausscript noch mal...moment...hier:
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
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
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
#===============================================================================
# ** MOUSIE!  The Mouse system
#===============================================================================
#    Version 3.1
#    by DerVVulfman
#    October 3, 2012
#===============================================================================
#
#   SETTING UP THE MOUSE ICON SYSTEM
#
#   Mouse icons are stored in a hash array.
#
#   The system is designed  so you can create  your custom names or handles for
#   each mouse cursor/icon, let alone assign the custom icon(s) for your mouse.
#
#   Custom handles are string values  that you can use  in map events to change
#   the appearance of the 'mouse' when it is over same said event.  Each handle
#   is tagged to an icon filename.   When the mouse is dragged over a map event
#   with this handle  in the required 'comment',  the cursor itself will change
#   to that of the icon it is assigned.
#
#   Icon filenames are the custom graphics  that are used  to show the mouse on
#   the screen.   These 24x24 graphics are stored in the Graphics\Icons folder.
#
#   The MOUSE_DEFAULT value holds the handle of the regular/default mouse as it
#   is seen throughout the game.   As the mouse typically  keeps the same shape
#   throughout the game, this feature is rather under-used. But it is necessary
#   to assign a name nonetheless.
#
#   The MOUSE_ICON hash array  holds the custom handles for each icon  (and the
#   mouse icons) that are shown when the mouse is over an event.   It is fairly
#   straightforward and uses only a pair of values...  the handle and the icon.
#   First, enter the custom handle, then have it point to an Icon filename. The
#   one thing to remember is that you must also include the MOUSE_DEFAULT value
#   and assign it a custom icon as well.  The startup handles of the MOUSE_ICON
#   array can be changed in-game by the use of the $mouse.mouse_icon_set script
#   call.
#
#   The MOUSE_MOVE_FUNCTION determines if the system allows the player  to move
#   the character around the screen with the mouse.  It is very straightforward
#   and can be enabled/disabled with the 'mouse_move' script call.
#
#   The MOUSE_EVENT_FUNCTION determines if the system allows the player to move
#   the cursor over events on which to simply click and activate.   This allows
#   for the game designer  to make sim-like games.  It is  very straightforward
#   and can be enabled/disabled with the 'mouse_event' script call.   One thing
#   to note is that it disables the ability  to move the player with the mouse.
#   Also, it only functions if the event is set to 'Action Button'.
#
#   The MOUSE_MENU_FUNCTION determines if the system  allows you to control the
#   menu with the mouse.   It is very simple to use and can be enabled/disabled
#   with the 'mouse_menu' script call.
#
#   The MOUSE_STARTUP_VISIBLE  informs the system if the mouse icon  is visible
#   when the game begins.  The visibility of the mouse icon can be turned on or
#   off with the $game_system.mouse_visible_bool script call.
#
#-------------------------------------------------------------------------------
#  
#   CALL VALUES FOR YOUR PROJECT
#
#   This system  is designed  to update  all mouse data automatically  as it is 
#   tied into the  Input class  and is processed through the Input.update calls
#   throughout the default system.
#
#   Only a few actual calls are necessary:
#
#       Mouse.click?  *  Mouse.dbclick?  *  Mouse.press?  *  Mouse.pos
#        Mouse.pos_set  *  Mouse.pos_x  *  Mouse.pos_y  *  Mouse.screen
#                      Mouse.screen_x  *  Mouse.screen_y
#                       $game_system.mouse_visible_bool
#                           $mouse.mouse_icon_set
#                   mouse_move * mouse_event * mouse_menu
#
#
#   Mouse.click?(key)
#       This call determines whether a mouse button is currently being pressed.
#       If the button is being pressed, it returns TRUE. If not, returns FALSE.
#       It works in the same manner as the Input.press? & Input.trigger? calls.
#           The 'key' value passed into the call  defines which mouse button is
#           to be tested:  Left_Click, Right_Click or Middle_Click
#
#   Mouse.dbclick?(key)
#       This call  determines whether  a mouse button  has been quickly pressed
#       and released twice.   If the button was twice-clicked,  it returns TRUE
#       If not, it returns FALSE.
#           The 'key' value passed into the call  defines which mouse button is
#           to be tested:  Left_Click, Right_Click or Middle_Click
#
#   Mouse.press?(key)
#       This call  determines whether a mouse button has been depressed and not
#       yet released.  While depresses, it returns TRUE. If not, returns FALSE.
#           The 'key' value passed into the call  defines which mouse button is
#           to be tested:  Left_Click, Right_Click or Middle_Click
#
#   Mouse.pos
#       This call returns the mouse cursor's X and Y position (in pixels) based
#       on the game's screen.  Under normal conditions, this is a 640x480 area.
#           A passable value of 'false' allows this method to return a value of
#           'nil' if the mouse os outside the gaming window, otherwise it re-
#           turns a position of -1,-1.
#
#   Mouse.pos_set(x, y)
#       This call sets the mouse cursor's position specified by x and y.
#
#   Mouse.pos_x
#       This call returns  the mouse cursor's X position  (in pixels)  based on 
#       the game's screen. Under normal conditions, would be a value up to 640.
#
#   Mouse.pos_y
#       This call returns  the mouse cursor's Y position  (in pixels)  based on 
#       the game's screen. Under normal conditions, would be a value up to 480.
#
#   Mouse.screen
#       This call returns the mouse cursor's X and Y position (in pixels) based
#       on the entire window screen, regardless if it is within the game window
#       or not.  The returned value is based solely on the screen and the reso-
#       lution settings for your display.
#
#   Mouse.screen_x
#       This call returns  the mouse cursor's X position  (in pixels)  based on 
#       the entire window screen,  regardless if it's within the game window or
#       not.
#
#   Mouse.screen_y
#       This call returns  the mouse cursor's X position  (in pixels)  based on 
#       the entire window screen,  regardless if it's within the game window or
#       not.
#
#   $game_system.mouse_visible_bool
#       Not exactly one  that controls the mouse,  but determines  if the mouse
#       is visible.  By setting this value to true, the mouse is visible on the
#       screen.  But setting it to nil (not false), erases it.
#
#   $mouse.mouse_icon_set
#       This allows the game designer  to allow the mouse icons  to change from
#       one complete set of icons to another set depending upon gameplay.
#
#   mouse_move(true/false)
#       This call allows you to turn on/off mouse movement function during game
#       play.   A value of true lets the player move the character with the use
#       of the mouse while false prevents movement.
#
#   mouse_event(true/false)
#       This call lets you turn on/off the ability of the mouse to activate the
#       list of commands  within a map event.   A value of true  lets the mouse
#       click and run a map event while false prevents it. Please remember that
#       this disables mouse point-n-click movement.
#
#   mouse_menu(true/false
#       This call allows you to turn on/off menu highlight & selection features
#       during gameplay.   This extends to the use of the right mouse button to
#       enter the main menu  from the map screen.   A value of true enables the
#       ability to control menu functions with the mouse while a value of false
#       prevents them.
#
#-------------------------------------------------------------------------------
#
#  NOTES:
#
#  Odd as it may sound, Mousie prefers to use Near Fantastica's V1 Pathfinding
#  system in preferance  over Version 2.   This is merely because  version 1's
#  pathfinding algorythm, though more primitive,  takes less time to calculate
#  than version 2 and is thus more instantaneous.
#
#  If you change the on/off features of the menu and/or mouse movement options,
#  they only get saved  into the savegame file.  On startup,  the values within
#  the configuration system  will be  loaded  before the  savegame values  take 
#  effect.  If one desires to have the effects of the mouse menu option to take
#  effect the moment  you enter the Title screen,  they will have to make their
#  own special save file.   This system covers only  the normal operations that
#  are expected in gameplay.
#
#  The Event Click feature was designed solely so the mouse can move overtop of
#  events and activate them with a single mouse click. This is a common feature
#  in sim and real time tactical games (such as Age of Empires, Warcraft, etc).
#  It also disables mouse movement (even if configured)  as it would appear odd
#  if clicking on an event  within a simulation game  moves a character towards
#  the same clicked object.  It is not a bug.  It is a feature.
#
#  For compatability  with an older 'Full Keyboard' script by Cybersam,  a new
#  method was added for the Input.pressed? command which his system uses.   It
#  is a basic replica  of the '.press?' method within the Input class,  merely
#  changing alias names and calls to suit Cybersam's input method.
#
#-------------------------------------------------------------------------------
#
#  CREDITS AND THANKS
#
#  Some routines within this script  have been based  on the work of Mr.Mo,
#  Lambchop, Behemoth and Near Fantastica.  I also have to thank Delmaschio
#  of RMVXP.Com and House Slasher  for noticing that autorun events did not
#  hinder point-n-click movement... now fixed.   Along with that,  allow me
#  to thank sixtyandaquarter for bringing up the idea  of enabling and dis-
#  abling menu and movement functions in the system.   And thanks to Reives
#  for the idea of changing  the entire set o f mouse icons in-game.  Some,
#  thanks to sixtyandaquarter for getting me off my butt and allow the sys-
#  tem click on events and run them immediately.  And finally to MeKool for
#  noticing an event freeze problem, and that I failed  to insert all of my
#  mouse positioning system.
#  
#===============================================================================  
 
 
  # Default Handle                    Default String
    MOUSE_DEFAULT                 =   "Default"
 
  # Mouse Array    Cursor Handle      Mouse Icon file
    MOUSE_ICON = { MOUSE_DEFAULT  =>  "Arrow"  }          
 
  # Left-Clicking Control---
  # 0 = single click action
  # 1 = double-click action
  MOUSE_LEFT_ACTION = 0
 
  # Right-Clicking Control--
  # 0 = Menu / 'B' pressed
  # 1 = Stop Movement
  MOUSE_RIGHT_ACTION = 0
 
 
  # Mouse Movement on Startup --
  # true          = Mouse Movement is available
  # false or nil  = Movement disabled
  #
  # *  You can change point-n-click movement with the script call:
  #    mouse_move(boolean) where boolean is true or false.
  # ** Movement still relies on the use of a pathfinding script.
  MOUSE_MOVE_FUNCTION   = false
 
  # Mouse Event Click on Startup --
  # true          = Event Clicking is available
  # false or nil  = Event Clicking disabled
  #
  # *  You can change event clicking with the script call:
  #    mouse_click(boolean) where boolean is true or false.
  # ** This disables mouse movement altogether
  MOUSE_EVENT_FUNCTION  = true  
 
  # Mouse Menu Functions on Startup --
  # true          = Mouse Menu Control is available
  # false or nil  = Menu Control is disabled
  #
  # *  You can change menu control with the script call:
  #    mouse_menu(boolean) where boolean is true or false.
  # ** Unless you make your own configuration system, the
  #    Scene_Title functions will default to this regardless
  #    of any save game values.
  MOUSE_MENU_FUNCTION   = true
 
  # Visible on Startup --
  # true          = Mouse visible as normal
  # false or nil  = Mouse is hidden
  #
  # * You can change visibility with $game_system.mouse_visible_bool
  #   $game_system.mouse_visible_bool = false will hide the mouse.
  #   $game_system.mouse_visible_bool = true will reveal it again.
  #
  MOUSE_STARTUP_VISIBLE = true
 
  #  Movement range--
  #  Range in 'steps' the pathfinding 
  #  for NF Pathfinding version 2 beta
  #  High values & large maps causes lag
  PF_RANGE = 100
 
 
module Mouse
  #-------------------------------------------------------------------------
  # * Win32API calls
  #-------------------------------------------------------------------------
  @cursor_pos_get = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
  @cursor_pos_set = Win32API.new('user32', 'SetCursorPos', 'ii', 'i')
  @cursor_show    = Win32API.new('user32', 'ShowCursor', 'L', 'i')
  @window_find    = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')  
  @window_c_rect  = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
  @window_scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
  @window_cli2scr = Win32API.new('user32', 'ClientToScreen', %w(l p), 'i')
  @readini        = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l') 
  @key            = Win32API.new("user32", "GetAsyncKeyState", 'i', 'i')
  #-------------------------------------------------------------------------
  # * Mouse Button Values
  #-------------------------------------------------------------------------
  Left_Click    = 1
  Right_Click   = 2
  Middle_Click  = 4
  MOUSE_BUTTONS = { Left_Click    => 1,
                    Right_Click   => 2,
                    Middle_Click  => 4 }
  MOUSE_REPEAT = MOUSE_BUTTONS.clone
  MOUSE_REPEAT.keys.each { |k| MOUSE_REPEAT[k] = [false, false, 10]}  
  #-------------------------------------------------------------------------
  # * Game Initialization Values
  #-------------------------------------------------------------------------
  @game_window = nil    # Set game handle to nil
  @cursor_show.call(0)  # Turn off system mouse
  @mouse_visible = true # default mouse setting
  #-------------------------------------------------------------------------
  # * Click?
  #     button : button to check
  #-------------------------------------------------------------------------
  def Mouse.click?(button)
    MOUSE_REPEAT[button][1] >= 1
  end
  #-------------------------------------------------------------------------
  # * Double Clicked?
  #     button : button to check
  #-------------------------------------------------------------------------
  def Mouse.dbclick?(button)
    MOUSE_REPEAT[button][1] == 2
  end  
  #-------------------------------------------------------------------------
  # * press?
  #     button : button to check
  #-------------------------------------------------------------------------
  def Mouse.press?(button)
    MOUSE_REPEAT[button][0] == true
  end    
  #-------------------------------------------------------------------------
  # * Get Mouse Position
  #-------------------------------------------------------------------------
  def Mouse.pos(catch_anywhere = true)
    x, y = screen_to_client(screen_x, screen_y)
    width, height = client_size
    if catch_anywhere or (x >= 0 and y >= 0 and x < width and y < height)  
      return x, y
    else
      return 0, 0
    end    
  end
  #-------------------------------------------------------------------------
  # * Set Mouse Position
  #     x      : new x-coordinate (0 to 640)
  #     y      : new y-coordinate (0 to 480)
  #-------------------------------------------------------------------------
  def Mouse.pos_set(x, y)
    x = [[x, 0].max, 640].min
    y = [[y, 0].max, 480].min
    x, y = client_to_screen(x, y)
    @cursor_pos_set.call(x, y)
  end
  #-------------------------------------------------------------------------
  # * Get Mouse X-Coordinate Position
  #-------------------------------------------------------------------------
  def Mouse.pos_x
    x, y = pos
    return x
  end
  #-------------------------------------------------------------------------
  # * Get Mouse Y-Coordinate Position
  #-------------------------------------------------------------------------
  def Mouse.pos_y
    x, y = pos
    return y
  end
  #-------------------------------------------------------------------------
  # * Get Mouse Screen Position
  #-------------------------------------------------------------------------
  def Mouse.screen
    pos = [0, 0].pack('ll')
    @cursor_pos_get.call(pos)
    return pos.unpack('ll')
  end  
  #-------------------------------------------------------------------------
  # * Get Mouse Screen X-Coordinate Position
  #-------------------------------------------------------------------------
  def Mouse.screen_x
    pos = [0, 0].pack('ll')
    @cursor_pos_get.call(pos)
    return pos.unpack('ll')[0]
  end
  #-------------------------------------------------------------------------
  # * Get Mouse Screen Y-Coordinate Position
  #-------------------------------------------------------------------------
  def Mouse.screen_y
    pos = [0, 0].pack('ll')
    @cursor_pos_get.call(pos)
    return pos.unpack('ll')[1]
  end
  #-------------------------------------------------------------------------
  #                           AUTOMATIC FUNCTIONS                          #
  #-------------------------------------------------------------------------
  #-------------------------------------------------------------------------
  # * Get the Game Window's width and height
  #-------------------------------------------------------------------------
  def Mouse.client_size
    rect = [0, 0, 0, 0].pack('l4')
    @window_c_rect.call(Mouse.hwnd, rect)
    right, bottom = rect.unpack('l4')[2..3]
    return right, bottom
  end  
  #-------------------------------------------------------------------------
  # * Get the game window handle (specific to game)
  #-------------------------------------------------------------------------
  def Mouse.hwnd
    if @game_window.nil?
      game_name = "\0" * 256
      @readini.call('Game','Title','',game_name,255,".\\Game.ini")
      game_name.delete!("\0")
      @game_window = @window_find.call('RGSS Player',game_name)
    end
    return @game_window
  end  
  #-------------------------------------------------------------------------  
  # * Convert game window coordinates from screen coordinates
  #-------------------------------------------------------------------------  
  def Mouse.screen_to_client(x, y)
    return nil unless x and y
    pos = [x, y].pack('ll')
    if @window_scr2cli.call(hwnd, pos) != 0
       return pos.unpack('ll')
     else
       return nil
    end
  end
  #-------------------------------------------------------------------------  
  # * Converts client coordinates to screen coordinates
  #-------------------------------------------------------------------------  
  def Mouse.client_to_screen(x, y)
    return nil unless x and y
    pos = [x, y].pack('ll')
    if @window_cli2scr.call(hwnd, pos) != 0
       return pos.unpack('ll')
    else
       return nil
    end
  end  
  #--------------------------------------------------------------------------
  # * Frame Update (Mouse version)
  #--------------------------------------------------------------------------
  def Mouse.update
    MOUSE_BUTTONS.keys.each do |key|
      temp = MOUSE_REPEAT[key][0]
      key_pres = @key.call(MOUSE_BUTTONS[key]) != 0
      key_trig = temp == key_pres ? 0 : (key_pres ? (MOUSE_REPEAT[key][2].between?(1, 9) ? 2 : 1) : -1)
      count = key_trig > 0 ? 0 : [MOUSE_REPEAT[key][2]+1, 20].min
      MOUSE_REPEAT[key] = [key_pres, key_trig, count]
    end
  end
  #-------------------------------------------------------------------------
  # * Visible?
  #-------------------------------------------------------------------------
  def Mouse.visible?(visible=true)
    if visible
      @cursor_show.call(-1)
    else
      @cursor_show.call(0)
    end
  end
end
 
 
 
#==============================================================================
# ** Game_System
#------------------------------------------------------------------------------
#  This class handles data surrounding the system. Backround music, etc.
#  is managed here as well. Refer to "$game_system" for the instance of 
#  this class.
#==============================================================================
 
class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :mouse_pf1                # Path Finding v1 detection bool
  attr_accessor :mouse_pf2                # Path Finding v2 detection bool
  attr_accessor :mouse_visible_bool       # Mouse System Visibility bool
  attr_accessor :menu_enabled             # Mouse Controlled Menu bool
  attr_accessor :move_enabled             # Mouse Controlled Movement bool
  attr_accessor :eclick_enabled           # Mouse Event Clicking bool
  attr_accessor :mouse_icon_set           # Mouse icons
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias mouse_init initialize
  def initialize
    mouse_init
    @mouse_pf1          = nil
    @mouse_pf2          = nil
    @mouse_visible_bool = MOUSE_STARTUP_VISIBLE
    @move_enabled       = nil
    @menu_enabled       = nil
    @eclick_enabled     = nil
    @mouse_icon_set     = {}
  end
end
 
 
 
#==============================================================================
# ** Sprite_Mouse
#------------------------------------------------------------------------------
#  This sprite is used to display the mouse.  It observes the Mouse module and
#  automatically changes mouse graphic conditions.
#==============================================================================
 
class Sprite_Mouse
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :icon
  attr_accessor :x
  attr_accessor :y
  attr_accessor :clicked
  attr_accessor :menu_enabled
  attr_accessor :move_enabled
  attr_accessor :eclick_enabled
  attr_accessor :mouse_icon_set
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @x              = 0
    @y              = 0
    @clicked        = nil
    @sprite         = Sprite.new
    @sprite.z       = 5000
    @draw           = false
    @events         = {}
    @move_enabled   = MOUSE_MOVE_FUNCTION
    @menu_enabled   = MOUSE_MENU_FUNCTION
    @eclick_enabled = MOUSE_EVENT_FUNCTION
    @mouse_icon_set = MOUSE_ICON
    reset
  end
  #--------------------------------------------------------------------------
  # * Reset
  #--------------------------------------------------------------------------
  def reset
    @icon = RPG::Cache.icon(@mouse_icon_set[MOUSE_DEFAULT])
    @icon_name = @mouse_icon_set[MOUSE_DEFAULT]
    @sprite.bitmap.dispose if @sprite.bitmap != nil and @sprite.bitmap.disposed?
    @sprite.bitmap = @icon
    @draw = false
    # Updates the co-ordinates of the icon
    @x, @y = Mouse.pos
    @sprite.x = @x
    @sprite.y = @y
    @sprite.z = 5000
    unless defined?($game_system.mouse_visible_bool)
      @sprite.visible = MOUSE_STARTUP_VISIBLE  
    else
      @sprite.visible = $game_system.mouse_visible_bool ? true : false
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    Mouse.update
    @sprite.visible = $game_system.mouse_visible_bool ? true : false
    # Updates the co-ordinates of the icon
    @x, @y = Mouse.pos
    # Skip if not on the screen
    return if @x == nil or @y == nil
    #Get Client Size
    width,height = Mouse.client_size
    @sprite.x = @x
    @sprite.y = @y
    #Check if needs to restart
    (@draw = (@x < 0 or @y < 0 or @x > width or @y > height)) if !@draw
    #Reset if need to reset
    reset if @draw and @x > 1 and @y > 1 and @x < width and @y < height
    #Show mouse if need to
    if (@x < 0 or @y < 0 or @x > width or @y > height) and @visible
      Mouse.visible?
    elsif (@x > 0 or @y > 0 or @x < width or @y < height) and !@visible
      Mouse.visible?(false)
    end
    #Return if Scene is not Scene_Map
    return if !$scene.is_a?(Scene_Map)
    # Return if mouse movement disabled
    return unless $mouse.move_enabled or $mouse.eclick_enabled
    # Prevent movement if event running or message showing
    unless $game_system.map_interpreter.running? or
      $game_temp.message_window_showing    
      #Check if the mouse is clicked
      mouse_pressed if Mouse.click?(Mouse::Left_Click) and !$game_temp.message_window_showing
      if MOUSE_RIGHT_ACTION == 1
        if $game_system.mouse_pf1
          $game_player.clear_path if Mouse.click?(Mouse::Right_Click)
        end
        if $game_system.mouse_pf2
          $path_finding.setup_depth(PF_RANGE)
          $path_finding.setup_player if Mouse.click?(Mouse::Right_Click)
        end
      end
    end    
    #Check for mouse over
    mouse_over_icon
  end
  #--------------------------------------------------------------------------
  # * Mouse Pressed
  #--------------------------------------------------------------------------
  def mouse_pressed(button_type = nil)
    @clicked = 1
    if Mouse.dbclick?(Mouse::Left_Click)
      @clicked = 2
    end
    # If event Clicking
    if @eclick_enabled
      evented = get_object
      if evented[0]
        evented[1].start if evented[1].trigger == 0
      end
    else
      # Routines called for Path Finding v1
      if $game_system.mouse_pf1
        # Turn to face regardless
        $game_player.find_facing(tile_x, tile_y)
        #If there is nothing than move
        return if !$game_map.passable?(tile_x, tile_y, 0, $game_player)
        $game_player.find_path(tile_x, tile_y)
      end
      # Routines called for Path Finding v2
      if $game_system.mouse_pf2
        $path_finding.setup_depth(PF_RANGE)
        $path_finding.setup_player
        $path_finding.add_paths_player(tile_x, tile_y, true)
        $path_finding.start_player      
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Mouseover Icon
  #--------------------------------------------------------------------------
  def mouse_over_icon
    object = get_object
    if object[0]
      event = @events[object[1].id]
      return if event == nil
      list = event.list
      return if list == nil
      #Check what the list is
      for key in @mouse_icon_set.keys
        next if !list.include?(key)
        next if @icon_name == @mouse_icon_set[key]
        @icon = RPG::Cache.icon(@mouse_icon_set[key])
        @icon_name = @mouse_icon_set[key]
        @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
        @sprite.bitmap = @icon
      end
    elsif @icon_name != @mouse_icon_set[MOUSE_DEFAULT]
      @icon = RPG::Cache.icon(@mouse_icon_set[MOUSE_DEFAULT])
      @icon_name = @mouse_icon_set[MOUSE_DEFAULT]
      @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
      @sprite.bitmap = @icon
    end
  end
  #--------------------------------------------------------------------------
  # * Get the current x-coordinate of the tile
  #--------------------------------------------------------------------------
  def tile_x
    return ((($game_map.display_x.to_f/4.0).floor + @x.to_f)/32.0).floor
  end
  #--------------------------------------------------------------------------
  # * Get the current y-coordinate of the tile
  #--------------------------------------------------------------------------
  def tile_y
    return ((($game_map.display_y.to_f/4.0).floor + @y.to_f)/32.0).floor
  end  
  #--------------------------------------------------------------------------
  # * Get Object
  #--------------------------------------------------------------------------
  def get_object
    for event in $game_map.events.values
      return [true,event] if event.x == tile_x and event.y == tile_y
    end
    return [false,nil]
  end  
  #--------------------------------------------------------------------------
  # * MOUSE Refresh(Event, List, Characterset Name
  #--------------------------------------------------------------------------
  def refresh(event, list)
    @events.delete(event.id)
    if event.list && event.list[0].code == 108
      icon = event.list[0].parameters 
    end
    @events[event.id] = Mouse_Event.new(event.id)
    @events[event.id].list = icon
  end
end
 
 
 
$mouse = Sprite_Mouse.new
 
 
#==============================================================================
# ** Mouse_Event
#------------------------------------------------------------------------------
#  This class deals with events. It adds new functionality between events and
#  the mouse system.  It's used within the Game_Map class.
#==============================================================================
 
class Mouse_Event
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :id
  attr_accessor :list
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(id)
    @id = id
    @list = nil
  end
end
 
 
 
#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
#  This class deals with events. It handles functions including event page 
#  switching via condition determinants, and running parallel process events.
#  It's used within the Game_Map class.
#==============================================================================
 
class Game_Event < Game_Character
  #--------------------------------------------------------------------------
  # * Event ID
  #--------------------------------------------------------------------------
  def id
    return @id
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  alias nf_game_event_refresh refresh
  def refresh
    nf_game_event_refresh
    $mouse.refresh(self, @list)
  end
end
 
 
 
#==============================================================================
# ** Input
#------------------------------------------------------------------------------
#   Adds new Mouse Input functions into a new class
#==============================================================================
class << Input
  #--------------------------------------------------------------------------
  # * Update old input calls
  #--------------------------------------------------------------------------
  alias old_update update unless $@
  def Input.update
    old_update
    $mouse.update
  end
  #--------------------------------------------------------------------------
  # * Update old input triggers
  #     num : A, B, C
  #--------------------------------------------------------------------------
  alias old_trigger? trigger? unless $@
  def Input.trigger?(num)
    return old_trigger?(num) if Mouse.pos(false) == nil
    case num
    when Input::A
      if  $mouse.menu_enabled && !$scene.is_a?(Scene_Map)
        return (old_trigger?(num) or Mouse.click?(Mouse::Middle_Click))
      else
        return old_trigger?(num)
      end
    when Input::B
      if MOUSE_RIGHT_ACTION == 0
        if $mouse.menu_enabled
          return (old_trigger?(num) or Mouse.click?(Mouse::Right_Click))
        else
          return old_trigger?(num)
        end
      else
        if $mouse.menu_enabled
          return (old_trigger?(num) or Mouse.click?(Mouse::Right_Click))          
        else
          return (old_trigger?(num))
        end
      end
    when Input::C
      if MOUSE_LEFT_ACTION == 0
        if $mouse.menu_enabled && !$scene.is_a?(Scene_Map)
          return (old_trigger?(num) or Mouse.click?(Mouse::Left_Click))        
        elsif $mouse.move_enabled && $scene.is_a?(Scene_Map)
          return (old_trigger?(num) or Mouse.click?(Mouse::Left_Click))        
        elsif $mouse.eclick_enabled && $scene.is_a?(Scene_Map)
          return Mouse.click?(Mouse::Left_Click)
        else
          return old_trigger?(num)
        end
      else
        if !$scene.is_a?(Scene_Map)
          if $mouse.menu_enabled
            return (old_trigger?(num) or Mouse.click?(Mouse::Left_Click))
          else
            return old_trigger?(num)
          end
        else
          if $mouse.clicked == 2
            return (old_trigger?(num) or Mouse.click?(Mouse::Left_Click))
          else
            return (old_trigger?(num))
          end
        end
      end
    else
      return old_trigger?(num)
    end
  end
  #--------------------------------------------------------------------------
  # * Update old input presses
  #     num : A, B, C
  #--------------------------------------------------------------------------
  alias old_press? press? unless $@
  def Input.press?(num)
    return old_press?(num) if Mouse.pos(false) == nil
    case num
    when Input::A
      if  $mouse.menu_enabled && !$scene.is_a?(Scene_Map)
        return (old_press?(num) or Mouse.press?(Mouse::Middle_Click))
      else
        return old_press?(num)
      end
    when Input::B
      if MOUSE_RIGHT_ACTION == 0
        if $mouse.menu_enabled
          return (old_press?(num) or Mouse.press?(Mouse::Right_Click))
        else
          return old_press?(num)
        end
      else
        if $mouse.menu_enabled
          return (old_press?(num) or Mouse.press?(Mouse::Right_Click))          
        else
          return (old_press?(num))
        end
      end
    when Input::C
      if MOUSE_LEFT_ACTION == 0
        if $mouse.menu_enabled && !$scene.is_a?(Scene_Map)
          return (old_press?(num) or Mouse.press?(Mouse::Left_Click))        
        elsif $mouse.move_enabled && $scene.is_a?(Scene_Map)
          return (old_press?(num) or Mouse.press?(Mouse::Left_Click))        
        elsif $mouse.eclick_enabled && $scene.is_a?(Scene_Map)
          return Mouse.press?(Mouse::Left_Click)
        else
          return old_press?(num)
        end
      else
        if !$scene.is_a?(Scene_Map)
          if $mouse.menu_enabled
            return (old_press?(num) or Mouse.press?(Mouse::Left_Click))
          else
            return old_press?(num)
          end
        else
          return (old_press?(num))
        end
      end
    else
      return old_press?(num)
    end
  end
  #--------------------------------------------------------------------------
  # * Update old input presses (Cybersam Version)
  #     num : A, B, C
  #--------------------------------------------------------------------------
  if defined?(Input.pressed?)
    alias old_pressed? pressed? unless $@
    def Input.pressed?(num)
      return old_press?(num) if Mouse.pos(false) == nil
      case num
      when Input::A
        if  $mouse.menu_enabled && !$scene.is_a?(Scene_Map)
          return (old_pressed?(num) or Mouse.press?(Mouse::Middle_Click))
        else
          return old_pressed?(num)
        end
      when Input::B
        if MOUSE_RIGHT_ACTION == 0
          if $mouse.menu_enabled
            return (old_pressed?(num) or Mouse.press?(Mouse::Right_Click))
          else
            return old_pressed?(num)
          end
        else
          if $mouse.menu_enabled
            return (old_pressed?(num) or Mouse.press?(Mouse::Right_Click))          
          else
            return (old_pressed?(num))
          end
        end
      when Input::C
        if MOUSE_LEFT_ACTION == 0
          if $mouse.menu_enabled && !$scene.is_a?(Scene_Map)
            return (old_pressed?(num) or Mouse.press?(Mouse::Left_Click))        
          elsif $mouse.move_enabled && $scene.is_a?(Scene_Map)
            return (old_pressed?(num) or Mouse.press?(Mouse::Left_Click))        
          elsif $mouse.eclick_enabled && $scene.is_a?(Scene_Map)
            return Mouse.press?(Mouse::Left_Click)
          else
            return old_pressed?(num)
          end
        else
          if !$scene.is_a?(Scene_Map)
            if $mouse.menu_enabled
              return (old_pressed?(num) or Mouse.press?(Mouse::Left_Click))
            else
              return old_pressed?(num)
            end
          else
            return (old_pressed?(num))
          end
        end
      else
        return old_pressed?(num)
      end
    end
  end
end
 
 
 
 
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================
 
class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------  
  attr_accessor :facingpath               # direction faced if 1 tile away
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias mouse_init initialize
  def initialize
    mouse_init
    # Path Finding v1 Detection
    if defined?(find_path)
      $game_system.mouse_pf1 = true
    else
      if defined?(pf_passable?)
        $game_system.mouse_pf2 = true
      end
    end
  end  
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias mouse_update update
  def update
    turn_facing if @facingpath != 0
    mouse_update
  end  
  #--------------------------------------------------------------------------
  # * Find Facing Direction
  #   Addition to Path Finding v 1
  #--------------------------------------------------------------------------  
  def find_facing(x,y)
    sx, sy = @x, @y      
    @facingpath = find_direction(sx,sy,x,y)
  end  
  #--------------------------------------------------------------------------
  # * Find Direction
  #   Addition to Path Finding v 1
  #--------------------------------------------------------------------------  
  def find_direction(sx,sy,ex,ey)
    ffx = sx - ex
    ffy = sy - ey
    facing = 0
    case ffx
    when 1 ; facing = 4
    when -1; facing = 6
    when 0
      case ffy
      when 1 ; facing = 8
      when -1; facing = 2
      end
    end
    return facing
  end  
  #--------------------------------------------------------------------------
  # * Turn Towards Object
  #   Addition to Path Finding v 1
  #--------------------------------------------------------------------------
  def turn_to(b)
    # Get difference in player coordinates
    sx = @x - b.x
    sy = @y - b.y
    # If coordinates are equal
    if sx == 0 and sy == 0
      return
    end
    # If horizontal distance is longer
    if sx.abs > sy.abs
      # Turn to the right or left towards player 
      sx > 0 ? turn_left : turn_right
    # If vertical distance is longer
    else
      # Turn up or down towards player
      sy > 0 ? turn_up : turn_down
    end
  end
  #--------------------------------------------------------------------------
  # * Turn Facing Click
  #   Addition to Path Finding v 1
  #--------------------------------------------------------------------------  
  def turn_facing
    case @facingpath
    when 2; turn_down
    when 4; turn_left
    when 6; turn_right
    when 8; turn_up
    end
    # Turn off
    @facingpath = 0
  end  
  #--------------------------------------------------------------------------
  # * Run Path
  #   EDIT to Path Finding v 1
  #--------------------------------------------------------------------------
  def run_path
    return if moving?
    step = @map[@x,@y]
    if step == 1
      @map = nil
      @runpath = false
      turn_to(@object) if @object != nil and in_range?(self, @object, 1)
      return
    end
    dir = rand(2)
    case dir
    when 0
      move_right  if @map[@x+1, @y]   == step - 1 and step != 0
      move_down   if @map[@x,   @y+1] == step - 1 and step != 0
      move_left   if @map[@x-1, @y]   == step - 1 and step != 0
      move_up     if @map[@x,   @y-1] == step - 1 and step != 0
    when 1
      move_up     if @map[@x,   @y-1] == step - 1 and step != 0
      move_left   if @map[@x-1, @y]   == step - 1 and step != 0
      move_down   if @map[@x,   @y+1] == step - 1 and step != 0
      move_right  if @map[@x+1, @y]   == step - 1 and step != 0
    end
  end  
end
 
 
 
#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================
 
class Interpreter
  #--------------------------------------------------------------------------
  # * Mouse Movement Enabler
  #     boolean : (true/false)
  #--------------------------------------------------------------------------
  def mouse_move(boolean = true)
    if boolean == true
      $mouse.move_enabled = true
    else
      $mouse.move_enabled = nil
    end
  end
  #--------------------------------------------------------------------------
  # * Mouse Menu Enabler
  #     boolean : (true/false)
  #--------------------------------------------------------------------------
  def mouse_menu(boolean = true)
    if boolean == true
      $mouse.menu_enabled = true
    else
      $mouse.menu_enabled = nil
    end
  end  
  #--------------------------------------------------------------------------
  # * Mouse Event Enabler
  #     boolean : (true/false)
  #--------------------------------------------------------------------------
  def mouse_event(boolean = true)
    if boolean == true
      $mouse.eclick_enabled = true
    else
      $mouse.eclick_enabled = nil
    end
  end
end
 
 
 
#==============================================================================
# ** Scene_Save
#------------------------------------------------------------------------------
#  This class performs save screen processing.
#==============================================================================
 
class Scene_Save < Scene_File
  #--------------------------------------------------------------------------
  # * Write Save Data
  #     file : write file object (opened)
  #--------------------------------------------------------------------------
  alias mouse_wsd write_save_data
  def write_save_data(file)
    # Store Mouse Values
    $game_system.move_enabled   = $mouse.move_enabled
    $game_system.menu_enabled   = $mouse.menu_enabled
    $game_system.eclick_enabled = $mouse.eclick_enabled   
    $game_system.mouse_icon_set = $mouse.mouse_icon_set
    # Perform the original call
    mouse_wsd(file)
  end
end
 
 
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
#  This class performs load screen processing.
#==============================================================================
 
class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Read Save Data
  #     file : file object for reading (opened)
  #--------------------------------------------------------------------------
  alias mouse_rsd read_save_data
  def read_save_data(file)
    # Perform the original call
    mouse_rsd(file)
    # Restore Mouse values
    $mouse.move_enabled   = $game_system.move_enabled 
    $mouse.menu_enabled   = $game_system.menu_enabled 
    $mouse.eclick_enabled = $game_system.eclick_enabled
    $mouse.mouse_icon_set = $game_system.mouse_icon_set
  end
end
zum Lesen den Text mit der Maus markieren

Und hier:
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
#===============================================================================
# ** MOUSIE!  Window Edits
#===============================================================================
#    by Lambchop
#
#    Edits also includes special conditions.  These conditions turn on/off the
#    mouse selection/highlight ability if the Mouse Menu option is turned off.
#    See "MOUSE_MENU_FUNCTION" for details
#===============================================================================
 
 
 
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
#  This window class contains cursor movement and scroll functions.
#==============================================================================
 
class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # * Initialize the mouse
  #--------------------------------------------------------------------------
  alias mouse_initialize initialize
  def initialize(x, y, width, height)
    mouse_initialize(x, y, width, height)
    @scroll_wait = 0
  end
  #--------------------------------------------------------------------------
  # * Update the mouse
  #--------------------------------------------------------------------------
  alias mouse_update update
  def update
    mouse_update
    mouse_operation if self.active && $mouse.menu_enabled
  end
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    width = self.width / @column_max - 32
    height = 32
    for index in 0...@item_max
      x = index % @column_max * (width + 32)
      y = index / @column_max * 32
      if mx > x and
         mx < x + width and
         my > y and
         my < y + height
        mouse_cursor(index)
        break
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Track the position of the mouse cursor
  #--------------------------------------------------------------------------
  def mouse_cursor(index)
    return if @index == index
    @scroll_wait -= 1 if @scroll_wait > 0
    row1 = @index / @column_max
    row2 = index / @column_max
    bottom = self.top_row + (self.page_row_max - 1)
    if row1 == self.top_row and row2 < self.top_row
      return if @scroll_wait > 0
      @index = [@index - @column_max, 0].max
      @scroll_wait = 4
    elsif row1 == bottom and row2 > bottom
      return if @scroll_wait > 0
      @index = [@index + @column_max, @item_max - 1].min
      @scroll_wait = 4
    else
      @index = index
    end
    $game_system.se_play($data_system.cursor_se)
  end
end
 
 
 
 
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================
 
class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation   
    return if @index < 0
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    x = 0
    width = self.width - 32
    height = 96
    for index in 0...@item_max
      y = index * 116
      if mx > x and
          mx < x + width and
          my > y and
          my < y + height
        mouse_cursor(index)
        break
      end
    end
  end
end
 
 
 
#==============================================================================
# ** Window_Target
#------------------------------------------------------------------------------
#  This window selects a use target for the actor on item and skill screens.
#==============================================================================
 
class Window_Target < Window_Selectable
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    return if @index <= -1
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    x = 0
    width = self.width - 32
    height = 96
    for index in 0...@item_max
      y = index * 116
      if mx > x and
          mx < x + width and
          my > y and
          my < y + height
        mouse_cursor(index)
        break
      end
    end
  end
end
 
 
 
#==============================================================================
# ** Window_NameInput
#------------------------------------------------------------------------------
#  This window is used to select text characters on the input name screen.
#==============================================================================
 
class Window_NameInput < Window_Base
  #--------------------------------------------------------------------------
  # ● Update the position of the mouse
  #--------------------------------------------------------------------------
  alias mouse_update update
  def update
    mouse_update
    mouse_operation if self.active  && $mouse.menu_enabled
  end
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    last_index = @index
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    width = 28
    height = 32
    for index in 0...180
      x = 4 + index / 5 / 9 * 152 + index % 5 * 28
      y = index / 5 % 9 * 32
      if mx > x and
          mx < x + width and
          my > y and
          my < y + height
        @index = index
        break
      end
    end
    x = 544
    y = 9 * 32
    width = 64
    if mx > x and
        mx < x + width and
        my > y and
        my < y + height
      @index = 180
    end
    $game_system.se_play($data_system.cursor_se) unless @index == index
  end
end
 
 
 
#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
#  This message window is used to display text.
#==============================================================================
 
class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    x = 8
    width = 128 
    height = 32
    for index in 0...@item_max
      y = ($game_temp.choice_start + index) * 32
      if mx > x and mx < x + width and my > y and my < y + height
        mouse_cursor(index)
        break
      end
    end
  end
end
 
 
 
#==============================================================================
# ** Window_PartyCommand
#------------------------------------------------------------------------------
#  This window is used to select whether to fight or escape on the battle
#  screen.
#==============================================================================
 
class Window_PartyCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    y = 0
    width = 128
    height = 32
    for index in 0...@item_max
      x = 160 + index * 160
      if mx > x and
          mx < x + width and
          my > y and
          my < y + height
        mouse_cursor(index)
        break
      end
    end
  end
end
 
 
 
#==============================================================================
# ** Window_MenuPosition
#------------------------------------------------------------------------------
#  This window positions the cursor on the screen.
#==============================================================================
 
class Window_MenuPosition < Window_Selectable
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    y = 0
    width = self.contents.width / @item_max - 10
    height = 32
    for index in 0...@item_max
      x = self.contents.width / (@item_max) * index + 4
      if mx > x and
         mx < x + width and
         my > y and
         my < y + height
        mouse_cursor(index)
        break
      end
    end
  end
end
 
 
 
#==============================================================================
# ** Arrow_Base
#------------------------------------------------------------------------------
#  This sprite is used as an arrow cursor for the battle screen. This class
#  is used as a superclass for the Arrow_Enemy and Arrow_Actor classes.
#==============================================================================
 
class Arrow_Base < Sprite
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias mouse_update update
  def update
    mouse_update
    mouse_operation if $mouse.menu_enabled
  end
end
 
 
 
#==============================================================================
# ** Arrow_Enemy
#------------------------------------------------------------------------------
#  This arrow cursor is used to choose enemies. This class inherits from the 
#  Arrow_Base class.
#==============================================================================
 
class Arrow_Enemy < Arrow_Base
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    mx, my = Mouse.pos
    for index in 0...$game_troop.enemies.size
      enemy = $game_troop.enemies[index]
      bitmap = RPG::Cache.battler(enemy.battler_name, 0)
      width = bitmap.width
      height = bitmap.height
      x = enemy.screen_x - width / 2
      y = enemy.screen_y - height
      if mx > x and
          mx < x + width and
          my > y and
          my < y + height
        break if @index == index
        @index = index
        $game_system.se_play($data_system.cursor_se)
        break
      end
    end
  end
end
 
 
 
#==============================================================================
# ** Arrow_Actor
#------------------------------------------------------------------------------
#  This arrow cursor is used to choose an actor. This class inherits from the
#  Arrow_Base class.
#==============================================================================
 
class Arrow_Actor < Arrow_Base
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation 
    mx, my = Mouse.pos
    for index in 0...$game_party.actors.size
      index = $game_party.actors.size - index - 1
      actor = $game_party.actors[index]
      bitmap = RPG::Cache.battler(actor.battler_name, 0)
      width = bitmap.width
      height = bitmap.height
      x = actor.screen_x - width / 2
      y = actor.screen_y - height
      if mx > x and
          mx < x + width and
          my > y and
          my < y + height
        break if @index == index
        @index = index
        $game_system.se_play($data_system.cursor_se)
        break
      end
    end
  end
end
 
 
 
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This is a superclass for the save screen and load screen.
#==============================================================================
 
class Scene_File
  #--------------------------------------------------------------------------
  # * Update the mouse
  #--------------------------------------------------------------------------
  alias mouse_update update
  def update
    mouse_update
    save = false
    if $mouse.menu_enabled
      mx, my = Mouse.pos
      x = 0
      width = (save ? 160 : 640)
      height = 104
      for index in 0...4
        y = 64 + index % 4 * 104
        if mx > x and
            mx < x + width and
            my > y and
            my < y + height
          break if @file_index == index
          @savefile_windows[@file_index].selected = false
          @file_index = index
          @savefile_windows[@file_index].selected = true
          $game_system.se_play($data_system.cursor_se)
          break
        end
      end
    end
  end
end
zum Lesen den Text mit der Maus markieren
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

12

Montag, 20. Juli 2015, 17:20

Habe das Messagesystem im Gro umgeschrieben und jetzt kann ich problemlos innerhalb eines Dialogs speichern und den Spielverlauf an der Stelle auch wieder aufnehmen.
whoop whoop :dance:

Ich schreibe dafür Game_System, Window_Message und Interpreter um und habe einige neue Klassen erstellt - Speicherstände die vor Einfügen des Skriptes erstellt wurden funktionieren also sehr wahrscheinlich nichtmehr. Ich mach mich dann jetzt an das Handy-Menü - wie soll das aussehen und was soll es können?

13

Donnerstag, 23. Juli 2015, 16:48

Sorry für die komplett verspätete Antwort ^^' Und das wo du dir extra solche Mühe machst...Ich hatte mit einigen technischen schwierigkeiten zu kämpfen.
Erstmal: vielen Dank!

Was das Menü angeht hat sich eigentlich nichts verändert.
Spoiler
Bild
zum Lesen den Text mit der Maus markieren

Dies wäre die Grafik; wobei auf dem Bildschirm dann die Auswahlmöglichkeiten "Speichern, Laden, Beenden" wären. Bzw. Save, Load und Exit.
Eventuell mit der Option das die vier Tasten ebenfalls eine andere Scene aufrufen können wenn eine zugewiesen wird, ala $scene = Scene_Item.new oder so, zum Beispiel, wobei ich befürchte ich würde mich in meinen Features verheddern XD'
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

14

Freitag, 24. Juli 2015, 06:35

Hier mal eine kleine TechDemo für dich - ist alles noch Work in Progress und der Quellcode ist noch nicht aufgeräumt.
Basil erzählt dir was und währenddessen kann man via Rechtsklick das Menü öffnen, seine Items angucken oder Speichern. (Wichtig ist das beim aktuellen Setup in ShowChoices die Option Cancle auf Dissalow stehen muss, wenn ein Rechtsklick das Menü öffnen und nicht die Choice abbrechen soll.)

Ich denke was das Aussehen angeht, setzen wir uns nochmal zusammen wenn Du dabei bist die Grafiken zu finalisieren. Ansonsten kann man an diesem Punkt noch viel ändern, also sag mir was Du denkst und dann mach ich den Code soweit fertig, das Du ihn bei dir einsetzen kannst.
»Playm« hat folgende Datei angehängt:

15

Freitag, 24. Juli 2015, 16:52

You know... XD So als Jemand der selbst eher ein nicht-scripter ist, ist deine Arbeit ziemlich beeindruckend.
Danke! =D

Da das Ganze eine Visual Novel werden soll, kannst du die Spielzeit und Goldanzeige ruhig auslassen, da ich diese nicht als solche benutzen würde. ^^
Ansonnsten fällt mir außer dem visuellen Aspekt das sich die drei Menüpunkte in der Mitte des Smartphonebildschirms besser aufgehoben fühlen würden nichts weiter ein...


Ich hoffe mein Versuch ein einem mir halbwegs unvertrauten Genre wird all deiner Arbeit zumindest halbwegs gerecht, wenn ich fertig bin.
Nochmals: Danke! =D
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

16

Freitag, 24. Juli 2015, 19:09

Huch, zwei Downloads? Wer hat denn da Mäusschen gespielt?

Gern geschehen, ich hoffe Du wirst fertig. Aktuell sitzen die Buttons noch nicht perfekt da, wo sie laut Hintergrundbild seien würden (sieht man am Cursor) - soll ich das Skript anpassen, oder passt Du die Grafik an?

17

Freitag, 24. Juli 2015, 19:52

Gern geschehen, ich hoffe Du wirst fertig.

Das hoffe ich auch XD'
Ich meine, abschließen werde ich es auf jeden Fall. Ob ich es trotz der unerwarteten Probleme im Zeitlimit schaffe ist die Frage...Ich geb einfach mein bestes!

Ja, ich hab gesehen das die Buttons noch nicht ganz perfekt sind. Ich kann mir das gern im Script selbst anpassen, wenn du mir verrätst wonach ich ausschau halten muss. Das bekomm' ich vielleicht grad noch selber hin Xb
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

18

Freitag, 24. Juli 2015, 20:06

In der Klasse Window_Handy die Methode item_rect für den Cursor und bei Bedarf draw_icon für das zeichnen der Icons, falls Du das möchtest (kannst natürlich auch die Hintergrundgrafik benutzen, ohne extra noch Icons zu zeichnen).
Willst Du das Skript so wie es jetzt aufgeteilt ist benutzen? Verschlüsselst Du dein Projekt vor Veröffentlichung?

19

Dienstag, 28. Juli 2015, 22:54

Du meintest ja das du den Code noch aufräumen wolltest (und ich wollte schon die Icons der Grafik benutzen; hab ja extra welche rausgesucht die ich dafür verwenden kann Xb) aber sonnst...
Die Buttons sollte ich von der Platzierung mit deinem Hinweis Angeordnet bekommen, denke ich, und das Save/Load/Exit Menü müsste sich theoretisch ja auch so anpassen lassen, das es in der Mitte liegt =)
Ich hab den provisorischen, neuen Code von dir noch nicht mit dem getestet, was ich in meinem Projekt habe, aber sofern es da keine Konflikte geben sollte, bin ich eigentlich ganz zufrieden. ^^

Mit der Verschlüsselung ist das so eine Sache... Zum einen kommt es immer mal wieder zu Problemen beim Spielen von verschlüsselten Spielen, zum Anderen ist es auch nicht unmöglich ein einmal verschlüsseltes Projekt dennoch zu öffen. Außerdem schaue ich mir zum lernen gerne mal an, wie jemand etwas im Maker umgesetzt hat und möchte Anderen das nicht wegnehmen.
Dafür sprechen würde die Tatsache, das ich einen "Payed For" Musiktrack verwende, aber da die Audiodateien eh und so nicht mit verschlüsselt werden...
Sofern ich nicht irgendwo eine Regel übersehen habe die besagt, dass ich es verschlüssen muss, würde ich es schon offen lassen.
Ich werte es als "Kommerzielles Projekt", weil die Möglichkeit besteht Preise zu gewissen und schaue daher lieber zweimal nach, was ich wirklich an Außenrecourcen verwenden darf, aber das Spiel selbst ist letztenendes für jeden Frei zugänglich. Ich sehe also keinen wirklichen Grund, um es abzuschließen.



EDIT: Da ich mir nicht sicher war ob du an den Code noch mal rangehen wolltest oder nicht, hab ich jetzt mal versucht ihn so wie er ist anzupassen.
...Alles was ich geschafft habe war den Text "Save,Load,Exit" weiter nach rechts zu rücken XD' Wenn ich versucht habe die Optionen in der Mitte des Bildschirms zu plazieren hat das zwar funktioniert, aber wie ich den Curser dazu bekomme die neue Position abzufragen ist mir bisher ein Rätsel. Ebenfalls wie ich die Schriftgröße anpassen könnte. Den Teil des Scriptes der den maximalen Platz zuteilt konnte ich aufspüren, aber der hat ja leider keinen einfluss auf die Schrift für das Fenster selbst.
Spoiler
Bild So in etwa wollte ich es haben. Bild Und so sieht das Ergebniss meiner Versuche aus. =b
zum Lesen den Text mit der Maus markieren

Übersehe ich da etwas, das man als Scripter sofort ausfindig machen würde? (Wäre ja auch nicht das erste mal...XD)
Und aufgrund einer Unterhaltung mit einem anderen Makerer hab ich noch eine Frage: Wäre es theoretisch machbar, nur dem Window_Handy einen anderen Windowskin zuzuweisen?
Ich habe meinen Usernamen bewusst so geschrieben wie ihr ihn seht. Also bitte, schreibt das Y nicht groß sondern klein. Danke =D

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »yamina-chan« (28. Juli 2015, 22:54)


20

Dienstag, 28. Juli 2015, 23:10

Zitat

EDIT: Da ich mir nicht sicher war ob du an den Code noch mal rangehen wolltest oder nicht, hab ich jetzt mal versucht ihn so wie er ist anzupassen.
War nur beschäftigt, ich wollte den schon noch etwas in Ordnung bringen. Bis wann brauchst Du ihn denn fertig?

Zitat

...Alles was ich geschafft habe war den Text "Save,Load,Exit" weiter nach rechts zu rücken XD' Wenn ich versucht habe die Optionen in der Mitte des Bildschirms zu plazieren hat das zwar funktioniert, aber wie ich den Curser dazu bekomme die neue Position abzufragen ist mir bisher ein Rätsel. Ebenfalls wie ich die Schriftgröße anpassen könnte. Den Teil des Scriptes der den maximalen Platz zuteilt konnte ich aufspüren, aber der hat ja leider keinen einfluss auf die Schrift für das Fenster selbst.
Ich habe das Skript mal dahingehend angepasst. Probier mal aus, wie dir das gefällt - ich bring es dann noch in eine schöne Form.

Spoiler
Ersetze zum Ausprobieren Window_Handy mit dieser Definition:

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
#==============================================================================
# ** Window_Handy
#------------------------------------------------------------------------------
#  Work in Progress
#==============================================================================
 
class Window_Handy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Const
  #--------------------------------------------------------------------------
  LINE_HEIGHT = 48
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(224-16, 128, 192+32, 320-32)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 0
    refresh
    @item_max = 3 + 4
    self.index = -1
    self.windowskin = RPG::Cache.windowskin('001-Blue01')
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.size = 26
    self.contents.font.bold = true
    self.contents.draw_text( 0, 0*LINE_HEIGHT, 192, LINE_HEIGHT, 'Speichern', 1)
    self.contents.draw_text( 0, 1*LINE_HEIGHT, 192, LINE_HEIGHT, 'Laden',     1)
    self.contents.draw_text( 0, 2*LINE_HEIGHT, 192, LINE_HEIGHT, 'Beenden',   1)
    for i in 0..3
      draw_icon(i)
    end
  end
  #--------------------------------------------------------------------------
  # * 
  #--------------------------------------------------------------------------
  def draw_icon( icon_index )
    icon      = get_icon( icon_index )
    target_x  = icon_index * 48 + 6
    target_y  = 192 + 6
    icon_rect = Rect.new( 0, 0, 24, 24)
    offset    = (40 - 24) / 2
    contents.blt( target_x + offset, target_y + offset, icon, icon_rect )
  end
  #--------------------------------------------------------------------------
  # * 
  #--------------------------------------------------------------------------
  def get_icon( number )
    case number
    when 0
      RPG::Cache.icon('Phone')
    when 1
      RPG::Cache.icon('Envelope')
    when 2
      RPG::Cache.icon('Book')
    when 3
      RPG::Cache.icon('')
    end
  end
  #--------------------------------------------------------------------------
  # * 
  #--------------------------------------------------------------------------
  def item_rect( index )
    case index
    when 0,1,2
      Rect.new( 0, LINE_HEIGHT*index, 192, LINE_HEIGHT )
    when 3,4,5,6
      Rect.new( 6 + 48*(index-3), 6+192, 40, 40 )
    else
      nil
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      r = item_rect( @index )
      self.cursor_rect = r   if r
      self.cursor_rect.empty unless r
    end
  end
  #--------------------------------------------------------------------------
  # * Perform mouse operations
  #--------------------------------------------------------------------------
  def mouse_operation
    mx = Mouse.pos_x - (self.x - self.ox + 16)
    my = Mouse.pos_y - (self.y - self.oy + 16)
    for index in 0...@item_max
      rect = item_rect( index )
      if mx > rect.x and mx < rect.x + rect.width and
         my > rect.y and my < rect.y + rect.height
        mouse_cursor(index)
        break
      end
    end
  end
end
zum Lesen den Text mit der Maus markieren


Zitat

Und aufgrund einer Unterhaltung mit einem anderen Makerer hab ich noch eine Frage: Wäre es theoretisch machbar, nur dem Window_Handy einen anderen Windowskin zuzuweisen?
Natürlich. Kannst es im Skript schon ausprobieren (Zeile 22) - in der fertigen Version werde ich den Code nochmal etwas umstruckturieren, aber in der Form kannst Du am leichtesten eigene Anpassungen ausprobieren.

Zitat

Ich sehe also keinen wirklichen Grund, um es abzuschließen.
Ok, ist für mich deswegen interessant, weil ich dem Skript dann noch einen Infoheader voranstelle, da ich dir ja vermutlich eine kommerzielle Lizenz einräumen werde, damit Du das Skript im Contestprojekt benutzen kannst, aber keine allgemeine Lizenz zur kommerziellen Verwendung einräumen möchte.

Social Bookmarks