Command Color XP
#1
Command Color XP

by Kyonides

Did you ever want to change your command window's currently selected command a little bit? Thinking
Now you can do it! Shocked
This scriptlet lets you alter its color! Painter

Just configure the SELECT_COLOR constant accordingly and that's it! Two Thumbs Up! 

Code:
# * Command Color XP * #
#   Scripter : Kyonides
#   v0.5.0 - 2025-06-15

# The SELECT_COLOR Constant lets you configure your custom color following
# the usual (R,G,B) or (R,G,B,A) color format.

class Window_Command
  SELECT_COLOR = Color.new(255, 255, 0)
  DISABLED_ALPHA = 100
  alias :kyon_cmd_clr_win_comm_init :initialize
  alias :kyon_cmd_clr_win_comm_set_index :index=
  alias :kyon_cmd_clr_win_comm_dis_item :disable_item
  alias :kyon_cmd_clr_win_comm_up :update
  def initialize(width, commands)
    @disabled = []
    @last_pos = -1
    kyon_cmd_clr_win_comm_init(width, commands)
  end

  def index=(new_index)
    return if @index == new_index
    if @index >= 0
      last_color = @disabled.include?(@index)? disabled_color : normal_color
      draw_item(@index, last_color)
      @last_pos = @index
    end
    kyon_cmd_clr_win_comm_set_index(new_index)
    update_command_color
  end

  def disable_item(index)
    @disabled << index
    @disabled = @disabled.sort.uniq
    kyon_cmd_clr_win_comm_dis_item(index)
  end

  def update_command
    return if @last_pos == @index
    if @last_pos >= 0
      last_color = @disabled.include?(@last_pos)? disabled_color : normal_color
      draw_item(@last_pos, last_color)
    end
    update_command_color
    @last_pos = @index
  end

  def update_command_color
    new_color = SELECT_COLOR.dup
    new_color.alpha = @disabled.include?(@index)? DISABLED_ALPHA : 255
    draw_item(@index, new_color)
  end

  def update
    kyon_cmd_clr_win_comm_up
    update_command
  end
end

Terms & Use

Free as in Beer beer.
Crediting me as the author is optional. Winking
That's it! Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Star  Shop : Command Help Kain Nobel 0 2,249 04-04-2022, 10:46 AM
Last Post: Kain Nobel
   A.J.'s Missile Command DerVVulfman 1 7,456 11-20-2018, 06:28 AM
Last Post: DerVVulfman
   Leidy's Ring Command Window DerVVulfman 0 5,997 03-05-2008, 09:02 AM
Last Post: DerVVulfman
   Tactical Command Display Claihm 0 3,872 03-04-2008, 05:49 AM
Last Post: Claihm
   Command Control Claihm 0 5,854 03-04-2008, 05:35 AM
Last Post: Claihm
   Command Windows - Animated Text Selwyn 0 5,239 03-03-2008, 06:18 AM
Last Post: Selwyn
   Hex Color Codes in Messages RPG Advocate 0 4,969 03-03-2008, 05:18 AM
Last Post: RPG Advocate
   Custom Text Command Script RPG Advocate 0 5,558 03-03-2008, 05:04 AM
Last Post: RPG Advocate
   Simple Escape Command Trickster 0 5,126 03-02-2008, 06:45 AM
Last Post: Trickster



Users browsing this thread: 1 Guest(s)