Toggle TP Display with Switch

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Cryranos, Feb 6, 2014.

    Tags:
  1. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    Toggle TP Display with Switch
    by Cryranos​
    Introduction
    This is a tiny snippet that lets you designate a switch to determine whether TP is displayed or not. I made this because in my current project, the party doesn't gain access to anything related to TP until later in the game, and I don't want to clutter the battle status with useless information.

    Features
    - Lets you use a switch to control when TP appears in the battle status window instead of it always being on or off.

    Screenshots
    None

    How to Use
    Paste in the Materials section and designate a switch in the module. It may either conflict or become completely redundant when used with some battle systems besides the default. It also has the (intended) side-effect of making the "Show TP" box in the database editor completely useless.

    Script

    Code:
    #===============================================================================
    # RGSS3: Toggle TP Display Snippet
    #===============================================================================
    # by Cryranos/Metatron
    #===============================================================================
    # Instructions: Paste in the Materials section. Edit the module as needed.
    # This script replaces Window_BattleStatus#draw_gauge_area, and by extension,
    # removes functionality from the "Show TP" check box in the database.
    #===============================================================================
    module Cry
      module Show_TP
        TP_Show_Switch = 5
      end
    end
    class Window_BattleStatus
      def draw_gauge_area(rect, actor)
        if $game_switches[Cry::Show_TP::TP_Show_Switch]
          draw_gauge_area_with_tp(rect, actor)
        else 
          draw_gauge_area_without_tp(rect, actor)
        end
      end
    end
    Credit and Thanks
    - Me.
     
    Last edited: May 25, 2019
    #1
    tale likes this.
  2. tale

    tale Volunteer Veteran

    Messages:
    472
    Likes Received:
    761
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    N/A
    Fixed script format, credit Cryranos/Metatron.
    Code:
    #===============================================================================
    # RGSS3: Toggle TP Display Snippet
    #===============================================================================
    # by Cryranos/Metatron
    #===============================================================================
    # Instructions: Paste in the Materials section. Edit the module as needed.
    # This script replaces Window_BattleStatus#draw_gauge_area, and by extension,
    # removes functionality from the "Show TP" check box in the database.
    #===============================================================================
    module Cry
      module
        Show_TP TP_Show_Switch = 5
      end
    end
    class Window_BattleStatus
      def draw_gauge_area(rect, actor)
        if $game_switches[Cry::Show_TP::TP_Show_Switch]
          draw_gauge_area_with_tp(rect, actor)
        else draw_gauge_area_without_tp(rect, actor)
        end
      end
     end
     
    #2
    Ebanyle likes this.
  3. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi, thanks for fixing it for me; I would have never noticed otherwise.
     
    #3
    Ebanyle likes this.
  4. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,758
    Likes Received:
    384
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    except it's not quite lined up.
    Code:
    module Cry
      module
        Show_TP TP_Show_Switch = 5
      end
    Should be
    Code:
    module Cry
      module Show_TP
        TP_Show_Switch = 5
      end
    and
    Code:
        else draw_gauge_area_without_tp(rect, actor)
        end
    needs to be
    Code:
        else
          draw_gauge_area_without_tp(rect, actor)
        end
     
    #4
  5. Cryranos

    Cryranos Veteran Veteran

    Messages:
    58
    Likes Received:
    31
    Location:
    Kansas City
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks for pointing that out. How embarrassing.
     
    #5

Share This Page