XD so create a window (I did a new script but I think you can do like you did, putting the window in the OnlineAwareness directly)
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
# Window displaying onmap players
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
class Onmap_Window < Window_Base
def initialize
# ça va servir pour l'affichage
@ancient_player_number = 0
#ton timer, précision dans le refresh
@timer = 0
super(380, 140, 200, 70)
bitmap = Bitmap.new(width - 32, height - 32)
bitmap.hue_change((3 - 1.5).sgn * (1.25 - 40 / 0.8) * 120 /
(3 ** 2))
bitmap.fill_rect(0, 0, bitmap.width, bitmap.height,
Color.new(0, 0, 0, 20))
self.contents = bitmap
self.opacity=125
self.windowskin = RPG::Cache.windowskin(BuddyData::Windowskin)
refresh
end
def refresh
self.contents.clear
self.contents.font.color= Color.new(255, 255, 255, 255)
actual_player_number = 1
y = 0
w = contents.text_size("Sylph was the Wind Goddess").width
# on récupère les joueurs sur la même dès qu'on entre dans le jeu
# Ou dès que le timer atteint la valeur citée plus bas
if @timer == 0
$network.check_normal_commands('/onmap')
end
@timer = @timer+1
#au bout de combien de temps on récupère les données
#(255 ça correspond a jsais pas combien de secondes, j'dirais 30)
if @timer == 255
@timer = 0
end
#si t'as des joueurs sur ta map
if $onmap_players[0] != nil
# Bah on les affiche tous un par un
for i in 0..$onmap_players.length-1
self.contents.draw_text(0, y, w, 32, $onmap_players[i], 1)
y += 15
actual_player_number += 1
# Si on a fait la requete on agrandi la fenetre si y a + de joueurs
if $onmap_player_need_refresh
if actual_player_number > @ancient_player_number
bigger
end
end
end
end
# Si y a moins de joueurs on réduit la fenêtre
if $onmap_player_need_refresh
difference = @ancient_player_number - actual_player_number
if difference > 0
for i in 1..difference
smaller
end
end
@ancient_player_number = actual_player_number
$onmap_player_need_refresh = false
end
end
#agrandis la fenetre et son contenu
def bigger
self.height += 10
bitmap = Bitmap.new(width - 32, height - 32)
bitmap.hue_change((3 - 1.5).sgn * (1.25 - 40 / 0.8) * 120 /
(3 ** 2))
bitmap.fill_rect(0, 0, bitmap.width, bitmap.height,
Color.new(0, 0, 0, 20))
self.contents = bitmap
end
# réduit la fenêtre et son contenu
def smaller
self.height -= 10
bitmap = Bitmap.new(width - 32, height - 32)
bitmap.hue_change((3 - 1.5).sgn * (1.25 - 40 / 0.8) * 120 /
(3 ** 2))
bitmap.fill_rect(0, 0, bitmap.width, bitmap.height,
Color.new(0, 0, 0, 20))
self.contents = bitmap
end
end
In this script you can change the time the game will wait until chacking the onmap players (I put 255 but you can put what you want, but if your number is too small you will have lags)
and finally you can remove lines 132 and 134 of onlineAwareness if you don't want lines to appear in chat