Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module ImportantChoices
- LIST =
- [
- [_INTL("Yes"),_INTL("No")],
- [_INTL("Longer Option 1"),_INTL("Longer Option 2")],
- [_INTL("No"),_INTL("Yes")]
- ]
- end
- def pbShowCommands(msgwindow,commands=nil,cmdIfCancel=0,defaultCmd=0)
- return 0 if !commands
- cmdwindow=Window_CommandPokemonEx.new(commands)
- cmdwindow.z=99999
- cmdwindow.visible=true
- if ImportantChoices::LIST.include?(commands)
- cmdwindow.width = Graphics.width/2
- cmdwindow.x = (Graphics.width/2) - cmdwindow.width/2
- cmdwindow.y = (Graphics.height/2) - cmdwindow.height/2
- else
- cmdwindow.resizeToFit(cmdwindow.commands)
- pbPositionNearMsgWindow(cmdwindow,msgwindow,:right)
- end
- cmdwindow.index=defaultCmd
- command=0
- loop do
- Graphics.update
- Input.update
- cmdwindow.update
- msgwindow.update if msgwindow
- yield if block_given?
- if Input.trigger?(Input::BACK)
- if cmdIfCancel>0
- command=cmdIfCancel-1
- break
- elsif cmdIfCancel<0
- command=cmdIfCancel
- break
- end
- end
- if Input.trigger?(Input::USE)
- command=cmdwindow.index
- break
- end
- pbUpdateSceneMap
- end
- ret=command
- cmdwindow.dispose
- Input.update
- return ret
- end
- class Window_CommandPokemon < Window_DrawableCommand
- def drawItem(index,_count,rect)
- pbSetSystemFont(self.contents) if @starting
- rect=drawCursor(index,rect)
- pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,
- @commands[index],self.baseColor,self.shadowColor,align=1)
- end
- end
- def pbChangeChoiceFrame(filename)
- MessageConfig.pbSetSystemFrame("Graphics/Windowskins/" + filename)
- end
- def pbRestoreChoiceFrame
- MessageConfig.pbSetSystemFrame("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[$PokemonSystem.frame])
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement