| 赞 | 86 |
| VIP | |
| 好人卡 | |
| 积分 | 236 |
| 经验 | |
| 最后登录 | 2024-1-23 |
| 在线时间 | 123 小时 |
- 梦石
- 0
- 星屑
- 23554
- 在线时间
- 123 小时
- 注册时间
- 2019-5-18
- 回帖
- 44
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 xuhao1996 于 2022-8-1 00:29 编辑
RPG-MZ-手机菜单
自定义图标 数量
链接:https://pan.baidu.com/s/1pw926HjtoNib_h_7eLSAxQ?pwd=fvk3
提取码:fvk3
--来自百度网盘超级会员V4的分享
EST_PHONE_MENU_MZ/*:
@plugindesc 手机菜单引擎
<EST 手机菜单 MZ>
@author Estriole
@target MZ
@help
■ 资讯╒══════════════════════════╛
EST - 手机菜单 MZ
版本:1.1
通过 雌三醇
文件名:.js
■ 简介╒══════════════════════════╛
这个插件是菜单引擎插件。这意味着我们
可以设置我们自己的菜单命令...什么时候发生
我们点击那些命令......这个菜单引擎也
使用手机作为模板构建......但是这个菜单
引擎也可以使用其他形式的菜单工作。
■ 特点╒══════════════════════════╛
- 完全可定制的菜单引擎
- 可定制的图形菜单
- 模拟手机作为菜单(如果使用现有模板)
- 单击命令时自定义您想要的内容
- 自定义包含/启用命令
- 图像丢失时救援图像(或当您尚未制作时)
- 悬停时将命令图像交换到选定版本的能力。
- 最有效的常见事件在场景内执行
■ 更新日志╒══════════════════════════╛
v1.1 2020.11.22 > 次要 RegEx 修复以识别多个空格
拯救图像时的文件名。
> 用户将插件另存为不同名称时的故障保护
v1.0 2020.10.22 > 完成插件
■ 插件下载╒══════════════════════════╛
https://www.dropbox.com/s/4gv3tq ... ONE_MENU_MZ.js?dl=0
添加在:
EST_PHONE_ADDON_BASICMENU.js
添加适合手机的基本菜单场景
https://www.dropbox.com/s/6bquiq ... N_BASICMENU.js?dl=0
■ 截图╒══════════════════════════╛
快来了
■ 演示╒══════════════════════════╛
https://www.dropbox.com/sh/vhf1j ... lI81AAmAcK50Ha?dl=0
单击下载以下载整个文件夹。
■ 使用方法╒══════════════════════════╛
1> 安装插件
2> 设置插件参数(更多信息参见下面的参数)
还在那里设置你的菜单命令。
a> 首先设置您将放置图像的文件夹路径
b> 设置手机图片、phoneBG图片、rescueBG图片
c> 添加菜单命令(选择时包含所有条件和脚本)
[可选] 仅当您使用自己的图像时...
d> 设置PhoneXpos、PhoneYpos、phoneBGXoffset、phoneBGYoffset值
e> 设置你的 phoneBGWidth 和 PhoneBGHeight
这是必需的,因为图像是异步加载的。
f> 设置你的命令图像像素大小
这是必需的,因为图像是异步加载的。
3> 将所有手机图像放在您在插件参数中指定的文件夹中
确保至少放置 phoneIMG 图像、rescueBG 图像、rescueCommand 图像
您可以在处理项目时逐渐添加图像的其余部分。
4> 您的手机菜单引擎现在正在工作。
5> 您也可以在插件参数中设置 Scene_Phone 来替换 Scene_Menu
6> 您也可以设置 Scene_PhoneAddonLoad 来替换插件参数中的 Scene_Load
仍然困惑?请检查演示。
你也可以使用插件命令来修改一些东西...检查插件命令
部分了解更多信息。
■ 依赖关系╒══════════════════════════╛
没有任何
■ 兼容性╒══════════════════════════╛
MZ 是新引擎……所以我不能肯定。
但它应该与大多数东西兼容。
■ 参数╒══════════════════════════╛
!主要设置
>> 文件夹路径
~ 在 img/ 中放置手机文件的文件夹
>> 手机IMG
~ 手机座的图片名称
>> 手机BG
~ 手机背景图片名称
>> 救援BG
~ BG 不存在时救援的图片名称
>> 救援警报方法
抢救图像时...您希望如何被警告...
console.log() -> 在控制台上写
alert() -> 抛出警报
>> 手机作为 SceneMenu。
~ 如果设置为 true... 这将打开 Scene_Phone 而不是 Scene_Menu
从地图/事件打开菜单时。
!手机位置设置
>> phoneXpos
~ 手机的 X 位置
>> phoneYpos
~ 手机的 Y 位置
>> phoneBGXoffset
~ 手机背景的偏移 x 坐标
>> phoneBGYoffset
~ 偏移手机背景的 y 坐标
>> 手机BG宽度
~ 手机背景的宽度(以像素为单位)
>> 手机BG高度
~ 手机背景高度(以像素为单位)
!手机内容
>> 手机指令设置
〜设置您的菜单标题,要包含的条件,要启用的条件,
以及选择时执行的脚本。
这是一个您可以轻松添加的打击列表。
+ 命令标题 -> 命令的名称。图像也将使用此名称。
+ 脚本 -> 选择该命令时执行的脚本。
+ 包含条件 -> 条件,因此包含此命令。如果留空
你希望它总是包括
+ 启用条件 -> 条件,因此启用此命令。如果你把它留空
希望它始终启用
>> 救援命令
〜当图标命令没有图像时救援命令图像
~ (例如:仍在发展)
>> 菜单最大列数
~ 你的命令菜单有多少列
>> 菜单最大行数
~ 你的图标命令有多少行
>> 菜单命令高度
~ 您的图标命令的高度(可以与您的图像大小相同或添加
它下面的一些标题空间)
>> 中心图标命令
~ true => 命令图标图像居中。需要填写下面的命令大小参数。
>> 命令图像宽度
〜您的图标图像宽度(以像素为单位)。将计算使图标居中
>> 手机抽奖
~ true => 绘制命令标题,false => 如果您的图像已经清楚命令的作用
>> 手机动态图标
~ true => 高亮命令时。将更改为它的“_select”版本。
>> 手机隐藏光标
~ true => 光标高亮不会显示...(结合动态图标)
!高级设置
>> 自定义功能
〜您可以定义包含在手机场景中的自定义功能。
稍后可以使用 this.yourFunction() 调用。
■ 插件命令╒══════════════════════════╛
>> 呼叫场景_手机
〜调用Scene_Phone。
>> 更换手机图片
~ 更改手机图片
+ ImageName:图像文件的名称(不带 .png)
>> 更改手机背景图片
~ 更改手机背景图片
+ ImageName:图像文件的名称(不带 .png)
>> 手机更换菜单
~ Scene_Phone 是否替换 Scene_Menu?
+ Phone as SceneMenu:如果设置为 true... 这将打开 Scene_Phone 而不是 Scene_Menu
>> 添加手机指令
〜添加新的手机命令。
+ 命令标题:命令的名称。图像也将使用它作为文件名。
+ 脚本:选择该命令时执行的脚本。
+ 包含条件:包含此命令的条件。如果您希望它始终包含,请将其留空
+启用条件:启用此命令的条件。如果您希望它始终启用,请将其留空
>> 修改手机指令
~ 修改现有手机命令。
+ 命令标题:命令的名称。图像也将使用它作为文件名。
+ 脚本:选择该命令时执行的脚本。
+ 包含条件:包含此命令的条件。如果您希望它始终包含,请将其留空
+启用条件:启用此命令的条件。如果您希望它始终启用,请将其留空
■ 执照╒══════════════════════════╛
在所有项目中免费使用(包含色情内容的项目除外)
只要我记入(ESTRIOLE)。
■ 额外积分╒══════════════════════════╛
没有任何
■ 支持╒══════════════════════════╛
虽然我很受宠若惊,我很高兴人们一直在分享和
在其他 RPG Maker 社区中寻求对脚本的支持,我会
想问一下,请避免将我的脚本发布到其他地方
我经常这样做是因为它可以找到支持和修复错误
你我都难。
如果您正在寻求支持,可以通过以下方式与我联系:
[ http://forums.rpgmakerweb.com/ ]
pm我:雌三醇
也无法支持与 VisuStella 的兼容性。
因为他们的代码被混淆了,因此人类无法阅读。
如果有不兼容...请询问 VisuStella 团队。
■ 捐款╒══════════════════════════╛
如果你想支持我的工作,你可以在这里捐款
https://paypal.me/Estriole
■ 作者手记╒══════════════════════════╛
没有任何
■ Information ╒══════════════════════════╛
EST - PHONE MENU MZ
Version: 1.1
By Estriole
File name: .js
■ Introduction ╒══════════════════════════╛
This plugin is Menu Engine Plugin. Which mean we
can set our own Menu Command... what happen when
we click on those Command... this Menu Engine also
build with Phone as it's template... but this Menu
Engine could also work using other form of Menu.
■ Features ╒══════════════════════════╛
- fully customizeable Menu Engine
- Customizeable Graphic Menu
- Simulate Phone as Menu (if using existing template)
- Customize what you want when clicking the command
- Custom include / enable command
- rescue image when image missing (or when you have not made it yet)
- ability to swap command image to selected version when hovered.
- MOSTLY WORKING common event execute inside the scene
■ Changelog ╒══════════════════════════╛
v1.1 2020.11.22 > Minor RegEx Fix to recognize more than one space in
filename when rescuing images.
> failsafe when user save the plugin as different name
v1.0 2020.10.22 > Finish the plugins
■ Plugin Download ╒══════════════════════════╛
https://www.dropbox.com/s/4gv3tq ... ONE_MENU_MZ.js?dl=0
addon:
EST_PHONE_ADDON_BASICMENU.js
add basic menu scene that FITS on the phone
https://www.dropbox.com/s/6bquiq ... N_BASICMENU.js?dl=0
■ Screenshots ╒══════════════════════════╛
Coming Soon
■ Demo ╒══════════════════════════╛
https://www.dropbox.com/sh/vhf1j ... lI81AAmAcK50Ha?dl=0
click download to download the entire folder.
■ How to use ╒══════════════════════════╛
1> install the plugin
2> set the plugin parameters (see ■ Parameter below for more info)
also setup your menu command there.
a> first set the folder path where you will put the images
b> set the phone image, phoneBG image, and rescueBG image
c> add the menu command (with all the condition and script when chosen)
[optional] only if you're using your own image...
d> set PhoneXpos, PhoneYpos, phoneBGXoffset, phoneBGYoffset value
e> set your phoneBGWidth and PhoneBGHeight
this is required because image loaded asynchronously.
f> set your command image pixel size
this is required because image loaded asynchronously.
3> place the all the phone image in the folder you specify at Plugin parameter
make sure to at least place the phoneIMG image, rescueBG image, rescueCommand image
the rest of the image you can add gradually when you working on your project.
4> your phone menu engine is now working.
5> you can also set the Scene_Phone to replace Scene_Menu in plugin parameter
6> you can also set the Scene_PhoneAddonLoad to replace Scene_Load in plugin parameter
still confused? check the demo instead.
you can also use plugin commands to modify few things... check the plugin command
section for more info.
■ Dependencies ╒══════════════════════════╛
none
■ Compatibility ╒══════════════════════════╛
MZ is new engine... so i cannot say for sure.
but it should be compatible with most things.
■ Parameters ╒══════════════════════════╛
!Main Settings
>> folderPath
~ folder inside img/ where you place the phone files
>> phoneIMG
~ Image name of the Phone base
>> phoneBG
~ Image name of the Phone background
>> rescueBG
~ Image name for rescuing when BG not exist
>> Rescue Alert Method
When rescuing the image... how you want to be warned...
console.log() -> write on console
alert() -> throw alert
>> Phone as SceneMenu.
~ If set to true... this will open Scene_Phone instead of Scene_Menu
when opening menu from map / event.
!Phone Position Settings
>> phoneXpos
~ Position X of the phone
>> phoneYpos
~ Position Y of the phone
>> phoneBGXoffset
~ offset x coordinate of the Phone Background
>> phoneBGYoffset
~ offset y coordinate of the Phone Background
>> phoneBGWidth
~ Width of the Phone Background (in pixel)
>> phoneBGHeight
~ Height of the Phone Background (in pixel)
!Phone Content
>> Phone Command Settings
~ Set your menu title, condition to be included, condition to be enabled,
and what script execute when chosen.
it's a list of struck that you can add easily.
+ Command Title -> The name of the command. the image will also use this name.
+ Script -> Script that executed when choosing that command.
+ Include Condition -> Condition so this command included. left it blank if
you want it always include
+ Enable Condition -> Condition so this command enabled. left it blank if you
want it always enabled
>> rescueCommand
~ Rescue Command Image when icon command didn't have image
(ex: still in Development)
>> Menu Max Cols
~ How many column your command menu
>> Menu Max Rows
~ How many rows your icon command
>> Menu Command Height
~ Height of your icon command (can be the same with your image size or add
some space for title below it)
>> Center Icon Command
~ true => command icon image centered. requires to fill the command size parameter below.
>> Command Image Width
~ your icon image Width in pixel. will be calculated for centering the icon
>> Phone Draw Titles
~ true => draw command title, false => if your image already clear what the command do
>> Phone Dynamic Icon
~ true => when highlight command. will change to "_select" version of it.
>> Phone Hide Cursor
~ true => the cursor highlight will not shown... (combine with Dynamic Icon)
!advancedSettings
>> Custom Function
~ Custom function you can define to included inside the Phone Scene.
can be called with this.yourFunction() later.
■ Plugin Commands ╒══════════════════════════╛
>> Call Scene_Phone
~ calling Scene_Phone.
>> Change Phone Image
~ Changing the phone image
+ ImageName: Name of your Image files (without .png)
>> Change Phone Background Image
~ Changing the phone background image
+ ImageName: Name of your Image files (without .png)
>> Phone Replace Menu
~ Scene_Phone replace Scene_Menu or not?.
+ Phone as SceneMenu: If set to true... this will open Scene_Phone instead of Scene_Menu
>> Add Phone Command
~ adding new phone command.
+ Command Title: The name of the command. the image will also use this as filename.
+ Script: Script that executed when choosing that command.
+ Include Condition: Condition so this command included. left it blank if you want it always include
+ Enable Condition: Condition so this command enabled. left it blank if you want it always enabled
>> Modify Phone Command
~ Modify existing phone command.
+ Command Title: The name of the command. the image will also use this as filename.
+ Script: Script that executed when choosing that command.
+ Include Condition: Condition so this command included. left it blank if you want it always include
+ Enable Condition: Condition so this command enabled. left it blank if you want it always enabled
■ License ╒══════════════════════════╛
Free to use in all project (except the one containing pornography)
as long as i credited (ESTRIOLE).
■ Extra Credit ╒══════════════════════════╛
None
■ Support ╒══════════════════════════╛
While I'm flattered and I'm glad that people have been sharing and
asking support for scripts in other RPG Maker communities, I would
like to ask that you please avoid posting my scripts outside of where
I frequent because it would make finding support and fixing bugs
difficult for both of you and me.
If you're ever looking for support, I can be reached at the following:
[ http://forums.rpgmakerweb.com/ ]
pm me : estriole
also support to compatibility with VisuStella is not possible.
because their code is obfuscated thus cannot be read by human.
if there's incompatibility... please ask VisuStella Team.
■ Donate ╒══════════════════════════╛
If you want to support my work you can donate here
https://paypal.me/Estriole
■ Author's Notes ╒══════════════════════════╛
None
@param mainSettings
@text 主要设置
@desc 手机设置
@param folderPath
@text 文件夹路径
@desc 文件夹内的img/你把手机图标
@type string
@default system/cellphone/
@parent mainSettings
@param phoneIMG
@text 手机IMG
@desc 手机座的图片名称
@type string
@default phone
@parent mainSettings
@param phoneBG
@text 手机背景图片名称
@desc 手机背景图片名称
@type string
@default background
@parent mainSettings
@param rescueBG
@text 背景图片不存在时救援的图片名称
@desc 背景图片不存在时救援的图片名称
@type string
@default background
@parent mainSettings
@param alertMethod
@text 抢救图像时...您希望如何被警告...
@desc 抢救图像时...您希望如何被警告...
@type select
@option console.log()
@option alert()
@default console.log()
@parent mainSettings
@param phoneReplaceMenu
@text 手机作为场景菜单。
@desc 如果设置为 true... 这将打开 场景手机 而不是 Scene Menu
when opening menu from map / event.
@type boolean
@default true
@parent mainSettings
@param phonePosSettings
@text Phone Position Settings
@parent mainSettings
@text 手机位置设置
@param phoneXpos
@text 手机X位置
@desc 手机X位置
@type number
@default 250
@parent phonePosSettings
@param phoneYpos
@text 手机Y位置
@desc 手机Y位置
@type number
@default 20
@parent phonePosSettings
@param phoneBGXoffset
@text 手机背景X偏移
@desc 手机背景的偏移 x 坐标
@type number
@default 7
@parent phonePosSettings
@param phoneBGYoffset
@text 手机背景Y偏移
@desc 手机背景的偏移 Y坐标
@type number
@default 10
@parent phonePosSettings
@param phoneBGWidth
@text 手机背景宽度
@desc 手机背景的宽度(以像素为单位)
@type number
@default 241
@parent phonePosSettings
@param phoneBGHeight
@text 手机背景高度
@desc 手机背景高度(以像素为单位)
@type number
@default 529
@parent phonePosSettings
@param phoneContent
@text 手机内容
@desc 手机菜单的内容
@param phoneCommandSettings
@text 手机命令设置
@desc 设置您的菜单标题、要包含的条件、要启用的条件以及选择时执行的脚本。
@type struct<phoneCommandSettings>[]
@parent phoneContent
@default ["{\"Command\":\"背包\",\"Script\":\"SceneManager.push(Scene_PhoneAddonItem);\",\"includeCond\":\"\",\"enableCond\":\"\"}","{\"Command\":\"技能\",\"Script\":\"$gameSystem._phoneActorSelectionType = \\\"Skill\\\";\\nSceneManager.push(Scene_PhoneAddonActorSelection);\",\"includeCond\":\"\",\"enableCond\":\"\"}","{\"Command\":\"装备\",\"Script\":\"$gameSystem._phoneActorSelectionType = \\\"Equip\\\";\\nSceneManager.push(Scene_PhoneAddonActorSelection);\",\"includeCond\":\"\",\"enableCond\":\"\"}","{\"Command\":\"状态\",\"Script\":\"$gameSystem._phoneActorSelectionType = \\\"Status\\\";\\nSceneManager.push(Scene_PhoneAddonActorSelection);\",\"includeCond\":\"\",\"enableCond\":\"\"}","{\"Command\":\"整队\",\"Script\":\"SceneManager.push(Scene_PhoneAddonFormation);\",\"includeCond\":\"\",\"enableCond\":\"$gameParty.size() >= 2 && $gameSystem.isFormationEnabled();\"}","{\"Command\":\"Call\",\"Script\":\"$gameSystem._phoneActorSelectionType = \\\"Talk\\\";\\nSceneManager.push(Scene_PhoneAddonActorSelection);\",\"includeCond\":\"\",\"enableCond\":\"\"}","{\"Command\":\"设置\",\"Script\":\"SceneManager.push(Scene_PhoneAddonOptions);\",\"includeCond\":\"\",\"enableCond\":\"\"}","{\"Command\":\"保存\",\"Script\":\"SceneManager.push(Scene_PhoneAddonSave);\",\"includeCond\":\"\",\"enableCond\":\"$gameSystem._saveEnabled == true\"}","{\"Command\":\"退出\",\"Script\":\"SceneManager.push(Scene_PhoneAddonGameEnd);\",\"includeCond\":\"\",\"enableCond\":\"\"}"]
@param rescueIcon
@text 救援命令
@desc 图标命令没有图像时的救援命令图像
(ex: still in Development)
@type string
@default rescue_icon
@parent phoneContent
@param phoneMaxCols
@text 菜单最大列数
@desc 你的图标命令有多少列
@type number
@default 4
@parent phoneContent
@param phoneMaxRows
@text 菜单最大行数
@desc 你的图标命令有多少行
@type number
@default 6
@parent phoneContent
@param phoneItemHeight
@text 图标命令高度(以像素为单位)
@desc 您的图标命令的高度(可以与您的图像大小相同或在其下方添加一些标题)
@type number
@default 80
@parent phoneContent
@param phoneCenterIcon
@text 中心图标命令
@desc true => 命令图标图像居中
@type boolean
@default true
@parent phoneContent
@param phoneImgWidth
@text 命令图像宽度
@desc 您的图标图像宽度(以像素为单位)。 将计算使图标居中
@type number
@default 46
@parent phoneContent
@param phoneDrawTitles
@text 手机绘制标题
@desc true => 绘制命令标题,false => 如果您的图像已经清楚它的作用
@type boolean
@default true
@parent phoneContent
@param phoneDynamicIcon
@text 手机动态图标
@desc true => 高亮图标...更改图标 img + "_select" 后缀
@type boolean
@default true
@parent phoneContent
@param phoneHideCursor
@text 手机隐藏光标
@desc true => 光标高亮不会显示...(结合动态图标)
@type boolean
@default false
@parent phoneContent
@param advancedSettings
@text 高级设置
@param phoneCustomFunction
@text 手机自定义功能
@desc 您可以定义包含在手机场景中的自定义函数。 稍后可以使用 this.your Function() later. Custom function you can define to include inside the Phone Scene. can be called with this.your Function() later.
@type multiline_string[]
@parent advancedSettings
@default ["EST.PhoneMenu.picturesFeature = function(){\n $gameVariables.setValue(2, 333);\n alert(\"entering function pictures feature\");\n if(this._phoneCommand) this._phoneCommand.activate();\n};","EST.PhoneMenu.callScene = function(sceneClass, page, index){\n $gameTemp._phoneLastIcon = index || 0;\n $gameTemp._phoneLastPage = page || 0; \n SceneManager.push(sceneClass);\n};","EST.PhoneMenu.whatEverFunction= function (id){\n //do something here you want\n};"]
@command callPhone
@text 呼叫场景_手机
@desc 添加新的手机命令。
@command changePhoneIMG
@text 更改手机图片
@desc 更改手机图像
@arg imgName
@text 图像名称
@desc 图片文件的名称(不带 .png)
@type string
@default
@command changePhoneBG
@text 更改手机背景图片
@desc 更改手机背景图片
@arg imgName
@text 图像名称
@desc 图片文件的名称(不带 .png)
@type string
@default
@command phoneReplaceMenu
@text 手机更换菜单
@desc Scene_Phone 是否替换 Scene_Menu?
@arg value
@text 手机作为菜单。
@desc 如果设置为 true... 这将打开 Scene_Phone 而不是 Scene_Menu
when opening menu from map / event.
@type boolean
@default true
@command addPhoneCommand
@text 添加手机命令
@desc 添加新的手机命令。
@arg Command
@text 命令标题
@desc 命令的名称。 图像也将使用它作为文件名。
@type string
@arg Script
@text 脚本
@desc 选择该命令时执行的脚本。
@type multiline_string
@arg includeCond
@text 包含条件
@desc 条件因此包含此命令。 如果您希望它始终包含,请将其留空
@type multiline_string
@arg enableCond
@text 启用条件
@desc 条件使此命令启用。 如果您希望它始终启用,请将其留空
@type multiline_string
@command modPhoneCommand
@text 修改手机命令
@desc 修改现有手机命令。
@arg Command
@text 命令标题
@desc 命令的名称。 图像也将使用它作为文件名。
@type string
@arg Script
@text 脚本
@desc 选择该命令时执行的脚本。
@type multiline_string
@arg includeCond
@text 包含条件
@desc 条件因此包含此命令。 如果您希望它始终包含,请将其留空
@type multiline_string
@arg enableCond
@text 启用条件
@desc 条件使此命令启用。 如果您希望它始终启用,请将其留空
@type multiline_string
*/
/*~struct~phoneCommandSettings:
@param Command
@text 命令标题
@desc 命令的名称。 图像也将使用它作为文件名。
@type string
@param Script
@text 脚本
@desc 选择该命令时执行的脚本。
@type multiline_string
@param includeCond
@text 包含条件
@desc 条件因此包含此命令。 如果您希望它始终包含,请将其留空
@type multiline_string
@param enableCond
@text 启用条件
@desc 条件使此命令启用。 如果您希望它始终启用,请将其留空
@type multiline_string
*/
/*~struct~phoneInclude:
@param Command
@text 命令
@type string
@param Condition
@text 条件
@type string
*/
/*~struct~phoneEnable:
@param Command
@text 命令
@type string
@param Condition
@text 条件
@type string
*/
/*~struct~phoneScript:
@param Command
@text 命令
@type string
@param Script
@text 脚本
@type multiline_string
*/
/*~struct~phoneCustomFunction:
@param Function
@text 函数名称
@type string
@param Content
@text 内容
@type multiline_string
*/
var EST = EST || {};
EST.PhoneMenu = EST.PhoneMenu || {};
EST.PhoneMenu.pluginName=document.currentScript.src.split('/').slice(-1)[0].slice(0,-3).replace(/\%20/g," ");
//plugin commands
PluginManager.registerCommand(EST.PhoneMenu.pluginName, "callPhone", args => {
SceneManager.push(Scene_Phone);
});
PluginManager.registerCommand(EST.PhoneMenu.pluginName, "phoneReplaceMenu", args => {
$gameSystem.phoneReplaceMenu = JSON.parse(args["value"]);
});
PluginManager.registerCommand(EST.PhoneMenu.pluginName, "changePhoneIMG", args => {
$gameSystem.phoneIMG = args["imgName"];
});
PluginManager.registerCommand(EST.PhoneMenu.pluginName, "changePhoneBG", args => {
$gameSystem.phoneBG = args["imgName"];
});
PluginManager.registerCommand(EST.PhoneMenu.pluginName, "addPhoneCommand", args => {
$gameSystem.initPhoneMenu();
if($gameSystem._phoneIconTitles.includes(args["Command"])) return console.log("Command Already Exist");
$gameSystem._phoneIconTitles.push(args["Command"])
$gameSystem._phoneInclude[args["Command"]] = args["includeCond"];
$gameSystem._phoneEnabled[args["Command"]] = args["enableCond"];
$gameSystem._phoneScript[args["Command"]] = args["Script"];
});
PluginManager.registerCommand(EST.PhoneMenu.pluginName, "modPhoneCommand", args => {
$gameSystem.initPhoneMenu();
if(!$gameSystem._phoneIconTitles.includes(args["Command"])) return console.log("Command Did Not Exist");
$gameSystem._phoneInclude[args["Command"]] = args["includeCond"];
$gameSystem._phoneEnabled[args["Command"]] = args["enableCond"];
$gameSystem._phoneScript[args["Command"]] = args["Script"];
});
//parsing the plugin parameters
//main setting parameter
EST.PhoneMenu.Parameters = PluginManager.parameters(EST.PhoneMenu.pluginName);
EST.PhoneMenu.Parameters.phoneXpos = Number(EST.PhoneMenu.Parameters.phoneXpos);
EST.PhoneMenu.Parameters.phoneYpos = Number(EST.PhoneMenu.Parameters.phoneYpos);
EST.PhoneMenu.Parameters.phoneZpos = Number(EST.PhoneMenu.Parameters.phoneZpos);
EST.PhoneMenu.Parameters.phoneBGXoffset = Number(EST.PhoneMenu.Parameters.phoneBGXoffset);
EST.PhoneMenu.Parameters.phoneBGYoffset = Number(EST.PhoneMenu.Parameters.phoneBGYoffset);
EST.PhoneMenu.Parameters.phoneBGZoffset = Number(EST.PhoneMenu.Parameters.phoneBGZoffset);
EST.PhoneMenu.Parameters.phoneBGWidth = Number(EST.PhoneMenu.Parameters.phoneBGWidth);
EST.PhoneMenu.Parameters.phoneBGHeight = Number(EST.PhoneMenu.Parameters.phoneBGHeight);
//phone content parameter
EST.PhoneMenu.Parameters.phoneMaxCols = Number(EST.PhoneMenu.Parameters.phoneMaxCols);
EST.PhoneMenu.Parameters.phoneMaxRows = Number(EST.PhoneMenu.Parameters.phoneMaxRows);
EST.PhoneMenu.Parameters.phoneItemHeight = Number(EST.PhoneMenu.Parameters.phoneItemHeight);
EST.PhoneMenu.Parameters.phoneCenterIcon = JSON.parse(EST.PhoneMenu.Parameters.phoneCenterIcon);
EST.PhoneMenu.Parameters.phoneImgWidth = Number(EST.PhoneMenu.Parameters.phoneImgWidth);
EST.PhoneMenu.Parameters.phoneDrawTitles = JSON.parse(EST.PhoneMenu.Parameters.phoneDrawTitles);
EST.PhoneMenu.Parameters.phoneDynamicIcon = JSON.parse(EST.PhoneMenu.Parameters.phoneDynamicIcon);
EST.PhoneMenu.Parameters.phoneHideCursor = JSON.parse(EST.PhoneMenu.Parameters.phoneHideCursor);
EST.PhoneMenu.Parameters.phoneReplaceMenu = JSON.parse(EST.PhoneMenu.Parameters.phoneReplaceMenu);
//phone command setting parsing to 4 different container
EST.PhoneMenu.Parameters.iconTitles = [];
EST.PhoneMenu.Parameters.phoneCommandSettings = JSON.parse(EST.PhoneMenu.Parameters.phoneCommandSettings);
if(EST.PhoneMenu.Parameters.phoneCommandSettings){
for (const [i,cmd] of EST.PhoneMenu.Parameters.phoneCommandSettings.entries()){
EST.PhoneMenu.Parameters.phoneCommandSettings = JSON.parse(cmd);
EST.PhoneMenu.Parameters.iconTitles.push(EST.PhoneMenu.Parameters.phoneCommandSettings.Command);
};
EST.PhoneMenu.Parameters.phoneInclude = EST.PhoneMenu.Parameters.phoneCommandSettings.reduce(
(o, i) => Object.assign(o, {[i.Command]: i.includeCond }), {});
EST.PhoneMenu.Parameters.phoneEnable = EST.PhoneMenu.Parameters.phoneCommandSettings.reduce(
(o, i) => Object.assign(o, {[i.Command]: i.enableCond }), {});
EST.PhoneMenu.Parameters.phoneScript = EST.PhoneMenu.Parameters.phoneCommandSettings.reduce(
(o, i) => Object.assign(o, {[i.Command]: i.Script }), {});
};
// adding custom function to the EST.PhoneMenu (which later passed on the scene phone and window phone)
EST.PhoneMenu.Parameters.phoneCustomFunction = JSON.parse(EST.PhoneMenu.Parameters.phoneCustomFunction);
if(EST.PhoneMenu.Parameters.phoneCustomFunction){
for (cmd of EST.PhoneMenu.Parameters.phoneCustomFunction){
try{
eval(cmd);
}catch(e){
console.log("phoneCustomFunction Error\nCheck Entry: "+cmd);
}
};
};
//wrapper function
(function($){
//Add some Game_System function
Game_System.prototype.initPhoneMenu = function(){
this._phoneIconTitles = this._phoneIconTitles || EST.PhoneMenu.Parameters.iconTitles;
this._phoneInclude = this._phoneInclude || EST.PhoneMenu.Parameters.phoneInclude;
this._phoneEnabled = this._phoneEnabled || EST.PhoneMenu.Parameters.phoneEnable;
this._phoneScript = this._phoneScript || EST.PhoneMenu.Parameters.phoneScript;
};
Game_System.prototype.fullPhoneMenu = function(){
this.initPhoneMenu();
list = [];
for (cmd of this._phoneIconTitles){
if(!this._phoneInclude[cmd]) list.push(cmd);
if(this._phoneInclude[cmd] && eval(this._phoneInclude[cmd])) list.push(cmd);
};
return list;
};
Game_System.prototype.phoneMenu = function(page){
page = page || 0;
list = this.fullPhoneMenu();
max = EST.PhoneMenu.Parameters.phoneMaxCols * EST.PhoneMenu.Parameters.phoneMaxRows;
listpage = list.slice(page * max,page * max + max);
return listpage;
};
Game_System.prototype.phonePageMax = function(){
list = this.fullPhoneMenu();
max = EST.PhoneMenu.Parameters.phoneMaxCols * EST.PhoneMenu.Parameters.phoneMaxRows;
pagemax = Math.ceil(list.length / max);
return pagemax;
};
Object.defineProperties(Game_System.prototype, {
phoneIMG: {
get: function() {
return this._phoneIMG = this._phoneIMG || EST.PhoneMenu.Parameters.phoneIMG || "phone";
},
set: function(value){
this._phoneIMG = value;
},
configurable: true
}
});
Object.defineProperties(Game_System.prototype, {
phoneBG: {
get: function() {
return this._phoneBG = this._phoneBG || EST.PhoneMenu.Parameters.phoneBG || "background";
},
set: function(value){
this._phoneBG = value;
},
configurable: true
}
});
Object.defineProperties(Game_System.prototype, {
phoneReplaceMenu: {
get: function() {
return this._phoneReplaceMenu = this._phoneReplaceMenu || EST.PhoneMenu.Parameters.phoneReplaceMenu;
},
set: function(value){
this._phoneReplaceMenu = value;
},
configurable: true
}
});
//creating the Scene_Phone + including all EST.PhoneMenu parameter and function
Scene_Phone = function() {
this.initialize(...arguments);
};
Scene_Phone.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Phone.prototype.constructor = Scene_Phone;
Scene_Phone.prototype = Object.assign(Scene_Phone.prototype, EST.PhoneMenu);
Scene_Phone.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Phone.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.addMapLayer();
this.createPhoneBackground();
this._page = $gameTemp._phoneLastPage || 0;
this.createContents();
this.addPhoneCoverLayer();
this.picPatch();
this.weatherPatch();
this.createAllMessageWindow(); //scene interpreter patch
};
Scene_Phone.prototype.addMapLayer = function() {
if(SceneManager.isPreviousScene(Scene_Title)) return; //patch for load scene
this._map = new Spriteset_Map();
this.addChild(this._map);
};
Scene_Phone.prototype.addPhoneCoverLayer = function() {
this.addChild(this._phone);
};
Scene_Phone.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
this.updateMapLayer();
if(this._phoneCommand) this._phoneCommand.refresh();
};
Scene_Phone.prototype.updateMapLayer = function() {
if(SceneManager.isPreviousScene(Scene_Title)) return; //patch for load scene
if(this._map) this._map.update();
};
Scene_Phone.prototype.picPatch = function() {
if(SceneManager.isPreviousScene(Scene_Title)) return; //patch for load scene
for (pic of this._map._pictureContainer.children){
this.addChild(pic);//scene interpreter pictures layer patch
}
}
Scene_Phone.prototype.weatherPatch = function() {
if(SceneManager.isPreviousScene(Scene_Title)) return; //patch for load scene
for (ch of this._map.children){
if(ch.width == 0) continue;
this.addChild(ch);//scene interpreter map weather layer patch
}
}
Scene_Phone.prototype.createPhoneBackground = function() {
this._phone = new Sprite(ImageManager.loadBitmap("img/"+this.Parameters.folderPath,$gameSystem.phoneIMG));
this._phoneBG = new Sprite(ImageManager.loadBitmap("img/"+this.Parameters.folderPath,$gameSystem.phoneBG));
this._phone.x = this.Parameters.phoneXpos;
this._phone.y = this.Parameters.phoneYpos;
this._phoneBG.x = this._phone.x + this.Parameters.phoneBGXoffset;
this._phoneBG.y = this._phone.y + this.Parameters.phoneBGYoffset;
this.addChild(this._phoneBG);
};
Scene_Phone.prototype.createContents = function(){
var wx = this.Parameters.phoneXpos + this.Parameters.phoneBGXoffset;
var wy = this.Parameters.phoneYpos + this.Parameters.phoneBGYoffset + 15;
var ww = this.Parameters.phoneBGWidth;
var wh = this.Parameters.phoneBGHeight -15;
this._phoneCommand = new Window_PhoneCommand(new Rectangle(wx,wy,ww,wh),this._page);
this._phoneCommand.setHandler("ok", this.onPhoneMenuOk.bind(this));
this._phoneCommand.setHandler("cancel", this.onPhoneMenuCancel.bind(this));
this._phoneCommand.refresh();
this.addChild(this._phoneCommand);
if($gameTemp._phoneLastIcon) this._phoneCommand.select($gameTemp._phoneLastIcon);
};
Scene_Phone.prototype.update = function(){
Scene_MenuBase.prototype.update.call(this);
this.updatePhoneSpriteSetMap();
this.updateMapLayer();
this.updateInterpreter(); //scene interpreter patch
if (this._phoneCommand && this._phoneCommand._phoneNeedRedraw) {
this.redrawPhone();
};
if(Imported && Imported["LvMZAnimatedFaces"]){//compatibility patch with LvMZAnimatedFace
if ($gameMessage.hasText() && $gameMessage.animatedFace()) this._messageWindow.updateFaceAnimation();
};
};
Scene_Phone.prototype.redrawPhone = function(){ //redraw phone
this._phoneCommand.refresh();
this._phoneCommand._phoneNeedRedraw = false;
};
Scene_Phone.prototype.updatePhoneSpriteSetMap = function(){
if(SceneManager.isPreviousScene(Scene_Title)) return;
$gameMap.update(this.isActive());
$gameScreen.update(this.isActive());
$gamePlayer.update(false);
$gameTimer.update(this.isActive());
};
//scene interpreter patch
//interpreter part
Scene_Phone.prototype.updateInterpreter = function(){
if(SceneManager.isPreviousScene(Scene_Title)) return;
if ($gameMap._interpreter) {
if (!$gameMap._interpreter.isRunning()) {
$gameMap._interpreter.setup(this.list());
}
$gameMap._interpreter.update();
}
};
Scene_Phone.prototype.list = function(){
if($gameTemp._commonEventQueue && $gameTemp._commonEventQueue.length >0){
return new Game_CommonEvent($gameTemp._commonEventQueue.pop()).list();
};
return [];
};
//if the command script did not change scene
Scene_Phone.prototype.backToPhone = function(){
this._phoneCommand.activate();
};
//easier call common event using this.callCommonEvent(x)
Scene_Phone.prototype.callCommonEvent = function(id){
$gameTemp.reserveCommonEvent(id);
this.backToPhone();
};
//message part
Scene_Phone.prototype.isMessageWindowClosing = function() {
return this._messageWindow.isClosing();
};
Scene_Phone.prototype.createAllMessageWindow = function() {
this.createMessageWindow();
this.createScrollTextWindow();
this.createGoldWindow();
this.createNameBoxWindow();
this.createChoiceListWindow();
this.createNumberInputWindow();
this.createEventItemWindow();
this.associateWindows();
};
Scene_Phone.prototype.createMessageWindow = function() {
const rect = this.messageWindowRect();
this._messageWindow = new Window_Message(rect);
this.addChild(this._messageWindow);
};
Scene_Phone.prototype.messageWindowRect = function() {
const ww = Graphics.boxWidth;
const wh = this.calcWindowHeight(4, false) + 8;
const wx = (Graphics.boxWidth - ww) / 2;
const wy = 0;
return new Rectangle(wx, wy, ww, wh);
};
Scene_Phone.prototype.createScrollTextWindow = function() {
const rect = this.scrollTextWindowRect();
this._scrollTextWindow = new Window_ScrollText(rect);
this.addChild(this._scrollTextWindow);
};
Scene_Phone.prototype.scrollTextWindowRect = function() {
const wx = 0;
const wy = 0;
const ww = Graphics.boxWidth;
const wh = Graphics.boxHeight;
return new Rectangle(wx, wy, ww, wh);
};
Scene_Phone.prototype.createGoldWindow = function() {
const rect = this.goldWindowRect();
this._goldWindow = new Window_Gold(rect);
this._goldWindow.openness = 0;
this.addChild(this._goldWindow);
};
Scene_Phone.prototype.goldWindowRect = function() {
const ww = this.mainCommandWidth();
const wh = this.calcWindowHeight(1, true);
const wx = Graphics.boxWidth - ww;
const wy = 0;
return new Rectangle(wx, wy, ww, wh);
};
Scene_Phone.prototype.createNameBoxWindow = function() {
this._nameBoxWindow = new Window_NameBox();
this.addChild(this._nameBoxWindow);
};
Scene_Phone.prototype.createChoiceListWindow = function() {
this._choiceListWindow = new Window_ChoiceList();
this.addChild(this._choiceListWindow);
};
Scene_Phone.prototype.createNumberInputWindow = function() {
this._numberInputWindow = new Window_NumberInput();
this.addChild(this._numberInputWindow);
};
Scene_Phone.prototype.createEventItemWindow = function() {
const rect = this.eventItemWindowRect();
this._eventItemWindow = new Window_EventItem(rect);
this.addChild(this._eventItemWindow);
};
Scene_Phone.prototype.eventItemWindowRect = function() {
const wx = 0;
const wy = 0;
const ww = Graphics.boxWidth;
const wh = this.calcWindowHeight(4, true);
return new Rectangle(wx, wy, ww, wh);
};
Scene_Phone.prototype.associateWindows = function() {
const messageWindow = this._messageWindow;
messageWindow.setGoldWindow(this._goldWindow);
messageWindow.setNameBoxWindow(this._nameBoxWindow);
messageWindow.setChoiceListWindow(this._choiceListWindow);
messageWindow.setNumberInputWindow(this._numberInputWindow);
messageWindow.setEventItemWindow(this._eventItemWindow);
this._nameBoxWindow.setMessageWindow(messageWindow);
this._choiceListWindow.setMessageWindow(messageWindow);
this._numberInputWindow.setMessageWindow(messageWindow);
this._eventItemWindow.setMessageWindow(messageWindow);
};
//end scene interpreter patch
Scene_Phone.prototype.waitForInterpreter = function(){
this.update();
};
Scene_Phone.prototype.onPhoneMenuCancel = function(){
SoundManager.playCancel();
$gameTemp._phoneLastIcon = null;
$gameTemp._phoneLastPage = null;
SceneManager.pop();
};
Scene_Phone.prototype.onPhoneMenuOk = function(){
$gameTemp._phoneLastIcon = this._phoneCommand._index;
$gameTemp._phoneLastPage = this._phoneCommand._page;
if(this.Parameters.phoneScript[this._phoneCommand.currentData()["name"]]) var chk = this.Parameters.phoneScript[this._phoneCommand.currentData()["name"]] || null;
if(!chk) alert("EST_PHONE_MENU_MZ\nThis command script did not have script");
if(!chk) this._phoneCommand.activate();
if(chk) eval(chk);
this._phoneNeedRedraw = true;
this._phoneCommand.needRedraw = true;
};
//creating the Window_PhoneCommand + include all EST.PhoneMenu parameter and function
Window_PhoneCommand = function() {
this.initialize(...arguments);
};
Window_PhoneCommand.prototype = Object.create(Window_MenuCommand.prototype);
Window_PhoneCommand.prototype.constructor = Window_PhoneCommand;
Window_PhoneCommand.prototype = Object.assign(Window_PhoneCommand.prototype, EST.PhoneMenu);
//try new approach Window_PhoneCommand
Window_PhoneCommand.prototype.initialize = function(rect) {
Window_MenuCommand.prototype.initialize.call(this, rect);
this._page = 0;
this.opacity = 0;
this._canRepeat = false;
this.selectLast();
};
Window_PhoneCommand.prototype.makeCommandList = function() {
this.addMainCommands();
};
Window_PhoneCommand.prototype.addMainCommands = function() {
var enabled = true;
for (cmd of $gameSystem.phoneMenu(this._page)){
try{
enabled = this.Parameters.phoneEnable[cmd] == undefined ? true : eval(this.Parameters.phoneEnable[cmd]);
}catch(e){
enabled = true;
};
this.addCommand(cmd, cmd, enabled);
};
};
Window_PhoneCommand.prototype.maxCols = function() {
return this.Parameters.phoneMaxCols || 4;
};
Window_PhoneCommand.prototype.itemHeight = function() {
return this.Parameters.phoneItemHeight;
};
Window_PhoneCommand.prototype.itemPadding = function() {
return 0;
};
Window_PhoneCommand.prototype.rowSpacing = function() {
return 10;
};
Window_PhoneCommand.prototype.drawBackgroundRect = function(rect) {
Window_MenuCommand.prototype.drawBackgroundRect.call(this, rect);
this.contentsBack.paintOpacity = 0;
};
Window_PhoneCommand.prototype.drawItem = function(index) {
const rect = this.itemLineRect(index);
const align = this.itemTextAlign();
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawIcons(this.commandName(index), rect, align, index);
};
Window_PhoneCommand.prototype.drawIcons = function(cmd, rect, align, index) {
// swapping image if selected
var suff = "";
if(this.Parameters.phoneDynamicIcon && this._index == index) suff = "_select";
//centering icon
var cx = 0;
if(this.Parameters.phoneCenterIcon) cx = (this.itemWidth() - (this._padding * 2 / this.maxCols()) - this.Parameters.phoneImgWidth)/2;
//load bitmap
const bitmap = ImageManager.loadBitmap("img/"+this.Parameters.folderPath,cmd + suff);
$gameTemp._storingPhoneWindow = this;
bitmap.addLoadListener(function(){
if ($gameTemp._storingPhoneWindow) $gameTemp._storingPhoneWindow._phoneNeedRedraw = true;
});
const pw = rect.width;
const ph = rect.height;
const sw = pw;
const sh = this.itemHeight();
const dx = rect.x;
const dy = 0 + (sh*Math.floor(index/this.maxCols()));
const sx = 0 - cx;
const sy = -4;
this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);
if(this.Parameters.phoneDrawTitles){
this.contents.fontSize = 12;
this.contents.drawText(cmd, sx + dx, sy + dy + 46, pw, this.lineHeight(), align);
this.resetFontSettings();
};
};
Window_PhoneCommand.prototype.refreshBitmapLoaded = function(obj) {
obj._phoneNeedRedraw;
};
//patch for scene interpreter
Window_PhoneCommand.prototype.processCursorMove = function(){
if (!SceneManager.isPreviousScene(Scene_Title) && $gameMap._interpreter.isRunning()) return this.activate();
Window_MenuCommand.prototype.processCursorMove.call(this);
};
Window_PhoneCommand.prototype.processHandling = function(){
if (!SceneManager.isPreviousScene(Scene_Title) && $gameMap._interpreter.isRunning()) return this.activate();
Window_MenuCommand.prototype.processHandling.call(this);
};
Window_PhoneCommand.prototype.processTouch = function(){
if (!SceneManager.isPreviousScene(Scene_Title) && $gameMap._interpreter.isRunning()) return this.activate();
Window_MenuCommand.prototype.processTouch.call(this);
};
//end patch for scene interpreter
Window_PhoneCommand.prototype._updateCursor = function() {
Window_MenuCommand.prototype._updateCursor.call(this);
if (this.Parameters.phoneHideCursor)this._cursorSprite.visible = false;
};
Window_PhoneCommand.prototype.areMainCommandsEnabled = function() {
return $gameParty.exists();
};
Window_PhoneCommand.prototype.isFormationEnabled = function() {
return $gameParty.size() >= 2 && $gameSystem.isFormationEnabled();
};
Window_PhoneCommand.prototype.isOptionsEnabled = function() {
return true;
};
Window_PhoneCommand.prototype.isSaveEnabled = function() {
return !DataManager.isEventTest() && $gameSystem.isSaveEnabled();
};
Window_PhoneCommand.prototype.isGameEndEnabled = function() {
return true;
};
Window_PhoneCommand.prototype.processOk = function() {
if (this.constructor == Window_PhoneCommand) $gameTemp._phoneLastIcon = this._index;
Window_MenuCommand.prototype.processOk.call(this);
};
Window_PhoneCommand.prototype.selectLast = function() {
$gameTemp._phoneLastIcon ? this.select($gameTemp._phoneLastIcon) : this.select(0);
};
Window_PhoneCommand.prototype.cursorPagedown = function(cDown) {
if (this._page + 1 == $gameSystem.phonePageMax()) return;
this._page = Math.min($gameSystem.phonePageMax()-1, this._page + 1);
if(cDown) {
this.refresh();
var chk = this._index - this.Parameters.phoneMaxCols * (this.Parameters.phoneMaxRows - 1);
this.select(Math.min(0 + chk, this._list.length - 1));
return;
};
this.select(0);
this.refresh();
};
Window_PhoneCommand.prototype.cursorPageup = function(cUp) {
this._page = Math.max(0, this._page - 1);
if(cUp){
this.refresh()
this.select(this._list.length - this.Parameters.phoneMaxCols + this._index);
return;
};
this.select(0);
this.refresh();
};
Window_PhoneCommand.prototype.cursorUp = function() {
var chk = this.Parameters.phoneMaxCols - 1;
if (this._index <= chk & this._page !== 0) return this.cursorPageup(true);
Window_MenuCommand.prototype.cursorUp.call(this);
this.refresh();
};
Window_PhoneCommand.prototype.cursorLeft = function() {
Window_MenuCommand.prototype.cursorLeft.call(this);
this.refresh();
};
Window_PhoneCommand.prototype.cursorRight = function() {
Window_MenuCommand.prototype.cursorRight.call(this);
this.refresh();
};
Window_PhoneCommand.prototype.cursorDown = function() {
var chk = this.Parameters.phoneMaxCols * (this.Parameters.phoneMaxRows - 1);
if(this._index >= chk) return this.cursorPagedown(true);
Window_MenuCommand.prototype.cursorDown.call(this);
this.refresh();
};
Window_PhoneCommand.prototype.onTouchSelect = function(trigger) {
Window_MenuCommand.prototype.onTouchSelect.call(this,trigger);
this.refresh();
};
Window_PhoneCommand.prototype.processWheelScroll = function() {
if (this.isWheelScrollEnabled() && this.isTouchedInsideFrame()) {
const threshold = 20;
if (TouchInput.wheelY >= threshold) {
this.cursorPagedown();
}
if (TouchInput.wheelY <= -threshold) {
this.cursorPageup();
}
}
};
// method to redirect to rescue image if included inside the
$.ImageManager_throwLoadError = ImageManager.throwLoadError;
ImageManager.throwLoadError = function(bitmap) {
var alertMethod = EST.PhoneMenu.Parameters.alertMethod;
var regex = new RegExp("img\/"+ EST.PhoneMenu.Parameters.folderPath +"(.*)\.png");
var urlfilename = bitmap.url.match(regex);
if(urlfilename) urlfilename[1] = urlfilename[1].replace(/\%20/g," ");
if(urlfilename && EST.PhoneMenu.Parameters.iconTitles.includes(urlfilename[1])){
var rescueMessage = "Missing Icon Files :"+urlfilename[1]+".png\nThis will be rescued with rescue image";
bitmap._url = "img\/"+ EST.PhoneMenu.Parameters.folderPath + EST.PhoneMenu.Parameters.rescueIcon +"\.png";
bitmap._loadingState = "rescued";
if (alertMethod == "console.log()"){
console.log(rescueMessage)
return bitmap.retry(bitmap);
};
throw ["LoadError", rescueMessage, bitmap.retry.bind(bitmap)];
};
if(bitmap.url.match("_select")){
var rescueMessage = "Missing Icon Select Files :"+urlfilename[1]+".png\nThis will be rescued with non select Icon";
bitmap._url = bitmap._url.replace("_select","");
if (alertMethod == "console.log()"){
console.log(rescueMessage)
return bitmap.retry(bitmap);
};
throw ["LoadError", rescueMessage, bitmap.retry.bind(bitmap)];
}
if(urlfilename){
var rescueMessage = "Missing Background Files Actor_"+urlfilename[1]+".png\nThis will be rescued with rescue image";
bitmap._url = "img\/"+ EST.PhoneMenu.Parameters.folderPath +EST.PhoneMenu.Parameters.rescueBG+"\.png";
bitmap._loadingState = "rescued";
if (alertMethod == "console.log()"){
console.log(rescueMessage)
return bitmap.retry(bitmap);
};
throw ["LoadError", rescueMessage, bitmap.retry.bind(bitmap)];
};
$.ImageManager_throwLoadError.call(this,bitmap);
};
//hijack menu
$.SceneManager_push_hijackMenu = SceneManager.push;
SceneManager.push = function(sceneClass) {
if ($gameSystem.phoneReplaceMenu && sceneClass == Scene_Menu) sceneClass = Scene_Phone;
$.SceneManager_push_hijackMenu.call(this,sceneClass);
};
// creating superclass for phone addon
//creating the scene addons base
Scene_PhoneAddonBase = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonBase.prototype = Object.create(Scene_Phone.prototype);
Scene_PhoneAddonBase.prototype.constructor = Scene_PhoneAddonBase;
Scene_PhoneAddonBase.prototype.createContents = function(){
};
//creating the window addon base
Window_PhoneAddonBase = function() {
this.initialize(...arguments);
};
Window_PhoneAddonBase.prototype = Object.create(Window_PhoneCommand.prototype);
Window_PhoneAddonBase.prototype.constructor = Window_PhoneAddonBase;
Window_PhoneAddonBase.prototype.updateHelp = function() {
this.setHelpWindowItem(this.item());
};
Window_PhoneAddonBase.prototype.selectLast = function() {
this.select(0);
};
Window_PhoneAddonBase.prototype.maxCols = function(index){
return 1;
};
Window_PhoneAddonBase.prototype._updateCursor = function() {
Window_MenuCommand.prototype._updateCursor.call(this);
};
Window_PhoneAddonBase.prototype.cursorLeft = function() {
Window_MenuCommand.prototype.cursorLeft.call(this);
};
Window_PhoneAddonBase.prototype.cursorRight = function() {
Window_MenuCommand.prototype.cursorRight.call(this);
};
Window_PhoneAddonBase.prototype.cursorUp = function() {
Window_MenuCommand.prototype.cursorUp.call(this);
};
Window_PhoneAddonBase.prototype.cursorDown = function() {
Window_MenuCommand.prototype.cursorDown.call(this);
};
Window_PhoneAddonBase.prototype.cursorPagedown = function() {};
Window_PhoneAddonBase.prototype.cursorPageup = function() {};
Window_PhoneAddonBase.prototype.makeCommandList = function(){};
Window_PhoneAddonBase.prototype.commandName = function(index){};
Window_PhoneAddonBase.prototype.drawItem = function(index){};
})(EST.PhoneMenu);
EST_PHONE_ADDON_BASICMENU/*:
@plugindesc 手机菜单引擎 的基本菜单添加
<EST 手机插件基本菜单>
@author Estriole
@target MZ
@base EST_PHONE_MENU_MZ
@orderAfter EST_PHONE_MENU_MZ
@param phoneItemSettings
@text 电话项目设置
@param phoneItemHelpY
@text 电话 物品帮助 Y
@desc 电话 物品帮助 Y
@type number
@parent phoneItemSettings
@default 8
@param phoneItemCommandY
@text 物品类型窗口 Y 偏移
@desc 物品类型窗口 Y 偏移
@type number
@parent phoneItemSettings
@default 64
@param phoneItemListY
@text 物品列表窗口 Y 偏移
@desc 物品列表窗口 Y 偏移
@type number
@parent phoneItemSettings
@default 180
@param phoneItemActorY
@text 演员选择窗口 Y 偏移
@desc 演员选择窗口 Y 偏移
@type number
@parent phoneItemSettings
@default 180
@param phoneItemGaugeWidth
@text 电话项物品窗口宽度
@desc 物品窗口量规的宽度
@type number
@parent phoneItemSettings
@default 120
@param phoneSkillSettings
@text 电话技能设置
@param phoneSkillActorBG
@text 使用 Actor 背景
@desc 如果为真,将使用演员背景作为电话技能场景
@type boolean
@parent phoneSkillSettings
@default true
@param phoneSkillGaugeWidth
@text 电话技能量规宽度
@desc 演员选择时的仪表宽度
@type number
@parent phoneSkillSettings
@default 128
@param phoneSkillStatusGaugeWidth
@text 电话技能状态仪表宽度
@desc 技能用户状态量表的宽度
@type number
@parent phoneSkillSettings
@default 88
@param phoneSkillHelpY
@text 电话技能帮助 Y
@desc 帮助窗口 Y 偏移
@type number
@parent phoneSkillSettings
@default 8
@param phoneSkillCommandY
@text 技能类型窗口 Y 偏移
@desc 技能类型窗口 Y 偏移
@type number
@parent phoneSkillSettings
@default 64
@param phoneSkillStatusY
@text 状态窗口 Y 偏移
@desc 状态窗口 Y 偏移
@type number
@parent phoneSkillSettings
@default 64
@param phoneSkillListY
@text 技能列表窗口 Y 偏移
@desc 技能列表窗口 Y 偏移
@type number
@parent phoneSkillSettings
@default 240
@param phoneSkillActorY
@text 电话 技能 演员 Y
@desc 演员选择窗口 Y 偏移
@type number
@parent phoneSkillSettings
@default 240
@param phoneEquipSettings
@text 电话装备设置
@param phoneEquipActorBG
@text 电话 装备 演员 BG
@desc 如果为真,将使用演员背景进行手机装备场景
@type boolean
@parent phoneEquipSettings
@default true
@param phoneEquipGaugeWidth
@text 手机装备量规宽度
@desc 装备窗口量规的宽度
@type number
@parent phoneEquipSettings
@default 128
@param phoneEquipHelpY
@text 电话 装备帮助 Y
@desc 帮助窗口 Y 偏移
@type number
@parent phoneEquipSettings
@default 8
@param phoneEquipStatusY
@text 电话装备状态 Y
@desc 状态窗口 Y 偏移
@type number
@parent phoneEquipSettings
@default 56
@param phoneEquipCommandY
@text 电话装备命令 Y
@desc 命令窗口 Y 偏移
@type number
@parent phoneEquipSettings
@default 8
@param phoneEquipSlotY
@text 电话装备插槽 Y
@desc 槽窗 Y 偏移
@type number
@parent phoneEquipSettings
@default 90
@param phoneEquipItemY
@text 电话 装备物品 Y
@desc 物品窗口 Y 偏移
@type number
@parent phoneEquipSettings
@default 315
@param phoneStatusSettings
@text 电话状态设置
@param phoneStatusActorBG
@text 使用 Actor 背景
@desc 如果为真,将使用演员背景作为电话状态背景
@type boolean
@parent phoneStatusSettings
@default true
@param phoneStatusMaxLevelText
@text 演员等级达到最大值时显示的文字
@desc 演员等级达到最大值时显示的文字
@type string
@parent phoneStatusSettings
@default Max Level
@param expGaugeColor1
@text Exp 仪表颜色 1
@desc Exp 仪表 渐变的颜色 1
@type number
@parent phoneStatusSettings
@default 27
@param expGaugeColor2
@text Exp 仪表颜色 2
@desc Exp 仪表 渐变的颜色 2
@type number
@parent phoneStatusSettings
@default 17
@param phoneStatusItemHeight
@text 状态内容高度
@desc 状态窗口内容的高度
@type number
@parent phoneStatusSettings
@default 480
@param phoneStatusGaugeWidth
@text 电话状态仪表宽度
@desc 状态窗口量规的宽度
@type number
@parent phoneStatusSettings
@default 205
@param phoneStatusLineManager
@text --- 画线管理器 ---
@parent phoneStatusSettings
@param statusActorNameLine
@text 演员姓名栏
@desc 在电话状态中...演员姓名画在哪一行?
@type number
@parent phoneStatusLineManager
@default 0
@param statusActorLvLine
@text 演员级别线
@desc 在电话状态中...演员级别画在哪一行?
@type number
@parent phoneStatusLineManager
@default 3
@param statusActorClassLine
@text 演员班线
@desc 在电话状态中...演员类画哪一行?
@type number
@parent phoneStatusLineManager
@default 4
@param statusActorStatesLine
@text 演员状态线
@desc 在电话状态中......演员造成状态的哪条线绘制?
@type number
@parent phoneStatusLineManager
@default 5
@param statusActorGaugeLine
@text 演员 HP MP TP 线
@desc 在电话状态中...演员测量哪条线? (这需要将近 4 行)
@type number
@parent phoneStatusLineManager
@default 6
@param statusActorExpLine
@text 演员经验线
@desc 在电话状态中...演员 EXP 量规画了哪条线? (需要将近 2 行)
@type number
@parent phoneStatusLineManager
@default 9
@param statusActorAtkLine
@text 演员攻击线
@desc 在电话状态中...演员 Atk 画了哪条线?
@type number
@parent phoneStatusLineManager
@default 11
@param statusActorDefLine
@text 演员防御线
@desc 在电话状态中...演员 防御 画了哪条线?
@type number
@parent phoneStatusLineManager
@default 12
@param statusActorMatkLine
@text 演员魔法攻撃力线
@desc 在电话状态中……演员魔法攻撃力画了哪条线?
@type number
@parent phoneStatusLineManager
@default 13
@param statusActorMdefLine
@text 演员魔法防御线
@desc 在电话状态中...演员魔法防御画了哪条线?
@type number
@parent phoneStatusLineManager
@default 14
@param statusActorAgiLine
@text 演员敏捷线
@desc 在电话状态中...演员 敏捷画了哪条线?
@type number
@parent phoneStatusLineManager
@default 15
@param statusActorLukLine
@text 演员幸运线
@desc 在电话状态中...演员 幸运 画了哪条线?
@type number
@parent phoneStatusLineManager
@default 16
@param statusActorProfLine
@text 演员简介线
@desc 在电话状态中...演员个人资料绘制的哪一行? (inf 行)(最后推荐)
@type number
@parent phoneStatusLineManager
@default 17
@param phoneOptionSettings
@text 电话选项设置
@param phoneOptionY
@text 选项窗口 Y 偏移
@desc 选项窗口 Y 偏移
@type number
@parent phoneOptionSettings
@default 8
@param phoneLoadSettings
@text 电话保存设置
@param phoneReplaceLoad
@text 电话保存作为场景保存。
@desc 如果设置为 true... 这将打开 Scene Phone AddonLoad 而不是 Scene_Load
@type boolean
@default true
@parent phoneLoadSettings
@param phoneLoadCommonEvent
@text 加载公共事件
@desc 从手机加载保存文件时。 执行这个公共事件(设置为 0 不调用任何公共事件)
@type number
@min 0
@parent phoneLoadSettings
@default 0
@help
■ 资讯╒══════════════════════════╛
EST - 电话插件 - 基本菜单
版本:1.2
通过 雌三醇
文件名:EST_PHONE_ADDON_BASICMENU.js
■ 简介╒══════════════════════════╛
这个插件是 EST - PHONE MENU MZ 的插件
这个插件重新创建了所有基本菜单以适应手机场景
■ 特点╒══════════════════════════╛
- 手机屏幕中的所有基本菜单
■ 更新日志╒══════════════════════════╛
v1.0 2020.10.22 完成插件制作
v1.1 2020.10.25 修复技能用户状态下技能量表宽度问题
和演员选择
v1.2 2021.01.30 删除硬编码的 lv 和 exp 文本...现在使用数据库术语
添加插件参数 Max Level Text... 以便用户可以更改它。
■ 插件下载╒══════════════════════════╛
https://www.dropbox.com/s/6bquiq ... N_BASICMENU.js?dl=0
■ 截图╒══════════════════════════╛
快来了
■ 演示╒══════════════════════════╛
https://www.dropbox.com/sh/vhf1j ... lI81AAmAcK50Ha?dl=0
单击下载以下载整个文件夹。
■ 使用方法╒══════════════════════════╛
1.安装EST_PHONE_MENU_MZ.js(必填)
2.在它下面安装这个插件
3.打开EST_PHONE_MENU_MZ插件参数并搜索
用于电话命令设置参数。
在那里添加您的菜单命令。
这就是您应该在“脚本”参数上添加的内容
对于该菜单命令。
物品场景
SceneManager.push(Scene_PhoneAddonItem);
技能场景
$gameSystem._phoneActorSelectionType = "技能";
SceneManager.push(Scene_PhoneAddonActorSelection);
装备场景
$gameSystem._phoneActorSelectionType = "装备";
SceneManager.push(Scene_PhoneAddonActorSelection);
状态场景
$gameSystem._phoneActorSelectionType = "状态";
SceneManager.push(Scene_PhoneAddonActorSelection);
编队场景
SceneManager.push(Scene_PhoneAddonFormation);
选项场景
SceneManager.push(Scene_PhoneAddonOptions);
保存场景
SceneManager.push(Scene_PhoneAddonSave);
加载场景
SceneManager.push(Scene_PhoneAddonLoad);
游戏结束场景
SceneManager.push(Scene_PhoneAddonGameEnd);
4>您也可以在按下继续/加载时制作
在标题屏幕中...而不是调用 Scene_Load
将使用手机版本...
将“PhoneLoad as SceneLoad”参数更改为 true。
■ 依赖关系╒══════════════════════════╛
EST_PHONE_MENU_MZ.js
把这个插件放在它下面。
■ 兼容性╒══════════════════════════╛
MZ 是新引擎……所以我不能肯定。
但它应该与大多数东西兼容。
■ 参数╒══════════════════════════╛
!电话项目设置
>> 帮助窗口 Y 偏移
~ 帮助窗口 Y 偏移
>> ItemType 窗口 Y 偏移
~ ItemType 窗口 Y 偏移
>> 项目列表窗口 Y 偏移
~ ItemList 窗口 Y 偏移
>> 演员选择窗口 Y 偏移
~ 演员选择窗口 Y 偏移
>> 规格宽度
~ 项目窗口量规的宽度
!电话技能设置
>> 使用演员背景
~ 如果为真将使用演员背景作为电话技能场景
>> 规格宽度 1
〜演员选择中的仪表宽度
>> 标宽 2
~ 技能用户状态量表的宽度
>> 帮助窗口 Y 偏移
~ 帮助窗口 Y 偏移
>> SkillType 窗口 Y 偏移
~ SkillType 窗口 Y 偏移
>> 状态窗口 Y 偏移
~ 状态窗口 Y 偏移
>> 技能列表窗口 Y 偏移
~ 技能列表窗口 Y 偏移
>> 演员选择窗口 Y 偏移
~ 演员选择窗口 Y 偏移
!手机设备设置
>> 使用演员背景
~ 如果为真,将使用演员背景进行手机装备场景
>> 规格宽度
~ 装备窗规的宽度
>> 帮助窗口 Y 偏移
~ 帮助窗口 Y 偏移
>> 状态窗口 Y 偏移
~ 状态窗口 Y 偏移
>> 命令窗口 Y 偏移
~ 命令窗口 Y 偏移
>> 槽窗 Y 偏移
~ 槽窗 Y 偏移
>> 项目窗口 Y 偏移
~ 项目窗口 Y 偏移
!手机状态设置
>> 使用演员背景
~ 如果为 true 将使用演员背景作为电话状态
>> 最大级别文本
~ 当演员等级达到最大值时显示的文字
>> Exp Gauge 颜色 1
~ Exp Gauge 渐变的颜色 1
>> Exp Gauge 颜色 2
~ Exp Gauge 渐变的颜色 2
>> 状态内容高度
~ 状态窗口内容的高度
>> 规格宽度
~ 状态窗口量规的宽度
>> 演员姓名栏
~ 在电话状态中...演员的名字画在哪一行?
>> 演员等级线
~ 在电话状态中...演员级别画了哪条线?
>> 演员班线
~ 在电话状态中...演员类画了哪条线?
>> 演员国行
〜在电话状态中......演员造成的状态是哪条线?
>> 演员HPMPTP线
~ 在电话状态中...演员测量哪条线? (这需要将近 4 行)
>> 演员经验线
〜在电话状态中...演员EXP量规画了哪条线? (需要将近 2 行)
>> 演员攻击线
~ 在电话状态中...演员 Atk 画了哪条线?
>> 演员定义线
~ 在电话状态中...演员 Def 画了哪条线?
>> 演员马特线
~ 在电话状态中...演员马特画了哪条线?
>>演员Mdef线
~ 在电话状态中...演员 Mdef 画了哪条线?
>> 演员敏捷线
〜在电话状态中......演员Agi画了哪条线?
>> 演员陆行
~ 在电话状态中... 演员 Luk 画了哪条线?
>> 演员简介线
~ 在电话状态中...演员个人资料画了哪条线? (inf 行)(最后推荐)
!电话选项设置
>> 选项窗口 Y 偏移
~ 选项窗口 Y 偏移
!手机负载设置
>> PhoneLoad 作为 SceneLoad。
~ 如果设置为 true... 这将打开 Scene_PhoneAddonLoad 而不是 Scene_Load
>> 加载公共事件
〜从手机加载保存文件时。执行这个公共事件(设置为 0 不调用任何公共事件)
■ 执照╒══════════════════════════╛
在所有项目中免费使用(包含色情内容的项目除外)
只要我记入(ESTRIOLE)。
■ 额外积分╒══════════════════════════╛
■ 支持╒══════════════════════════╛
虽然我很受宠若惊,我很高兴人们一直在分享和
在其他 RPG Maker 社区中寻求对脚本的支持,我会
想问一下,请避免将我的脚本发布到其他地方
我经常这样做是因为它可以找到支持和修复错误
你我都难。
如果您正在寻求支持,可以通过以下方式与我联系:
[ http://forums.rpgmakerweb.com/ ]
pm我:雌三醇
也无法支持与 VisuStella 的兼容性。
因为他们的代码被混淆了,因此人类无法阅读。
如果有不兼容...请询问 VisuStella 团队。
■ 捐款╒══════════════════════════╛
如果你想支持我的工作,你可以在这里捐款
https://paypal.me/Estriole
■ 作者手记╒══════════════════════════╛
没有任何
■ Information ╒══════════════════════════╛
EST - PHONE ADDON - BASIC MENU
Version: 1.2
By Estriole
File name: EST_PHONE_ADDON_BASICMENU.js
■ Introduction ╒══════════════════════════╛
This plugin is addon to EST - PHONE MENU MZ
this plugin recreate all the basic menu to fits the phone scene
■ Features ╒══════════════════════════╛
- all basic menu in phone screen
■ Changelog ╒══════════════════════════╛
v1.0 2020.10.22 Finish making the plugin
v1.1 2020.10.25 fix the bug with skill gauge width in skill user status
and actor selection
v1.2 2021.01.30 remove the hardcoded lv and exp text... now use database term
add plugin parameter Max Level Text... so user can change it.
■ Plugin Download ╒══════════════════════════╛
https://www.dropbox.com/s/6bquiq ... N_BASICMENU.js?dl=0
■ Screenshots ╒══════════════════════════╛
Coming Soon
■ Demo ╒══════════════════════════╛
https://www.dropbox.com/sh/vhf1j ... lI81AAmAcK50Ha?dl=0
click download to download the entire folder.
■ How to use ╒══════════════════════════╛
1. Install EST_PHONE_MENU_MZ.js (required)
2. Install this plugin BELOW it
3. open the EST_PHONE_MENU_MZ plugin parameter and search
for Phone Command Settings parameter.
add your menu command there.
this is what you should put on the 'Script' parameter
for that menu command.
Item Scene
SceneManager.push(Scene_PhoneAddonItem);
Skill Scene
$gameSystem._phoneActorSelectionType = "Skill";
SceneManager.push(Scene_PhoneAddonActorSelection);
Equip Scene
$gameSystem._phoneActorSelectionType = "Equip";
SceneManager.push(Scene_PhoneAddonActorSelection);
Status Scene
$gameSystem._phoneActorSelectionType = "Status";
SceneManager.push(Scene_PhoneAddonActorSelection);
Formation Scene
SceneManager.push(Scene_PhoneAddonFormation);
Options Scene
SceneManager.push(Scene_PhoneAddonOptions);
Save Scene
SceneManager.push(Scene_PhoneAddonSave);
Load Scene
SceneManager.push(Scene_PhoneAddonLoad);
Game End Scene
SceneManager.push(Scene_PhoneAddonGameEnd);
4> you can also make when pressing continue / load
in title screen... instead of calling Scene_Load
will use the phone version...
change the "PhoneLoad as SceneLoad" parameter to true.
■ Dependencies ╒══════════════════════════╛
EST_PHONE_MENU_MZ.js
place this plugin BELOW it.
■ Compatibility ╒══════════════════════════╛
MZ is new engine... so i cannot say for sure.
but it should be compatible with most things.
■ Parameters ╒══════════════════════════╛
!Phone Item Settings
>> Help Window Y Offset
~ Help Window Y Offset
>> ItemType Window Y Offset
~ ItemType Window Y Offset
>> ItemList Window Y Offset
~ ItemList Window Y Offset
>> Actor Selection Window Y Offset
~ Actor Selection Window Y Offset
>> Gauge Width
~ Width of the Item Window Gauge
!Phone Skill Settings
>> Use Actor Background
~ if true will use actor background for phone skill scene
>> Gauge Width 1
~ Width of the Gauge in Actor Selection
>> Gauge Width 2
~ Width of the Skill User Status Gauge
>> Help Window Y Offset
~ Help Window Y Offset
>> SkillType Window Y Offset
~ SkillType Window Y Offset
>> Status Window Y Offset
~ Status Window Y Offset
>> SkillList Window Y Offset
~ SkillList Window Y Offset
>> Actor Selection Window Y Offset
~ Actor Selection Window Y Offset
!Phone Equip Settings
>> Use Actor Background
~ if true will use actor background for phone equip scene
>> Gauge Width
~ Width of the Equip Window Gauge
>> Help Window Y Offset
~ Help Window Y Offset
>> Status Window Y Offset
~ Status Window Y Offset
>> Command Window Y Offset
~ Command Window Y Offset
>> Slot Window Y Offset
~ Slot Window Y Offset
>> Item Window Y Offset
~ Item Window Y Offset
!Phone Status Settings
>> Use Actor Background
~ if true will use actor background for phone status
>> Max Level Text
~ Text to show when actor level maxed
>> Exp Gauge Color 1
~ Color 1 of the Exp Gauge gradient
>> Exp Gauge Color 2
~ Color 2 of the Exp Gauge gradient
>> Status Content Height
~ Height of the Status Window Content
>> Gauge Width
~ Width of the Status Window Gauge
>> Actor Name Line
~ In Phone Status... Which line the actor name drawn?
>> Actor Level Line
~ In Phone Status... Which line the actor level drawn?
>> Actor Class Line
~ In Phone Status... Which line the actor class drawn?
>> Actor States Line
~ In Phone Status... Which line the actor inflicted states drawn?
>> Actor HPMPTP Line
~ In Phone Status... Which line the actor gauges drawn? (this takes almost 4 lines)
>> Actor EXP Line
~ In Phone Status... Which line the actor EXP gauges drawn? (takes almost 2 lines)
>> Actor Atk Line
~ In Phone Status... Which line the actor Atk drawn?
>> Actor Def Line
~ In Phone Status... Which line the actor Def drawn?
>> Actor Matk Line
~ In Phone Status... Which line the actor Matk drawn?
>> Actor Mdef Line
~ In Phone Status... Which line the actor Mdef drawn?
>> Actor Agi Line
~ In Phone Status... Which line the actor Agi drawn?
>> Actor Luk Line
~ In Phone Status... Which line the actor Luk drawn?
>> Actor Profile Line
~ In Phone Status... Which line the actor Profile drawn? (inf lines)(recommended last)
!Phone Options Settings
>> Option Window Y Offset
~ Option Window Y Offset
!Phone Load Settings
>> PhoneLoad as SceneLoad.
~ If set to true... this will open Scene_PhoneAddonLoad instead of Scene_Load
>> Onload Common Event
~ When loading savefile from phone. execute this common event (set to 0 to not call any common event)
■ License ╒══════════════════════════╛
Free to use in all project (except the one containing pornography)
as long as i credited (ESTRIOLE).
■ Extra Credit ╒══════════════════════════╛
■ Support ╒══════════════════════════╛
While I'm flattered and I'm glad that people have been sharing and
asking support for scripts in other RPG Maker communities, I would
like to ask that you please avoid posting my scripts outside of where
I frequent because it would make finding support and fixing bugs
difficult for both of you and me.
If you're ever looking for support, I can be reached at the following:
[ http://forums.rpgmakerweb.com/ ]
pm me : estriole
also support to compatibility with VisuStella is not possible.
because their code is obfuscated thus cannot be read by human.
if there's incompatibility... please ask VisuStella Team.
■ Donate ╒══════════════════════════╛
If you want to support my work you can donate here
https://paypal.me/Estriole
■ Author's Notes ╒══════════════════════════╛
None
*/
var EST = EST || {};
EST.PhoneMenu = EST.PhoneMenu || {};
EST.PhoneMenu.addonName=document.currentScript.src.split('/').slice(-1)[0].slice(0,-3).replace(/\%20/g," ");
//merge addon parameter to main phone parameter
EST.PhoneMenu.AddonParam = PluginManager.parameters(EST.PhoneMenu.addonName);
Object.assign(EST.PhoneMenu.Parameters, EST.PhoneMenu.AddonParam);
//addon status parameter
EST.PhoneMenu.Parameters.phoneStatusActorBG = JSON.parse(EST.PhoneMenu.Parameters.phoneStatusActorBG);
EST.PhoneMenu.Parameters.expGaugeColor1 = Number(EST.PhoneMenu.Parameters.expGaugeColor1);
EST.PhoneMenu.Parameters.expGaugeColor2 = Number(EST.PhoneMenu.Parameters.expGaugeColor2);
EST.PhoneMenu.Parameters.statusActorNameLine = Number(EST.PhoneMenu.Parameters.statusActorNameLine);
EST.PhoneMenu.Parameters.statusActorLvLine = Number(EST.PhoneMenu.Parameters.statusActorLvLine);
EST.PhoneMenu.Parameters.statusActorClassLine = Number(EST.PhoneMenu.Parameters.statusActorClassLine);
EST.PhoneMenu.Parameters.statusActorStatesLine = Number(EST.PhoneMenu.Parameters.statusActorStatesLine);
EST.PhoneMenu.Parameters.statusActorGaugeLine = Number(EST.PhoneMenu.Parameters.statusActorGaugeLine);
EST.PhoneMenu.Parameters.statusActorExpLine = Number(EST.PhoneMenu.Parameters.statusActorExpLine);
EST.PhoneMenu.Parameters.statusActorAtkLine = Number(EST.PhoneMenu.Parameters.statusActorAtkLine);
EST.PhoneMenu.Parameters.statusActorDefLine = Number(EST.PhoneMenu.Parameters.statusActorDefLine);
EST.PhoneMenu.Parameters.statusActorMatkLine = Number(EST.PhoneMenu.Parameters.statusActorMatkLine);
EST.PhoneMenu.Parameters.statusActorMdefLine = Number(EST.PhoneMenu.Parameters.statusActorMdefLine);
EST.PhoneMenu.Parameters.statusActorAgiLine = Number(EST.PhoneMenu.Parameters.statusActorAgiLine);
EST.PhoneMenu.Parameters.statusActorLukLine = Number(EST.PhoneMenu.Parameters.statusActorLukLine);
EST.PhoneMenu.Parameters.statusActorProfLine = Number(EST.PhoneMenu.Parameters.statusActorProfLine);
EST.PhoneMenu.Parameters.phoneStatusItemHeight = Number(EST.PhoneMenu.Parameters.phoneStatusItemHeight);
EST.PhoneMenu.Parameters.phoneStatusGaugeWidth = Number(EST.PhoneMenu.Parameters.phoneStatusGaugeWidth);
// //addon equip parameter
EST.PhoneMenu.Parameters.phoneEquipActorBG = JSON.parse(EST.PhoneMenu.Parameters.phoneEquipActorBG);
EST.PhoneMenu.Parameters.phoneEquipHelpY = Number(EST.PhoneMenu.Parameters.phoneEquipHelpY);
EST.PhoneMenu.Parameters.phoneEquipStatusY = Number(EST.PhoneMenu.Parameters.phoneEquipStatusY);
EST.PhoneMenu.Parameters.phoneEquipCommandY = Number(EST.PhoneMenu.Parameters.phoneEquipCommandY);
EST.PhoneMenu.Parameters.phoneEquipSlotY = Number(EST.PhoneMenu.Parameters.phoneEquipSlotY);
EST.PhoneMenu.Parameters.phoneEquipItemY = Number(EST.PhoneMenu.Parameters.phoneEquipItemY);
EST.PhoneMenu.Parameters.phoneEquipGaugeWidth = Number(EST.PhoneMenu.Parameters.phoneEquipGaugeWidth);
// addon skill parameter
EST.PhoneMenu.Parameters.phoneSkillActorBG = JSON.parse(EST.PhoneMenu.Parameters.phoneSkillActorBG);
EST.PhoneMenu.Parameters.phoneSkillHelpY = Number(EST.PhoneMenu.Parameters.phoneSkillHelpY);
EST.PhoneMenu.Parameters.phoneSkillCommandY = Number(EST.PhoneMenu.Parameters.phoneSkillCommandY);
EST.PhoneMenu.Parameters.phoneSkillStatusY = Number(EST.PhoneMenu.Parameters.phoneSkillStatusY);
EST.PhoneMenu.Parameters.phoneSkillActorY = Number(EST.PhoneMenu.Parameters.phoneSkillActorY);
EST.PhoneMenu.Parameters.phoneSkillListY = Number(EST.PhoneMenu.Parameters.phoneSkillListY);
EST.PhoneMenu.Parameters.phoneSkillGaugeWidth = Number(EST.PhoneMenu.Parameters.phoneSkillGaugeWidth);
EST.PhoneMenu.Parameters.phoneSkillStatusGaugeWidth = Number(EST.PhoneMenu.Parameters.phoneSkillStatusGaugeWidth);
// addon item parameter
EST.PhoneMenu.Parameters.phoneItemHelpY = Number(EST.PhoneMenu.Parameters.phoneItemHelpY);
EST.PhoneMenu.Parameters.phoneItemCommandY = Number(EST.PhoneMenu.Parameters.phoneItemCommandY);
EST.PhoneMenu.Parameters.phoneItemActorY = Number(EST.PhoneMenu.Parameters.phoneItemActorY);
EST.PhoneMenu.Parameters.phoneItemListY = Number(EST.PhoneMenu.Parameters.phoneItemListY);
EST.PhoneMenu.Parameters.phoneItemGaugeWidth = Number(EST.PhoneMenu.Parameters.phoneItemGaugeWidth);
// addon option parameter
EST.PhoneMenu.Parameters.phoneOptionY = Number(EST.PhoneMenu.Parameters.phoneOptionY);
// addon load parameter
EST.PhoneMenu.Parameters.phoneReplaceLoad = JSON.parse(EST.PhoneMenu.Parameters.phoneReplaceLoad);
EST.PhoneMenu.Parameters.phoneLoadCommonEvent = Number(EST.PhoneMenu.Parameters.phoneLoadCommonEvent);
// adding parameters to scene and window phone
Scene_Phone.prototype = Object.assign(Scene_Phone.prototype, EST.PhoneMenu);
Window_PhoneCommand.prototype = Object.assign(Window_PhoneCommand.prototype, EST.PhoneMenu);
//wrapper
(function($){
//THE BASIC MENU ADDONS
//start actor selection for skill, equip, status, talk
Scene_PhoneAddonActorSelection = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonActorSelection.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonActorSelection.prototype.constructor = Scene_PhoneAddonActorSelection;
Scene_PhoneAddonActorSelection.prototype.createContents = function(){
var wx = this.Parameters.phoneXpos + this.Parameters.phoneBGXoffset;
var wy = this.Parameters.phoneYpos + this.Parameters.phoneBGYoffset + 15;
var ww = this.Parameters.phoneBGWidth;
var wh = this.Parameters.phoneBGHeight -15;
this._phoneCommand = new Window_PhoneAddonSelection(new Rectangle(wx,wy,ww,wh),this._page);
this._phoneCommand.setHandler("ok", this.onPhoneOK.bind(this));
this._phoneCommand.setHandler("cancel", this.onPhoneCancel.bind(this));
this._phoneCommand.refresh();
this.addChild(this._phoneCommand);
};
Scene_PhoneAddonActorSelection.prototype.onPhoneCancel = function() {
if ($gameMap._interpreter.isRunning()) return this._phoneCommand.activate();
SoundManager.playCancel();
$gameTemp._phoneLastIcon = null;
$gameTemp._phoneLastPage = null;
SceneManager.pop();
};
Scene_PhoneAddonActorSelection.prototype.onPhoneOK = function() {
var type = $gameSystem._phoneActorSelectionType;
$gameSystem._phoneMenuActor = this._phoneCommand._index;
switch (type){
case ("Skill"):
SceneManager.push(Scene_PhoneAddonSkill);
break;
case ("Equip"):
SceneManager.push(Scene_PhoneAddonEquip)
break;
case ("Status"):
SceneManager.push(Scene_PhoneAddonStatus)
break;
case ("Talk"):
var actorId = $gameParty.members()[$gameSystem._phoneMenuActor]._actorId;
var actor = $dataActors[actorId];
if (!actor) return this._phoneCommand.activate();
if (!actor.note.match(/<phoneTalkCE:(.*)>/im)) return this._phoneCommand.activate();
var ce = Number(actor.note.match(/<phoneTalkCE:(.*)>/im)[1]);
$gameTemp.reserveCommonEvent(ce);
break;
};
};
Window_PhoneAddonSelection = function() {
this.initialize(...arguments);
};
Window_PhoneAddonSelection.prototype = Object.create(Window_PhoneAddonBase.prototype);
Window_PhoneAddonSelection.prototype.constructor = Window_PhoneAddonSelection;
Window_PhoneAddonSelection.prototype.makeCommandList = function(){
for(actor of $gameParty.members()){
this.addCommand(actor, actor.name());
};
};
//patch for scene interpreter
Window_PhoneAddonSelection.prototype.processCursorMove = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_PhoneAddonBase.prototype.processCursorMove.call(this);
};
Window_PhoneAddonSelection.prototype.processHandling = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_PhoneAddonBase.prototype.processHandling.call(this);
};
Window_PhoneAddonSelection.prototype.processTouch = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_PhoneAddonBase.prototype.processTouch.call(this);
};
Window_PhoneAddonSelection.prototype.drawItem = function(index){
const rect = this.itemRect(index);
const align = "left";
var faceName = this._list[index].name.faceName();
var faceIndex = this._list[index].name.faceIndex();
this.drawFace(faceName,faceIndex,rect.x,rect.y, 144, rect.height);
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align);
this.drawText(TextManager.levelA+" "+this._list[index].name.level, rect.x + 144-24, rect.y+this.lineHeight(), rect.width, align);
};
Window_PhoneAddonSelection.prototype.commandName = function(index){
return this._list[index].name.name();
};
Window_PhoneAddonSelection.prototype.itemHeight = function() {
return 82;
};
Window_PhoneAddonSelection.prototype.processWheelScroll = function() {
if (this.isWheelScrollEnabled() && this.isTouchedInsideFrame()) {
const threshold = 20;
if (TouchInput.wheelY >= threshold) {
this.smoothScrollDown(1);
}
if (TouchInput.wheelY <= -threshold) {
this.smoothScrollUp(1);
}
}
};
//end addon actor selection
//start item
Scene_PhoneAddonItem = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonItem.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonItem.prototype.constructor = Scene_PhoneAddonItem;
Scene_PhoneAddonItem.prototype.createContents = function(){
var par = this.Parameters;
var wx = par.phoneXpos + par.phoneBGXoffset;
var wy = par.phoneYpos + par.phoneBGYoffset + 15;
var ww = par.phoneBGWidth;
var wh = par.phoneBGHeight -15;
// this.createHelpWindow();
this._helpWindow = new Window_PhoneHelp(new Rectangle(wx,wy + par.phoneItemHelpY,ww,90));
this._helpWindow.refresh();
this.addChild(this._helpWindow);
// this.createSkillTypeWindow();
this._phoneCommand = new Window_PhoneItemCategory(new Rectangle(wx, wy + par.phoneItemCommandY, ww, 112));
this._phoneCommand.setHelpWindow(this._helpWindow);
this._phoneCommand.setHandler("ok", this.onCategoryOk.bind(this));
this._phoneCommand.setHandler("cancel", this.onCategoryCancel.bind(this));
this.addChild(this._phoneCommand);
// this.createItemWindow();
this._itemWindow = new Window_PhoneItemList(new Rectangle(wx,wy + par.phoneItemListY,ww,wh - par.phoneItemListY));
this._itemWindow.setHelpWindow(this._helpWindow);
this._itemWindow.setHandler("ok", this.onItemOk.bind(this));
this._itemWindow.setHandler("cancel", this.onItemCancel.bind(this));
this._phoneCommand.setItemWindow(this._itemWindow);
this.addChild(this._itemWindow);
if (!this._phoneCommand.needsSelection()) {
this._itemWindow.y -= this._phoneCommand.height;
this._itemWindow.height += this._phoneCommand.height;
this._phoneCommand.hide();
this._phoneCommand.deactivate();
this.onCategoryOk();
};
this._actorWindow = new Window_PhoneItemActor(new Rectangle(wx, wy + par.phoneItemActorY,ww,wh - par.phoneItemActorY));
this._actorWindow.setHandler("ok", this.onActorOk.bind(this));
this._actorWindow.setHandler("cancel", this.onActorCancel.bind(this));
this._actorWindow.refresh();
this._actorWindow.hide();
this.addChild(this._actorWindow);
// //activating
this._phoneCommand.activate();
};
Scene_PhoneAddonItem.prototype.onCategoryOk = function() {
this._itemWindow.activate();
this._itemWindow.selectLast();
};
Scene_PhoneAddonItem.prototype.onCategoryCancel = function() {
this.popScene();
};
Scene_PhoneAddonItem.prototype.onItemOk = function() {
$gameParty.setLastItem(this.item());
this.determineItem();
};
Scene_PhoneAddonItem.prototype.determineItem = function() {
const action = new Game_Action(this.user());
const item = this.item();
action.setItemObject(item);
if (action.isForFriend()) {
this.showActorWindow();
this._actorWindow.selectForItem(this.item());
} else {
this.useItem();
this.activateItemWindow();
}
};
Scene_PhoneAddonItem.prototype.showActorWindow = function() {
this._itemWindow.hide();
this._actorWindow.refresh();
this._actorWindow.show();
this._actorWindow.activate();
};
Scene_PhoneAddonItem.prototype.hideActorWindow = function() {
this._itemWindow.show();
this._actorWindow.hide();
this._actorWindow.deactivate();
};
Scene_PhoneAddonItem.prototype.item = function() {
return this._itemWindow.item();
};
Scene_PhoneAddonItem.prototype.onItemCancel = function() {
if (this._phoneCommand.needsSelection()) {
this._itemWindow.deselect();
this._phoneCommand.activate();
} else {
this.popScene();
}
};
Scene_PhoneAddonItem.prototype.onActorOk = function() {
if (this.canUse()) {
this.useItem();
} else {
SoundManager.playBuzzer();
}
};
Scene_PhoneAddonItem.prototype.canUse = function() {
const user = this.user();
return user && user.canUse(this.item()) && this.isItemEffectsValid();
};
Scene_PhoneAddonItem.prototype.isItemEffectsValid = function() {
const action = new Game_Action(this.user());
action.setItemObject(this.item());
return this.itemTargetActors().some(target => action.testApply(target));
};
Scene_PhoneAddonItem.prototype.itemTargetActors = function() {
const action = new Game_Action(this.user());
action.setItemObject(this.item());
if (!action.isForFriend()) {
return [];
} else if (action.isForAll()) {
return $gameParty.members();
} else {
return [$gameParty.members()[this._actorWindow.index()]];
}
};
Scene_PhoneAddonItem.prototype.onActorCancel = function() {
this.hideActorWindow();
this.activateItemWindow();
};
Scene_PhoneAddonItem.prototype.activateItemWindow = function() {
this._itemWindow.refresh();
this._itemWindow.activate();
};
Scene_PhoneAddonItem.prototype.playSeForItem = function() {
SoundManager.playUseItem();
};
Scene_PhoneAddonItem.prototype.useItem = function() {
this.playSeForItem();
this.user().useItem(this.item());
this.applyItem();
this.checkGameover();
this._actorWindow.refresh();
this._itemWindow.redrawCurrentItem();
};
Scene_PhoneAddonItem.prototype.applyItem = function() {
const action = new Game_Action(this.user());
action.setItemObject(this.item());
for (const target of this.itemTargetActors()) {
for (let i = 0; i < action.numRepeats(); i++) {
action.apply(target);
}
}
action.applyGlobal();
};
Scene_PhoneAddonItem.prototype.user = function() {
const members = $gameParty.movableMembers();
const bestPha = Math.max(...members.map(member => member.pha));
return members.find(member => member.pha === bestPha);
};
Window_PhoneItemCategory = function() {
this.initialize(...arguments);
};
Window_PhoneItemCategory.prototype = Object.create(Window_ItemCategory.prototype);
Window_PhoneItemCategory.prototype.constructor = Window_PhoneItemCategory;
Window_PhoneItemCategory.prototype.initialize = function(rect) {
Window_ItemCategory.prototype.initialize.call(this, rect);
this.opacity = 0;
this.contents.fontSize = 18;
};
Window_PhoneItemCategory.prototype.maxCols = function(rect) {
return 2;
};
Window_PhoneItemList = function() {
this.initialize(...arguments);
};
Window_PhoneItemList.prototype = Object.create(Window_ItemList.prototype);
Window_PhoneItemList.prototype.constructor = Window_PhoneItemList;
Window_PhoneItemList.prototype.initialize = function(rect) {
Window_ItemList.prototype.initialize.call(this, rect);
this.opacity = 0;
this.contents.fontSize = 18;
};
Window_PhoneItemList.prototype.maxCols = function(rect) {
return 1;
};
Window_PhoneItemActor = function() {
this.initialize(...arguments);
};
Window_PhoneItemActor.prototype = Object.create(Window_MenuActor.prototype);
Window_PhoneItemActor.prototype.constructor = Window_PhoneItemActor;
Window_PhoneItemActor.prototype.initialize = function(rect) {
Window_MenuActor.prototype.initialize.call(this, rect);
this.opacity = 0;
};
Window_PhoneItemActor.prototype.drawItem = function(index) {
this.drawPendingItemBackground(index);
this.drawItemImage(index);
this.drawItemStatus(index);
};
Window_PhoneItemActor.prototype.drawFace = function(
faceName, faceIndex, x, y, width, height
) {
width = width || ImageManager.faceWidth;
height = height || ImageManager.faceHeight;
const bitmap = ImageManager.loadFace(faceName);
const pw = ImageManager.faceWidth;
const ph = ImageManager.faceHeight;
const sw = Math.min(width, pw);
const sh = Math.min(height, ph);
const dx = Math.floor(x + Math.max(width - pw, 0) / 2);
const dy = Math.floor(y + Math.max(height - ph, 0) / 2);
const sx = (faceIndex % 4) * pw + (pw - sw) / 2;
const sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy, sw/2, sh/2);
};
Window_PhoneItemActor.prototype.drawItemStatus = function(index) {
const actor = this.actor(index);
const rect = this.itemRect(index);
const x = rect.x;
const y = rect.y - 72 + 8;
this.drawActorSimpleStatus(actor, x, y);
};
Window_PhoneItemActor.prototype.refresh = function() {
for(ic of this._innerChildren){ic.hide()};
Window_MenuActor.prototype.refresh.call(this);
};
Window_PhoneItemActor.prototype.drawActorSimpleStatus = function(actor, x, y) {
const lineHeight = this.lineHeight();
const x2 = x + 144/2 + 4;
this.contents.fontSize = 14;
this.drawActorName(actor, x, y + lineHeight * 2.25);
this.drawActorIcons(actor, x, y + lineHeight * 3, this.itemRect(this._index).width);
this.placeBasicGauges(actor, x2, y + 64 - 8);
};
Window_PhoneItemActor.prototype.drawActorIcons = function(actor, x, y, width) {
width = width || 144;
const iconWidth = ImageManager.iconWidth/2;
const icons = actor.allIcons().slice(0, Math.floor(width / iconWidth));
let iconX = x;
for (const icon of icons) {
this.drawIcon(icon, iconX, y + 2);
iconX += iconWidth;
}
};
Window_PhoneItemActor.prototype.drawIcon = function(iconIndex, x, y) {
const bitmap = ImageManager.loadSystem("IconSet");
const pw = ImageManager.iconWidth;
const ph = ImageManager.iconHeight;
const sx = (iconIndex % 16) * pw;
const sy = Math.floor(iconIndex / 16) * ph;
this.contents.blt(bitmap, sx, sy, pw, ph, x, y, pw/2, ph/2);
};
Window_PhoneItemActor.prototype.placeBasicGauges = function(actor, x, y) {
this.placeGauge(actor, "hp", x, y);
this.placeGauge(actor, "mp", x, y + this.gaugeLineHeight());
if ($dataSystem.optDisplayTp) {
this.placeGauge(actor, "tp", x, y + this.gaugeLineHeight() * 2);
}
};
Window_PhoneItemActor.prototype.gaugeLineHeight = function() {
return 14;
};
Window_PhoneItemActor.prototype.placeGauge = function(actor, type, x, y) {
const key = "actor%1-gauge-%2".format(actor.actorId(), type);
const sprite = this.createInnerSprite(key, Sprite_GaugePhoneItem);
sprite.setup(actor, type);
sprite.move(x, y);
sprite.show();
};
//patch for scene interpreter
Window_PhoneItemActor.prototype.processCursorMove = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_MenuActor.prototype.processCursorMove.call(this);
};
Window_PhoneItemActor.prototype.processHandling = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_MenuActor.prototype.processHandling.call(this);
};
Window_PhoneItemActor.prototype.processTouch = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_MenuActor.prototype.processTouch.call(this);
};
// gauge width modification for phone scene
Sprite_GaugePhoneItem = function() {
this.initialize(...arguments);
}
Sprite_GaugePhoneItem.prototype = Object.create(Sprite_Gauge.prototype);
Sprite_GaugePhoneItem.prototype.constructor = Sprite_GaugePhoneItem;
Sprite_GaugePhoneItem.prototype.gaugeX = function() {
return 20;
};
Sprite_GaugePhoneItem.prototype.bitmapWidth = function() {
return EST.PhoneMenu.Parameters.phoneItemGaugeWidth;
// plan for plugin parameter -> phone status gauge width
};
Sprite_GaugePhoneItem.prototype.drawValue = function() {
const currentValue = this.currentValue();
const maxValue = this.currentMaxValue();
const width = this.bitmapWidth();
const height = this.bitmapHeight();
this.setupValueFont();
this.bitmap.fontSize = 10;
this.bitmap.drawText(currentValue +"/"+ maxValue, 0, 0, width, height, "right");
};
Sprite_GaugePhoneItem.prototype.drawLabel = function() {
const label = this.label();
const x = this.labelOutlineWidth() / 2;
const y = this.labelY();
const width = this.bitmapWidth();
const height = this.bitmapHeight();
this.setupLabelFont();
this.bitmap.fontSize = 14;
this.bitmap.paintOpacity = this.labelOpacity();
this.bitmap.drawText(label, x, y, width, height, "left");
this.bitmap.paintOpacity = 255;
};
//end item
//start skill
Scene_PhoneAddonSkill = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonSkill.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonSkill.prototype.constructor = Scene_PhoneAddonSkill;
Scene_PhoneAddonSkill.prototype.createPhoneBackground = function() {
var actorIndex = this.actor()._actorId;
this._phone = new Sprite(ImageManager.loadBitmap("img/"+this.Parameters.folderPath,$gameSystem.phoneIMG));
$gameTemp._storingPhoneWindow = this;
var filename = this.Parameters.phoneSkillActorBG ? "Actor_"+actorIndex : $gameSystem.phoneBG;
var bitmap = ImageManager.loadBitmap("img/"+this.Parameters.folderPath,filename);
bitmap.addLoadListener(function(){
if ($gameTemp._storingPhoneWindow) $gameTemp._storingPhoneWindow._phoneNeedRedraw = true;
});
this._phoneBG = new Sprite(bitmap);
this._phone.x = this.Parameters.phoneXpos;
this._phone.y = this.Parameters.phoneYpos;
this._phoneBG.x = this._phone.x + this.Parameters.phoneBGXoffset;
this._phoneBG.y = this._phone.y + this.Parameters.phoneBGYoffset;
this.addChild(this._phoneBG);
};
Scene_PhoneAddonSkill.prototype.createContents = function(){
var par = this.Parameters;
var wx = par.phoneXpos + par.phoneBGXoffset;
var wy = par.phoneYpos + par.phoneBGYoffset + 15;
var ww = par.phoneBGWidth;
var wh = par.phoneBGHeight -15;
// this.createHelpWindow();
this._helpWindow = new Window_PhoneHelp(new Rectangle(wx,wy + par.phoneSkillHelpY,ww,90));
this._helpWindow.refresh();
this.addChild(this._helpWindow);
// this.createSkillTypeWindow();
this._phoneCommand = new Window_PhoneSkillType(new Rectangle(wx + ww/2,wy + par.phoneSkillCommandY, ww/2, 144 + 8));
this._phoneCommand.setHelpWindow(this._helpWindow);
this._phoneCommand.setHandler("skill", this.commandSkill.bind(this));
this._phoneCommand.setHandler("cancel", this.commandCancel.bind(this));
this._phoneCommand.setHandler("pagedown", this.nextActor.bind(this));
this._phoneCommand.setHandler("pageup", this.previousActor.bind(this));
this.addChild(this._phoneCommand);
// this.createStatusWindow();
this._statusWindow = new Window_PhoneSkillStatus(new Rectangle(wx,wy + par.phoneSkillStatusY , ww/2, 144 + 8));
this.addChild(this._statusWindow);
// this.createItemWindow();
this._itemWindow = new Window_PhoneSkillList(new Rectangle(wx,wy + par.phoneSkillListY,ww,wh - par.phoneSkillListY));
this._itemWindow.setHelpWindow(this._helpWindow);
this._itemWindow.setHandler("ok", this.onItemOk.bind(this));
this._itemWindow.setHandler("cancel", this.onItemCancel.bind(this));
this._phoneCommand.setSkillWindow(this._itemWindow);
this.addChild(this._itemWindow);
this._actorWindow = new Window_PhoneSkillActor(new Rectangle(wx, wy + par.phoneSkillActorY,ww,wh - par.phoneSkillActorY));
this._actorWindow.setHandler("ok", this.onActorOk.bind(this));
this._actorWindow.setHandler("cancel", this.onActorCancel.bind(this));
this._actorWindow.hide();
this.addChild(this._actorWindow);
this.refreshActor();
//activating
this._phoneCommand.activate();
};
Scene_PhoneAddonSkill.prototype.commandSkill = function(){
this._itemWindow.activate();
this._itemWindow.selectLast();
};
Scene_PhoneAddonSkill.prototype.commandCancel = function(){
this.popScene();
};
Scene_PhoneAddonSkill.prototype.nextActor = function(){
$gameSystem._phoneMenuActor = Math.min($gameParty.members().length-1 , $gameSystem._phoneMenuActor + 1);
this.updateActor();
this.onActorChange();
this._phoneCommand._phoneNeedRedraw = true;
this._phoneCommand.activate();
};
Scene_PhoneAddonSkill.prototype.previousActor = function(){
$gameSystem._phoneMenuActor = Math.max(0,$gameSystem._phoneMenuActor - 1);
this.updateActor();
this.onActorChange();
this._phoneCommand._phoneNeedRedraw = true;
this._phoneCommand.activate();
};
Scene_PhoneAddonSkill.prototype.onActorChange = function() {
Scene_PhoneAddonBase.prototype.onActorChange.call(this);
this.refreshActor();
this._itemWindow.deselect();
this._actorWindow.deselect();
this._phoneCommand.activate();
};
Scene_PhoneAddonSkill.prototype.onItemOk = function(){
this.actor().setLastMenuSkill(this.item());
this.determineItem();
};
Scene_PhoneAddonSkill.prototype.item = function(){
return this._itemWindow.item();
};
Scene_PhoneAddonSkill.prototype.determineItem = function() {
const action = new Game_Action(this.user());
const item = this.item();
action.setItemObject(item);
if (action.isForFriend()) {
this.showActorWindow();
this._actorWindow.selectForItem(this.item());
} else {
this.useItem();
this.activateItemWindow();
}
};
Scene_PhoneAddonSkill.prototype.user = function(){
return this.actor();
};
Scene_PhoneAddonSkill.prototype.showActorWindow = function(){
this._itemWindow.hide();
this._actorWindow.show();
this._actorWindow.activate();
};
Scene_PhoneAddonSkill.prototype.activateItemWindow = function(){
this._itemWindow.refresh();
this._itemWindow.activate();
};
Scene_PhoneAddonSkill.prototype.hideActorWindow = function(){
this._actorWindow.hide();
this._actorWindow.deactivate();
this._itemWindow.show();
};
Scene_PhoneAddonSkill.prototype.useItem = function(){
this.playSeForItem();
this.user().useItem(this.item());
this.applyItem();
this.checkGameover();
this._actorWindow.refresh();
};
Scene_PhoneAddonSkill.prototype.playSeForItem = function(){
SoundManager.playUseItem();
};
Scene_PhoneAddonSkill.prototype.onItemCancel = function(){
this._itemWindow.deselect();
this._phoneCommand.activate();
};
Scene_PhoneAddonSkill.prototype.applyItem = function() {
const action = new Game_Action(this.user());
action.setItemObject(this.item());
for (const target of this.itemTargetActors()) {
for (let i = 0; i < action.numRepeats(); i++) {
action.apply(target);
}
}
action.applyGlobal();
};
Scene_PhoneAddonSkill.prototype.itemTargetActors = function() {
const action = new Game_Action(this.user());
action.setItemObject(this.item());
if (!action.isForFriend()) {
return [];
} else if (action.isForAll()) {
return $gameParty.members();
} else {
return [$gameParty.members()[this._actorWindow.index()]];
}
};
Scene_PhoneAddonSkill.prototype.onActorOk = function(){
if (this.canUse()) {
this.useItem();
this._statusWindow.refresh();
} else {
SoundManager.playBuzzer();
}
};
Scene_PhoneAddonSkill.prototype.canUse = function(){
const user = this.user();
return user && user.canUse(this.item()) && this.isItemEffectsValid();
};
Scene_PhoneAddonSkill.prototype.isItemEffectsValid = function(){
const action = new Game_Action(this.user());
action.setItemObject(this.item());
return this.itemTargetActors().some(target => action.testApply(target));
};
Scene_PhoneAddonSkill.prototype.onActorCancel = function(){
this._statusWindow.refresh();
this.hideActorWindow();
this.activateItemWindow();
};
Scene_PhoneAddonSkill.prototype.refreshActor = function() {
const actor = this.actor();
this._phoneCommand.setActor(actor);
this._statusWindow.setActor(actor);
this._itemWindow.setActor(actor);
};
Scene_PhoneAddonSkill.prototype.redrawPhone = function(){
var actorIndex = this.actor()._actorId;
if (this.Parameters.phoneSkillActorBG) this._phoneBG.bitmap = ImageManager.loadBitmap("img/"+this.Parameters.folderPath,"Actor_"+actorIndex);
this._phoneCommand._phoneNeedRedraw = false;
};
Scene_PhoneAddonSkill.prototype.actor = function() {
return $gameParty.members()[$gameSystem._phoneMenuActor]
};
// skill windows
Window_PhoneSkillType = function() {
this.initialize(...arguments);
};
Window_PhoneSkillType.prototype = Object.create(Window_SkillType.prototype);
Window_PhoneSkillType.prototype.constructor = Window_PhoneSkillType;
Window_PhoneSkillType.prototype.initialize = function(rect) {
Window_SkillType.prototype.initialize.call(this, rect);
this.contents.fontSize = 18;
this.opacity = 0;
};
Window_PhoneSkillType.prototype.processWheelScroll = function() {
if (this.isWheelScrollEnabled() && this.isTouchedInsideFrame()) {
const threshold = 20;
if (TouchInput.wheelY >= threshold) {
SceneManager._scene.nextActor();
}
if (TouchInput.wheelY <= -threshold) {
SceneManager._scene.previousActor();
}
}
};
Window_PhoneSkillStatus = function() {
this.initialize(...arguments);
};
Window_PhoneSkillStatus.prototype = Object.create(Window_SkillStatus.prototype);
Window_PhoneSkillStatus.prototype.constructor = Window_PhoneSkillStatus;
Window_PhoneSkillStatus.prototype.initialize = function(rect) {
Window_SkillStatus.prototype.initialize.call(this, rect);
this.opacity = 0;
};
Window_PhoneSkillStatus.prototype.refresh = function() {
for(ic of this._innerChildren){ic.hide()};
Window_StatusBase.prototype.refresh.call(this);
this.contents.fontSize = 18;
if (this._actor) {
const x = this.colSpacing() / 2;
const h = this.innerHeight;
const y = h / 2 - this.lineHeight() * 1.5;
// this.drawActorFace(this._actor, x + 1, 0, 144, h);
this.drawActorSimpleStatus(this._actor, x, y);
}
};
Window_PhoneSkillStatus.prototype.drawActorSimpleStatus = function(actor, x, y) {
const lineHeight = this.lineHeight();
const x2 = x + 140;
this.drawActorName(actor, x, y);
this.placeBasicGauges(actor, x, y + lineHeight);
};
Window_PhoneSkillStatus.prototype.placeGauge = function(actor, type, x, y) {
const key = "actor%1-gauge-%2".format(actor.actorId(), type);
const sprite = this.createInnerSprite(key, Sprite_GaugePhoneSkillStatus);
sprite.setup(actor, type);
sprite.move(x, y);
sprite.show();
};
// gauge width modification for phone scene
Sprite_GaugePhoneSkill = function() {
this.initialize(...arguments);
}
Sprite_GaugePhoneSkill.prototype = Object.create(Sprite_Gauge.prototype);
Sprite_GaugePhoneSkill.prototype.constructor =Sprite_GaugePhoneSkill;
Sprite_GaugePhoneSkill.prototype.bitmapWidth = function() {
return EST.PhoneMenu.Parameters.phoneSkillGaugeWidth;
};
Sprite_GaugePhoneSkill.prototype.gaugeX = function() {
return 20;
};
Sprite_GaugePhoneSkill.prototype.drawValue = function() {
const currentValue = this.currentValue();
const maxValue = this.currentMaxValue();
const width = this.bitmapWidth();
const height = this.bitmapHeight();
this.setupValueFont();
this.bitmap.fontSize = 10;
this.bitmap.drawText(currentValue +"/"+ maxValue, 0, 0, width, height, "right");
};
Sprite_GaugePhoneSkill.prototype.drawLabel = function() {
const label = this.label();
const x = this.labelOutlineWidth() / 2;
const y = this.labelY();
const width = this.bitmapWidth();
const height = this.bitmapHeight();
this.setupLabelFont();
this.bitmap.fontSize = 14;
this.bitmap.paintOpacity = this.labelOpacity();
this.bitmap.drawText(label, x, y, width, height, "left");
this.bitmap.paintOpacity = 255;
};
// gauge width modification for phone scene
Sprite_GaugePhoneSkillStatus = function() {
this.initialize(...arguments);
}
Sprite_GaugePhoneSkillStatus.prototype = Object.create(Sprite_GaugePhoneSkill.prototype);
Sprite_GaugePhoneSkillStatus.prototype.constructor =Sprite_GaugePhoneSkillStatus;
Sprite_GaugePhoneSkillStatus.prototype.bitmapWidth = function() {
return EST.PhoneMenu.Parameters.phoneSkillStatusGaugeWidth;
};
Window_PhoneSkillList = function() {
this.initialize(...arguments);
};
Window_PhoneSkillList.prototype = Object.create(Window_SkillList.prototype);
Window_PhoneSkillList.prototype.constructor = Window_PhoneSkillList;
Window_PhoneSkillList.prototype.initialize = function(rect) {
Window_SkillList.prototype.initialize.call(this, rect);
this.contents.fontSize = 18;
this.opacity = 0;
};
Window_PhoneSkillList.prototype.maxCols = function(rect) {
return 1;
};
Window_PhoneSkillActor = function() {
this.initialize(...arguments);
};
Window_PhoneSkillActor.prototype = Object.create(Window_MenuActor.prototype);
Window_PhoneSkillActor.prototype.constructor = Window_PhoneSkillActor;
Window_PhoneSkillActor.prototype.initialize = function(rect) {
Window_MenuActor.prototype.initialize.call(this, rect);
this.opacity = 0;
};
Window_PhoneSkillActor.prototype.refresh = function() {
for(ic of this._innerChildren){ic.hide()};
Window_MenuActor.prototype.refresh.call(this);
};
Window_PhoneSkillActor.prototype.drawItem = function(index) {
this.drawPendingItemBackground(index);
this.drawItemImage(index);
this.drawItemStatus(index);
};
Window_PhoneSkillActor.prototype.drawFace = function(
faceName, faceIndex, x, y, width, height
) {
width = width || ImageManager.faceWidth;
height = height || ImageManager.faceHeight;
const bitmap = ImageManager.loadFace(faceName);
const pw = ImageManager.faceWidth;
const ph = ImageManager.faceHeight;
const sw = Math.min(width, pw);
const sh = Math.min(height, ph);
const dx = Math.floor(x + Math.max(width - pw, 0) / 2);
const dy = Math.floor(y + Math.max(height - ph, 0) / 2);
const sx = (faceIndex % 4) * pw + (pw - sw) / 2;
const sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy, sw/2, sh/2);
};
Window_PhoneSkillActor.prototype.drawItemStatus = function(index) {
const actor = this.actor(index);
const rect = this.itemRect(index);
const x = rect.x;
const y = rect.y - 72 + 8;
this.drawActorSimpleStatus(actor, x, y);
};
Window_PhoneSkillActor.prototype.drawActorSimpleStatus = function(actor, x, y) {
const lineHeight = this.lineHeight();
const x2 = x + 144/2 + 4;
this.contents.fontSize = 14;
this.drawActorName(actor, x, y + lineHeight * 2.25);
this.drawActorIcons(actor, x, y + lineHeight * 3, this.itemRect(this._index).width);
this.placeBasicGauges(actor, x2, y + 64 - 8);
};
Window_PhoneSkillActor.prototype.drawActorIcons = function(actor, x, y, width) {
width = width || 144;
const iconWidth = ImageManager.iconWidth/2;
const icons = actor.allIcons().slice(0, Math.floor(width / iconWidth));
let iconX = x;
for (const icon of icons) {
this.drawIcon(icon, iconX, y + 2);
iconX += iconWidth;
}
};
Window_PhoneSkillActor.prototype.drawIcon = function(iconIndex, x, y) {
const bitmap = ImageManager.loadSystem("IconSet");
const pw = ImageManager.iconWidth;
const ph = ImageManager.iconHeight;
const sx = (iconIndex % 16) * pw;
const sy = Math.floor(iconIndex / 16) * ph;
this.contents.blt(bitmap, sx, sy, pw, ph, x, y, pw/2, ph/2);
};
Window_PhoneSkillActor.prototype.placeBasicGauges = function(actor, x, y) {
this.placeGauge(actor, "hp", x, y);
this.placeGauge(actor, "mp", x, y + this.gaugeLineHeight());
if ($dataSystem.optDisplayTp) {
this.placeGauge(actor, "tp", x, y + this.gaugeLineHeight() * 2);
}
};
Window_PhoneSkillActor.prototype.gaugeLineHeight = function() {
return 14;
};
Window_PhoneSkillActor.prototype.placeGauge = function(actor, type, x, y) {
const key = "actor%1-gauge-%2".format(actor.actorId(), type);
const sprite = this.createInnerSprite(key, Sprite_GaugePhoneSkill);
sprite.setup(actor, type);
sprite.move(x, y);
sprite.show();
};
//patch for scene interpreter
Window_PhoneSkillActor.prototype.processCursorMove = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_MenuActor.prototype.processCursorMove.call(this);
};
Window_PhoneSkillActor.prototype.processHandling = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_MenuActor.prototype.processHandling.call(this);
};
Window_PhoneSkillActor.prototype.processTouch = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_MenuActor.prototype.processTouch.call(this);
};
//end skill
//start equip
Scene_PhoneAddonEquip = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonEquip.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonEquip.prototype.constructor = Scene_PhoneAddonEquip;
Scene_PhoneAddonEquip.prototype.createPhoneBackground = function() {
var actorIndex = this.actor()._actorId;
this._phone = new Sprite(ImageManager.loadBitmap("img/"+this.Parameters.folderPath,$gameSystem.phoneIMG));
$gameTemp._storingPhoneWindow = this;
var filename = this.Parameters.phoneEquipActorBG ? "Actor_"+actorIndex : $gameSystem.phoneBG;
var bitmap = ImageManager.loadBitmap("img/"+this.Parameters.folderPath,filename);
bitmap.addLoadListener(function(){
if ($gameTemp._storingPhoneWindow) $gameTemp._storingPhoneWindow._phoneNeedRedraw = true;
});
this._phoneBG = new Sprite(bitmap);
this._phone.x = this.Parameters.phoneXpos;
this._phone.y = this.Parameters.phoneYpos;
this._phoneBG.x = this._phone.x + this.Parameters.phoneBGXoffset;
this._phoneBG.y = this._phone.y + this.Parameters.phoneBGYoffset;
this.addChild(this._phoneBG);
};
Scene_PhoneAddonEquip.prototype.createContents = function(){
var par = this.Parameters;
var wx = par.phoneXpos + par.phoneBGXoffset;
var wy = par.phoneYpos + par.phoneBGYoffset + 15;
var ww = par.phoneBGWidth;
var wh = par.phoneBGHeight -15;
//help window
this._helpWindow = new Window_PhoneHelp(new Rectangle(wx,wy+par.phoneEquipHelpY,ww,90));
this._helpWindow.refresh();
this.addChild(this._helpWindow);
this._helpWindow.hide();
//status window
this._statusWindow = new Window_PhoneEquipStatus(new Rectangle(wx,wy+par.phoneEquipStatusY,ww,wh));
this.addChild(this._statusWindow);
//command window
this._phoneCommand = new Window_PhoneEquipCommand(new Rectangle(wx,wy+par.phoneEquipCommandY,ww,90));
this._phoneCommand.setHelpWindow(this._helpWindow);
this._phoneCommand.setHandler("equip", this.commandEquip.bind(this));
this._phoneCommand.setHandler("optimize", this.commandOptimize.bind(this));
this._phoneCommand.setHandler("clear", this.commandClear.bind(this));
this._phoneCommand.setHandler("cancel", this.popScene.bind(this));
this._phoneCommand.setHandler("pagedown", this.nextActor.bind(this));
this._phoneCommand.setHandler("pageup", this.previousActor.bind(this));
this.addChild(this._phoneCommand);
//create slot
this._slotWindow = new Window_PhoneEquipSlot(new Rectangle(wx,wy+par.phoneEquipSlotY,ww,wh-par.phoneEquipSlotY));
this._slotWindow.setHandler("ok", this.onPhoneOK.bind(this));
this._slotWindow.setHandler("cancel", this.onPhoneCancel.bind(this));
this._slotWindow.refresh();
this._slotWindow.setActor(this.actor());
this._slotWindow.setHelpWindow(this._helpWindow);
this._slotWindow.setStatusWindow(this._statusWindow);
this.addChild(this._slotWindow);
//create item list
this._itemWindow = new Window_PhoneEquipItem(new Rectangle(wx,wy+par.phoneEquipItemY,ww,wh-par.phoneEquipItemY));
this._itemWindow.setStatusWindow(this._statusWindow);
this._itemWindow.setHelpWindow(this._helpWindow);
this._itemWindow.setHandler("ok", this.onEquipOK.bind(this));
this._itemWindow.setHandler("cancel", this.onEquipCancel.bind(this));
this._itemWindow.hide();
this._slotWindow.setItemWindow(this._itemWindow);
this.addChild(this._itemWindow);
this.refreshActor();
//activating
this._phoneCommand.activate();
};
Scene_PhoneAddonEquip.prototype.actor = function() {
return $gameParty.members()[$gameSystem._phoneMenuActor]
};
Scene_PhoneAddonEquip.prototype.commandEquip = function() {
this._slotWindow.activate();
this._slotWindow.select(0);
};
Scene_PhoneAddonEquip.prototype.commandOptimize = function() {
SoundManager.playEquip();
this.actor().optimizeEquipments();
this._statusWindow.refresh();
this._slotWindow.refresh();
this._phoneCommand.activate();
};
Scene_PhoneAddonEquip.prototype.commandClear = function() {
SoundManager.playEquip();
this.actor().clearEquipments();
this._statusWindow.refresh();
this._slotWindow.refresh();
this._phoneCommand.activate();
};
Scene_PhoneAddonEquip.prototype.popScene = function() {
SceneManager.pop();
};
Scene_PhoneAddonEquip.prototype.nextActor = function() {
$gameSystem._phoneMenuActor = Math.min($gameParty.members().length-1 , $gameSystem._phoneMenuActor + 1);
this.updateActor();
this.onActorChange();
this._phoneCommand._phoneNeedRedraw = true;
this._phoneCommand.activate();
};
Scene_PhoneAddonEquip.prototype.previousActor = function() {
$gameSystem._phoneMenuActor = Math.max(0,$gameSystem._phoneMenuActor - 1);
this.updateActor();
this.onActorChange();
this._phoneCommand._phoneNeedRedraw = true;
this._phoneCommand.activate();
};
Scene_PhoneAddonEquip.prototype.redrawPhone = function(){
var actorIndex = this.actor()._actorId;
if (this.Parameters.phoneEquipActorBG) this._phoneBG.bitmap = ImageManager.loadBitmap("img/"+this.Parameters.folderPath,"Actor_"+actorIndex);
this._phoneCommand.refresh();
this._statusWindow.refresh();
this._slotWindow.refresh();
this._itemWindow.refresh();
this._helpWindow.refresh();
this._phoneCommand._phoneNeedRedraw = false;
};
Scene_PhoneAddonEquip.prototype.onPhoneOK = function() {
this._slotWindow.hide();
this._phoneCommand.hide();
this._itemWindow.refresh();
this._itemWindow.show();
this._itemWindow.activate();
this._itemWindow.select(0);
this._helpWindow.refresh();
this._helpWindow.show();
this._statusWindow.refresh();
// this._statusWindow.show();
};
Scene_PhoneAddonEquip.prototype.onPhoneCancel = function() {
this._slotWindow.deselect();
this._phoneCommand.activate();
};
Scene_PhoneAddonEquip.prototype.onEquipOK = function() {
SoundManager.playEquip();
this.executeEquipChange();
this.hideItemWindow();
this._slotWindow.refresh();
this._itemWindow.refresh();
this._statusWindow.refresh();
};
Scene_PhoneAddonEquip.prototype.executeEquipChange = function() {
const actor = this.actor();
const slotId = this._slotWindow.index();
const item = this._itemWindow.item();
actor.changeEquip(slotId, item);
};
Scene_PhoneAddonEquip.prototype.onEquipCancel = function() {
this.hideItemWindow();
};
Scene_PhoneAddonEquip.prototype.refreshActor = function() {
const actor = this.actor();
this._statusWindow.setActor(actor);
this._slotWindow.setActor(actor);
this._itemWindow.setActor(actor);
};
Scene_PhoneAddonEquip.prototype.executeEquipChange = function() {
const actor = this.actor();
const slotId = this._slotWindow.index();
const item = this._itemWindow.item();
actor.changeEquip(slotId, item);
};
Scene_PhoneAddonEquip.prototype.onActorChange = function() {
Scene_PhoneAddonBase.prototype.onActorChange.call(this);
this.refreshActor();
this._itemWindow.hide();
this._itemWindow.deselect();
this._slotWindow.select(0);
this._slotWindow.activate();
this._phoneCommand.activate();
};
Scene_PhoneAddonEquip.prototype.onItemOk = function() {
SoundManager.playEquip();
this.executeEquipChange();
this.hideItemWindow();
this._slotWindow.refresh();
this._itemWindow.refresh();
this._statusWindow.refresh();
};
Scene_PhoneAddonEquip.prototype.executeEquipChange = function() {
const actor = this.actor();
const slotId = this._slotWindow.index();
const item = this._itemWindow.item();
actor.changeEquip(slotId, item);
};
Scene_PhoneAddonEquip.prototype.onItemCancel = function() {
this.hideItemWindow();
};
Scene_PhoneAddonEquip.prototype.onActorChange = function() {
Scene_MenuBase.prototype.onActorChange.call(this);
this.refreshActor();
this.hideItemWindow();
};
Scene_PhoneAddonEquip.prototype.hideItemWindow = function() {
this._slotWindow.show();
this._phoneCommand.show();
this._slotWindow.activate();
this._itemWindow.hide();
this._itemWindow.deselect();
this._helpWindow.hide();
};
Window_PhoneEquipSlot = function() {
this.initialize(...arguments);
};
Window_PhoneEquipSlot.prototype = Object.create(Window_EquipSlot.prototype);
Window_PhoneEquipSlot.prototype.constructor =Window_PhoneEquipSlot;
Window_PhoneEquipSlot.prototype.initialize = function(rect) {
Window_EquipSlot.prototype.initialize.call(this, rect);
this.opacity = 0;
};
Window_PhoneEquipSlot.prototype.drawItem = function(index) {
if (this._actor) {
const slotName = this.actorSlotName(this._actor, index);
const item = this.itemAt(index);
const slotNameWidth = this.slotNameWidth();
const rect = this.itemLineRect(index);
const itemWidth = rect.width;
this.changeTextColor(ColorManager.systemColor());
this.changePaintOpacity(this.isEnabled(index));
this.drawText(slotName, rect.x, rect.y - (rect.height/2), slotNameWidth, rect.height);
this.drawItemName(item, rect.x, rect.y + (rect.height/2), itemWidth);
this.changePaintOpacity(true);
}
};
Window_PhoneEquipSlot.prototype.slotNameWidth = function() {
return 100;
};
Window_PhoneEquipSlot.prototype.itemHeight = function() {
return 80;
};
//patch for scene interpreter
Window_PhoneEquipSlot.prototype.processCursorMove = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_EquipSlot.prototype.processCursorMove.call(this);
};
Window_PhoneEquipSlot.prototype.processHandling = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_EquipSlot.prototype.processHandling.call(this);
};
Window_PhoneEquipSlot.prototype.processTouch = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_EquipSlot.prototype.processTouch.call(this);
};
Window_PhoneEquipItem = function() {
this.initialize(...arguments);
}
Window_PhoneEquipItem.prototype = Object.create(Window_EquipItem.prototype);
Window_PhoneEquipItem.prototype.constructor = Window_PhoneEquipItem;
Window_PhoneEquipItem.prototype.initialize = function(rect) {
Window_EquipItem.prototype.initialize.call(this, rect);
this.contents.fontSize = 18;
this.opacity = 0;
};
//patch for scene interpreter
Window_PhoneEquipItem.prototype.processCursorMove = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_EquipItem.prototype.processCursorMove.call(this);
};
Window_PhoneEquipItem.prototype.processHandling = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_EquipItem.prototype.processHandling.call(this);
};
Window_PhoneEquipItem.prototype.processTouch = function(){
if ($gameMap._interpreter.isRunning()) return this.activate();
Window_EquipItem.prototype.processTouch.call(this);
};
Window_PhoneEquipStatus = function() {
this.initialize(...arguments);
}
Window_PhoneEquipStatus.prototype = Object.create(Window_EquipStatus.prototype);
Window_PhoneEquipStatus.prototype.constructor = Window_PhoneEquipStatus;
Window_PhoneEquipStatus.prototype.initialize = function(rect) {
Window_EquipStatus.prototype.initialize.call(this, rect);
this.opacity = 0;
};
Window_PhoneEquipStatus.prototype.refresh = function() {
this.contents.clear();
for(ic of this._innerChildren){ic.hide()};
if (this._actor) {
const nameRect = this.itemLineRect(0);
this.contents.fontSize = 18;
this.drawActorSimpleStatus(this._actor, this.itemPadding(), 0, EST.PhoneMenu.phoneBGWidth - this.itemPadding()*2);
if(SceneManager._scene._phoneCommand.visible) return;
this.drawAllParams();
this.drawHPMPdiff();
}
};
Window_PhoneEquipStatus.prototype.drawAllParams = function() {
for (let i = 0; i < 6; i++) {
const x = this.itemPadding();
const y = this.paramY(i) + 3 * this.lineHeight();
this.drawItem(x, y, 2 + i);
}
};
Window_PhoneEquipStatus.prototype.drawHPMPdiff = function() {
if (!this._actor) return;
if (!this._tempActor) return;
const x = this.itemPadding();
const y = 0 + this.lineHeight() * 1;
var hpdiff = this._tempActor.mhp - this._actor.mhp;
var mpdiff = this._tempActor.mmp - this._actor.mmp;
this.changeTextColor(ColorManager.systemColor());
this.drawText("\u2192", this.paramX() + this.paramWidth(), y , this.rightArrowWidth(), "center");
this.drawText("\u2192", this.paramX() + this.paramWidth(), y + this.lineHeight() , this.rightArrowWidth(), "center");
this.changeTextColor(ColorManager.paramchangeTextColor(hpdiff));
this.drawText(this._tempActor.mhp, x , y , EST.PhoneMenu.Parameters.phoneBGWidth - 36, "right");
this.changeTextColor(ColorManager.paramchangeTextColor(mpdiff));
this.drawText(this._tempActor.mmp, x , y + this.lineHeight() , EST.PhoneMenu.Parameters.phoneBGWidth - 36, "right");
};
Window_PhoneEquipStatus.prototype.lineHeight = function() {
return 24;
};
Window_PhoneEquipStatus.prototype.drawActorSimpleStatus = function(actor, x, y) {
const lineHeight = this.lineHeight();
const x2 = x + 140;
this.drawActorName(actor, x, y);
if(SceneManager._scene._phoneCommand.visible) return;
this.placeBasicGauges(actor, x, y + lineHeight);
};
Window_PhoneEquipStatus.prototype.placeGauge = function(actor, type, x, y) {
const key = "actor%1-gauge-%2".format(actor.actorId(), type);
const sprite = this.createInnerSprite(key, Sprite_GaugePhoneEquip);
sprite.setup(actor, type);
sprite.move(x, y);
sprite.show();
};
// gauge width modification for equip scene
Sprite_GaugePhoneEquip = function() {
this.initialize(...arguments);
}
Sprite_GaugePhoneEquip.prototype = Object.create(Sprite_Gauge.prototype);
Sprite_GaugePhoneEquip.prototype.constructor = Sprite_GaugePhoneEquip;
Sprite_GaugePhoneEquip.prototype.drawValue = function() {
const currentValue = this.currentValue();
const maxValue = this.currentMaxValue();
const width = this.bitmapWidth();
const height = this.bitmapHeight();
this.setupValueFont();
this.bitmap.fontSize = 14;
this.bitmap.drawText(currentValue +"/"+ maxValue, 0, 0, width, height, "right");
};
Sprite_GaugePhoneEquip.prototype.bitmapWidth = function() {
return EST.PhoneMenu.Parameters.phoneEquipGaugeWidth;
};
Window_PhoneEquipStatus.prototype.paramY = function(index) {
return Math.floor(this.lineHeight() * (index + 1.5));
};
Window_PhoneEquipStatus.prototype.paramX = function() {
const itemPadding = this.itemPadding();
const rightArrowWidth = this.rightArrowWidth();
const paramWidth = this.paramWidth();
return this.innerWidth - itemPadding - paramWidth * 2 - rightArrowWidth;
};
Window_PhoneHelp = function() {
this.initialize(...arguments);
}
Window_PhoneHelp.prototype = Object.create(Window_Help.prototype);
Window_PhoneHelp.prototype.constructor = Window_PhoneHelp;
Window_PhoneHelp.prototype.initialize = function(rect) {
Window_Help.prototype.initialize.call(this, rect);
this.opacity = 0;
this.contents.fontSize = 16;
this.contents.fontBold = true;
};
Window_PhoneHelp.prototype.refresh = function() {
const rect = this.baseTextRect();
this.contents.clear();
this.drawBackgroundRect(rect);
const align = "left";
var line = 0;
txts = this.convertEscapeCharacters(this._text);
txts = txts.split(/\n|\\n/);
for(txt of txts){
if (!txt) continue;
this.drawText(txt, rect.x, 0 + this.lineHeight() * line, rect.width, align);
line++;
};
};
Window_PhoneHelp.prototype.lineHeight = function() {
return 20;
};
Window_PhoneHelp.prototype.drawBackgroundRect = function(rect) {
const c1 = ColorManager.itemBackColor1();
const c2 = ColorManager.itemBackColor2();
const x = rect.x;
const y = rect.y;
const w = rect.width;
const h = rect.height - 24;
this.contentsBack.gradientFillRect(x, y, w, h, c1, c2, true);
this.contentsBack.strokeRect(x, y, w, h, c1);
this.contentsBack.paintOpacity = 0;
};
Window_PhoneEquipCommand = function() {
this.initialize(...arguments);
}
Window_PhoneEquipCommand.prototype = Object.create(Window_EquipCommand.prototype);
Window_PhoneEquipCommand.prototype.constructor = Window_PhoneEquipCommand;
Window_PhoneEquipCommand.prototype.initialize = function(rect) {
Window_EquipCommand.prototype.initialize.call(this, rect);
this.opacity = 0;
};
Window_PhoneEquipCommand.prototype.processWheelScroll = function() {
if (this.isWheelScrollEnabled() && this.isTouchedInsideFrame()) {
const threshold = 20;
if (TouchInput.wheelY >= threshold) {
SceneManager._scene.nextActor();
}
if (TouchInput.wheelY <= -threshold) {
SceneManager._scene.previousActor();
}
}
};
//end equip
//start status
Scene_PhoneAddonStatus = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonStatus.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonStatus.prototype.constructor = Scene_PhoneAddonStatus;
Scene_PhoneAddonStatus.prototype.createPhoneBackground = function() {
var actorIndex = this.actor()._actorId;
this._phone = new Sprite(ImageManager.loadBitmap("img/"+this.Parameters.folderPath,$gameSystem.phoneIMG));
$gameTemp._storingPhoneWindow = this;
var filename = this.Parameters.phoneStatusActorBG ? "Actor_"+actorIndex : $gameSystem.phoneBG;
var bitmap = ImageManager.loadBitmap("img/"+this.Parameters.folderPath,filename);
bitmap.addLoadListener(function(){
if ($gameTemp._storingPhoneWindow) $gameTemp._storingPhoneWindow._phoneNeedRedraw = true;
});
this._phoneBG = new Sprite(bitmap);
this._phone.x = this.Parameters.phoneXpos;
this._phone.y = this.Parameters.phoneYpos;
this._phoneBG.x = this._phone.x + this.Parameters.phoneBGXoffset;
this._phoneBG.y = this._phone.y + this.Parameters.phoneBGYoffset;
this.addChild(this._phoneBG);
};
Scene_PhoneAddonStatus.prototype.actor = function() {
return $gameParty.members()[$gameSystem._phoneMenuActor];
}
Scene_PhoneAddonStatus.prototype.createContents = function(){
var wx = this.Parameters.phoneXpos + this.Parameters.phoneBGXoffset;
var wy = this.Parameters.phoneYpos + this.Parameters.phoneBGYoffset + 15;
var ww = this.Parameters.phoneBGWidth;
var wh = this.Parameters.phoneBGHeight -15;
this._phoneCommand = new Window_PhoneAddonStatus(new Rectangle(wx,wy,ww,wh),this._page);
this._phoneCommand.setHandler("ok", this.onPhoneOK.bind(this));
this._phoneCommand.setHandler("cancel", this.onPhoneCancel.bind(this));
this._phoneCommand.refresh();
this.addChild(this._phoneCommand);
};
Scene_PhoneAddonStatus.prototype.onPhoneOK = function() {
this._phoneCommand.activate();
if ($gameMap._interpreter.isRunning()) return;
var actor = $dataActors[this.actor()._actorId];
if (!actor) return;
if (!actor.note.match(/<phoneStatusCE:(.*)>/im)) return;
var ce = Number(actor.note.match(/<phoneStatusCE:(.*)>/im)[1]);
$gameTemp.reserveCommonEvent(ce);
};
Scene_PhoneAddonStatus.prototype.onPhoneCancel = function() {
if ($gameMap._interpreter.isRunning()) return this._phoneCommand.activate();
SoundManager.playCancel();
$gameTemp._phoneLastIcon = null;
$gameTemp._phoneLastPage = null;
SceneManager.pop();
};
Scene_PhoneAddonStatus.prototype.redrawPhone = function(){
var actorIndex = this.actor()._actorId;
if (this.Parameters.phoneStatusActorBG) this._phoneBG.bitmap = ImageManager.loadBitmap("img/"+this.Parameters.folderPath,"Actor_"+actorIndex);
this._phoneCommand.refresh();
this._phoneCommand._phoneNeedRedraw = false;
};
Window_PhoneAddonStatus = function() {
this.initialize(...arguments);
};
Window_PhoneAddonStatus.prototype = Object.create(Window_PhoneAddonBase.prototype);
Window_PhoneAddonStatus.prototype.constructor = Window_PhoneAddonStatus;
Window_PhoneAddonStatus.prototype.makeCommandList = function(){
var actor = this.actor();
this.addCommand(actor, actor.name());
};
Window_PhoneAddonStatus.prototype.actor = function(){
return $gameParty.members()[$gameSystem._phoneMenuActor]
};
Window_PhoneAddonStatus.prototype._updateCursor = function() {
Window_PhoneAddonBase.prototype._updateCursor.call(this);
this._cursorSprite.visible = false;
};
Window_PhoneAddonStatus.prototype.drawItem = function(index){
const rect = this.itemRect(index);
const align = "left";
var actor = this._list[index].name;
var par = this.Parameters;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
//name of the actor
this.contents.fontSize = 18;
this.drawText(actor.name(), rect.x, + this.lineHeight() * par.statusActorNameLine, rect.width, align);
//Lv text with system color
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.levelA, rect.x, rect.y + this.lineHeight()*par.statusActorLvLine, rect.width, align);
this.resetTextColor();
//lv value of the actor
this.drawText(actor.level, rect.x+40, rect.y+this.lineHeight()*par.statusActorLvLine, rect.width, align);
//actor current class
this.drawText(actor.currentClass().name, rect.x, rect.y+this.lineHeight()*par.statusActorClassLine, rect.width, align);
//draw actor states
this.drawActorIcons(actor, rect.x, rect.y + this.lineHeight()*par.statusActorStatesLine, rect.width);
//draw hp mp tp
this.placeBasicGauges(actor, rect.x, rect.y + 10 + this.lineHeight()*par.statusActorGaugeLine, rect.width);
//draw exp gauge
this.drawExpGauge(actor, rect.x, rect.y + this.lineHeight()*par.statusActorExpLine, rect.width);
//draw parameter
this.drawActorParam(actor, rect.x, rect.y+ this.lineHeight()*par.statusActorAtkLine, rect.width, 2);
this.drawActorParam(actor, rect.x, rect.y+ this.lineHeight()*par.statusActorDefLine, rect.width, 3);
this.drawActorParam(actor, rect.x, rect.y+ this.lineHeight()*par.statusActorMatkLine, rect.width, 4);
this.drawActorParam(actor, rect.x, rect.y+ this.lineHeight()*par.statusActorMdefLine, rect.width, 5);
this.drawActorParam(actor, rect.x, rect.y+ this.lineHeight()*par.statusActorAgiLine, rect.width, 6);
this.drawActorParam(actor, rect.x, rect.y+ this.lineHeight()*par.statusActorLukLine, rect.width, 7);
//draw actor profile
this.drawActorProfile(actor, rect.x, rect.y + this.lineHeight()*par.statusActorProfLine, rect.width, "center");
this.resetFontSettings();
};
Window_PhoneAddonStatus.prototype.drawActorProfile = function(actor, x, y, width, align) {
this.contents.fontSize = 12;
this.contents.fontBold = true;
var line = 0;
var txts = actor.profile()
txts = this.convertEscapeCharacters(txts);
txts = txts.split(/\n|\\n/);
for(txt of txts){
if (!txt) continue;
this.drawText(txt, x, y + this.lineHeight() * line, width, align);
line++;
}
this.resetFontSettings();
this.contents.fontBold = false;
};
Window_PhoneAddonStatus.prototype.drawActorParam = function(actor, x, y, width, paramId){
///disini
this.contents.fontSize = 18;
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.param(paramId), x, y, width, "left");
this.resetTextColor();
this.drawText(actor.param(paramId), x + 144, y, 60, "right");
};
Window_PhoneAddonStatus.prototype.drawExpGauge = function(actor, x, y, width){
var maxExp= (actor.expForLevel(actor._level+1) - actor.expForLevel(actor._level));
var levelExp= maxExp - actor.nextRequiredExp();
var rate = actor.maxLevel() == actor._level ? 1 : levelExp / maxExp;
var fillW = Math.floor(width * rate);
var gaugeY = y + this.lineHeight() - 8;
var color1 = ColorManager.textColor(this.Parameters.expGaugeColor1);
var color2 = ColorManager.textColor(this.Parameters.expGaugeColor2);
this.contents.fillRect(x, gaugeY, width, this.lineHeight(), ColorManager.gaugeBackColor());
this.contents.gradientFillRect(x, gaugeY, fillW, this.lineHeight(), color1, color2);
this.contents.fontSize = 18;
if(actor.maxLevel() == actor._level) return this.drawText(this.Parameters.phoneStatusMaxLevelText,x,gaugeY,width,"center");
this.drawText(TextManager.expA+ " " + levelExp + " / " + maxExp, x, gaugeY, width, "center");
this.resetFontSettings();
};
Window_PhoneAddonStatus.prototype.lineHeight = function(){
return 24;
};
Window_PhoneAddonStatus.prototype.drawActorIcons = function(actor, x, y, width) {
width = width || 144;
const iconWidth = ImageManager.iconWidth;
const icons = actor.allIcons().slice(0, Math.floor(width / iconWidth));
let iconX = x;
for (const icon of icons) {
this.drawIcon(icon, iconX, y + 2);
iconX += iconWidth;
}
};
Window_PhoneAddonStatus.prototype.commandName = function(index){
return this._list[index].name.name();
};
Window_PhoneAddonStatus.prototype.itemHeight = function() {
return this.Parameters.phoneStatusItemHeight
//bisa jadi plugin parameter juga ini
return 480;
};
Window_PhoneAddonStatus.prototype.refresh = function() {
for(ic of this._innerChildren){ic.hide()};
Window_PhoneAddonBase.prototype.refresh.call(this);
};
Window_PhoneAddonStatus.prototype.placeBasicGauges = function(actor, x, y) {
this.placeGauge(actor, "hp", x, y);
this.placeGauge(actor, "mp", x, y + this.gaugeLineHeight());
if ($dataSystem.optDisplayTp) {
this.placeGauge(actor, "tp", x, y + this.gaugeLineHeight() * 2);
}
};
Window_PhoneAddonStatus.prototype.placeGauge = function(actor, type, x, y) {
const key = "actor%1-gauge-%2".format(actor.actorId(), type);
const sprite = this.createInnerSprite(key, Sprite_GaugePhoneStatus);
sprite.setup(actor, type);
sprite.move(x, y);
sprite.show();
};
Window_PhoneAddonStatus.prototype.createInnerSprite = function(key, spriteClass) {
const dict = this._additionalSprites || {};
if (dict[key]) {
return dict[key];
} else {
const sprite = new spriteClass();
dict[key] = sprite;
this.addInnerChild(sprite);
return sprite;
}
};
Window_PhoneAddonStatus.prototype.cursorPagedown = function() {
$gameSystem._phoneMenuActor = Math.min($gameParty.members().length-1 , $gameSystem._phoneMenuActor + 1);
this._phoneNeedRedraw = true;
this.refresh();
};
Window_PhoneAddonStatus.prototype.cursorPageup = function() {
$gameSystem._phoneMenuActor = Math.max(0,$gameSystem._phoneMenuActor - 1);
this._phoneNeedRedraw = true;
this.refresh();
};
Window_PhoneAddonStatus.prototype.cursorLeft = function() {
this.cursorPageup()
Window_PhoneAddonBase.prototype.cursorLeft.call(this);
};
Window_PhoneAddonStatus.prototype.cursorRight = function() {
this.cursorPagedown()
Window_PhoneAddonBase.prototype.cursorRight.call(this);
};
Window_PhoneAddonStatus.prototype.cursorUp = function() {
this.cursorPageup()
Window_PhoneAddonBase.prototype.cursorUp.call(this);
};
Window_PhoneAddonStatus.prototype.cursorDown = function() {
this.cursorPagedown()
Window_PhoneAddonBase.prototype.cursorDown.call(this);
};
Window_PhoneAddonStatus.prototype.gaugeLineHeight = function() {
return 24;
};
// gauge width modification for phone scene
Sprite_GaugePhoneStatus = function() {
this.initialize(...arguments);
}
Sprite_GaugePhoneStatus.prototype = Object.create(Sprite_Gauge.prototype);
Sprite_GaugePhoneStatus.prototype.constructor = Sprite_GaugePhoneStatus;
Sprite_GaugePhoneStatus.prototype.bitmapWidth = function() {
return EST.PhoneMenu.Parameters.phoneStatusGaugeWidth;
};
Sprite_GaugePhoneStatus.prototype.drawValue = function() {
const currentValue = this.currentValue();
const maxValue = this.currentMaxValue();
const width = this.bitmapWidth();
const height = this.bitmapHeight();
this.setupValueFont();
this.bitmap.fontSize = 16;
this.bitmap.drawText(currentValue +"/"+ maxValue, 0, 0, width, height, "right");
};
//end status
//start formation
Scene_PhoneAddonFormation = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonFormation.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonFormation.prototype.constructor = Scene_PhoneAddonFormation;
Scene_PhoneAddonFormation.prototype.createContents = function(){
var par = this.Parameters;
var wx = par.phoneXpos + par.phoneBGXoffset;
var wy = par.phoneYpos + par.phoneBGYoffset + 15;
var ww = par.phoneBGWidth;
var wh = par.phoneBGHeight -15;
this._phoneCommand = new Window_PhoneAddonFormation(new Rectangle(wx,wy,ww,wh));
this._phoneCommand.setHandler("ok", this.onFormationOk.bind(this));
this._phoneCommand.setHandler("cancel", this.onFormationCancel.bind(this));
this._phoneCommand.activate();
this.addChild(this._phoneCommand);
};
Scene_PhoneAddonFormation.prototype.onFormationOk = function(){
const index = this._phoneCommand.index();
const pendingIndex = this._phoneCommand.pendingIndex();
if (pendingIndex >= 0) {
$gameParty.swapOrder(index, pendingIndex);
this._phoneCommand.setPendingIndex(-1);
this._phoneCommand.redrawItem(index);
this.estActorEventPatch();
} else {
this._phoneCommand.setPendingIndex(index);
}
this._phoneCommand.activate();
};
Scene_PhoneAddonFormation.prototype.estActorEventPatch = function(){
if(!EST || !EST.ActorEvent) return;
$gameMap.events().forEach(function(ev){
if(ev && ev.page()) {
if(ev) ev.setupEventActorGraphic();
}
});
};
Scene_PhoneAddonFormation.prototype.onFormationCancel = function(){
if (this._phoneCommand.pendingIndex() >= 0) {
this._phoneCommand.setPendingIndex(-1);
this._phoneCommand.activate();
} else {
SceneManager.pop();
}};
Window_PhoneAddonFormation = function() {
this.initialize(...arguments);
};
Window_PhoneAddonFormation.prototype = Object.create(Window_MenuStatus.prototype);
Window_PhoneAddonFormation.prototype.constructor = Window_PhoneAddonFormation;
Window_PhoneAddonFormation.prototype.initialize = function(rect) {
Window_MenuStatus.prototype.initialize.call(this, rect);
this.opacity = 0;
this._formationMode = true;
};
Window_PhoneAddonFormation.prototype.drawItem = function(index) {
this.drawPendingItemBackground(index);
this.drawItemImage(index);
this.drawItemStatus(index);
};
Window_PhoneAddonFormation.prototype.drawPendingItemBackground = function(index) {
if (index === this._pendingIndex) {
const rect = this.itemRect(index);
const color = ColorManager.pendingColor();
this.changePaintOpacity(false);
this.contents.fillRect(rect.x, rect.y, rect.width, rect.height, color);
this.changePaintOpacity(true);
}
};
Window_PhoneAddonFormation.prototype.drawFace = function(
faceName, faceIndex, x, y, width, height
) {
width = width || ImageManager.faceWidth;
height = height || ImageManager.faceHeight;
const bitmap = ImageManager.loadFace(faceName);
const pw = ImageManager.faceWidth;
const ph = ImageManager.faceHeight;
const sw = Math.min(width, pw);
const sh = Math.min(height, ph);
const dx = Math.floor(x + Math.max(width - pw, 0) / 2);
const dy = Math.floor(y + Math.max(height - ph, 0) / 2);
const sx = (faceIndex % 4) * pw + (pw - sw) / 2;
const sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy, sw/2, sh/2);
};
Window_PhoneAddonFormation.prototype.drawItemStatus = function(index) {
const actor = this.actor(index);
const rect = this.itemRect(index);
const x = rect.x;
const y = rect.y + rect.height / 2 - this.lineHeight() * 1.5;
this.drawActorSimpleStatus(actor, x, y);
};
Window_PhoneAddonFormation.prototype.drawActorSimpleStatus = function(actor, x, y) {
const lineHeight = this.lineHeight();
const x2 = x + 144/2 + 4;
this.contents.fontSize = 14;
this.drawActorName(actor, x, y + lineHeight * 1.5);
this.drawActorLevel(actor, x, y + lineHeight * 2.25);
this.drawActorIcons(actor, x, y + lineHeight * 3, this.itemRect(this._index).width);
this.drawActorClass(actor, x2, y - lineHeight * 1);
this.placeBasicGauges(actor, x2, y);
};
Window_PhoneAddonFormation.prototype.drawActorLevel = function(actor, x, y) {
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.levelA, x, y, 48);
this.resetTextColor();
this.drawText(actor.level, x, y, 36, "right");
};
Window_PhoneAddonFormation.prototype.drawActorIcons = function(actor, x, y, width) {
width = width || 144;
const iconWidth = ImageManager.iconWidth/2;
const icons = actor.allIcons().slice(0, Math.floor(width / iconWidth));
let iconX = x;
for (const icon of icons) {
this.drawIcon(icon, iconX, y + 2);
iconX += iconWidth;
}
};
Window_PhoneAddonFormation.prototype.drawIcon = function(iconIndex, x, y) {
const bitmap = ImageManager.loadSystem("IconSet");
const pw = ImageManager.iconWidth;
const ph = ImageManager.iconHeight;
const sx = (iconIndex % 16) * pw;
const sy = Math.floor(iconIndex / 16) * ph;
this.contents.blt(bitmap, sx, sy, pw, ph, x, y, pw/2, ph/2);
};
Window_PhoneAddonFormation.prototype.lineHeight = function() {
return 24;
};
//end formation
//start options
Scene_PhoneAddonOptions = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonOptions.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonOptions.prototype.constructor = Scene_PhoneAddonOptions;
Scene_PhoneAddonOptions.prototype.createContents = function(){
var par = this.Parameters;
var wx = par.phoneXpos + par.phoneBGXoffset;
var wy = par.phoneYpos + par.phoneBGYoffset + 15;
var ww = par.phoneBGWidth;
var wh = par.phoneBGHeight -15;
this._phoneCommand = new Window_PhoneAddonOptions(new Rectangle(wx,wy+par.phoneOptionY,ww,wh));
this._phoneCommand.setHandler("cancel", this.popScene.bind(this));
this.addChild(this._phoneCommand);
};
Window_PhoneAddonOptions = function() {
this.initialize(...arguments);
};
Window_PhoneAddonOptions.prototype = Object.create(Window_Options.prototype);
Window_PhoneAddonOptions.prototype.constructor = Window_PhoneAddonOptions;
Window_PhoneAddonOptions.prototype.initialize = function(rect) {
Window_Options.prototype.initialize.call(this, rect);
this.opacity = 0;
};
// end options
//start save
Scene_PhoneAddonSave = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonSave.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonSave.prototype.constructor = Scene_PhoneAddonSave;
Scene_PhoneAddonSave.prototype.createContents = function(){
DataManager.loadAllSavefileImages();
var par = this.Parameters;
var wx = par.phoneXpos + par.phoneBGXoffset;
var wy = par.phoneYpos + par.phoneBGYoffset + 15;
var ww = par.phoneBGWidth;
var wh = par.phoneBGHeight -15;
const rect = this.helpWindowRect();
this._helpWindow = new Window_PhoneHelp(new Rectangle(wx, wy+8, ww, 96));
this.addChild(this._helpWindow);
this._phoneCommand = new Window_PhoneAddonSave(new Rectangle(wx,wy + 96,ww,wh-96));
this._phoneCommand.setHandler("ok", this.onSavefileOk.bind(this));
this._phoneCommand.setHandler("cancel", this.popScene.bind(this));
this._phoneCommand.setMode(this.mode(), this.needsAutosave());
this._phoneCommand.selectSavefile(this.firstSavefileId());
this._phoneCommand.refresh();
this.addChild(this._phoneCommand);
this._helpWindow.setText(this.helpWindowText());
};
Scene_PhoneAddonSave.prototype.savefileId = function() {
return this._phoneCommand.savefileId();
};
Scene_PhoneAddonSave.prototype.isSavefileEnabled = function(savefileId) {
return this._phoneCommand.isEnabled(savefileId);
};
Scene_PhoneAddonSave.prototype.mode = function() {
return "save";
};
Scene_PhoneAddonSave.prototype.needsAutosave = function() {
return $gameSystem.isAutosaveEnabled();
};
Scene_PhoneAddonSave.prototype.activateListWindow = function() {
this._phoneCommand.activate();
};
Scene_PhoneAddonSave.prototype.helpWindowText = function() {
return TextManager.saveMessage;
};
Scene_PhoneAddonSave.prototype.firstSavefileId = function() {
return $gameSystem.savefileId();
};
Scene_PhoneAddonSave.prototype.onSavefileOk = function() {
const savefileId = this.savefileId();
if (this.isSavefileEnabled(savefileId)) {
this.executeSave(savefileId);
} else {
this.onSaveFailure();
}
};
Scene_PhoneAddonSave.prototype.executeSave = function(savefileId) {
$gameSystem.setSavefileId(savefileId);
$gameSystem.onBeforeSave();
DataManager.saveGame(savefileId)
.then(() => this.onSaveSuccess())
.catch(() => this.onSaveFailure());
};
Scene_PhoneAddonSave.prototype.onSaveSuccess = function() {
SoundManager.playSave();
this.popScene();
};
Scene_PhoneAddonSave.prototype.onSaveFailure = function() {
SoundManager.playBuzzer();
this.activateListWindow();
};
Window_PhoneAddonSave = function() {
this.initialize(...arguments);
};
Window_PhoneAddonSave.prototype = Object.create(Window_SavefileList.prototype);
Window_PhoneAddonSave.prototype.constructor = Window_PhoneAddonSave;
Window_PhoneAddonSave.prototype.initialize = function(rect) {
Window_SavefileList.prototype.initialize.call(this, rect);
this.contents.fontSize = 18;
this.opacity = 0;
};
Window_PhoneAddonSave.prototype.drawContents = function(info, rect) {
const bottom = rect.y;
const lineHeight = this.lineHeight();
this.drawPartyCharacters(info, rect.x + 16, bottom + 8 + lineHeight);
this.drawPlaytime(info, rect.x, rect.y, rect.width);
};
Window_PhoneAddonSave.prototype.drawPartyCharacters = function(info, x, y) {
if (info.characters) {
let characterX = x;
for (const data of info.characters) {
this.drawCharacter(data[0], data[1], characterX, y);
characterX += 24;
}
}
};
Window_PhoneAddonSave.prototype.drawCharacter = function(
characterName, characterIndex, x, y
) {
const bitmap = ImageManager.loadCharacter(characterName);
const big = ImageManager.isBigCharacter(characterName);
const pw = bitmap.width / (big ? 3 : 12);
const ph = bitmap.height / (big ? 4 : 8);
const n = big ? 0: characterIndex;
const sx = ((n % 4) * 3 + 1) * pw;
const sy = Math.floor(n / 4) * 4 * ph;
this.contents.blt(bitmap, sx, sy, pw, ph, x, y, pw/2, ph/2);
};
//end save
//start game end
Scene_PhoneAddonGameEnd = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonGameEnd.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonGameEnd.prototype.constructor = Scene_PhoneAddonGameEnd;
Scene_PhoneAddonGameEnd.prototype.createContents = function(){
var wx = this.Parameters.phoneXpos + this.Parameters.phoneBGXoffset;
var wy = this.Parameters.phoneYpos + this.Parameters.phoneBGYoffset + 15;
var ww = this.Parameters.phoneBGWidth;
var wh = this.Parameters.phoneBGHeight -15;
this._phoneCommand = new Window_PhoneAddonGameEnd(new Rectangle(wx,wy,ww,wh));
this._phoneCommand.setHandler("toTitle", this.commandToTitle.bind(this));
this._phoneCommand.setHandler("shutDown", this.commandShutDown.bind(this));
this._phoneCommand.setHandler("cancel", this.popScene.bind(this));
this._phoneCommand.refresh();
this.addChild(this._phoneCommand);
};
Scene_PhoneAddonGameEnd.prototype.commandToTitle = function() {
this.fadeOutAll();
SceneManager.goto(Scene_Title);
Window_TitleCommand.initCommandPosition();
};
Scene_PhoneAddonGameEnd.prototype.commandShutDown = function() {
this.fadeOutAll();
SceneManager.exit();
};
Window_PhoneAddonGameEnd = function() {
this.initialize(...arguments);
};
Window_PhoneAddonGameEnd.prototype = Object.create(Window_PhoneAddonBase.prototype);
Window_PhoneAddonGameEnd.prototype.constructor = Window_PhoneAddonGameEnd;
Window_PhoneAddonGameEnd.prototype.makeCommandList = function(){
this.addCommand(TextManager.toTitle, "toTitle");
this.addCommand("退出游戏", "shutDown");
this.addCommand(TextManager.cancel, "cancel");
};
Window_PhoneAddonGameEnd.prototype.drawItem = function(index){
Window_Command.prototype.drawItem.call(this, index);
};
Window_PhoneAddonGameEnd.prototype.commandName = function(index){
return this._list[index].name;
};
//end game end
//start load
Scene_PhoneAddonLoad = function() {
this.initialize(...arguments);
};
Scene_PhoneAddonLoad.prototype = Object.create(Scene_PhoneAddonBase.prototype);
Scene_PhoneAddonLoad.prototype.constructor = Scene_PhoneAddonLoad;
Scene_PhoneAddonLoad.prototype.initialize = function() {
Scene_PhoneAddonBase.prototype.initialize.call(this);
this._loadSuccess = false;
};
Scene_PhoneAddonLoad.prototype.terminate = function() {
Scene_PhoneAddonBase.prototype.terminate.call(this);
if (this._loadSuccess) {
$gameSystem.onAfterLoad();
}
};
Scene_PhoneAddonLoad.prototype.createContents = function(){
DataManager.loadAllSavefileImages();
var par = this.Parameters;
var wx = par.phoneXpos + par.phoneBGXoffset;
var wy = par.phoneYpos + par.phoneBGYoffset + 15;
var ww = par.phoneBGWidth;
var wh = par.phoneBGHeight -15;
const rect = this.helpWindowRect();
this._helpWindow = new Window_PhoneHelp(new Rectangle(wx, wy+8, ww, 96));
this.addChild(this._helpWindow);
this._phoneCommand = new Window_PhoneAddonSave(new Rectangle(wx,wy + 96,ww,wh-96));
this._phoneCommand.setHandler("ok", this.onSavefileOk.bind(this));
this._phoneCommand.setHandler("cancel", this.popScene.bind(this));
this._phoneCommand.setMode(this.mode(), this.needsAutosave());
this._phoneCommand.selectSavefile(this.firstSavefileId());
this._phoneCommand.refresh();
this.addChild(this._phoneCommand);
this._helpWindow.setText(this.helpWindowText());
};
Scene_PhoneAddonLoad.prototype.savefileId = function() {
return this._phoneCommand.savefileId();
};
Scene_PhoneAddonLoad.prototype.isSavefileEnabled = function(savefileId) {
return this._phoneCommand.isEnabled(savefileId);
};
Scene_PhoneAddonLoad.prototype.mode = function() {
return "load";
};
Scene_PhoneAddonLoad.prototype.needsAutosave = function() {
return $gameSystem.isAutosaveEnabled();
};
Scene_PhoneAddonLoad.prototype.activateListWindow = function() {
this._phoneCommand.activate();
};
Scene_PhoneAddonLoad.prototype.helpWindowText = function() {
return TextManager.loadMessage;
};
Scene_PhoneAddonLoad.prototype.firstSavefileId = function() {
return DataManager.latestSavefileId();
};
Scene_PhoneAddonLoad.prototype.onSavefileOk = function() {
const savefileId = this.savefileId();
if (this.isSavefileEnabled(savefileId)) {
this.executeLoad(savefileId);
} else {
this.onLoadFailure();
}
};
Scene_PhoneAddonLoad.prototype.executeLoad = function(savefileId) {
DataManager.loadGame(savefileId)
.then(() => this.onLoadSuccess())
.catch(() => this.onLoadFailure());
};
Scene_PhoneAddonLoad.prototype.onLoadSuccess = function() {
SoundManager.playLoad();
this.fadeOutAll();
this.reloadMapIfUpdated();
SceneManager.goto(Scene_Map);
this._loadSuccess = true;
};
Scene_PhoneAddonLoad.prototype.onLoadFailure = function() {
SoundManager.playBuzzer();
this.activateListWindow();
};
Scene_PhoneAddonLoad.prototype.reloadMapIfUpdated = function() {
if ($gameSystem.versionId() !== $dataSystem.versionId) {
const mapId = $gameMap.mapId();
const x = $gamePlayer.x;
const y = $gamePlayer.y;
$gamePlayer.reserveTransfer(mapId, x, y);
$gamePlayer.requestMapReload();
}
};
// Window_PhoneAddonLoad = function() {
// this.initialize(...arguments);
// };
// Window_PhoneAddonLoad.prototype = Object.create(Window_SavefileList.prototype);
// Window_PhoneAddonLoad.prototype.constructor = Window_PhoneAddonLoad;
// Window_PhoneAddonLoad.prototype.initialize = function(rect) {
// Window_SavefileList.prototype.initialize.call(this, rect);
// this.contents.fontSize = 18;
// this.opacity = 0;
// };
// Window_PhoneAddonLoad.prototype.drawContents = function(info, rect) {
// const bottom = rect.y;
// const lineHeight = this.lineHeight();
// this.drawPartyCharacters(info, rect.x + 16, bottom + 8 + lineHeight);
// this.drawPlaytime(info, rect.x, rect.y, rect.width);
// };
// Window_PhoneAddonLoad.prototype.drawPartyCharacters = function(info, x, y) {
// if (info.characters) {
// let characterX = x;
// for (const data of info.characters) {
// this.drawCharacter(data[0], data[1], characterX, y);
// characterX += 24;
// }
// }
// };
// Window_PhoneAddonLoad.prototype.drawCharacter = function(
// characterName, characterIndex, x, y
// ) {
// const bitmap = ImageManager.loadCharacter(characterName);
// const big = ImageManager.isBigCharacter(characterName);
// const pw = bitmap.width / (big ? 3 : 12);
// const ph = bitmap.height / (big ? 4 : 8);
// const n = big ? 0: characterIndex;
// const sx = ((n % 4) * 3 + 1) * pw;
// const sy = Math.floor(n / 4) * 4 * ph;
// this.contents.blt(bitmap, sx, sy, pw, ph, x, y, pw/2, ph/2);
// };
//hijack load
$.SceneManager_push_hijackLoad = SceneManager.push;
SceneManager.push = function(sceneClass) {
if (EST.PhoneMenu.Parameters.phoneReplaceLoad && sceneClass == Scene_Load) sceneClass = Scene_PhoneAddonLoad;
$.SceneManager_push_hijackLoad.call(this,sceneClass);
};
//onload common event
$.Game_System_onAfterLoad_onloadCE = Game_System.prototype.onAfterLoad;
Game_System.prototype.onAfterLoad = function() {
$.Game_System_onAfterLoad_onloadCE.call(this);
var ce = EST.PhoneMenu.Parameters.phoneLoadCommonEvent
if (ce > 0) $gameTemp.reserveCommonEvent(ce);
};
//end load
})(EST.PhoneMenu);
GALV_MessageStylesMZ//-----------------------------------------------------------------------------
// Galv's Message Styles MZ
//-----------------------------------------------------------------------------
// For: RPGMAKER MV
// GALV_MessageStylesMZ.js
//-----------------------------------------------------------------------------
// 2020-11-07 - Version 2.1 - added plugin order fix
// 2020-10-18 - Version 2.0 - hopefully fixed bugs with other text commands
// 2020-10-11 - Version 1.9 - fixed another text command issue
// 2020-10-04 - Version 1.8 - fixed issue when using other text commands after
// the pop command
// 2020-10-02 - Version 1.7 - fixed position issue when using larger screen
// width/height than the UI.
// 2020-09-28 - Version 1.6 - added compatibility with Galv's Cam Control zoom
// 2020-09-26 - Version 1.5 - fixed some code scope issues
// 2020-09-22 - Version 1.4 - added compatibility codes
// 2020-09-19 - Version 1.3 - added ability to add y offset per message
// more code updates/improvements
// 2020-09-18 - Version 1.2 - added ability to change message windowskin,
// arrow graphics, code updates and improvements,
// fixed target x,y bug and changed syntax method
// fixed 'middle' align arrow to be invisible
// 2020-09-17 - Version 1.1 - fixed a bug with the \. and \| wait codes
// 2020-09-16 - Version 1.0 - release
//-----------------------------------------------------------------------------
// Terms can be found at:
// galvs-scripts.com
//-----------------------------------------------------------------------------
var Imported = Imported || {};
Imported.Galv_MessageStyles = true;
var Galv = Galv || {}; // Galv's main object
Galv.Mstyle = Galv.Mstyle || {}; // Galv's stuff
Galv.Mstyle.pluginName = "GALV_MessageStylesMZ";
//-----------------------------------------------------------------------------
/*:
* @plugindesc (v.2.1) “显示文本”窗口漂浮在角色上方并在游戏过程中改变视觉效果。
* @url http://galvs-scripts.com
* @target MZ
* @author Galv
* @orderAfter GALV_MessageTimerMZ
*
* @param iIndicator
* @text 输入指示灯位置
* @desc pos,x,y - pos 是方向号(小键盘)。 1,2,3,4,6,7,8,9。
* @default 2,0,-12
*
* @param mPadding
* @text 消息填充
* @desc 在消息框中的文本周围添加填充...上、右、下、左。
* @default 0,0,0,0
*
* @param invertPos
* @text 反转浮动消息
* @type boolean
* @default false
* @desc 显示浮动消息时,显示窗口位置“底部”将改为顶部,反之亦然。
*
* @param aGraphic
* @text 箭头图形
* @desc 来自 /img/system/ 的图像,用于指向浮动消息框的目标。 留空为无。
* @default WindowArrow
*
* @param yOffset
* @text 默认 Y 偏移
* @desc 消息框将出现在事件/演员上方多少像素。
* @default 60
*
*
* @command mWindowStyle
* @text 消息窗口样式
* @desc 设置默认消息窗口的样式(not using \pop).
*
* @arg windowskin
* @text 窗口皮肤
* @default Window
* @desc /img/system 中的 窗口皮肤 图形(无扩展名)
*
*
* @command pWindowStyle
* @text 流行窗口样式
* @desc 设置弹出消息窗口的样式(使用 \pop 时)。
*
* @arg windowskin
* @text 视窗皮肤
* @default Window
* @desc /img/system 中的 视窗皮肤 图形(无扩展名)。
*
* @arg arrowGraphic
* @text 箭头图形
* @default WindowArrow
* @dec 更改弹出窗口的箭头图形。
*
*
* @command defaultWindowStyle
* @text 重置窗口样式
* @desc 将两个窗口的样式更改为默认样式。
*
* @help
* Galv 的消息样式
* ------------------------------------------------- --------------------------
* 这个插件的主要目的是让你的“显示文本”消息框
* 与游戏中的其他窗口具有不同的风格。插件设置
* 有多种可以调整的视觉设置,此外还可以使用
* 显示文本消息中的文本代码将允许您将该消息转换为
*浮动消息。
*
* 注意:目前内部不支持使用 /{ 和 \} 文本命令
*弹出消息窗口。
*
* ------------------------------------------------- --------------------------
* 在 SHOW TEXT 消息事件命令中使用的代码
* ------------------------------------------------- --------------------------
* 以下代码必须放在 Show Message 事件的第一行
* 命令工作。
*
* \流行[t]
*
* t = event Id - 在地图上定位事件
* 0 指向使用 Show Text 命令的事件
* -1,-2,-3,-4... 负数来定位这些职位的关注者
* a1、a2、a3 等...如果他们是追随者,则针对特定演员。如果
* 不是关注者,消息不会显示
* x|y 以屏幕像素位置为目标。
*
* 例子
* \pop[23] // 目标事件 23
* \pop[-3] // 瞄准你的追随者阵容中的第三个追随者
* \pop[a8] // 仅当actor是地图上的追随者时才针对actor 8
* \pop[500|200] // 将消息中心定位到屏幕位置
* // 500px X 和 200px Y
*
* 可选:
* 高级数据可以通过消息中的 \pop[] 文本添加。
*
* \pop[t,y,windowskin,windowarrow]
*
* t = 同上
* y = y 偏移的另一个修改器(以像素为单位) - 用于更高的精灵。
* 设置为 0 不修改默认 y 偏移
* windowskin = 要使用的不同窗口的文件名(空白表示无变化)
* windowarrow = 要使用的不同箭头的文件名(空白表示没有变化)
*
* ------------------------------------------------- --------------------------
* 插件命令
* ------------------------------------------------- --------------------------
* 有插件命令可用于更改 windowskins。当他们在
* 已使用,所有消息将使用新设置,直到再次使用
* 将它们改回默认值。这些是正在进行的工作,更多功能
* 可以添加到它们。
* Galv's Message Styles
* ----------------------------------------------------------------------------
* The main purpose of this plugin is to allow your "Show Text" message boxes
* to have a different style to other windows in the game. The plugin settings
* have a variety of visual settings you can tweak, and in addition using a
* text code in Show Text messages will allow you to turn that message into a
* floating message.
*
* NOTE: The use of /{ and \} text commands are not currently supported inside
* pop message windows.
*
* ----------------------------------------------------------------------------
* CODE to use inside a SHOW TEXT message event command
* ----------------------------------------------------------------------------
* The following code must be put in the first line of a Show Message event
* command to work.
*
* \pop[t]
*
* t = event Id - to target an event on the map
* 0 to target the event the Show Text command is used in
* -1,-2,-3,-4... negative numbers to target followers in those postions
* a1,a2,a3, etc... to target a specific actor IF they are a follower. If
* not a follower, the message will not display
* x|y to target a SCREEN pixel position.
*
* EXAMPLES
* \pop[23] // targets event 23
* \pop[-3] // targets the 3rd follower in your follower lineup
* \pop[a8] // targets actor 8, only if the actor is a follower on the map
* \pop[500|200] // targets center of message to screen position at
* // 500px X and 200px Y
*
* OPTIONALLY:
* Advanced data can be added via the \pop[] text within a message.
*
* \pop[t,y,windowskin,windowarrow]
*
* t = same as above
* y = another modifier for y offset in pixels - for taller sprites.
* set to 0 to not modify the default y offset
* windowskin = filename for a different window to use (blank for no change)
* windowarrow = filename for a different arrow to use (blank for no change)
*
* ----------------------------------------------------------------------------
* PLUGIN COMMANDS
* ----------------------------------------------------------------------------
* There are plugin commands available to change windowskins. When they are
* used, all messages will use the new settings until they used again to
* change them back to defaults. These are a work in progress, more features
* may be added to them.
*
*/
//-----------------------------------------------------------------------------
// CODE STUFFS
//-----------------------------------------------------------------------------
// PLUGIN COMMANDS
//-----------------------------------------------------------------------------
PluginManager.registerCommand(Galv.Mstyle.pluginName, "mWindowStyle", args => {
args.index = 0;
$gameSystem.updateMStyles(args);
});
PluginManager.registerCommand(Galv.Mstyle.pluginName, "pWindowStyle", args => {
args.index = 1;
$gameSystem.updateMStyles(args);
});
PluginManager.registerCommand(Galv.Mstyle.pluginName, "defaultWindowStyle", args => {
$gameSystem.buildMStyles();
});
Galv.Mstyle.invertPos = PluginManager.parameters(Galv.Mstyle.pluginName)['invertPos'] == 'true';
Galv.Mstyle.arrow = PluginManager.parameters(Galv.Mstyle.pluginName)['aGraphic'];
Galv.Mstyle.yOffset = Number(PluginManager.parameters(Galv.Mstyle.pluginName)['yOffset']);
// If screen is bigger than ui
Galv.Mstyle.screenXOffset = 0;
Galv.Mstyle.screenYOffset = 0;
Galv.Mstyle.indPos = PluginManager.parameters(Galv.Mstyle.pluginName)['iIndicator'].split(",");
for (let i = 0; i < Galv.Mstyle.indPos.length; i++) {
Galv.Mstyle.indPos = Number(Galv.Mstyle.indPos);
};
Galv.Mstyle.padding = PluginManager.parameters(Galv.Mstyle.pluginName)['mPadding'].split(",");
for (let i = 0; i < Galv.Mstyle.padding.length; i++) {
Galv.Mstyle.padding = Number(Galv.Mstyle.padding);
};
Galv.Mstyle.target = null;
Galv.Mstyle.thisEvent = null;
Galv.Mstyle.refreshOnClose = false;
Galv.Mstyle.tempPopData = {};
Galv.Mstyle.checkTarget = function(text) {
let target = {};
let tmp = text.replace(/\\/g, "\x1b");
tmp = tmp.replace(/\x1b\x1b/g, "\\");
tmp = tmp.replace(/\x1bV\[(\d+)\]/gi, (_, p1) =>
$gameVariables.value(parseInt(p1))
);
let popData = tmp.match(/\x1bpop\[[^\]]*\]/gi);
if (popData) {
const data = popData[0].match(/\[(.*)\]/)[1].split(",");
const d = data[0].split("|");
if (!d[1]) {
// target is an id only
target.id = d[0];
} else {
// target is an x,y
target.x = d[0];
target.y = d[1];
}
target.extra = []; // additional potential data here
for (let i = 1; i < data.length; i++) {
target.extra.push(data);
}
}
return target;
};
Galv.Mstyle.setTarget = function(target) {
// build temp pop data object
this.buildTempPopData(target);
if (target.y) {
// Target has a Y value, so it's an X,Y object
this.xyTarget = {
_x: Number(target.x),
_y: Number(target.y),
screenX: function() {return this._x},
screenY: function() {return this._y},
};
return this.xyTarget;
} else if (!target.id.contains("a")) {
// Target is an ID (event or negatives for follower) and NOT and x,y location
target.id = Number(target.id);
// event ID or player
if (target.id >= -1) {
switch (target.id) {
case 0:
return $gameMap.event(this.thisEvent);
break;
case -1:
return $gamePlayer;
break;
default:
return $gameMap.event(target.id);
break;
};
} else {
// Target is a follower
const f = Math.abs(target.id);
if (f > $gameParty.battleMembers().length) {
// if no follower exists - don't do it!
return false;
} else {
return $gamePlayer._followers.follower(f - 2);
};
};
} else if (target.id.contains("a")) {
// Target an actor - check if the actor is in the followers
const actor = $gameActors.actor(Number(target.id.replace("a","")));
actorIndex = actor.index();
if (actorIndex < 0 || actorIndex > $gameParty.battleMembers().length) {
return false;
} else {
const ind = actorIndex - 1;
return ind < 0 ? $gamePlayer : $gamePlayer._followers.follower(ind);
};
};
};
Galv.Mstyle.buildTempPopData = function(target) {
this.tempPopData = {}; // reset temp data
this.tempPopData.array = target.extra || []; // array of extra data
this.processTempPopData();
}
Galv.Mstyle.processTempPopData = function() {
let data = this.tempPopData.array
this.tempPopData.yo = Number(data[0]) || 0;
this.tempPopData.windowskin = data[1] || "";
this.tempPopData.windowarrow = data[2] || "";
// Add more data here if needed
};
Galv.Mstyle.refreshMessageWindows = function() {
if (SceneManager._scene._messageWindow) SceneManager._scene._messageWindow.refreshGraphics();
if (SceneManager._scene._nameWindow) SceneManager._scene._nameBoxWindow.refreshGraphics();
};
Galv.Mstyle.zoomOffset = function(v1,v2) {
return (v1-v2) - (v1-v2) * $gameScreen.zoomScale();
};
// GAME SYSTEM
//-----------------------------------------------------------------------------
Galv.Mstyle.Game_System_initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
Galv.Mstyle.Game_System_initialize.call(this);
this.buildMStyles();
};
Game_System.prototype.buildMStyles = function() {
const windowskin = 'Window';
const arrow = Galv.Mstyle.arrow;
this._mStyles = [
// default message window settings [0]
{windowskin: windowskin},
// pop message settings [1]
{windowskin: windowskin,arrowGraphic: arrow},
];
};
Game_System.prototype.updateMStyles = function(args) {
// update the message style settings
this._mStyles[args.index] = args;
};
// INTERPRETER
//-----------------------------------------------------------------------------
Galv.Mstyle.Game_Interpreter_command101 = Game_Interpreter.prototype.command101;
Game_Interpreter.prototype.command101 = function(params) {
const ispop = this._list[this._index + 1].parameters[0].match(/\\pop/i);
if (ispop) {
// Is a pop message
Galv.Mstyle.thisEvent = this._eventId;
Galv.Mstyle.target = Galv.Mstyle.setTarget(Galv.Mstyle.checkTarget(this._list[this._index + 1].parameters[0]));
if (Galv.Mstyle.target == false) {
while (this.nextEventCode() === 401) { // Text data
this._index++;
};
return false;
};
} else {
// Not a pop message
Galv.Mstyle.thisEvent = null;
Galv.Mstyle.target = null;
};
return Galv.Mstyle.Game_Interpreter_command101.call(this,params);
};
// WINDOW MESSAGE
//-----------------------------------------------------------------------------
Galv.Mstyle.Window_Message_initialize = Window_Message.prototype.initialize;
Window_Message.prototype.initialize = function(rect) {
Galv.Mstyle.Window_Message_initialize.call(this,rect);
Galv.Mstyle.screenXOffset = (Graphics.width - Graphics.boxWidth) / 2;
Galv.Mstyle.screenYOffset = (Graphics.height - Graphics.boxHeight) / 2;
this.createWindowTail();
};
Window_Message.prototype.refreshGraphics = function() {
this.loadWindowskin();
this.contents.clear();
this.updateTone();
this.changeWindowDimensions();
this.createContents();
this.openness = 0;
this.createWindowTail();
};
Window_Message.prototype.loadWindowskin = function() {
Window_Base.prototype.loadPopMessageWindowskin.call(this);
};
Galv.Mstyle.Window_Message_updateClose = Window_Message.prototype.updateClose;
Window_Message.prototype.updateClose = function() {
if (Galv.Mstyle.refreshOnClose && this.isClosed()) {
Galv.Mstyle.refreshOnClose = false;
Galv.Mstyle.refreshMessageWindows();
}
Galv.Mstyle.Window_Message_updateClose.call(this);
};
Window_Message.prototype.createWindowTail = function() {
const arrowName = Galv.Mstyle.tempPopData.windowarrow ? Galv.Mstyle.tempPopData.windowarrow : $gameSystem._mStyles[1].arrowGraphic;
if (this._tailSprite) {
if (this._tailSprite.name != arrowName) {
this.removeChild(this._tailSprite); // if arrow graphic has changed, remove the sprite to rebuild it.
} else {
return; // no need to rebuild the sprite below.
}
}
this._tailSprite = new Sprite();
this._tailSprite.bitmap = ImageManager.loadSystem(arrowName);
this._tailSprite.opacity = 0;
this._tailSprite.anchor.x = 0.5;
this._tailSprite.name = arrowName;
this.addChild(this._tailSprite);
};
Galv.Mstyle.Window_Message_startMessage = Window_Message.prototype.startMessage;
Window_Message.prototype.startMessage = function() {
Galv.Mstyle.Window_Message_startMessage.call(this);
this.startPopMessageStuff();
};
Window_Message.prototype.startPopMessageStuff = function() {
this.loadWindowskin(); // load windowskin in case it was changed with plugin command
this._nameBoxWindow.loadWindowskin();
this.createWindowTail();
this.changeWindowDimensions();
this.refreshDimmerBitmap();
this.setPopSettings();
this.createWindowTail();
}
Galv.Mstyle.Window_Message_updatePlacement = Window_Message.prototype.updatePlacement;
Window_Message.prototype.updatePlacement = function() {
if (Galv.Mstyle.target) {
this.pTarget = Galv.Mstyle.target;
this.updateFloatPlacement();
} else {
this.pTarget = null;
this.changeWindowDimensions();
Galv.Mstyle.Window_Message_updatePlacement.call(this);
};
};
Galv.Mstyle.Window_Message_terminateMessage = Window_Message.prototype.terminateMessage;
Window_Message.prototype.terminateMessage = function() {
Galv.Mstyle.Window_Message_terminateMessage.call(this);
this.pTarget = null;
Galv.Mstyle.target = null;
Galv.Mstyle.thisEvent = null;
};
Galv.Mstyle.Window_Message_update = Window_Message.prototype.update;
Window_Message.prototype.update = function() {
Galv.Mstyle.Window_Message_update.call(this);
this.updateFloatPlacement();
};
Window_Message.prototype.setPopSettings = function() {
// Invert bottom and top if setting is true
if (Galv.Mstyle.invertPos) {
if ($gameMessage._positionType == 2) {
$gameMessage._positionType = 0;
} else if ($gameMessage._positionType == 0) {
$gameMessage._positionType = 2;
}
};
// Initial yOffset value
switch ($gameMessage._positionType) {
case 1: // MIDDLE
this.yOffset = -(this.height / 2);
break;
case 2: // BOTTOM
this.yOffset = 15;
break;
};
};
Window_Message.prototype.updateFloatPlacement = function() {
if (this.pTarget == null) return this._tailSprite.opacity = 0; // If not a floating message, hide tailsprite and stop function
if (this.openness < 255) this._tailSprite.opacity = 0; // hide tail sprite when not fully open
// init pos X,Y
let zx = this.pTarget.screenX() - Galv.Mstyle.screenXOffset;
let zy = this.pTarget.screenY() - Galv.Mstyle.screenYOffset;
// compensate for zoomed screen
const zoomX = Galv.Mstyle.zoomOffset(Graphics.boxWidth / 2,zx);
const zoomY = Galv.Mstyle.zoomOffset(Graphics.boxHeight / 2,zy);
let posX = zx - this.width / 2 + zoomX;
let posY = zy + this.yOffset + Galv.Mstyle.tempPopData.yo + zoomY;
// set posX
if (posX + this.width > Graphics.boxWidth) {
posX = Graphics.boxWidth - this.width;
} else if (posX < 0) {
posX = 0;
};
this.x = posX;
this._nameBoxWindow.x = this.x;
// set posY
const nameBoxOffset = this._nameBoxWindow._name ? this._nameBoxWindow.height : 0;
if (posY + this.height > Graphics.height) {
// If window would go off bottom of screen
const maxY = Graphics.height - this.height;
posY = Math.min(maxY,this.pTarget.screenY() - Galv.Mstyle.yOffset - this.height);
this.tailPos = 0;
} else if (posY - nameBoxOffset < 0) {
// If window would go off top of screen
posY = Math.max(this.pTarget.screenY() + 15,0); // position box under when it hits top of screen
this.tailPos = 2;
} else {
this.tailPos = $gameMessage._positionType;
};
if ($gameMessage._positionType == 1) this.tailPos = 1; // if set to middle, no tail.
this.y = posY;
this._nameBoxWindow.y = posY - nameBoxOffset;
// Update other stuff
this.updateOtherMsgWindows();
this.updateTailSprite();
};
Window_Message.prototype.updateOtherMsgWindows = function() {
this.updateFloatGoldWindow();
this.updateFloatChoiceWindow();
};
Window_Message.prototype.updateFloatGoldWindow = function() {
if (!this._goldWindow) return;
this._goldWindow.y = this._nameBoxWindow.y < this._goldWindow.height ? Graphics.boxHeight - this._goldWindow.height : 0;
};
Window_Message.prototype.updateFloatChoiceWindow = function() {
const positionType = $gameMessage.choicePositionType();
const setY = this.y + this.height;
if (setY + this._choiceListWindow.height > Graphics.height) {
// If choice window goes off bottom of screen.
this._choiceListWindow.y = this.y - this._choiceListWindow.height;
} else {
this._choiceListWindow.y = setY;
}
switch (positionType) {
case 0: // left
this._choiceListWindow.x = this.x;
break;
case 1: // middle
this._choiceListWindow.x = this.x + (this.width / 2) - this._choiceListWindow.width / 2;
break;
case 2: // right
this._choiceListWindow.x = this.x + this.width - this._choiceListWindow.width;
break;
};
};
Window_Message.prototype.updateTailSprite = function() {
if (this.openness > 200) {
if (this.tailPos == 1) { // MID
this._tailSprite.opacity = 0;
} else if (this.tailPos == 2) { // BOT
this._tailSprite.y = 2;
this._tailSprite.scale.y = -1;
this._tailSprite.opacity += 50;
} else if (this.tailPos == 0) { // TOP
this._tailSprite.scale.y = 1;
this._tailSprite.y = this.height - 2;
this._tailSprite.opacity += 50;
};
};
// compensate for zoomed screen
const screenX = this.pTarget.screenX() - Galv.Mstyle.screenXOffset;
const zoomX = Galv.Mstyle.zoomOffset(Graphics.boxWidth / 2,screenX);
this._tailSprite.x = screenX - this.x + zoomX;
};
Galv.Mstyle.Window_Message_newLineX = Window_Message.prototype.newLineX;
Window_Message.prototype.newLineX = function(textState) {
const padding = !$gameMessage.faceName() ? Galv.Mstyle.padding[3] : 0;
return Galv.Mstyle.Window_Message_newLineX.call(this, textState) + padding;
};
Galv.Mstyle.Window_Message_newPage = Window_Message.prototype.newPage;
Window_Message.prototype.newPage = function(textState) {
Galv.Mstyle.Window_Message_newPage.call(this,textState);
textState.y += Galv.Mstyle.padding[0];
};
Window_Message.prototype.galvExtraWidths = function() {
return 0; // For compatibility
};
Window_Message.prototype.galvExtraHeights = function() {
return 0; // For compatibility
};
Window_Message.prototype.changeWindowDimensions = function() {
if (this.pTarget != null) {
Galv.Mstyle.testActive = true;
let w = 0;
let h = 0;
const faceoffset = $gameMessage.faceName() ? ImageManager.faceWidth + 25 : 0;
const xO = $gameMessage.faceName() ? faceoffset : 8;
// Calc text width
for (let i = 0; i < $gameMessage._texts.length; i++) {
let lineWidth = this.testWidthEx($gameMessage._texts);
if (w < lineWidth) w = lineWidth;
};
w = w + $gameSystem.windowPadding() * 2 + xO + Galv.Mstyle.padding[3] + Galv.Mstyle.padding[1]; // padding!
w += this.galvExtraWidths();
this.width = Math.min(Graphics.boxWidth,w); // can't be wider than the screen!
// Calc minimum lines
let minFaceHeight = 0;
if ($gameMessage._faceName) minFaceHeight = ImageManager.faceHeight + $gameSystem.windowPadding() * 2;
// Calc text height
let textState = { index: 0 };
let extraFontHeight = 0;
const lines = $gameMessage._texts
// Dodgy way to modify text line height if the \{ \} text codes are used.
for (let i = 0; i < lines.length; i++) {
let up = (lines.match(/\\{/g) || []).length;
let down = (lines.match(/\\}/g) || []).length;
// Height
extraFontHeight += extraFontHeight + ((up - down));
}
extraFontHeight *= 24;
// Escape characters from text
textState.text = this.convertEscapeCharacters($gameMessage.allText());
// Build actual height from everything
const allLineHeight = this.calcTextHeight(textState,true);
const height = allLineHeight + $gameSystem.windowPadding() * 2 + extraFontHeight;
const minHeight = this.fittingHeight($gameMessage._texts.length);
this.height = Math.max(height,minHeight,minFaceHeight);
this.height += Galv.Mstyle.padding[0] + Galv.Mstyle.padding[2];
this.height += this.galvExtraHeights();
this.yOffset = -Galv.Mstyle.yOffset - this.height;
Galv.Mstyle.testActive = false;
this.otherMStyleCommands(); // stop certain things happening when drawing the text that was used for determining size.
} else { // if this.pTarget is null
// normal message window
this.yOffset = 0;
this.width = this.windowWidth();
this.height = this.fittingHeight(4) + Galv.Mstyle.padding[0] + Galv.Mstyle.padding[2];
this.x = (Graphics.boxWidth - this.width) / 2;
};
};
Galv.Mstyle.Window_Message_processEscapeCharacter = Window_Message.prototype.processEscapeCharacter;
Window_Message.prototype.processEscapeCharacter = function(code, textState) {
// if only testing the text for sizes, don't process the characters that pause, etc.
if (Galv.Mstyle.testActive) return Window_Base.prototype.processEscapeCharacter.call(this, code, textState);
Galv.Mstyle.Window_Message_processEscapeCharacter.call(this,code,textState);
}
Window_Message.prototype.otherMStyleCommands = function() {
};
Window_Message.prototype.windowWidth = function() {
return Graphics.boxWidth;
};
Window_Message.prototype.testWidthEx = function(text) {
return this.textSizeEx(text).width;
};
Galv.Mstyle.Window_Message__refreshPauseSign = Window_Message.prototype._refreshPauseSign;
Window_Message.prototype._refreshPauseSign = function() {
Galv.Mstyle.Window_Message__refreshPauseSign.call(this);
// indicator graphic to let user know they need to press a button
let x = 0;
let y = 0;
const oX = Galv.Mstyle.indPos[1];
const oY = Galv.Mstyle.indPos[2];
this._pauseSignSprite.anchor.y = 0.5;
this._pauseSignSprite.anchor.x = 0.5;
const pos = Galv.Mstyle.indPos[0];
switch (pos) {
case 1:
x = oX;
y = this._height + oY;
break;
case 2:
x = this._width / 2 + oX;
y = this._height + oY;
break;
case 3:
x = this.width + oX;
y = this._height + oY;
break;
case 4:
x = oX;
y = this.height / 2 + oY;
break;
case 6:
x = this.width + oX;
y = this.height / 2 + oY;
break;
case 7:
x = oX;
y = oY;
break;
case 8:
x = this._width / 2 + oX;
y = oY;
break;
case 9:
x = this.width + oX;
y = oY;
break;
}
this._pauseSignSprite.move(x,y);
};
Galv.Mstyle.Window_Message_convertEscapeCharacters = Window_Message.prototype.convertEscapeCharacters;
Window_Message.prototype.convertEscapeCharacters = function(text) {
text = Galv.Mstyle.Window_Message_convertEscapeCharacters.call(this,text);
text = text.replace(/\x1bpop\[[^\]]*\]/gi, ""); // Remove it if different characters are present!
return text;
};
// WINDOW NAMEBOX
//-----------------------------------------------------------------------------
Window_NameBox.prototype.loadWindowskin = function() {
Window_Base.prototype.loadPopMessageWindowskin.call(this);
};
// WINDOW BASE
//-----------------------------------------------------------------------------
Window_Base.prototype.loadPopMessageWindowskin = function() {
if (Galv.Mstyle.target) {
// use the pop settings
const skin = Galv.Mstyle.tempPopData.windowskin ? Galv.Mstyle.tempPopData.windowskin : $gameSystem._mStyles[1].windowskin;
return this.windowskin = ImageManager.loadSystem(skin);
} else {
// use the default settings
return this.windowskin = ImageManager.loadSystem($gameSystem._mStyles[0].windowskin);
}
}; |
|