RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Shop Input Expansion

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 73
Sad Egg
Shop Input Expansion
Version: 1.0b
Author: Ahnez67
Date: 03.06.2011

Version History


  • <Version 1.0b> 19.07.2011 - Minor Bugfix
  • <Version 1.0> 03.06.2011 - Original Release

Planned Future Versions

  • None at all.

Description


This Script adds 4 new features to the Shop's Number Input. By default, you can buy up to 99 itens at the same time (100+ if you're using my Inventory: Breaking Limits Script).
You can select how many items you want to buy, adding ou subtracting 1/10 units per time. But, if your limit is 9,999, then it will take forever, knowing that you can only add 10 units at the same time.
With this script, you can Add/ Subtract 100 units at same time. Or even skiping all this work, pressing Left when the number of items is 1.

Features

  • You can add or subtract 100 items at the same time
  • You can go straight to 1 or to the max limit

Screenshots are useless here

Instructions

Paste it above Main, but below the Default Scripts. Then, if you're using the Breaking Limit Script, and the limit is 100 or highter, set the HUND_ITEM (line 28) to true.
And it's ready.
Read the Header for further information

Script


Code: [Select]
#############################################################################
#-------------------------------AHNEZ67-------------------------------------#
#-------------------------|SHOP INPUT EXPANSION|---------------------------#
#---------------------------------------------------------------------------#
#############################################################################
#------------------------------|Description|--------------------------------#
# You can change the Shop Input options (The number of itens you can buy at #
#the same time)-------------------------------------------------------------#
#By defaut, there are 4 inputs, Right and Left, that increases(or decreases)#
#the value by 1. And Up/Down, that increases/decreases the value by 10------#
#With this script, you can increase or decrease the value by 100 (if you're #
#using my "Inventory: Breaking Limits" Script), and, you can set it directly#
#to the max limit, or to the minimal (normally 1) pressing Right or Left    #
#when the value is equal to 1 or equal to the limit-------------------------#
#------------------------------|Instructions|-------------------------------#
#Paste this script above main, and below the Default Scripts----------------#
#Set the "HUND_ITEM" to true ONLY IF YOU'RE USING MY "INVENTORY: BREAKING   # 
#lIMITS" SCRIPT-------------------------------------------------------------#
#There are only 4 new functions to the Shop's number selection.
#Input X (Letter A [Keyboard]) = Add 100
#Input Y (Letter S [Keyboard]) = Subtracts 100
#Input Right (When number of itens = limit of itens) = Resets to 1
#Input Left (When number of itens = 1) = Set number of itens to max

##EDITABLE REGION##
module AHNEZVAR
  module HYAKU
  HUND_ITEM = false #If False, X and Y commands will not work
  end
end
##EDITABLE REGION##
 
class Window_ShopNumber < Window_Base
  def update
    super
    if self.active
      last_number = @number
      if Input.repeat?(Input::RIGHT) and @number < @max
        @number += 1
      elsif Input.repeat?(Input::RIGHT) and @number = @max
        @number = 1
      end
      if Input.repeat?(Input::LEFT) and @number > 1
        @number -= 1
      elsif Input.repeat?(Input::LEFT) and @number = 1
        @number = @max
      end
      if Input.repeat?(Input::UP) and @number < @max
        @number = [@number + 10, @max].min
      end
      if Input.repeat?(Input::DOWN) and @number > 1
        @number = [@number - 10, 1].max
      end
      if Input.repeat?(Input::X) and @number < @max and AHNEZVAR::HYAKU::HUND_ITEM
        @number = [@number + 100, @max].min
      end
      if Input.repeat?(Input::Y) and @number > 1 and AHNEZVAR::HYAKU::HUND_ITEM
        @number = [number - 100, @max].min
        if @number < 1
          @number = 1
        end
      end
      if @number != last_number
        Sound.play_cursor
        refresh
      end
    end
  end
end

Credit


  • Ahnez67


Support


Post here if you encounter any problem with this script

Known Compatibility Issues

None know

Demo


There's no Demo version of this Script. It's not really necessary for such simple Script.

---------------------------------------------------------------------------------------
No credits needed. But it was made by me.
Commercial and non-Commercial games are all the same for me. You are free to use and edit it as you wish
« Last Edit: July 19, 2011, 11:25:54 PM by Ahnez67 »
Hello, i'm Japanese and my English is broken-

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, this goes well with your other script and I suppose it will be useful for any games that do have huge item capacities. Nice work!
« Last Edit: March 07, 2011, 11:49:06 PM by modern algebra »

***
Rep:
Level 74
I'm baaack!
nice script