Le Deal du moment : -50%
-50% Baskets Nike Air Huarache
Voir le deal
64.99 €

Aller en bas
dricc
dricc
Membre

Nombre de messages : 2760
Localisation : Lille
Distinction : Altruiste - Incarnation de la Patience [Mist']
Date d'inscription : 10/08/2009

Mettre sa page web sur l'ecran titre Empty Mettre sa page web sur l'ecran titre

Lun 3 Mai 2010 - 12:53
Ce script va vous permettre de mettre un accés à votre site web directement depuis l'ecran titre .

Si vous l'essayez , soyez pas surpris : ça met un certain temps avant que le browser ouvre le site en question .

Auteur : Modern Algebra
Origine : http://rmrk.net/index.php/topic,38038.0.html

Moi , je n'ai fait que traduire un peu . Ah oui , vous noterez aussi que j'ai mis un super site comme exemple lol

Code:

#==============================================================================
#    Website Launch from Title
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: April 5, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#    Ce simple script ajoute une option pour accéder à un site web à partir
#  d'une option sur l'ecran titre . ne marche que sous windows , mais VX aussi .
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#    Modifier les 4 constantes ci dessous
#==============================================================================
# ** CONFIGURABLE CONSTANTS
#==============================================================================
MAWLT_COMMAND = "Forum de la communauté"        # L enom de la nouvelle commande
MAWLT_INDEX = 2              # Où la commande apparaitra sur la fenetre
MAWLT_URL = "http://rpgmakervx.1fr1.net" # l'URL complete su site à accéder
MAWLT_Y_OFFSET = -24          # Coordonnées Y en pixel de décalage

#==============================================================================
# ** Window Command
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new accessor variable - mawlt_index_override
#    new method - mawlt_add_command
#    aliased method - draw_item
#==============================================================================

class Window_Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :mawlt_index_override
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Command
  #    index  : the position to add the command in
  #    command : the command to add
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def mawlt_add_command (index, command)
    return unless @commands
    @commands.insert (index, command)
    @item_max += 1
    self.y += MAWLT_Y_OFFSET
    self.height = self.height + WLH
    create_contents
    disabled = []
    @wlt_disabled_commands = [] unless @wlt_disabled_commands
    @wlt_disabled_commands.each { |x| disabled.push (x >= index ? x + 1 : x) }
    @wlt_disabled_commands.clear
    refresh
    disabled.each { |x| draw_item (x, false) }
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mal_wlt_drwitm_8yh1 draw_item
  def draw_item (index, enabled = true, *args)
    mal_wlt_drwitm_8yh1 (index, enabled, *args) # Run Original Method
    @wlt_disabled_commands = [] unless @wlt_disabled_commands
    @wlt_disabled_commands.push (index) if !enabled && !@wlt_disabled_commands.include? (index)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Index
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malg_wlt_indxovrd_8km1 index
  def index (*args)
    indx = malg_wlt_indxovrd_8km1 (*args) # Run Original Method
    return indx if !@mawlt_index_override || !Input.trigger? (Input::C) || indx < MAWLT_INDEX
    return indx - 1 if indx > MAWLT_INDEX
    return -1
  end
end

#==============================================================================
# ** Scene Title
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - create_command_window, update
#==============================================================================

class Scene_Title
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Command Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malgbr_wsitelaunch_crtcmmnd_9ol2 create_command_window
  def create_command_window (*args)
    malgbr_wsitelaunch_crtcmmnd_9ol2 (*args) # Run Original Method
    @command_window.mawlt_add_command (MAWLT_INDEX, MAWLT_COMMAND)
    @command_window.index += 1 if @command_window.index >= MAWLT_INDEX
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mawlt_update_7uj2 update
  def update (*args)
    @command_window.mawlt_index_override = true
    mawlt_update_7uj2 (*args)
    @command_window.mawlt_index_override = false
    if Input.trigger? (Input::C) && @command_window.index == MAWLT_INDEX
      Sound.play_decision
      system("start #{MAWLT_URL}")
    end
  end
end
Berka
Berka
Staffeux retraité

Nombre de messages : 1832
Age : 33
Localisation : Paris
Distinction : rubyste déglingué
9ème dan en scripting-no-jutsu

Nouveau Justine Beber ;P
Date d'inscription : 16/12/2007
http://rpgruby.olympe-network.com

Mettre sa page web sur l'ecran titre Empty Re: Mettre sa page web sur l'ecran titre

Lun 3 Mai 2010 - 19:00
Pour que ce soit plus rapide, change par :
Code:
if Input.trigger? (Input::C) && @command_window.index == MAWLT_INDEX
  Sound.play_decision
  Thread.new{system("start #{MAWLT_URL}")}
end
dricc
dricc
Membre

Nombre de messages : 2760
Localisation : Lille
Distinction : Altruiste - Incarnation de la Patience [Mist']
Date d'inscription : 10/08/2009

Mettre sa page web sur l'ecran titre Empty Re: Mettre sa page web sur l'ecran titre

Mar 4 Mai 2010 - 10:58
Ah oui, super .
Je me suis permis de remonter l'info à modern algebra .
Contenu sponsorisé

Mettre sa page web sur l'ecran titre Empty Re: Mettre sa page web sur l'ecran titre

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum