mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Moved get_user_name back to where it belongs, and added self to the wallpaper methods so they would be accessible from the event parser.
39 lines
1.1 KiB
Ruby
39 lines
1.1 KiB
Ruby
class Game_Oneshot
|
|
#--------------------------------------------------------------------------
|
|
# * Public Instance Variables
|
|
#--------------------------------------------------------------------------
|
|
attr_accessor :player_name # map music (for battle memory)
|
|
attr_accessor :plight_timer # start of plight's plight
|
|
attr_accessor :wallpaper # the wallpaper that we should use
|
|
|
|
def initialize
|
|
if $GDC
|
|
@player_name = ''
|
|
else
|
|
@player_name = Game_Oneshot.get_user_name
|
|
end
|
|
@lights = {}
|
|
@plight_timer = nil
|
|
@wallpaper = nil
|
|
end
|
|
def self.get_user_name
|
|
user_name = (Steam.enabled? ? Steam::USER_NAME : Oneshot::USER_NAME).split(/\s+/)
|
|
if user_name[0].casecmp('the') == 0 || user_name[0].casecmp('a') == 0
|
|
return user_name.join(' ')
|
|
else
|
|
return user_name[0]
|
|
end
|
|
end
|
|
end
|
|
|
|
module Wallpaper
|
|
def self.set_persistent(name)
|
|
$game_oneshot.wallpaper = name
|
|
Wallpaper.set(name)
|
|
end
|
|
|
|
def self.reset_persistent
|
|
$game_oneshot.wallpaper = nil
|
|
Wallpaper.reset
|
|
end
|
|
end
|