[สคริปต์] ระบบวันเวลา ตามเครื่องคอม
หน้า 1 จาก 1
[สคริปต์] ระบบวันเวลา ตามเครื่องคอม
สคริปต์ วันเวลา ตามเครื่องคอม (ตามปัจจุบัน)
หากใครเคยเล่นเกมpokemonบนเครื่องDSก็จะรู้ว่าเกมนั้น ใช้วันเวลาจริง เช่น ถ้าเราเล่นตอน 3 ทุ่ม เวลาในเกม ก็จะ 3 ทุ่มเช่นกัน ซึ่งสคริปต์นี้จะมีผลแบบนี้นั่นเอง
----------------------------------------------------------------------------
หากใครเคยเล่นเกมpokemonบนเครื่องDSก็จะรู้ว่าเกมนั้น ใช้วันเวลาจริง เช่น ถ้าเราเล่นตอน 3 ทุ่ม เวลาในเกม ก็จะ 3 ทุ่มเช่นกัน ซึ่งสคริปต์นี้จะมีผลแบบนี้นั่นเอง
----------------------------------------------------------------------------
- #============================
- # Your Current Time Window
- # version 1.1
- # by shadowball
- # 11.25.2007 - 11.28.2007
- #============================
- # This is what I edited in the Window_PlayTime script...
- # I replaced the original lines (where def refresh is defined) with these...
- # It prints the current date/time this way:
- # Sunday
- # 11.25.2007 23:59
- class Window_YourCurrentTime < Window_Base
- #------------------------------------------------------------
- # * Object Initialization
- #------------------------------------------------------------
- def initialize
- super(0, 0, 160, 96)#88)
- self.contents = Bitmap.new(width - 32, height - 32)
- #self.windowskin = RPG::Cache.windowskin('001-WallofCloudsSHB01')
- refresh
- end
- #------------------------------------------------------------
- # * Refresh
- #------------------------------------------------------------
- def refresh
- self.contents.clear
- # Draw Time Text
- t = Time.now
- # The full weekday name is normally displayed in English.
- # If you speak English, you may delete this hash.
- days = {'Monday' => 'วันจันทร์',
- 'Tuesday' => 'วันอังคาร',
- 'Wednesday' => 'วันพุธ',
- 'Thursday' => 'วันพฤหัสบดี',
- 'Friday' => 'วันศุกร์',
- 'Saturday' => 'วันเสาร์',
- 'Sunday' => 'วันอาทิตย์'}
- months = {'January' => 'มกราคม',
- 'February' => 'กุมภาพันธ์',
- 'March' => 'มีนาคม',
- 'April' => 'เมษายน',
- 'May' => 'พฤษภาคม',
- 'June' => 'มิถุนายน',
- 'July' => 'กรกฎาคม',
- 'August' => 'สิงหาคม',
- 'September' => 'กันยายน',
- 'October' => 'ตุลาคม',
- 'November' => 'พฤศจิกายน',
- 'December' => 'ธันวาคม'}
- text1 = days[t.strftime('%A')]
- text2 = months[t.strftime('%B')]
- # End of full weekday / month name in your language
- text3 = t.strftime('%d / %m / %Y %H:%M')
- self.contents.font.bold = true
- # System Color
- self.contents.font.color = system_color
- # Print Day Of The Week
- self.contents.draw_text(0, 0, 60, 32, text1, 0)
- # Normal Color
- self.contents.font.color = normal_color
- # Print Time
- self.contents.draw_text(0, 32, 145, 32, text3, 0)
- #self.contents.draw_text(0, 32, 145, 32, text2, 0)
- end
- #--------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
- #=======================================
- # ** Window_YourCurrentTimeHUD
- # v1.0
- # by shadowball
- # 27.12.2007
- #=======================================
- class Scene_Map
- alias_method :shbyct_main, :main
- def main
- # Make play time window
- @yctime_window = Window_YourCurrentTime.new
- @yctime_window.x = 480
- @yctime_window.y = 0
- @yctime_window.z = 120
- shbyct_main
- Graphics.freeze
- @yctime_window.dispose
- end
- alias_method :shbyct_update, :update
- def update
- @shb_hour = Time.now.strftime('%H').to_i
- if @shb_hour < 5 || @shb_hour > 18 # 7 p.m. - 5 a.m.
- $game_screen.start_tone_change(Tone.new(-120, -120, -120, 0), 1)
- elsif @shb_hour > 4 && @shb_hour < 7 # 5 - 7 a.m.
- $game_screen.start_tone_change(Tone.new(-40, -40, 0, 0), 1)
- elsif @shb_hour > 6 && @shb_hour < 16 # 7 a.m. - 4 p.m.
- $game_screen.start_tone_change(Tone.new(0, 0, 0, 0), 1)
- elsif @shb_hour > 15 && @shb_hour < 19 # 4 - 7 p.m.
- $game_screen.start_tone_change(Tone.new(30, 10, 0, 0), 1)
- end
- shbyct_update
- @yctime_window.update
- if Input.trigger?(Input::L) && $scene.is_a?(Scene_Map)
- @yctime_window.visible = false
- elsif Input.trigger?(Input::R) && $scene.is_a?(Scene_Map)
- @yctime_window.visible = true
- end
- end
- end
- class Scene_Menu
- alias_method :shbyct_main, :main
- def main
- # Make play time window
- @yctime_window = Window_YourCurrentTime.new
- @yctime_window.x = 0
- @yctime_window.y = 224
- @yctime_window.z = 120
- shbyct_main
- Graphics.freeze
- @yctime_window.dispose
- end
- alias_method :shbyct_update, :update
- def update
- shbyct_update
- @yctime_window.update
- end
- end
CruelMaster- Admin
- จำนวนข้อความ : 144
เฟรน โกล์ : 397444
ชื่อเสียง : 2
Join date : 16/03/2010
: 26
ที่อยู่ : 159/7 ถนน ประชาอุทิศ ตำบล ท่าตะเภา อำเภอเมือง จังหวัดชุมพร
เหรียญ
เหรียญมาร: 1
Similar topics
» [สคริปต์] ระบบหลอดเลือดศัตรู
» [สคริปต์] ติดตั้งFontอัตโนมัติ
» [สคริปต์] โจมตีแล้วเพิ่มSPทีละนิด
» [สคริปต์] ระบบจับมอนเตอร์แบบโปเกมอน
» [สคริปต์] ซื้อสกิลจากร้านค้า
» [สคริปต์] ติดตั้งFontอัตโนมัติ
» [สคริปต์] โจมตีแล้วเพิ่มSPทีละนิด
» [สคริปต์] ระบบจับมอนเตอร์แบบโปเกมอน
» [สคริปต์] ซื้อสกิลจากร้านค้า
หน้า 1 จาก 1
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ
|
|