Save-Point
Actors' Custom Windowskins XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: Actors' Custom Windowskins XP (/thread-11558.html)



Actors' Custom Windowskins XP - kyonides - 04-15-2025

Actors' Custom Windowskins
XP

by Kyonides

Introduction

[Image: think.gif] Do you need to change the look of all of your windows based on who's the current [Image: deedlit.gif] party leader?
Then you definitely have to use this scriptlet for sure! [Image: wink.gif]

Setup
  • This scriptlet should be placed among the very first scripts in the invisible custom script section below Scene_Debug.
  • Go to the WinSkin module and add a new line per actor's ID like this:

Code:
Code:
SKINS[2] = "My Skin 2"

If you forgot to add a custom windowskin for a given actor, it will use VX's or ACE's skin by default.

The Script

Code:
# * Actors' Custom Windowskins XP * #
#   Scripter : Kyonides
#   2025-04-15

# All Windowskins Need to be Placed in the Graphics/Windowskins directory!

module WinSkin
  SKINS = {} # <<== Leave it Alone!
  # Default Windowskin or Skin for Unlisted Actors
  SKINS.default = "Window"
  # Custom Windowskins
  SKINS[1] = "My Skin 1"
  SKINS[2] = "My Skin 2"
end

class Game_System
  attr_accessor :start_game
end

class Game_Party
  alias :kyon_skin_gm_pty_init :initialize
  def initialize
    kyon_skin_gm_pty_init
    $game_system.start_game = true
  end

  def leader_id
    @actors[0].id
  end
end

class Window_Base
  alias :kyon_skin_win_bs_up :update
  def initialize(x, y, width, height)
    super()
    update_windowskin
    place(x, y, width, height)
    reset_z
  end

  def place(x, y, w, h)
    self.x = x
    self.y = y
    self.width = w
    self.height = h
  end

  def reset_z
    self.z = 100
  end

  def update
    super
    update_windowskin
  end

  def update_windowskin
    if $game_system.start_game
      set_custom_windowskin
    else
      set_default_windowskin
    end
  end

  def set_custom_windowskin
    return if $game_party.leader_id == @actor_id
    @actor_id = $game_party.leader_id
    @windowskin_name = WinSkin::SKINS[@actor_id]
    $game_system.windowskin_name = @windowskin_name
    self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  end

  def set_default_windowskin
    return if $game_system.windowskin_name == @windowskin_name
    @windowskin_name = $game_system.windowskin_name
    self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  end
end

Terms & Conditions

Free as in [Image: beer.gif] beer.
Include me in your game credits.
That's it! [Image: tongue.gif]


RE: Actors' Custom Windowskins XP - kyonides - 04-15-2025

Maintenance Update

This release includes a mandatory Bug bug fix that will prevent your game from crashing because of the very first menu not being able to properly calculate the width or height of that first window. No further changes were needed this time.