Initial Commit
This commit is contained in:
commit
51531729e0
185 changed files with 3007011 additions and 0 deletions
20
.gitignore
vendored
Normal file
20
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Ignore all files
|
||||
*.*
|
||||
|
||||
# Except
|
||||
!*.json
|
||||
!*.js
|
||||
!*.zip
|
||||
!*.7z
|
||||
!*.csv
|
||||
!*.ain
|
||||
!*.fnl
|
||||
!*.ks
|
||||
!*.tjs
|
||||
!*.yaml
|
||||
!Data/*
|
||||
!*.rb
|
||||
!.gitignore
|
||||
!README.md
|
||||
|
||||
# Images
|
||||
49
README.md
Normal file
49
README.md
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# Apply Patch
|
||||
1. Click Code
|
||||
2. Click Download ZIP
|
||||
3. Extract to game folder and Replace All.
|
||||
|
||||
# How To Contribute
|
||||
TLDR 3 steps.
|
||||
|
||||
Fork the repository.
|
||||
Make the changes.
|
||||
Submit a pull request to the project owner.
|
||||
|
||||
If everything looks good and doesn't break things I'll merge it in.
|
||||
|
||||
Longer Version:
|
||||
|
||||
Things that are needed:
|
||||
* [VSCode](https://code.visualstudio.com/) Make sure you check all the boxes for context menus. 
|
||||
* The Game
|
||||
* [Git](https://git-scm.com/downloads) (Use the default for everything. Just keep clicking Next)
|
||||
* Motivation to learn
|
||||
|
||||
Installation:
|
||||
1. Fork the repo using the fork button at the top. Click Code > HTTPS > Copy URL.
|
||||
2. Right click on the game folder and click 'Open with VSCode' (Shift+Right_Click if you are on Windows 11)
|
||||
3. Click on the Source Control Button and click initialize repository.
|
||||
|
||||

|
||||
|
||||
4. At the top click on Terminal > New Terminal. Enter the following: `git clone [URL_YOU_COPIED_ABOVE]`.
|
||||
5. Copy the contents of the new folder created with git clone into the game folder and replace all.
|
||||
6. Your source control menu should be good to go and look like this.
|
||||
|
||||

|
||||
|
||||
Now you are all setup, all you need to do is play the game and look for any changes that need to be made. Stuff like spelling errors, wrong names, inconsistencies, spacing issues, etc.
|
||||
|
||||
7. Use the FIND functionality to search for what you are trying to fix. For example if a character's name is wrong, type that into the search menu and start looking, then make the change. Try not to mess with any scripts or variables you might see.
|
||||
|
||||

|
||||
|
||||
8. After you are satisfied with your changes it's time to put in a PR. Go to source control to see all your changes. Add a message and click the `Commit` button to save them all.
|
||||
|
||||

|
||||
|
||||
8. Click Sync to push your changes to your fork. Now all that's left is to put in a pull request.
|
||||
9. Go to Pull Requests > New Pull Requests. Look at the arrow, your fork should be pointing to the original repo (mine). Add in details on what you fixed and Submit. If everything looks good I'll merge it in and you would have successfully contributed.
|
||||
|
||||
Got questions? Just shoot me a message, more than happy to walk you through any of the tools.
|
||||
12
package.json
Normal file
12
package.json
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"name": "",
|
||||
"main": "www/index.html",
|
||||
"js-flags": "--expose-gc",
|
||||
"window": {
|
||||
"title": "",
|
||||
"toolbar": false,
|
||||
"width": 816,
|
||||
"height": 624,
|
||||
"icon": "www/icon/icon.png"
|
||||
}
|
||||
}
|
||||
265
www/data/Actors.json
Normal file
265
www/data/Actors.json
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
[
|
||||
null,
|
||||
{
|
||||
"id": 1,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "SD_Kanojo",
|
||||
"classId": 4,
|
||||
"equips": [
|
||||
24,
|
||||
0,
|
||||
2,
|
||||
0
|
||||
],
|
||||
"faceIndex": 7,
|
||||
"faceName": "",
|
||||
"traits": [
|
||||
{
|
||||
"code": 62,
|
||||
"dataId": 3,
|
||||
"value": 1
|
||||
}
|
||||
],
|
||||
"initialLevel": 1,
|
||||
"maxLevel": 99,
|
||||
"name": "ルナ",
|
||||
"nickname": "",
|
||||
"note": "<LevelUpVoice:Runa_LevelUp>\n<処女スキル:20,9>\n<攻撃ボイス:Runa_Attack1,100,100,0 | Runa_Attack2,100,100,0 | Runa_Attack3,100,100,0 | Runa_Attack4,100,100,0 | Runa_Attack5,100,100,0 | Runa_Attack6,100,100,0 | Runa_Attack7,100,100,0 | Runa_Attack8,100,100,0>\n<ダメージボイス:Runa_Damage1,100,100,0 | Runa_Damage2,100,100,0 | Runa_Damage3,100,100,0 | Runa_Damage4,100,100,0 | Runa_Damage5,100,100,0 | Runa_Damage6,100,100,0 | Runa_Damage7,100,100,0 | Runa_Damage8,100,100,0 | Runa_Damage9,100,100,0 | Runa_Damage10,100,100,0 | Runa_Damage11,100,100,0>\n<拘束ボイス1:Runa_Damage2,100,100,0 | Runa_Damage5,100,100,0 | Runa_Damage9,100,100,0 | Runa_Damage11,100,100,0>\n<拘束ボイス2:,100,100,0>\n<拘束ボイス2ex:Runa_EX,100,100,0>\n<拘束ボイス3:,100,100,0>\n<スキルボイス:Runa_Special,100,100,0>\n<死亡ボイス:Runa_Death1,100,100 | Runa_Death2,100,100>\n<アーマー:SD_Kanojo,0>\n<マイクロビキニ:SD_Kanojo,1>\n<nude:SD_Kanojo,2>",
|
||||
"profile": "\\N[2]の彼女ではあるが純潔でプラトニックラブな関係\n魔法を得意としており全般的に使いこなせる魔術師"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "SD_Kareshi",
|
||||
"classId": 7,
|
||||
"equips": [
|
||||
35,
|
||||
0,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"faceIndex": 2,
|
||||
"faceName": "",
|
||||
"traits": [
|
||||
{
|
||||
"code": 62,
|
||||
"dataId": 3,
|
||||
"value": 1
|
||||
}
|
||||
],
|
||||
"initialLevel": 1,
|
||||
"maxLevel": 99,
|
||||
"name": "ヨースケ",
|
||||
"nickname": "",
|
||||
"note": "<LevelUpVoice:Non_LevelUp>\n<処女スキル:21,10>\n<攻撃ボイス:Non_Attack1,100,100,0>\n<ダメージボイス:Non_Damage1,100,100,0>\n<拘束ボイス1:Non_Damage1,100,100,0>\n<拘束ボイス2:,100,100,0>\n<拘束ボイス2ex:Non_EX,100,100,0>\n<拘束ボイス3:,100,100,0>\n<スキルボイス:Non_Special1,100,100,0>\n<死亡ボイス:Non_Death1,100,100>\n<noBind>",
|
||||
"profile": "\\N[1]の彼氏で婚前交渉しないと決めているためプラトニックな関係の童貞男\n狩人としてはごく平均的な能力の冒険者で武器は弓矢"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "SD_Dalton",
|
||||
"classId": 2,
|
||||
"equips": [
|
||||
13,
|
||||
0,
|
||||
4,
|
||||
0
|
||||
],
|
||||
"faceIndex": 0,
|
||||
"faceName": "",
|
||||
"traits": [
|
||||
{
|
||||
"code": 62,
|
||||
"dataId": 3,
|
||||
"value": 1
|
||||
}
|
||||
],
|
||||
"initialLevel": 10,
|
||||
"maxLevel": 99,
|
||||
"name": "ドルトン",
|
||||
"nickname": "",
|
||||
"note": "<noBind>",
|
||||
"profile": "小太りでムッツリスケベな中年冒険者【拠点:スラム】\n森林ダンジョンではその大型斧は効果的で頼れる傭兵"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "SD_Arashi",
|
||||
"classId": 10,
|
||||
"equips": [
|
||||
2,
|
||||
0,
|
||||
5,
|
||||
0
|
||||
],
|
||||
"faceIndex": 1,
|
||||
"faceName": "",
|
||||
"traits": [
|
||||
{
|
||||
"code": 62,
|
||||
"dataId": 3,
|
||||
"value": 1
|
||||
}
|
||||
],
|
||||
"initialLevel": 9,
|
||||
"maxLevel": 99,
|
||||
"name": "アラシ",
|
||||
"nickname": "",
|
||||
"note": "<noBind>",
|
||||
"profile": "女と金目当てでこの島に来たチャラい冒険者【拠点:村の宿屋】\n剣士としてダンジョン攻略経験もある心強い傭兵"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "SD_Bob",
|
||||
"classId": 5,
|
||||
"equips": [
|
||||
57,
|
||||
0,
|
||||
7,
|
||||
0
|
||||
],
|
||||
"faceIndex": 0,
|
||||
"faceName": "",
|
||||
"traits": [
|
||||
{
|
||||
"code": 62,
|
||||
"dataId": 3,
|
||||
"value": 1
|
||||
}
|
||||
],
|
||||
"initialLevel": 11,
|
||||
"maxLevel": 99,
|
||||
"name": "ボブ",
|
||||
"nickname": "",
|
||||
"note": "<noBind>",
|
||||
"profile": "余計な武器は持たず腕っぷしだけで事足りる重量系冒険者【拠点:スラム】\n進行を妨害する岩も驚異的な腕力で破壊できる猛獣系の傭兵"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "SD_Syota",
|
||||
"classId": 1,
|
||||
"equips": [
|
||||
48,
|
||||
0,
|
||||
6,
|
||||
0
|
||||
],
|
||||
"faceIndex": 0,
|
||||
"faceName": "",
|
||||
"traits": [
|
||||
{
|
||||
"code": 62,
|
||||
"dataId": 3,
|
||||
"value": 1
|
||||
}
|
||||
],
|
||||
"initialLevel": 8,
|
||||
"maxLevel": 99,
|
||||
"name": "ショウタ",
|
||||
"nickname": "",
|
||||
"note": "<noBind>",
|
||||
"profile": "夢は世界一の冒険者で子分を引き連れる親分にも憧れる少年【拠点:村】\n小柄な体型を活かし狭い近道も通れる役立つ傭兵"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "SD_Inaka_musume",
|
||||
"classId": 8,
|
||||
"equips": [
|
||||
0,
|
||||
0,
|
||||
9,
|
||||
0
|
||||
],
|
||||
"faceIndex": 0,
|
||||
"faceName": "",
|
||||
"traits": [
|
||||
{
|
||||
"code": 62,
|
||||
"dataId": 3,
|
||||
"value": 1
|
||||
}
|
||||
],
|
||||
"initialLevel": 1,
|
||||
"maxLevel": 99,
|
||||
"name": "田舎娘",
|
||||
"nickname": "",
|
||||
"note": "<noBind>",
|
||||
"profile": "薬草採取と調剤を生業としている引っ込み思案な性格の女の子\n森への警護依頼がきっかけで\\N[2]と出会う"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "",
|
||||
"classId": 1,
|
||||
"equips": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"faceIndex": 0,
|
||||
"faceName": "",
|
||||
"traits": [],
|
||||
"initialLevel": 1,
|
||||
"maxLevel": 99,
|
||||
"name": "",
|
||||
"nickname": "",
|
||||
"note": "",
|
||||
"profile": ""
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "",
|
||||
"classId": 1,
|
||||
"equips": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"faceIndex": 0,
|
||||
"faceName": "",
|
||||
"traits": [],
|
||||
"initialLevel": 1,
|
||||
"maxLevel": 99,
|
||||
"name": "",
|
||||
"nickname": "",
|
||||
"note": "",
|
||||
"profile": ""
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"battlerName": "",
|
||||
"characterIndex": 0,
|
||||
"characterName": "",
|
||||
"classId": 1,
|
||||
"equips": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"faceIndex": 0,
|
||||
"faceName": "",
|
||||
"traits": [],
|
||||
"initialLevel": 1,
|
||||
"maxLevel": 99,
|
||||
"name": "",
|
||||
"nickname": "",
|
||||
"note": "",
|
||||
"profile": ""
|
||||
}
|
||||
]
|
||||
424783
www/data/Animations.json
Normal file
424783
www/data/Animations.json
Normal file
File diff suppressed because it is too large
Load diff
2371
www/data/Armors.json
Normal file
2371
www/data/Armors.json
Normal file
File diff suppressed because it is too large
Load diff
13719
www/data/Classes.json
Normal file
13719
www/data/Classes.json
Normal file
File diff suppressed because it is too large
Load diff
372363
www/data/CommonEvents.json
Normal file
372363
www/data/CommonEvents.json
Normal file
File diff suppressed because it is too large
Load diff
16071
www/data/Enemies.json
Normal file
16071
www/data/Enemies.json
Normal file
File diff suppressed because it is too large
Load diff
6194
www/data/Items.json
Normal file
6194
www/data/Items.json
Normal file
File diff suppressed because it is too large
Load diff
41538
www/data/Map001.json
Normal file
41538
www/data/Map001.json
Normal file
File diff suppressed because it is too large
Load diff
7364
www/data/Map002.json
Normal file
7364
www/data/Map002.json
Normal file
File diff suppressed because it is too large
Load diff
19386
www/data/Map003.json
Normal file
19386
www/data/Map003.json
Normal file
File diff suppressed because it is too large
Load diff
243345
www/data/Map006.json
Normal file
243345
www/data/Map006.json
Normal file
File diff suppressed because it is too large
Load diff
29998
www/data/Map007.json
Normal file
29998
www/data/Map007.json
Normal file
File diff suppressed because it is too large
Load diff
48697
www/data/Map008.json
Normal file
48697
www/data/Map008.json
Normal file
File diff suppressed because it is too large
Load diff
39326
www/data/Map009.json
Normal file
39326
www/data/Map009.json
Normal file
File diff suppressed because it is too large
Load diff
9625
www/data/Map010.json
Normal file
9625
www/data/Map010.json
Normal file
File diff suppressed because it is too large
Load diff
42091
www/data/Map011.json
Normal file
42091
www/data/Map011.json
Normal file
File diff suppressed because it is too large
Load diff
65714
www/data/Map013.json
Normal file
65714
www/data/Map013.json
Normal file
File diff suppressed because it is too large
Load diff
40659
www/data/Map015.json
Normal file
40659
www/data/Map015.json
Normal file
File diff suppressed because it is too large
Load diff
41854
www/data/Map016.json
Normal file
41854
www/data/Map016.json
Normal file
File diff suppressed because it is too large
Load diff
14987
www/data/Map017.json
Normal file
14987
www/data/Map017.json
Normal file
File diff suppressed because it is too large
Load diff
77076
www/data/Map018.json
Normal file
77076
www/data/Map018.json
Normal file
File diff suppressed because it is too large
Load diff
61030
www/data/Map019.json
Normal file
61030
www/data/Map019.json
Normal file
File diff suppressed because it is too large
Load diff
9608
www/data/Map020.json
Normal file
9608
www/data/Map020.json
Normal file
File diff suppressed because it is too large
Load diff
22890
www/data/Map021.json
Normal file
22890
www/data/Map021.json
Normal file
File diff suppressed because it is too large
Load diff
8793
www/data/Map022.json
Normal file
8793
www/data/Map022.json
Normal file
File diff suppressed because it is too large
Load diff
19352
www/data/Map023.json
Normal file
19352
www/data/Map023.json
Normal file
File diff suppressed because it is too large
Load diff
21645
www/data/Map025.json
Normal file
21645
www/data/Map025.json
Normal file
File diff suppressed because it is too large
Load diff
4514
www/data/Map027.json
Normal file
4514
www/data/Map027.json
Normal file
File diff suppressed because it is too large
Load diff
9911
www/data/Map029.json
Normal file
9911
www/data/Map029.json
Normal file
File diff suppressed because it is too large
Load diff
195350
www/data/Map030.json
Normal file
195350
www/data/Map030.json
Normal file
File diff suppressed because it is too large
Load diff
49362
www/data/Map031.json
Normal file
49362
www/data/Map031.json
Normal file
File diff suppressed because it is too large
Load diff
55641
www/data/Map032.json
Normal file
55641
www/data/Map032.json
Normal file
File diff suppressed because it is too large
Load diff
51163
www/data/Map033.json
Normal file
51163
www/data/Map033.json
Normal file
File diff suppressed because it is too large
Load diff
38929
www/data/Map034.json
Normal file
38929
www/data/Map034.json
Normal file
File diff suppressed because it is too large
Load diff
44910
www/data/Map035.json
Normal file
44910
www/data/Map035.json
Normal file
File diff suppressed because it is too large
Load diff
34527
www/data/Map036.json
Normal file
34527
www/data/Map036.json
Normal file
File diff suppressed because it is too large
Load diff
31868
www/data/Map037.json
Normal file
31868
www/data/Map037.json
Normal file
File diff suppressed because it is too large
Load diff
32166
www/data/Map038.json
Normal file
32166
www/data/Map038.json
Normal file
File diff suppressed because it is too large
Load diff
45499
www/data/Map039.json
Normal file
45499
www/data/Map039.json
Normal file
File diff suppressed because it is too large
Load diff
9731
www/data/Map040.json
Normal file
9731
www/data/Map040.json
Normal file
File diff suppressed because it is too large
Load diff
7257
www/data/Map041.json
Normal file
7257
www/data/Map041.json
Normal file
File diff suppressed because it is too large
Load diff
29525
www/data/Map042.json
Normal file
29525
www/data/Map042.json
Normal file
File diff suppressed because it is too large
Load diff
4563
www/data/Map043.json
Normal file
4563
www/data/Map043.json
Normal file
File diff suppressed because it is too large
Load diff
10722
www/data/Map044.json
Normal file
10722
www/data/Map044.json
Normal file
File diff suppressed because it is too large
Load diff
10034
www/data/Map045.json
Normal file
10034
www/data/Map045.json
Normal file
File diff suppressed because it is too large
Load diff
14808
www/data/Map046.json
Normal file
14808
www/data/Map046.json
Normal file
File diff suppressed because it is too large
Load diff
13850
www/data/Map047.json
Normal file
13850
www/data/Map047.json
Normal file
File diff suppressed because it is too large
Load diff
11379
www/data/Map048.json
Normal file
11379
www/data/Map048.json
Normal file
File diff suppressed because it is too large
Load diff
46004
www/data/Map049.json
Normal file
46004
www/data/Map049.json
Normal file
File diff suppressed because it is too large
Load diff
18878
www/data/Map050.json
Normal file
18878
www/data/Map050.json
Normal file
File diff suppressed because it is too large
Load diff
66565
www/data/Map052.json
Normal file
66565
www/data/Map052.json
Normal file
File diff suppressed because it is too large
Load diff
33320
www/data/Map053.json
Normal file
33320
www/data/Map053.json
Normal file
File diff suppressed because it is too large
Load diff
11620
www/data/Map054.json
Normal file
11620
www/data/Map054.json
Normal file
File diff suppressed because it is too large
Load diff
11460
www/data/Map055.json
Normal file
11460
www/data/Map055.json
Normal file
File diff suppressed because it is too large
Load diff
1661
www/data/Map056.json
Normal file
1661
www/data/Map056.json
Normal file
File diff suppressed because it is too large
Load diff
1608
www/data/Map057.json
Normal file
1608
www/data/Map057.json
Normal file
File diff suppressed because it is too large
Load diff
6843
www/data/Map058.json
Normal file
6843
www/data/Map058.json
Normal file
File diff suppressed because it is too large
Load diff
18339
www/data/Map059.json
Normal file
18339
www/data/Map059.json
Normal file
File diff suppressed because it is too large
Load diff
3683
www/data/Map060.json
Normal file
3683
www/data/Map060.json
Normal file
File diff suppressed because it is too large
Load diff
3880
www/data/Map061.json
Normal file
3880
www/data/Map061.json
Normal file
File diff suppressed because it is too large
Load diff
488
www/data/MapInfos.json
Normal file
488
www/data/MapInfos.json
Normal file
|
|
@ -0,0 +1,488 @@
|
|||
[
|
||||
null,
|
||||
{
|
||||
"id": 1,
|
||||
"expanded": true,
|
||||
"name": "住処",
|
||||
"order": 1,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"expanded": false,
|
||||
"name": "世界樹",
|
||||
"order": 2,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 681.3333333333334
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"expanded": true,
|
||||
"name": "タワーダンジョン",
|
||||
"order": 10,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 873.3333333333334
|
||||
},
|
||||
null,
|
||||
null,
|
||||
{
|
||||
"id": 6,
|
||||
"expanded": true,
|
||||
"name": "村",
|
||||
"order": 3,
|
||||
"parentId": 0,
|
||||
"scrollX": 1430.6666666666667,
|
||||
"scrollY": 2482.6666666666665
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"expanded": true,
|
||||
"name": "塔1F 転移の間",
|
||||
"order": 11,
|
||||
"parentId": 3,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 1198.6666666666667
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"expanded": false,
|
||||
"name": "塔2F 平原1",
|
||||
"order": 12,
|
||||
"parentId": 3,
|
||||
"scrollX": 2162.6666666666665,
|
||||
"scrollY": 604
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"expanded": true,
|
||||
"name": "塔4F 森1",
|
||||
"order": 14,
|
||||
"parentId": 3,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 2222.6666666666665
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"expanded": false,
|
||||
"name": "塔6F 中ボス1",
|
||||
"order": 17,
|
||||
"parentId": 3,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 748
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"expanded": false,
|
||||
"name": "塔19F 乳液3",
|
||||
"order": 32,
|
||||
"parentId": 3,
|
||||
"scrollX": 2758.6666666666665,
|
||||
"scrollY": 680
|
||||
},
|
||||
null,
|
||||
{
|
||||
"id": 13,
|
||||
"expanded": true,
|
||||
"name": "塔20F 乳液4",
|
||||
"order": 33,
|
||||
"parentId": 3,
|
||||
"scrollX": 3076,
|
||||
"scrollY": 1508
|
||||
},
|
||||
null,
|
||||
{
|
||||
"id": 15,
|
||||
"expanded": false,
|
||||
"name": "塔8F 氷2",
|
||||
"order": 19,
|
||||
"parentId": 3,
|
||||
"scrollX": 1216,
|
||||
"scrollY": 2200
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"expanded": false,
|
||||
"name": "塔7F 氷1",
|
||||
"order": 18,
|
||||
"parentId": 3,
|
||||
"scrollX": 1216,
|
||||
"scrollY": 1900
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"expanded": false,
|
||||
"name": "塔11F 中ボス2",
|
||||
"order": 23,
|
||||
"parentId": 3,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 1593.3333333333333
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"expanded": false,
|
||||
"name": "塔17F 胎動1",
|
||||
"order": 30,
|
||||
"parentId": 3,
|
||||
"scrollX": 2998.6666666666665,
|
||||
"scrollY": 680
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
"expanded": false,
|
||||
"name": "塔18F 胎動2",
|
||||
"order": 31,
|
||||
"parentId": 3,
|
||||
"scrollX": 3168,
|
||||
"scrollY": 604
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
"expanded": false,
|
||||
"name": "塔 ラスボス",
|
||||
"order": 37,
|
||||
"parentId": 3,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 825.3333333333334
|
||||
},
|
||||
{
|
||||
"id": 21,
|
||||
"expanded": false,
|
||||
"name": "隠れの森2",
|
||||
"order": 5,
|
||||
"parentId": 6,
|
||||
"scrollX": 1393.3333333333333,
|
||||
"scrollY": 694.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"expanded": true,
|
||||
"name": "オープニング1",
|
||||
"order": 40,
|
||||
"parentId": 0,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
"expanded": true,
|
||||
"name": "塔21F 中ボス4",
|
||||
"order": 35,
|
||||
"parentId": 3,
|
||||
"scrollX": 1216,
|
||||
"scrollY": 1093.3333333333333
|
||||
},
|
||||
null,
|
||||
{
|
||||
"id": 25,
|
||||
"expanded": false,
|
||||
"name": "隠れの森1",
|
||||
"order": 4,
|
||||
"parentId": 6,
|
||||
"scrollX": 1430.6666666666667,
|
||||
"scrollY": 1796
|
||||
},
|
||||
null,
|
||||
{
|
||||
"id": 27,
|
||||
"expanded": false,
|
||||
"name": "はじまり画面",
|
||||
"order": 39,
|
||||
"parentId": 0,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
null,
|
||||
{
|
||||
"id": 29,
|
||||
"expanded": false,
|
||||
"name": "雪小屋",
|
||||
"order": 22,
|
||||
"parentId": 35,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 30,
|
||||
"expanded": false,
|
||||
"name": "スラム",
|
||||
"order": 6,
|
||||
"parentId": 0,
|
||||
"scrollX": 1430.6666666666667,
|
||||
"scrollY": 1316
|
||||
},
|
||||
{
|
||||
"id": 31,
|
||||
"expanded": true,
|
||||
"name": "塔5F 森2",
|
||||
"order": 15,
|
||||
"parentId": 3,
|
||||
"scrollX": 2432,
|
||||
"scrollY": 1789.3333333333333
|
||||
},
|
||||
{
|
||||
"id": 32,
|
||||
"expanded": true,
|
||||
"name": "コロシアム",
|
||||
"order": 7,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 1305.3333333333333
|
||||
},
|
||||
{
|
||||
"id": 33,
|
||||
"expanded": false,
|
||||
"name": "塔3F 平原2",
|
||||
"order": 13,
|
||||
"parentId": 3,
|
||||
"scrollX": 1216,
|
||||
"scrollY": 1966.6666666666667
|
||||
},
|
||||
{
|
||||
"id": 34,
|
||||
"expanded": false,
|
||||
"name": "塔9F 雪1",
|
||||
"order": 20,
|
||||
"parentId": 3,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 2044
|
||||
},
|
||||
{
|
||||
"id": 35,
|
||||
"expanded": true,
|
||||
"name": "塔10F 雪2",
|
||||
"order": 21,
|
||||
"parentId": 3,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 604
|
||||
},
|
||||
{
|
||||
"id": 36,
|
||||
"expanded": false,
|
||||
"name": "塔12F 火山1",
|
||||
"order": 24,
|
||||
"parentId": 3,
|
||||
"scrollX": 1216,
|
||||
"scrollY": 1892
|
||||
},
|
||||
{
|
||||
"id": 37,
|
||||
"expanded": false,
|
||||
"name": "塔13F 火山2",
|
||||
"order": 25,
|
||||
"parentId": 3,
|
||||
"scrollX": 1216,
|
||||
"scrollY": 2276
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"expanded": true,
|
||||
"name": "塔14F 溶岩1",
|
||||
"order": 26,
|
||||
"parentId": 3,
|
||||
"scrollX": 1216,
|
||||
"scrollY": 1796
|
||||
},
|
||||
{
|
||||
"id": 39,
|
||||
"expanded": true,
|
||||
"name": "塔15F 溶岩2",
|
||||
"order": 27,
|
||||
"parentId": 3,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 604
|
||||
},
|
||||
{
|
||||
"id": 40,
|
||||
"expanded": false,
|
||||
"name": "塔16F 中ボス3",
|
||||
"order": 29,
|
||||
"parentId": 3,
|
||||
"scrollX": 1216.5,
|
||||
"scrollY": 748.5
|
||||
},
|
||||
{
|
||||
"id": 41,
|
||||
"expanded": false,
|
||||
"name": "ツリーハウス",
|
||||
"order": 16,
|
||||
"parentId": 31,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 42,
|
||||
"expanded": true,
|
||||
"name": "ビーチ",
|
||||
"order": 8,
|
||||
"parentId": 0,
|
||||
"scrollX": 2358.6666666666665,
|
||||
"scrollY": 1720
|
||||
},
|
||||
{
|
||||
"id": 43,
|
||||
"expanded": false,
|
||||
"name": "ワールドマップ",
|
||||
"order": 38,
|
||||
"parentId": 0,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 44,
|
||||
"expanded": false,
|
||||
"name": "洞窟",
|
||||
"order": 28,
|
||||
"parentId": 39,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 45,
|
||||
"expanded": false,
|
||||
"name": "小部屋",
|
||||
"order": 34,
|
||||
"parentId": 13,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 46,
|
||||
"expanded": true,
|
||||
"name": "オープニング4",
|
||||
"order": 44,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 985.3333333333334
|
||||
},
|
||||
{
|
||||
"id": 47,
|
||||
"expanded": true,
|
||||
"name": "オープニング3",
|
||||
"order": 43,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 997.3333333333334
|
||||
},
|
||||
{
|
||||
"id": 48,
|
||||
"expanded": true,
|
||||
"name": "オープニング2",
|
||||
"order": 42,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 1006.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 49,
|
||||
"expanded": true,
|
||||
"name": "オープニング5",
|
||||
"order": 45,
|
||||
"parentId": 0,
|
||||
"scrollX": 1390.6666666666667,
|
||||
"scrollY": 2012
|
||||
},
|
||||
{
|
||||
"id": 50,
|
||||
"expanded": false,
|
||||
"name": "オープニング6",
|
||||
"order": 46,
|
||||
"parentId": 0,
|
||||
"scrollX": 1390.6666666666667,
|
||||
"scrollY": 1316
|
||||
},
|
||||
null,
|
||||
{
|
||||
"id": 52,
|
||||
"expanded": false,
|
||||
"name": "回想部屋",
|
||||
"order": 49,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 53,
|
||||
"expanded": false,
|
||||
"name": "ビーチ 海水浴",
|
||||
"order": 9,
|
||||
"parentId": 42,
|
||||
"scrollX": 2432,
|
||||
"scrollY": 1720
|
||||
},
|
||||
{
|
||||
"id": 54,
|
||||
"expanded": true,
|
||||
"name": "オープニング7-2",
|
||||
"order": 48,
|
||||
"parentId": 55,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 790.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 55,
|
||||
"expanded": true,
|
||||
"name": "オープニング7-1",
|
||||
"order": 47,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 1305.3333333333333
|
||||
},
|
||||
{
|
||||
"id": 56,
|
||||
"expanded": false,
|
||||
"name": "オープニング1-2",
|
||||
"order": 41,
|
||||
"parentId": 22,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 57,
|
||||
"expanded": false,
|
||||
"name": "スプラッシュ",
|
||||
"order": 50,
|
||||
"parentId": 0,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 58,
|
||||
"expanded": false,
|
||||
"name": "最上階への廊下",
|
||||
"order": 36,
|
||||
"parentId": 23,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 1093.3333333333333
|
||||
},
|
||||
{
|
||||
"id": 59,
|
||||
"expanded": true,
|
||||
"name": "エンディング",
|
||||
"order": 51,
|
||||
"parentId": 0,
|
||||
"scrollX": 1081.3333333333333,
|
||||
"scrollY": 998.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 60,
|
||||
"expanded": true,
|
||||
"name": "ハッピーエンド",
|
||||
"order": 52,
|
||||
"parentId": 59,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
},
|
||||
{
|
||||
"id": 61,
|
||||
"expanded": true,
|
||||
"name": "バッドエンド",
|
||||
"order": 53,
|
||||
"parentId": 59,
|
||||
"scrollX": 1092,
|
||||
"scrollY": 614.6666666666666
|
||||
}
|
||||
]
|
||||
15340
www/data/Skills.json
Normal file
15340
www/data/Skills.json
Normal file
File diff suppressed because it is too large
Load diff
2177
www/data/States.json
Normal file
2177
www/data/States.json
Normal file
File diff suppressed because it is too large
Load diff
1288
www/data/System.json
Normal file
1288
www/data/System.json
Normal file
File diff suppressed because it is too large
Load diff
176097
www/data/Tilesets.json
Normal file
176097
www/data/Tilesets.json
Normal file
File diff suppressed because it is too large
Load diff
18923
www/data/Troops.json
Normal file
18923
www/data/Troops.json
Normal file
File diff suppressed because it is too large
Load diff
3885
www/data/Weapons.json
Normal file
3885
www/data/Weapons.json
Normal file
File diff suppressed because it is too large
Load diff
445
www/js/libs/fpsmeter.js
Normal file
445
www/js/libs/fpsmeter.js
Normal file
|
|
@ -0,0 +1,445 @@
|
|||
/*! FPSMeter 0.3.1 - 9th May 2013 | https://github.com/Darsain/fpsmeter */
|
||||
(function (m, j) {
|
||||
function s(a, e) {
|
||||
for (var g in e)
|
||||
try {
|
||||
a.style[g] = e[g];
|
||||
} catch (j) {}
|
||||
return a;
|
||||
}
|
||||
function H(a) {
|
||||
return null == a
|
||||
? String(a)
|
||||
: "object" === typeof a || "function" === typeof a
|
||||
? Object.prototype.toString
|
||||
.call(a)
|
||||
.match(/\s([a-z]+)/i)[1]
|
||||
.toLowerCase() || "object"
|
||||
: typeof a;
|
||||
}
|
||||
function R(a, e) {
|
||||
if ("array" !== H(e)) return -1;
|
||||
if (e.indexOf) return e.indexOf(a);
|
||||
for (var g = 0, j = e.length; g < j; g++) if (e[g] === a) return g;
|
||||
return -1;
|
||||
}
|
||||
function I() {
|
||||
var a = arguments,
|
||||
e;
|
||||
for (e in a[1])
|
||||
if (a[1].hasOwnProperty(e))
|
||||
switch (H(a[1][e])) {
|
||||
case "object":
|
||||
a[0][e] = I({}, a[0][e], a[1][e]);
|
||||
break;
|
||||
case "array":
|
||||
a[0][e] = a[1][e].slice(0);
|
||||
break;
|
||||
default:
|
||||
a[0][e] = a[1][e];
|
||||
}
|
||||
return 2 < a.length
|
||||
? I.apply(null, [a[0]].concat(Array.prototype.slice.call(a, 2)))
|
||||
: a[0];
|
||||
}
|
||||
function N(a) {
|
||||
a = Math.round(255 * a).toString(16);
|
||||
return 1 === a.length ? "0" + a : a;
|
||||
}
|
||||
function S(a, e, g, j) {
|
||||
if (a.addEventListener)
|
||||
a[j ? "removeEventListener" : "addEventListener"](e, g, !1);
|
||||
else if (a.attachEvent) a[j ? "detachEvent" : "attachEvent"]("on" + e, g);
|
||||
}
|
||||
function D(a, e) {
|
||||
function g(a, b, d, c) {
|
||||
return y[0 | a][Math.round(Math.min(((b - d) / (c - d)) * J, J))];
|
||||
}
|
||||
function r() {
|
||||
f.legend.fps !== q &&
|
||||
((f.legend.fps = q), (f.legend[T] = q ? "FPS" : "ms"));
|
||||
K = q ? b.fps : b.duration;
|
||||
f.count[T] = 999 < K ? "999+" : K.toFixed(99 < K ? 0 : d.decimals);
|
||||
}
|
||||
function m() {
|
||||
z = A();
|
||||
L < z - d.threshold &&
|
||||
((b.fps -= b.fps / Math.max(1, (60 * d.smoothing) / d.interval)),
|
||||
(b.duration = 1e3 / b.fps));
|
||||
for (c = d.history; c--; )
|
||||
(E[c] = 0 === c ? b.fps : E[c - 1]),
|
||||
(F[c] = 0 === c ? b.duration : F[c - 1]);
|
||||
r();
|
||||
if (d.heat) {
|
||||
if (w.length)
|
||||
for (c = w.length; c--; )
|
||||
w[c].el.style[h[w[c].name].heatOn] = q
|
||||
? g(h[w[c].name].heatmap, b.fps, 0, d.maxFps)
|
||||
: g(h[w[c].name].heatmap, b.duration, d.threshold, 0);
|
||||
if (f.graph && h.column.heatOn)
|
||||
for (c = u.length; c--; )
|
||||
u[c].style[h.column.heatOn] = q
|
||||
? g(h.column.heatmap, E[c], 0, d.maxFps)
|
||||
: g(h.column.heatmap, F[c], d.threshold, 0);
|
||||
}
|
||||
if (f.graph)
|
||||
for (p = 0; p < d.history; p++)
|
||||
u[p].style.height =
|
||||
(q
|
||||
? E[p]
|
||||
? Math.round((O / d.maxFps) * Math.min(E[p], d.maxFps))
|
||||
: 0
|
||||
: F[p]
|
||||
? Math.round((O / d.threshold) * Math.min(F[p], d.threshold))
|
||||
: 0) + "px";
|
||||
}
|
||||
function k() {
|
||||
20 > d.interval
|
||||
? ((x = M(k)), m())
|
||||
: ((x = setTimeout(k, d.interval)), (P = M(m)));
|
||||
}
|
||||
function G(a) {
|
||||
a = a || window.event;
|
||||
a.preventDefault
|
||||
? (a.preventDefault(), a.stopPropagation())
|
||||
: ((a.returnValue = !1), (a.cancelBubble = !0));
|
||||
b.toggle();
|
||||
}
|
||||
function U() {
|
||||
d.toggleOn && S(f.container, d.toggleOn, G, 1);
|
||||
a.removeChild(f.container);
|
||||
}
|
||||
function V() {
|
||||
f.container && U();
|
||||
h = D.theme[d.theme];
|
||||
y = h.compiledHeatmaps || [];
|
||||
if (!y.length && h.heatmaps.length) {
|
||||
for (p = 0; p < h.heatmaps.length; p++) {
|
||||
y[p] = [];
|
||||
for (c = 0; c <= J; c++) {
|
||||
var b = y[p],
|
||||
e = c,
|
||||
g;
|
||||
g = (0.33 / J) * c;
|
||||
var j = h.heatmaps[p].saturation,
|
||||
m = h.heatmaps[p].lightness,
|
||||
n = void 0,
|
||||
k = void 0,
|
||||
l = void 0,
|
||||
t = (l = void 0),
|
||||
v = (n = k = void 0),
|
||||
v = void 0,
|
||||
l = 0.5 >= m ? m * (1 + j) : m + j - m * j;
|
||||
0 === l
|
||||
? (g = "#000")
|
||||
: ((t = 2 * m - l),
|
||||
(k = (l - t) / l),
|
||||
(g *= 6),
|
||||
(n = Math.floor(g)),
|
||||
(v = g - n),
|
||||
(v *= l * k),
|
||||
0 === n || 6 === n
|
||||
? ((n = l), (k = t + v), (l = t))
|
||||
: 1 === n
|
||||
? ((n = l - v), (k = l), (l = t))
|
||||
: 2 === n
|
||||
? ((n = t), (k = l), (l = t + v))
|
||||
: 3 === n
|
||||
? ((n = t), (k = l - v))
|
||||
: 4 === n
|
||||
? ((n = t + v), (k = t))
|
||||
: ((n = l), (k = t), (l -= v)),
|
||||
(g = "#" + N(n) + N(k) + N(l)));
|
||||
b[e] = g;
|
||||
}
|
||||
}
|
||||
h.compiledHeatmaps = y;
|
||||
}
|
||||
f.container = s(document.createElement("div"), h.container);
|
||||
f.count = f.container.appendChild(
|
||||
s(document.createElement("div"), h.count)
|
||||
);
|
||||
f.legend = f.container.appendChild(
|
||||
s(document.createElement("div"), h.legend)
|
||||
);
|
||||
f.graph = d.graph
|
||||
? f.container.appendChild(s(document.createElement("div"), h.graph))
|
||||
: 0;
|
||||
w.length = 0;
|
||||
for (var q in f) f[q] && h[q].heatOn && w.push({ name: q, el: f[q] });
|
||||
u.length = 0;
|
||||
if (f.graph) {
|
||||
f.graph.style.width =
|
||||
d.history * h.column.width +
|
||||
(d.history - 1) * h.column.spacing +
|
||||
"px";
|
||||
for (c = 0; c < d.history; c++)
|
||||
(u[c] = f.graph.appendChild(
|
||||
s(document.createElement("div"), h.column)
|
||||
)),
|
||||
(u[c].style.position = "absolute"),
|
||||
(u[c].style.bottom = 0),
|
||||
(u[c].style.right =
|
||||
c * h.column.width + c * h.column.spacing + "px"),
|
||||
(u[c].style.width = h.column.width + "px"),
|
||||
(u[c].style.height = "0px");
|
||||
}
|
||||
s(f.container, d);
|
||||
r();
|
||||
a.appendChild(f.container);
|
||||
f.graph && (O = f.graph.clientHeight);
|
||||
d.toggleOn &&
|
||||
("click" === d.toggleOn && (f.container.style.cursor = "pointer"),
|
||||
S(f.container, d.toggleOn, G));
|
||||
}
|
||||
"object" === H(a) && a.nodeType === j && ((e = a), (a = document.body));
|
||||
a || (a = document.body);
|
||||
var b = this,
|
||||
d = I({}, D.defaults, e || {}),
|
||||
f = {},
|
||||
u = [],
|
||||
h,
|
||||
y,
|
||||
J = 100,
|
||||
w = [],
|
||||
W = 0,
|
||||
B = d.threshold,
|
||||
Q = 0,
|
||||
L = A() - B,
|
||||
z,
|
||||
E = [],
|
||||
F = [],
|
||||
x,
|
||||
P,
|
||||
q = "fps" === d.show,
|
||||
O,
|
||||
K,
|
||||
c,
|
||||
p;
|
||||
b.options = d;
|
||||
b.fps = 0;
|
||||
b.duration = 0;
|
||||
b.isPaused = 0;
|
||||
b.tickStart = function () {
|
||||
Q = A();
|
||||
};
|
||||
b.tick = function () {
|
||||
z = A();
|
||||
W = z - L;
|
||||
B += (W - B) / d.smoothing;
|
||||
b.fps = 1e3 / B;
|
||||
b.duration = Q < L ? B : z - Q;
|
||||
L = z;
|
||||
};
|
||||
b.pause = function () {
|
||||
x && ((b.isPaused = 1), clearTimeout(x), C(x), C(P), (x = P = 0));
|
||||
return b;
|
||||
};
|
||||
b.resume = function () {
|
||||
x || ((b.isPaused = 0), k());
|
||||
return b;
|
||||
};
|
||||
b.set = function (a, c) {
|
||||
d[a] = c;
|
||||
q = "fps" === d.show;
|
||||
-1 !== R(a, X) && V();
|
||||
-1 !== R(a, Y) && s(f.container, d);
|
||||
return b;
|
||||
};
|
||||
b.showDuration = function () {
|
||||
b.set("show", "ms");
|
||||
return b;
|
||||
};
|
||||
b.showFps = function () {
|
||||
b.set("show", "fps");
|
||||
return b;
|
||||
};
|
||||
b.toggle = function () {
|
||||
b.set("show", q ? "ms" : "fps");
|
||||
return b;
|
||||
};
|
||||
b.hide = function () {
|
||||
b.pause();
|
||||
f.container.style.display = "none";
|
||||
return b;
|
||||
};
|
||||
b.show = function () {
|
||||
b.resume();
|
||||
f.container.style.display = "block";
|
||||
return b;
|
||||
};
|
||||
b.destroy = function () {
|
||||
b.pause();
|
||||
U();
|
||||
b.tick = b.tickStart = function () {};
|
||||
};
|
||||
V();
|
||||
k();
|
||||
}
|
||||
var A,
|
||||
r = m.performance;
|
||||
A =
|
||||
r && (r.now || r.webkitNow)
|
||||
? r[r.now ? "now" : "webkitNow"].bind(r)
|
||||
: function () {
|
||||
return +new Date();
|
||||
};
|
||||
for (
|
||||
var C = m.cancelAnimationFrame || m.cancelRequestAnimationFrame,
|
||||
M = m.requestAnimationFrame,
|
||||
r = ["moz", "webkit", "o"],
|
||||
G = 0,
|
||||
k = 0,
|
||||
Z = r.length;
|
||||
k < Z && !C;
|
||||
++k
|
||||
)
|
||||
M =
|
||||
(C =
|
||||
m[r[k] + "CancelAnimationFrame"] ||
|
||||
m[r[k] + "CancelRequestAnimationFrame"]) &&
|
||||
m[r[k] + "RequestAnimationFrame"];
|
||||
C ||
|
||||
((M = function (a) {
|
||||
var e = A(),
|
||||
g = Math.max(0, 16 - (e - G));
|
||||
G = e + g;
|
||||
return m.setTimeout(function () {
|
||||
a(e + g);
|
||||
}, g);
|
||||
}),
|
||||
(C = function (a) {
|
||||
clearTimeout(a);
|
||||
}));
|
||||
var T =
|
||||
"string" === H(document.createElement("div").textContent)
|
||||
? "textContent"
|
||||
: "innerText";
|
||||
D.extend = I;
|
||||
window.FPSMeter = D;
|
||||
D.defaults = {
|
||||
interval: 100,
|
||||
smoothing: 10,
|
||||
show: "fps",
|
||||
toggleOn: "click",
|
||||
decimals: 1,
|
||||
maxFps: 60,
|
||||
threshold: 100,
|
||||
position: "absolute",
|
||||
zIndex: 10,
|
||||
left: "5px",
|
||||
top: "5px",
|
||||
right: "auto",
|
||||
bottom: "auto",
|
||||
margin: "0 0 0 0",
|
||||
theme: "dark",
|
||||
heat: 0,
|
||||
graph: 0,
|
||||
history: 20,
|
||||
};
|
||||
var X = ["toggleOn", "theme", "heat", "graph", "history"],
|
||||
Y = "position zIndex left top right bottom margin".split(" ");
|
||||
})(window);
|
||||
(function (m, j) {
|
||||
j.theme = {};
|
||||
var s = (j.theme.base = {
|
||||
heatmaps: [],
|
||||
container: {
|
||||
heatOn: null,
|
||||
heatmap: null,
|
||||
padding: "5px",
|
||||
minWidth: "95px",
|
||||
height: "30px",
|
||||
lineHeight: "30px",
|
||||
textAlign: "right",
|
||||
textShadow: "none",
|
||||
},
|
||||
count: {
|
||||
heatOn: null,
|
||||
heatmap: null,
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
right: 0,
|
||||
padding: "5px 10px",
|
||||
height: "30px",
|
||||
fontSize: "24px",
|
||||
fontFamily: "Consolas, Andale Mono, monospace",
|
||||
zIndex: 2,
|
||||
},
|
||||
legend: {
|
||||
heatOn: null,
|
||||
heatmap: null,
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
padding: "5px 10px",
|
||||
height: "30px",
|
||||
fontSize: "12px",
|
||||
lineHeight: "32px",
|
||||
fontFamily: "sans-serif",
|
||||
textAlign: "left",
|
||||
zIndex: 2,
|
||||
},
|
||||
graph: {
|
||||
heatOn: null,
|
||||
heatmap: null,
|
||||
position: "relative",
|
||||
boxSizing: "padding-box",
|
||||
MozBoxSizing: "padding-box",
|
||||
height: "100%",
|
||||
zIndex: 1,
|
||||
},
|
||||
column: { width: 4, spacing: 1, heatOn: null, heatmap: null },
|
||||
});
|
||||
j.theme.dark = j.extend({}, s, {
|
||||
heatmaps: [{ saturation: 0.8, lightness: 0.8 }],
|
||||
container: {
|
||||
background: "#222",
|
||||
color: "#fff",
|
||||
border: "1px solid #1a1a1a",
|
||||
textShadow: "1px 1px 0 #222",
|
||||
},
|
||||
count: { heatOn: "color" },
|
||||
column: { background: "#3f3f3f" },
|
||||
});
|
||||
j.theme.light = j.extend({}, s, {
|
||||
heatmaps: [{ saturation: 0.5, lightness: 0.5 }],
|
||||
container: {
|
||||
color: "#666",
|
||||
background: "#fff",
|
||||
textShadow:
|
||||
"1px 1px 0 rgba(255,255,255,.5), -1px -1px 0 rgba(255,255,255,.5)",
|
||||
boxShadow: "0 0 0 1px rgba(0,0,0,.1)",
|
||||
},
|
||||
count: { heatOn: "color" },
|
||||
column: { background: "#eaeaea" },
|
||||
});
|
||||
j.theme.colorful = j.extend({}, s, {
|
||||
heatmaps: [{ saturation: 0.5, lightness: 0.6 }],
|
||||
container: {
|
||||
heatOn: "backgroundColor",
|
||||
background: "#888",
|
||||
color: "#fff",
|
||||
textShadow: "1px 1px 0 rgba(0,0,0,.2)",
|
||||
boxShadow: "0 0 0 1px rgba(0,0,0,.1)",
|
||||
},
|
||||
column: { background: "#777", backgroundColor: "rgba(0,0,0,.2)" },
|
||||
});
|
||||
j.theme.transparent = j.extend({}, s, {
|
||||
heatmaps: [{ saturation: 0.8, lightness: 0.5 }],
|
||||
container: {
|
||||
padding: 0,
|
||||
color: "#fff",
|
||||
textShadow: "1px 1px 0 rgba(0,0,0,.5)",
|
||||
},
|
||||
count: { padding: "0 5px", height: "40px", lineHeight: "40px" },
|
||||
legend: { padding: "0 5px", height: "40px", lineHeight: "42px" },
|
||||
graph: { height: "40px" },
|
||||
column: {
|
||||
width: 5,
|
||||
background: "#999",
|
||||
heatOn: "backgroundColor",
|
||||
opacity: 0.5,
|
||||
},
|
||||
});
|
||||
})(window, FPSMeter);
|
||||
207
www/js/libs/iphone-inline-video.browser.js
Normal file
207
www/js/libs/iphone-inline-video.browser.js
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
/*! npm.im/iphone-inline-video */
|
||||
var makeVideoPlayableInline = (function () {
|
||||
"use strict"; /*! npm.im/intervalometer */
|
||||
function e(e, n, r, i) {
|
||||
function t(r) {
|
||||
(d = n(t, i)), e(r - (a || r)), (a = r);
|
||||
}
|
||||
var d, a;
|
||||
return {
|
||||
start: function () {
|
||||
d || t(0);
|
||||
},
|
||||
stop: function () {
|
||||
r(d), (d = null), (a = 0);
|
||||
},
|
||||
};
|
||||
}
|
||||
function n(n) {
|
||||
return e(n, requestAnimationFrame, cancelAnimationFrame);
|
||||
}
|
||||
function r(e, n, r, i) {
|
||||
function t(n) {
|
||||
Boolean(e[r]) === Boolean(i) && n.stopImmediatePropagation(), delete e[r];
|
||||
}
|
||||
return e.addEventListener(n, t, !1), t;
|
||||
}
|
||||
function i(e, n, r, i) {
|
||||
function t() {
|
||||
return r[n];
|
||||
}
|
||||
function d(e) {
|
||||
r[n] = e;
|
||||
}
|
||||
i && d(e[n]), Object.defineProperty(e, n, { get: t, set: d });
|
||||
}
|
||||
function t(e, n, r) {
|
||||
r.addEventListener(n, function () {
|
||||
return e.dispatchEvent(new Event(n));
|
||||
});
|
||||
}
|
||||
function d(e, n) {
|
||||
Promise.resolve().then(function () {
|
||||
e.dispatchEvent(new Event(n));
|
||||
});
|
||||
}
|
||||
function a(e) {
|
||||
var n = new Audio();
|
||||
return (
|
||||
t(e, "play", n),
|
||||
t(e, "playing", n),
|
||||
t(e, "pause", n),
|
||||
(n.crossOrigin = e.crossOrigin),
|
||||
(n.src = e.src || e.currentSrc || "data:"),
|
||||
n
|
||||
);
|
||||
}
|
||||
function o(e, n, r) {
|
||||
(m || 0) + 200 < Date.now() && ((e[g] = !0), (m = Date.now())),
|
||||
r || (e.currentTime = n),
|
||||
(A[++k % 3] = (100 * n) | 0);
|
||||
}
|
||||
function u(e) {
|
||||
return e.driver.currentTime >= e.video.duration;
|
||||
}
|
||||
function s(e) {
|
||||
var n = this;
|
||||
n.video.readyState >= n.video.HAVE_FUTURE_DATA
|
||||
? (n.hasAudio ||
|
||||
((n.driver.currentTime =
|
||||
n.video.currentTime + (e * n.video.playbackRate) / 1e3),
|
||||
n.video.loop && u(n) && (n.driver.currentTime = 0)),
|
||||
o(n.video, n.driver.currentTime))
|
||||
: n.video.networkState !== n.video.NETWORK_IDLE ||
|
||||
n.video.buffered.length ||
|
||||
n.video.load(),
|
||||
n.video.ended && (delete n.video[g], n.video.pause(!0));
|
||||
}
|
||||
function c() {
|
||||
var e = this,
|
||||
n = e[b];
|
||||
return e.webkitDisplayingFullscreen
|
||||
? void e[E]()
|
||||
: ("data:" !== n.driver.src &&
|
||||
n.driver.src !== e.src &&
|
||||
(o(e, 0, !0), (n.driver.src = e.src)),
|
||||
void (
|
||||
e.paused &&
|
||||
((n.paused = !1),
|
||||
e.buffered.length || e.load(),
|
||||
n.driver.play(),
|
||||
n.updater.start(),
|
||||
n.hasAudio ||
|
||||
(d(e, "play"),
|
||||
n.video.readyState >= n.video.HAVE_ENOUGH_DATA && d(e, "playing")))
|
||||
));
|
||||
}
|
||||
function v(e) {
|
||||
var n = this,
|
||||
r = n[b];
|
||||
r.driver.pause(),
|
||||
r.updater.stop(),
|
||||
n.webkitDisplayingFullscreen && n[T](),
|
||||
(r.paused && !e) ||
|
||||
((r.paused = !0),
|
||||
r.hasAudio || d(n, "pause"),
|
||||
n.ended && ((n[g] = !0), d(n, "ended")));
|
||||
}
|
||||
function p(e, r) {
|
||||
var i = (e[b] = {});
|
||||
(i.paused = !0),
|
||||
(i.hasAudio = r),
|
||||
(i.video = e),
|
||||
(i.updater = n(s.bind(i))),
|
||||
r
|
||||
? (i.driver = a(e))
|
||||
: (e.addEventListener("canplay", function () {
|
||||
e.paused || d(e, "playing");
|
||||
}),
|
||||
(i.driver = {
|
||||
src: e.src || e.currentSrc || "data:",
|
||||
muted: !0,
|
||||
paused: !0,
|
||||
pause: function () {
|
||||
i.driver.paused = !0;
|
||||
},
|
||||
play: function () {
|
||||
(i.driver.paused = !1), u(i) && o(e, 0);
|
||||
},
|
||||
get ended() {
|
||||
return u(i);
|
||||
},
|
||||
})),
|
||||
e.addEventListener(
|
||||
"emptied",
|
||||
function () {
|
||||
var n = !i.driver.src || "data:" === i.driver.src;
|
||||
i.driver.src &&
|
||||
i.driver.src !== e.src &&
|
||||
(o(e, 0, !0),
|
||||
(i.driver.src = e.src),
|
||||
n ? i.driver.play() : i.updater.stop());
|
||||
},
|
||||
!1
|
||||
),
|
||||
e.addEventListener("webkitbeginfullscreen", function () {
|
||||
e.paused
|
||||
? r && !i.driver.buffered.length && i.driver.load()
|
||||
: (e.pause(), e[E]());
|
||||
}),
|
||||
r &&
|
||||
(e.addEventListener("webkitendfullscreen", function () {
|
||||
i.driver.currentTime = e.currentTime;
|
||||
}),
|
||||
e.addEventListener("seeking", function () {
|
||||
A.indexOf((100 * e.currentTime) | 0) < 0 &&
|
||||
(i.driver.currentTime = e.currentTime);
|
||||
}));
|
||||
}
|
||||
function l(e) {
|
||||
var n = e[b];
|
||||
(e[E] = e.play),
|
||||
(e[T] = e.pause),
|
||||
(e.play = c),
|
||||
(e.pause = v),
|
||||
i(e, "paused", n.driver),
|
||||
i(e, "muted", n.driver, !0),
|
||||
i(e, "playbackRate", n.driver, !0),
|
||||
i(e, "ended", n.driver),
|
||||
i(e, "loop", n.driver, !0),
|
||||
r(e, "seeking"),
|
||||
r(e, "seeked"),
|
||||
r(e, "timeupdate", g, !1),
|
||||
r(e, "ended", g, !1);
|
||||
}
|
||||
function f(e, n, r) {
|
||||
void 0 === n && (n = !0),
|
||||
void 0 === r && (r = !0),
|
||||
(r && !h) ||
|
||||
e[b] ||
|
||||
(p(e, n),
|
||||
l(e),
|
||||
e.classList.add("IIV"),
|
||||
!n && e.autoplay && e.play(),
|
||||
/iPhone|iPod|iPad/.test(navigator.platform) ||
|
||||
console.warn(
|
||||
"iphone-inline-video is not guaranteed to work in emulated environments"
|
||||
));
|
||||
}
|
||||
var m,
|
||||
y =
|
||||
"undefined" == typeof Symbol
|
||||
? function (e) {
|
||||
return "@" + (e || "@") + Math.random();
|
||||
}
|
||||
: Symbol,
|
||||
h =
|
||||
"object-fit" in document.head.style &&
|
||||
/iPhone|iPod/i.test(navigator.userAgent) &&
|
||||
!matchMedia("(-webkit-video-playable-inline)").matches,
|
||||
b = y(),
|
||||
g = y(),
|
||||
E = y("nativeplay"),
|
||||
T = y("nativepause"),
|
||||
A = [],
|
||||
k = 0;
|
||||
return (f.isWhitelisted = h), f;
|
||||
})();
|
||||
629
www/js/libs/lz-string.js
Normal file
629
www/js/libs/lz-string.js
Normal file
|
|
@ -0,0 +1,629 @@
|
|||
var LZString = {
|
||||
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
||||
_f: String.fromCharCode,
|
||||
compressToBase64: function (e) {
|
||||
if (e == null) return "";
|
||||
var t = "";
|
||||
var n, r, i, s, o, u, a;
|
||||
var f = 0;
|
||||
e = LZString.compress(e);
|
||||
while (f < e.length * 2) {
|
||||
if (f % 2 == 0) {
|
||||
n = e.charCodeAt(f / 2) >> 8;
|
||||
r = e.charCodeAt(f / 2) & 255;
|
||||
if (f / 2 + 1 < e.length) i = e.charCodeAt(f / 2 + 1) >> 8;
|
||||
else i = NaN;
|
||||
} else {
|
||||
n = e.charCodeAt((f - 1) / 2) & 255;
|
||||
if ((f + 1) / 2 < e.length) {
|
||||
r = e.charCodeAt((f + 1) / 2) >> 8;
|
||||
i = e.charCodeAt((f + 1) / 2) & 255;
|
||||
} else r = i = NaN;
|
||||
}
|
||||
f += 3;
|
||||
s = n >> 2;
|
||||
o = ((n & 3) << 4) | (r >> 4);
|
||||
u = ((r & 15) << 2) | (i >> 6);
|
||||
a = i & 63;
|
||||
if (isNaN(r)) {
|
||||
u = a = 64;
|
||||
} else if (isNaN(i)) {
|
||||
a = 64;
|
||||
}
|
||||
t =
|
||||
t +
|
||||
LZString._keyStr.charAt(s) +
|
||||
LZString._keyStr.charAt(o) +
|
||||
LZString._keyStr.charAt(u) +
|
||||
LZString._keyStr.charAt(a);
|
||||
}
|
||||
return t;
|
||||
},
|
||||
decompressFromBase64: function (e) {
|
||||
if (e == null) return "";
|
||||
var t = "",
|
||||
n = 0,
|
||||
r,
|
||||
i,
|
||||
s,
|
||||
o,
|
||||
u,
|
||||
a,
|
||||
f,
|
||||
l,
|
||||
c = 0,
|
||||
h = LZString._f;
|
||||
e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "");
|
||||
while (c < e.length) {
|
||||
u = LZString._keyStr.indexOf(e.charAt(c++));
|
||||
a = LZString._keyStr.indexOf(e.charAt(c++));
|
||||
f = LZString._keyStr.indexOf(e.charAt(c++));
|
||||
l = LZString._keyStr.indexOf(e.charAt(c++));
|
||||
i = (u << 2) | (a >> 4);
|
||||
s = ((a & 15) << 4) | (f >> 2);
|
||||
o = ((f & 3) << 6) | l;
|
||||
if (n % 2 == 0) {
|
||||
r = i << 8;
|
||||
if (f != 64) {
|
||||
t += h(r | s);
|
||||
}
|
||||
if (l != 64) {
|
||||
r = o << 8;
|
||||
}
|
||||
} else {
|
||||
t = t + h(r | i);
|
||||
if (f != 64) {
|
||||
r = s << 8;
|
||||
}
|
||||
if (l != 64) {
|
||||
t += h(r | o);
|
||||
}
|
||||
}
|
||||
n += 3;
|
||||
}
|
||||
return LZString.decompress(t);
|
||||
},
|
||||
compressToUTF16: function (e) {
|
||||
if (e == null) return "";
|
||||
var t = "",
|
||||
n,
|
||||
r,
|
||||
i,
|
||||
s = 0,
|
||||
o = LZString._f;
|
||||
e = LZString.compress(e);
|
||||
for (n = 0; n < e.length; n++) {
|
||||
r = e.charCodeAt(n);
|
||||
switch (s++) {
|
||||
case 0:
|
||||
t += o((r >> 1) + 32);
|
||||
i = (r & 1) << 14;
|
||||
break;
|
||||
case 1:
|
||||
t += o(i + (r >> 2) + 32);
|
||||
i = (r & 3) << 13;
|
||||
break;
|
||||
case 2:
|
||||
t += o(i + (r >> 3) + 32);
|
||||
i = (r & 7) << 12;
|
||||
break;
|
||||
case 3:
|
||||
t += o(i + (r >> 4) + 32);
|
||||
i = (r & 15) << 11;
|
||||
break;
|
||||
case 4:
|
||||
t += o(i + (r >> 5) + 32);
|
||||
i = (r & 31) << 10;
|
||||
break;
|
||||
case 5:
|
||||
t += o(i + (r >> 6) + 32);
|
||||
i = (r & 63) << 9;
|
||||
break;
|
||||
case 6:
|
||||
t += o(i + (r >> 7) + 32);
|
||||
i = (r & 127) << 8;
|
||||
break;
|
||||
case 7:
|
||||
t += o(i + (r >> 8) + 32);
|
||||
i = (r & 255) << 7;
|
||||
break;
|
||||
case 8:
|
||||
t += o(i + (r >> 9) + 32);
|
||||
i = (r & 511) << 6;
|
||||
break;
|
||||
case 9:
|
||||
t += o(i + (r >> 10) + 32);
|
||||
i = (r & 1023) << 5;
|
||||
break;
|
||||
case 10:
|
||||
t += o(i + (r >> 11) + 32);
|
||||
i = (r & 2047) << 4;
|
||||
break;
|
||||
case 11:
|
||||
t += o(i + (r >> 12) + 32);
|
||||
i = (r & 4095) << 3;
|
||||
break;
|
||||
case 12:
|
||||
t += o(i + (r >> 13) + 32);
|
||||
i = (r & 8191) << 2;
|
||||
break;
|
||||
case 13:
|
||||
t += o(i + (r >> 14) + 32);
|
||||
i = (r & 16383) << 1;
|
||||
break;
|
||||
case 14:
|
||||
t += o(i + (r >> 15) + 32, (r & 32767) + 32);
|
||||
s = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return t + o(i + 32);
|
||||
},
|
||||
decompressFromUTF16: function (e) {
|
||||
if (e == null) return "";
|
||||
var t = "",
|
||||
n,
|
||||
r,
|
||||
i = 0,
|
||||
s = 0,
|
||||
o = LZString._f;
|
||||
while (s < e.length) {
|
||||
r = e.charCodeAt(s) - 32;
|
||||
switch (i++) {
|
||||
case 0:
|
||||
n = r << 1;
|
||||
break;
|
||||
case 1:
|
||||
t += o(n | (r >> 14));
|
||||
n = (r & 16383) << 2;
|
||||
break;
|
||||
case 2:
|
||||
t += o(n | (r >> 13));
|
||||
n = (r & 8191) << 3;
|
||||
break;
|
||||
case 3:
|
||||
t += o(n | (r >> 12));
|
||||
n = (r & 4095) << 4;
|
||||
break;
|
||||
case 4:
|
||||
t += o(n | (r >> 11));
|
||||
n = (r & 2047) << 5;
|
||||
break;
|
||||
case 5:
|
||||
t += o(n | (r >> 10));
|
||||
n = (r & 1023) << 6;
|
||||
break;
|
||||
case 6:
|
||||
t += o(n | (r >> 9));
|
||||
n = (r & 511) << 7;
|
||||
break;
|
||||
case 7:
|
||||
t += o(n | (r >> 8));
|
||||
n = (r & 255) << 8;
|
||||
break;
|
||||
case 8:
|
||||
t += o(n | (r >> 7));
|
||||
n = (r & 127) << 9;
|
||||
break;
|
||||
case 9:
|
||||
t += o(n | (r >> 6));
|
||||
n = (r & 63) << 10;
|
||||
break;
|
||||
case 10:
|
||||
t += o(n | (r >> 5));
|
||||
n = (r & 31) << 11;
|
||||
break;
|
||||
case 11:
|
||||
t += o(n | (r >> 4));
|
||||
n = (r & 15) << 12;
|
||||
break;
|
||||
case 12:
|
||||
t += o(n | (r >> 3));
|
||||
n = (r & 7) << 13;
|
||||
break;
|
||||
case 13:
|
||||
t += o(n | (r >> 2));
|
||||
n = (r & 3) << 14;
|
||||
break;
|
||||
case 14:
|
||||
t += o(n | (r >> 1));
|
||||
n = (r & 1) << 15;
|
||||
break;
|
||||
case 15:
|
||||
t += o(n | r);
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
return LZString.decompress(t);
|
||||
},
|
||||
compressToUint8Array: function (e) {
|
||||
var t = LZString.compress(e);
|
||||
var n = new Uint8Array(t.length * 2);
|
||||
for (var r = 0, i = t.length; r < i; r++) {
|
||||
var s = t.charCodeAt(r);
|
||||
n[r * 2] = s >>> 8;
|
||||
n[r * 2 + 1] = s % 256;
|
||||
}
|
||||
return n;
|
||||
},
|
||||
decompressFromUint8Array: function (e) {
|
||||
if (e === null || e === undefined) {
|
||||
return LZString.decompress(e);
|
||||
} else {
|
||||
var t = new Array(e.length / 2);
|
||||
for (var n = 0, r = t.length; n < r; n++) {
|
||||
t[n] = e[n * 2] * 256 + e[n * 2 + 1];
|
||||
}
|
||||
return LZString.decompress(String.fromCharCode.apply(null, t));
|
||||
}
|
||||
},
|
||||
compressToEncodedURIComponent: function (e) {
|
||||
return LZString.compressToBase64(e).replace(/=/g, "$").replace(/\//g, "-");
|
||||
},
|
||||
decompressFromEncodedURIComponent: function (e) {
|
||||
if (e) e = e.replace(/$/g, "=").replace(/-/g, "/");
|
||||
return LZString.decompressFromBase64(e);
|
||||
},
|
||||
compress: function (e) {
|
||||
if (e == null) return "";
|
||||
var t,
|
||||
n,
|
||||
r = {},
|
||||
i = {},
|
||||
s = "",
|
||||
o = "",
|
||||
u = "",
|
||||
a = 2,
|
||||
f = 3,
|
||||
l = 2,
|
||||
c = "",
|
||||
h = 0,
|
||||
p = 0,
|
||||
d,
|
||||
v = LZString._f;
|
||||
for (d = 0; d < e.length; d += 1) {
|
||||
s = e.charAt(d);
|
||||
if (!Object.prototype.hasOwnProperty.call(r, s)) {
|
||||
r[s] = f++;
|
||||
i[s] = true;
|
||||
}
|
||||
o = u + s;
|
||||
if (Object.prototype.hasOwnProperty.call(r, o)) {
|
||||
u = o;
|
||||
} else {
|
||||
if (Object.prototype.hasOwnProperty.call(i, u)) {
|
||||
if (u.charCodeAt(0) < 256) {
|
||||
for (t = 0; t < l; t++) {
|
||||
h = h << 1;
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
}
|
||||
n = u.charCodeAt(0);
|
||||
for (t = 0; t < 8; t++) {
|
||||
h = (h << 1) | (n & 1);
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = n >> 1;
|
||||
}
|
||||
} else {
|
||||
n = 1;
|
||||
for (t = 0; t < l; t++) {
|
||||
h = (h << 1) | n;
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = 0;
|
||||
}
|
||||
n = u.charCodeAt(0);
|
||||
for (t = 0; t < 16; t++) {
|
||||
h = (h << 1) | (n & 1);
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = n >> 1;
|
||||
}
|
||||
}
|
||||
a--;
|
||||
if (a == 0) {
|
||||
a = Math.pow(2, l);
|
||||
l++;
|
||||
}
|
||||
delete i[u];
|
||||
} else {
|
||||
n = r[u];
|
||||
for (t = 0; t < l; t++) {
|
||||
h = (h << 1) | (n & 1);
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = n >> 1;
|
||||
}
|
||||
}
|
||||
a--;
|
||||
if (a == 0) {
|
||||
a = Math.pow(2, l);
|
||||
l++;
|
||||
}
|
||||
r[o] = f++;
|
||||
u = String(s);
|
||||
}
|
||||
}
|
||||
if (u !== "") {
|
||||
if (Object.prototype.hasOwnProperty.call(i, u)) {
|
||||
if (u.charCodeAt(0) < 256) {
|
||||
for (t = 0; t < l; t++) {
|
||||
h = h << 1;
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
}
|
||||
n = u.charCodeAt(0);
|
||||
for (t = 0; t < 8; t++) {
|
||||
h = (h << 1) | (n & 1);
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = n >> 1;
|
||||
}
|
||||
} else {
|
||||
n = 1;
|
||||
for (t = 0; t < l; t++) {
|
||||
h = (h << 1) | n;
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = 0;
|
||||
}
|
||||
n = u.charCodeAt(0);
|
||||
for (t = 0; t < 16; t++) {
|
||||
h = (h << 1) | (n & 1);
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = n >> 1;
|
||||
}
|
||||
}
|
||||
a--;
|
||||
if (a == 0) {
|
||||
a = Math.pow(2, l);
|
||||
l++;
|
||||
}
|
||||
delete i[u];
|
||||
} else {
|
||||
n = r[u];
|
||||
for (t = 0; t < l; t++) {
|
||||
h = (h << 1) | (n & 1);
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = n >> 1;
|
||||
}
|
||||
}
|
||||
a--;
|
||||
if (a == 0) {
|
||||
a = Math.pow(2, l);
|
||||
l++;
|
||||
}
|
||||
}
|
||||
n = 2;
|
||||
for (t = 0; t < l; t++) {
|
||||
h = (h << 1) | (n & 1);
|
||||
if (p == 15) {
|
||||
p = 0;
|
||||
c += v(h);
|
||||
h = 0;
|
||||
} else {
|
||||
p++;
|
||||
}
|
||||
n = n >> 1;
|
||||
}
|
||||
while (true) {
|
||||
h = h << 1;
|
||||
if (p == 15) {
|
||||
c += v(h);
|
||||
break;
|
||||
} else p++;
|
||||
}
|
||||
return c;
|
||||
},
|
||||
decompress: function (e) {
|
||||
if (e == null) return "";
|
||||
if (e == "") return null;
|
||||
var t = [],
|
||||
n,
|
||||
r = 4,
|
||||
i = 4,
|
||||
s = 3,
|
||||
o = "",
|
||||
u = "",
|
||||
a,
|
||||
f,
|
||||
l,
|
||||
c,
|
||||
h,
|
||||
p,
|
||||
d,
|
||||
v = LZString._f,
|
||||
m = { string: e, val: e.charCodeAt(0), position: 32768, index: 1 };
|
||||
for (a = 0; a < 3; a += 1) {
|
||||
t[a] = a;
|
||||
}
|
||||
l = 0;
|
||||
h = Math.pow(2, 2);
|
||||
p = 1;
|
||||
while (p != h) {
|
||||
c = m.val & m.position;
|
||||
m.position >>= 1;
|
||||
if (m.position == 0) {
|
||||
m.position = 32768;
|
||||
m.val = m.string.charCodeAt(m.index++);
|
||||
}
|
||||
l |= (c > 0 ? 1 : 0) * p;
|
||||
p <<= 1;
|
||||
}
|
||||
switch ((n = l)) {
|
||||
case 0:
|
||||
l = 0;
|
||||
h = Math.pow(2, 8);
|
||||
p = 1;
|
||||
while (p != h) {
|
||||
c = m.val & m.position;
|
||||
m.position >>= 1;
|
||||
if (m.position == 0) {
|
||||
m.position = 32768;
|
||||
m.val = m.string.charCodeAt(m.index++);
|
||||
}
|
||||
l |= (c > 0 ? 1 : 0) * p;
|
||||
p <<= 1;
|
||||
}
|
||||
d = v(l);
|
||||
break;
|
||||
case 1:
|
||||
l = 0;
|
||||
h = Math.pow(2, 16);
|
||||
p = 1;
|
||||
while (p != h) {
|
||||
c = m.val & m.position;
|
||||
m.position >>= 1;
|
||||
if (m.position == 0) {
|
||||
m.position = 32768;
|
||||
m.val = m.string.charCodeAt(m.index++);
|
||||
}
|
||||
l |= (c > 0 ? 1 : 0) * p;
|
||||
p <<= 1;
|
||||
}
|
||||
d = v(l);
|
||||
break;
|
||||
case 2:
|
||||
return "";
|
||||
}
|
||||
t[3] = d;
|
||||
f = u = d;
|
||||
while (true) {
|
||||
if (m.index > m.string.length) {
|
||||
return "";
|
||||
}
|
||||
l = 0;
|
||||
h = Math.pow(2, s);
|
||||
p = 1;
|
||||
while (p != h) {
|
||||
c = m.val & m.position;
|
||||
m.position >>= 1;
|
||||
if (m.position == 0) {
|
||||
m.position = 32768;
|
||||
m.val = m.string.charCodeAt(m.index++);
|
||||
}
|
||||
l |= (c > 0 ? 1 : 0) * p;
|
||||
p <<= 1;
|
||||
}
|
||||
switch ((d = l)) {
|
||||
case 0:
|
||||
l = 0;
|
||||
h = Math.pow(2, 8);
|
||||
p = 1;
|
||||
while (p != h) {
|
||||
c = m.val & m.position;
|
||||
m.position >>= 1;
|
||||
if (m.position == 0) {
|
||||
m.position = 32768;
|
||||
m.val = m.string.charCodeAt(m.index++);
|
||||
}
|
||||
l |= (c > 0 ? 1 : 0) * p;
|
||||
p <<= 1;
|
||||
}
|
||||
t[i++] = v(l);
|
||||
d = i - 1;
|
||||
r--;
|
||||
break;
|
||||
case 1:
|
||||
l = 0;
|
||||
h = Math.pow(2, 16);
|
||||
p = 1;
|
||||
while (p != h) {
|
||||
c = m.val & m.position;
|
||||
m.position >>= 1;
|
||||
if (m.position == 0) {
|
||||
m.position = 32768;
|
||||
m.val = m.string.charCodeAt(m.index++);
|
||||
}
|
||||
l |= (c > 0 ? 1 : 0) * p;
|
||||
p <<= 1;
|
||||
}
|
||||
t[i++] = v(l);
|
||||
d = i - 1;
|
||||
r--;
|
||||
break;
|
||||
case 2:
|
||||
return u;
|
||||
}
|
||||
if (r == 0) {
|
||||
r = Math.pow(2, s);
|
||||
s++;
|
||||
}
|
||||
if (t[d]) {
|
||||
o = t[d];
|
||||
} else {
|
||||
if (d === i) {
|
||||
o = f + f.charAt(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
u += o;
|
||||
t[i++] = f + o.charAt(0);
|
||||
r--;
|
||||
f = o;
|
||||
if (r == 0) {
|
||||
r = Math.pow(2, s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
if (typeof module !== "undefined" && module != null) {
|
||||
module.exports = LZString;
|
||||
}
|
||||
524
www/js/libs/pixi-picture.js
Normal file
524
www/js/libs/pixi-picture.js
Normal file
|
|
@ -0,0 +1,524 @@
|
|||
var __extends =
|
||||
(this && this.__extends) ||
|
||||
function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() {
|
||||
this.constructor = d;
|
||||
}
|
||||
d.prototype =
|
||||
b === null ? Object.create(b) : ((__.prototype = b.prototype), new __());
|
||||
};
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var shaderLib = [
|
||||
{
|
||||
vertUniforms: "",
|
||||
vertCode: "vTextureCoord = aTextureCoord;",
|
||||
fragUniforms: "uniform vec4 uTextureClamp;",
|
||||
fragCode:
|
||||
"vec2 textureCoord = clamp(vTextureCoord, uTextureClamp.xy, uTextureClamp.zw);",
|
||||
},
|
||||
{
|
||||
vertUniforms: "uniform mat3 uTransform;",
|
||||
vertCode: "vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;",
|
||||
fragUniforms: "",
|
||||
fragCode: "vec2 textureCoord = vTextureCoord;",
|
||||
},
|
||||
{
|
||||
vertUniforms: "uniform mat3 uTransform;",
|
||||
vertCode: "vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;",
|
||||
fragUniforms:
|
||||
"uniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;",
|
||||
fragCode:
|
||||
"vec2 textureCoord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;" +
|
||||
"\ntextureCoord = (uMapCoord * vec3(textureCoord, 1.0)).xy;" +
|
||||
"\ntextureCoord = clamp(textureCoord, uClampFrame.xy, uClampFrame.zw);",
|
||||
},
|
||||
];
|
||||
var PictureShader = (function (_super) {
|
||||
__extends(PictureShader, _super);
|
||||
function PictureShader(gl, vert, frag, tilingMode) {
|
||||
var lib = shaderLib[tilingMode];
|
||||
_super.call(
|
||||
this,
|
||||
gl,
|
||||
vert
|
||||
.replace(/%SPRITE_UNIFORMS%/gi, lib.vertUniforms)
|
||||
.replace(/%SPRITE_CODE%/gi, lib.vertCode),
|
||||
frag
|
||||
.replace(/%SPRITE_UNIFORMS%/gi, lib.fragUniforms)
|
||||
.replace(/%SPRITE_CODE%/gi, lib.fragCode)
|
||||
);
|
||||
this.bind();
|
||||
this.tilingMode = tilingMode;
|
||||
this.tempQuad = new PIXI.Quad(gl);
|
||||
this.tempQuad.initVao(this);
|
||||
this.uniforms.uColor = new Float32Array([1, 1, 1, 1]);
|
||||
this.uniforms.uSampler = [0, 1];
|
||||
}
|
||||
PictureShader.blendVert =
|
||||
"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 mapMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n %SPRITE_CODE%\n vMapCoord = (mapMatrix * vec3(aVertexPosition, 1.0)).xy;\n}\n";
|
||||
return PictureShader;
|
||||
})(PIXI.Shader);
|
||||
extras.PictureShader = PictureShader;
|
||||
})((extras = PIXI.extras || (PIXI.extras = {})));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var overlayFrag =
|
||||
"\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n vec4 source = texture2D(uSampler[0], textureCoord) * uColor;\n vec4 target = texture2D(uSampler[1], vMapCoord);\n\n //reverse hardlight\n if (source.a == 0.0) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n //yeah, premultiplied\n vec3 Cb = source.rgb/source.a, Cs;\n if (target.a > 0.0) {\n Cs = target.rgb / target.a;\n }\n vec3 multiply = Cb * Cs * 2.0;\n vec3 Cs2 = Cs * 2.0 - 1.0;\n vec3 screen = Cb + Cs2 - Cb * Cs2;\n vec3 B;\n if (Cb.r <= 0.5) {\n B.r = multiply.r;\n } else {\n B.r = screen.r;\n }\n if (Cb.g <= 0.5) {\n B.g = multiply.g;\n } else {\n B.g = screen.g;\n }\n if (Cb.b <= 0.5) {\n B.b = multiply.b;\n } else {\n B.b = screen.b;\n }\n vec4 res;\n res.xyz = (1.0 - source.a) * Cs + source.a * B;\n res.a = source.a + target.a * (1.0-source.a);\n gl_FragColor = vec4(res.xyz * res.a, res.a);\n}\n";
|
||||
var HardLightShader = (function (_super) {
|
||||
__extends(HardLightShader, _super);
|
||||
function HardLightShader(gl, tilingMode) {
|
||||
_super.call(
|
||||
this,
|
||||
gl,
|
||||
extras.PictureShader.blendVert,
|
||||
overlayFrag,
|
||||
tilingMode
|
||||
);
|
||||
}
|
||||
return HardLightShader;
|
||||
})(extras.PictureShader);
|
||||
extras.HardLightShader = HardLightShader;
|
||||
})((extras = PIXI.extras || (PIXI.extras = {})));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
function mapFilterBlendModesToPixi(gl, array) {
|
||||
if (array === void 0) {
|
||||
array = [];
|
||||
}
|
||||
array[PIXI.BLEND_MODES.OVERLAY] = [
|
||||
new extras.OverlayShader(gl, 0),
|
||||
new extras.OverlayShader(gl, 1),
|
||||
new extras.OverlayShader(gl, 2),
|
||||
];
|
||||
array[PIXI.BLEND_MODES.HARD_LIGHT] = [
|
||||
new extras.HardLightShader(gl, 0),
|
||||
new extras.HardLightShader(gl, 1),
|
||||
new extras.HardLightShader(gl, 2),
|
||||
];
|
||||
return array;
|
||||
}
|
||||
extras.mapFilterBlendModesToPixi = mapFilterBlendModesToPixi;
|
||||
})((extras = PIXI.extras || (PIXI.extras = {})));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var normalFrag =
|
||||
"\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n\n vec4 sample = texture2D(uSampler[0], textureCoord);\n gl_FragColor = sample * uColor;\n}\n";
|
||||
var normalVert =
|
||||
"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n %SPRITE_CODE%\n}\n";
|
||||
var NormalShader = (function (_super) {
|
||||
__extends(NormalShader, _super);
|
||||
function NormalShader(gl, tilingMode) {
|
||||
_super.call(this, gl, normalVert, normalFrag, tilingMode);
|
||||
}
|
||||
return NormalShader;
|
||||
})(extras.PictureShader);
|
||||
extras.NormalShader = NormalShader;
|
||||
})((extras = PIXI.extras || (PIXI.extras = {})));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var overlayFrag =
|
||||
"\nvarying vec2 vTextureCoord;\nvarying vec2 vMapCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler[2];\nuniform vec4 uColor;\n%SPRITE_UNIFORMS%\n\nvoid main(void)\n{\n %SPRITE_CODE%\n vec4 source = texture2D(uSampler[0], textureCoord) * uColor;\n vec4 target = texture2D(uSampler[1], vMapCoord);\n\n //reverse hardlight\n if (source.a == 0.0) {\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n //yeah, premultiplied\n vec3 Cb = source.rgb/source.a, Cs;\n if (target.a > 0.0) {\n Cs = target.rgb / target.a;\n }\n vec3 multiply = Cb * Cs * 2.0;\n vec3 Cb2 = Cb * 2.0 - 1.0;\n vec3 screen = Cb2 + Cs - Cb2 * Cs;\n vec3 B;\n if (Cs.r <= 0.5) {\n B.r = multiply.r;\n } else {\n B.r = screen.r;\n }\n if (Cs.g <= 0.5) {\n B.g = multiply.g;\n } else {\n B.g = screen.g;\n }\n if (Cs.b <= 0.5) {\n B.b = multiply.b;\n } else {\n B.b = screen.b;\n }\n vec4 res;\n res.xyz = (1.0 - source.a) * Cs + source.a * B;\n res.a = source.a + target.a * (1.0-source.a);\n gl_FragColor = vec4(res.xyz * res.a, res.a);\n}\n";
|
||||
var OverlayShader = (function (_super) {
|
||||
__extends(OverlayShader, _super);
|
||||
function OverlayShader(gl, tilingMode) {
|
||||
_super.call(
|
||||
this,
|
||||
gl,
|
||||
extras.PictureShader.blendVert,
|
||||
overlayFrag,
|
||||
tilingMode
|
||||
);
|
||||
}
|
||||
return OverlayShader;
|
||||
})(extras.PictureShader);
|
||||
extras.OverlayShader = OverlayShader;
|
||||
})((extras = PIXI.extras || (PIXI.extras = {})));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
function nextPow2(v) {
|
||||
v += v === 0 ? 1 : 0;
|
||||
--v;
|
||||
v |= v >>> 1;
|
||||
v |= v >>> 2;
|
||||
v |= v >>> 4;
|
||||
v |= v >>> 8;
|
||||
v |= v >>> 16;
|
||||
return v + 1;
|
||||
}
|
||||
var PictureRenderer = (function (_super) {
|
||||
__extends(PictureRenderer, _super);
|
||||
function PictureRenderer(renderer) {
|
||||
_super.call(this, renderer);
|
||||
}
|
||||
PictureRenderer.prototype.onContextChange = function () {
|
||||
var gl = this.renderer.gl;
|
||||
this.drawModes = extras.mapFilterBlendModesToPixi(gl);
|
||||
this.normalShader = [
|
||||
new extras.NormalShader(gl, 0),
|
||||
new extras.NormalShader(gl, 1),
|
||||
new extras.NormalShader(gl, 2),
|
||||
];
|
||||
this._tempClamp = new Float32Array(4);
|
||||
this._tempColor = new Float32Array(4);
|
||||
this._tempRect = new PIXI.Rectangle();
|
||||
this._tempRect2 = new PIXI.Rectangle();
|
||||
this._tempRect3 = new PIXI.Rectangle();
|
||||
this._tempMatrix = new PIXI.Matrix();
|
||||
this._tempMatrix2 = new PIXI.Matrix();
|
||||
this._bigBuf = new Uint8Array(1 << 20);
|
||||
this._renderTexture = new PIXI.BaseRenderTexture(1024, 1024);
|
||||
};
|
||||
PictureRenderer.prototype.start = function () {};
|
||||
PictureRenderer.prototype.flush = function () {};
|
||||
PictureRenderer.prototype._getRenderTexture = function (
|
||||
minWidth,
|
||||
minHeight
|
||||
) {
|
||||
if (
|
||||
this._renderTexture.width < minWidth ||
|
||||
this._renderTexture.height < minHeight
|
||||
) {
|
||||
minHeight = nextPow2(minWidth);
|
||||
minHeight = nextPow2(minHeight);
|
||||
this._renderTexture.resize(minWidth, minHeight);
|
||||
}
|
||||
return this._renderTexture;
|
||||
};
|
||||
PictureRenderer.prototype._getBuf = function (size) {
|
||||
var buf = this._bigBuf;
|
||||
if (buf.length < size) {
|
||||
size = nextPow2(size);
|
||||
buf = new Uint8Array(size);
|
||||
this._bigBuf = buf;
|
||||
}
|
||||
return buf;
|
||||
};
|
||||
PictureRenderer.prototype.render = function (sprite) {
|
||||
if (!sprite.texture.valid) {
|
||||
return;
|
||||
}
|
||||
var tilingMode = 0;
|
||||
if (sprite.tileTransform) {
|
||||
tilingMode = this._isSimpleSprite(sprite) ? 1 : 2;
|
||||
}
|
||||
var blendShader = this.drawModes[sprite.blendMode];
|
||||
if (blendShader) {
|
||||
this._renderBlend(sprite, blendShader[tilingMode]);
|
||||
} else {
|
||||
this._renderNormal(sprite, this.normalShader[tilingMode]);
|
||||
}
|
||||
};
|
||||
PictureRenderer.prototype._renderNormal = function (sprite, shader) {
|
||||
var renderer = this.renderer;
|
||||
renderer.bindShader(shader);
|
||||
renderer.state.setBlendMode(sprite.blendMode);
|
||||
this._renderInner(sprite, shader);
|
||||
};
|
||||
PictureRenderer.prototype._renderBlend = function (sprite, shader) {
|
||||
var renderer = this.renderer;
|
||||
var spriteBounds = sprite.getBounds();
|
||||
var renderTarget = renderer._activeRenderTarget;
|
||||
var matrix = renderTarget.projectionMatrix;
|
||||
var flipX = matrix.a < 0;
|
||||
var flipY = matrix.d < 0;
|
||||
var resolution = renderTarget.resolution;
|
||||
var screen = this._tempRect;
|
||||
var fr = renderTarget.sourceFrame || renderTarget.destinationFrame;
|
||||
screen.x = 0;
|
||||
screen.y = 0;
|
||||
screen.width = fr.width;
|
||||
screen.height = fr.height;
|
||||
var bounds = this._tempRect2;
|
||||
var fbw = fr.width * resolution,
|
||||
fbh = fr.height * resolution;
|
||||
bounds.x =
|
||||
(spriteBounds.x + matrix.tx / matrix.a) * resolution + fbw / 2;
|
||||
bounds.y =
|
||||
(spriteBounds.y + matrix.ty / matrix.d) * resolution + fbh / 2;
|
||||
bounds.width = spriteBounds.width * resolution;
|
||||
bounds.height = spriteBounds.height * resolution;
|
||||
if (flipX) {
|
||||
bounds.y = fbw - bounds.width - bounds.x;
|
||||
}
|
||||
if (flipY) {
|
||||
bounds.y = fbh - bounds.height - bounds.y;
|
||||
}
|
||||
var screenBounds = this._tempRect3;
|
||||
var x_1 = Math.floor(Math.max(screen.x, bounds.x));
|
||||
var x_2 = Math.ceil(
|
||||
Math.min(screen.x + screen.width, bounds.x + bounds.width)
|
||||
);
|
||||
var y_1 = Math.floor(Math.max(screen.y, bounds.y));
|
||||
var y_2 = Math.ceil(
|
||||
Math.min(screen.y + screen.height, bounds.y + bounds.height)
|
||||
);
|
||||
var pixelsWidth = x_2 - x_1;
|
||||
var pixelsHeight = y_2 - y_1;
|
||||
if (pixelsWidth <= 0 || pixelsHeight <= 0) {
|
||||
return;
|
||||
}
|
||||
var rt = this._getRenderTexture(pixelsWidth, pixelsHeight);
|
||||
renderer.bindTexture(rt, 1, true);
|
||||
var gl = renderer.gl;
|
||||
if (renderer.renderingToScreen && renderTarget.root) {
|
||||
var buf = this._getBuf(pixelsWidth * pixelsHeight * 4);
|
||||
gl.readPixels(
|
||||
x_1,
|
||||
y_1,
|
||||
pixelsWidth,
|
||||
pixelsHeight,
|
||||
gl.RGBA,
|
||||
gl.UNSIGNED_BYTE,
|
||||
this._bigBuf
|
||||
);
|
||||
gl.texSubImage2D(
|
||||
gl.TEXTURE_2D,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
pixelsWidth,
|
||||
pixelsHeight,
|
||||
gl.RGBA,
|
||||
gl.UNSIGNED_BYTE,
|
||||
this._bigBuf
|
||||
);
|
||||
} else {
|
||||
gl.copyTexSubImage2D(
|
||||
gl.TEXTURE_2D,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
x_1,
|
||||
y_1,
|
||||
pixelsWidth,
|
||||
pixelsHeight
|
||||
);
|
||||
}
|
||||
renderer.bindShader(shader);
|
||||
renderer.state.setBlendMode(PIXI.BLEND_MODES.NORMAL);
|
||||
if (shader.uniforms.mapMatrix) {
|
||||
var mapMatrix = this._tempMatrix;
|
||||
mapMatrix.a = bounds.width / rt.width / spriteBounds.width;
|
||||
if (flipX) {
|
||||
mapMatrix.a = -mapMatrix.a;
|
||||
mapMatrix.tx =
|
||||
(bounds.x - x_1) / rt.width -
|
||||
(spriteBounds.x + spriteBounds.width) * mapMatrix.a;
|
||||
} else {
|
||||
mapMatrix.tx =
|
||||
(bounds.x - x_1) / rt.width - spriteBounds.x * mapMatrix.a;
|
||||
}
|
||||
mapMatrix.d = bounds.height / rt.height / spriteBounds.height;
|
||||
if (flipY) {
|
||||
mapMatrix.d = -mapMatrix.d;
|
||||
mapMatrix.ty =
|
||||
(bounds.y - y_1) / rt.height -
|
||||
(spriteBounds.y + spriteBounds.height) * mapMatrix.d;
|
||||
} else {
|
||||
mapMatrix.ty =
|
||||
(bounds.y - y_1) / rt.height - spriteBounds.y * mapMatrix.d;
|
||||
}
|
||||
shader.uniforms.mapMatrix = mapMatrix.toArray(true);
|
||||
}
|
||||
this._renderInner(sprite, shader);
|
||||
};
|
||||
PictureRenderer.prototype._renderInner = function (sprite, shader) {
|
||||
var renderer = this.renderer;
|
||||
if (shader.tilingMode > 0) {
|
||||
this._renderWithShader(sprite, shader.tilingMode === 1, shader);
|
||||
} else {
|
||||
this._renderSprite(sprite, shader);
|
||||
}
|
||||
};
|
||||
PictureRenderer.prototype._renderWithShader = function (
|
||||
ts,
|
||||
isSimple,
|
||||
shader
|
||||
) {
|
||||
var quad = shader.tempQuad;
|
||||
var renderer = this.renderer;
|
||||
renderer.bindVao(quad.vao);
|
||||
var vertices = quad.vertices;
|
||||
var _width = ts._width;
|
||||
var _height = ts._height;
|
||||
var _anchorX = ts._anchor._x;
|
||||
var _anchorY = ts._anchor._y;
|
||||
var w0 = _width * (1 - _anchorX);
|
||||
var w1 = _width * -_anchorX;
|
||||
var h0 = _height * (1 - _anchorY);
|
||||
var h1 = _height * -_anchorY;
|
||||
var wt = ts.transform.worldTransform;
|
||||
var a = wt.a;
|
||||
var b = wt.b;
|
||||
var c = wt.c;
|
||||
var d = wt.d;
|
||||
var tx = wt.tx;
|
||||
var ty = wt.ty;
|
||||
vertices[0] = a * w1 + c * h1 + tx;
|
||||
vertices[1] = d * h1 + b * w1 + ty;
|
||||
vertices[2] = a * w0 + c * h1 + tx;
|
||||
vertices[3] = d * h1 + b * w0 + ty;
|
||||
vertices[4] = a * w0 + c * h0 + tx;
|
||||
vertices[5] = d * h0 + b * w0 + ty;
|
||||
vertices[6] = a * w1 + c * h0 + tx;
|
||||
vertices[7] = d * h0 + b * w1 + ty;
|
||||
vertices = quad.uvs;
|
||||
vertices[0] = vertices[6] = -ts.anchor.x;
|
||||
vertices[1] = vertices[3] = -ts.anchor.y;
|
||||
vertices[2] = vertices[4] = 1.0 - ts.anchor.x;
|
||||
vertices[5] = vertices[7] = 1.0 - ts.anchor.y;
|
||||
quad.upload();
|
||||
var tex = ts._texture;
|
||||
var lt = ts.tileTransform.localTransform;
|
||||
var uv = ts.uvTransform;
|
||||
var mapCoord = uv.mapCoord;
|
||||
var uClampFrame = uv.uClampFrame;
|
||||
var uClampOffset = uv.uClampOffset;
|
||||
var w = tex.width;
|
||||
var h = tex.height;
|
||||
var W = _width;
|
||||
var H = _height;
|
||||
var tempMat = this._tempMatrix2;
|
||||
tempMat.set(
|
||||
(lt.a * w) / W,
|
||||
(lt.b * w) / H,
|
||||
(lt.c * h) / W,
|
||||
(lt.d * h) / H,
|
||||
lt.tx / W,
|
||||
lt.ty / H
|
||||
);
|
||||
tempMat.invert();
|
||||
if (isSimple) {
|
||||
tempMat.append(mapCoord);
|
||||
} else {
|
||||
shader.uniforms.uMapCoord = mapCoord.toArray(true);
|
||||
shader.uniforms.uClampFrame = uClampFrame;
|
||||
shader.uniforms.uClampOffset = uClampOffset;
|
||||
}
|
||||
shader.uniforms.uTransform = tempMat.toArray(true);
|
||||
var color = this._tempColor;
|
||||
var alpha = ts.worldAlpha;
|
||||
PIXI.utils.hex2rgb(ts.tint, color);
|
||||
color[0] *= alpha;
|
||||
color[1] *= alpha;
|
||||
color[2] *= alpha;
|
||||
color[3] = alpha;
|
||||
shader.uniforms.uColor = color;
|
||||
renderer.bindTexture(tex, 0, true);
|
||||
quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);
|
||||
};
|
||||
PictureRenderer.prototype._renderSprite = function (sprite, shader) {
|
||||
var renderer = this.renderer;
|
||||
var quad = shader.tempQuad;
|
||||
renderer.bindVao(quad.vao);
|
||||
var uvs = sprite.texture._uvs;
|
||||
var vertices = quad.vertices;
|
||||
var vd = sprite.vertexData;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
quad.vertices[i] = vd[i];
|
||||
}
|
||||
quad.uvs[0] = uvs.x0;
|
||||
quad.uvs[1] = uvs.y0;
|
||||
quad.uvs[2] = uvs.x1;
|
||||
quad.uvs[3] = uvs.y1;
|
||||
quad.uvs[4] = uvs.x2;
|
||||
quad.uvs[5] = uvs.y2;
|
||||
quad.uvs[6] = uvs.x3;
|
||||
quad.uvs[7] = uvs.y3;
|
||||
quad.upload();
|
||||
var frame = sprite.texture.frame;
|
||||
var base = sprite.texture.baseTexture;
|
||||
var clamp = this._tempClamp;
|
||||
var eps = 0.5 / base.resolution;
|
||||
clamp[0] = (frame.x + eps) / base.width;
|
||||
clamp[1] = (frame.y + eps) / base.height;
|
||||
clamp[2] = (frame.x + frame.width - eps) / base.width;
|
||||
clamp[3] = (frame.y + frame.height - eps) / base.height;
|
||||
shader.uniforms.uTextureClamp = clamp;
|
||||
var color = this._tempColor;
|
||||
PIXI.utils.hex2rgb(sprite.tint, color);
|
||||
var alpha = sprite.worldAlpha;
|
||||
color[0] *= alpha;
|
||||
color[1] *= alpha;
|
||||
color[2] *= alpha;
|
||||
color[3] = alpha;
|
||||
shader.uniforms.uColor = color;
|
||||
renderer.bindTexture(base, 0, true);
|
||||
quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);
|
||||
};
|
||||
PictureRenderer.prototype._isSimpleSprite = function (ts) {
|
||||
var renderer = this.renderer;
|
||||
var tex = ts._texture;
|
||||
var baseTex = tex.baseTexture;
|
||||
var isSimple =
|
||||
baseTex.isPowerOfTwo &&
|
||||
tex.frame.width === baseTex.width &&
|
||||
tex.frame.height === baseTex.height;
|
||||
if (isSimple) {
|
||||
if (!baseTex._glTextures[renderer.CONTEXT_UID]) {
|
||||
if (baseTex.wrapMode === PIXI.WRAP_MODES.CLAMP) {
|
||||
baseTex.wrapMode = PIXI.WRAP_MODES.REPEAT;
|
||||
}
|
||||
} else {
|
||||
isSimple = baseTex.wrapMode !== PIXI.WRAP_MODES.CLAMP;
|
||||
}
|
||||
}
|
||||
return isSimple;
|
||||
};
|
||||
return PictureRenderer;
|
||||
})(PIXI.ObjectRenderer);
|
||||
extras.PictureRenderer = PictureRenderer;
|
||||
PIXI.WebGLRenderer.registerPlugin("picture", PictureRenderer);
|
||||
PIXI.CanvasRenderer.registerPlugin("picture", PIXI.CanvasSpriteRenderer);
|
||||
})((extras = PIXI.extras || (PIXI.extras = {})));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var PictureSprite = (function (_super) {
|
||||
__extends(PictureSprite, _super);
|
||||
function PictureSprite(texture) {
|
||||
_super.call(this, texture);
|
||||
this.pluginName = "picture";
|
||||
}
|
||||
return PictureSprite;
|
||||
})(PIXI.Sprite);
|
||||
extras.PictureSprite = PictureSprite;
|
||||
})((extras = PIXI.extras || (PIXI.extras = {})));
|
||||
})(PIXI || (PIXI = {}));
|
||||
var PIXI;
|
||||
(function (PIXI) {
|
||||
var extras;
|
||||
(function (extras) {
|
||||
var PictureTilingSprite = (function (_super) {
|
||||
__extends(PictureTilingSprite, _super);
|
||||
function PictureTilingSprite(texture) {
|
||||
_super.call(this, texture);
|
||||
this.pluginName = "picture";
|
||||
}
|
||||
return PictureTilingSprite;
|
||||
})(extras.TilingSprite);
|
||||
extras.PictureTilingSprite = PictureTilingSprite;
|
||||
})((extras = PIXI.extras || (PIXI.extras = {})));
|
||||
})(PIXI || (PIXI = {}));
|
||||
//# sourceMappingURL=pixi-picture.js.map
|
||||
1113
www/js/libs/pixi-tilemap.js
Normal file
1113
www/js/libs/pixi-tilemap.js
Normal file
File diff suppressed because it is too large
Load diff
48989
www/js/libs/pixi.js
Normal file
48989
www/js/libs/pixi.js
Normal file
File diff suppressed because it is too large
Load diff
9
www/js/main.js
Normal file
9
www/js/main.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
//=============================================================================
|
||||
// main.js
|
||||
//=============================================================================
|
||||
|
||||
PluginManager.setup($plugins);
|
||||
|
||||
window.onload = function () {
|
||||
SceneManager.run(Scene_Boot);
|
||||
};
|
||||
4681
www/js/plugins.js
Normal file
4681
www/js/plugins.js
Normal file
File diff suppressed because it is too large
Load diff
1954
www/js/plugins/AB_EnemyBook.js
Normal file
1954
www/js/plugins/AB_EnemyBook.js
Normal file
File diff suppressed because it is too large
Load diff
1048
www/js/plugins/AB_SymbolEncounter.js
Normal file
1048
www/js/plugins/AB_SymbolEncounter.js
Normal file
File diff suppressed because it is too large
Load diff
90
www/js/plugins/AltMenuScreen.js
Normal file
90
www/js/plugins/AltMenuScreen.js
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
//=============================================================================
|
||||
// AltMenuScreen.js
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc Alternative menu screen layout.
|
||||
* @author Yoji Ojima
|
||||
*
|
||||
* @help This plugin does not provide plugin commands.
|
||||
*/
|
||||
|
||||
/*:ja
|
||||
* @plugindesc メニュー画面のレイアウトを変更します。
|
||||
* @author Yoji Ojima
|
||||
*
|
||||
* @help このプラグインには、プラグインコマンドはありません。
|
||||
*/
|
||||
|
||||
(function () {
|
||||
var _Scene_Menu_create = Scene_Menu.prototype.create;
|
||||
Scene_Menu.prototype.create = function () {
|
||||
_Scene_Menu_create.call(this);
|
||||
this._statusWindow.x = 0;
|
||||
this._statusWindow.y = this._commandWindow.height;
|
||||
this._goldWindow.x = Graphics.boxWidth - this._goldWindow.width;
|
||||
};
|
||||
|
||||
Window_MenuCommand.prototype.windowWidth = function () {
|
||||
return Graphics.boxWidth;
|
||||
};
|
||||
|
||||
Window_MenuCommand.prototype.maxCols = function () {
|
||||
return 4;
|
||||
};
|
||||
|
||||
Window_MenuCommand.prototype.numVisibleRows = function () {
|
||||
return 2;
|
||||
};
|
||||
|
||||
Window_MenuStatus.prototype.windowWidth = function () {
|
||||
return Graphics.boxWidth;
|
||||
};
|
||||
|
||||
Window_MenuStatus.prototype.windowHeight = function () {
|
||||
var h1 = this.fittingHeight(1);
|
||||
var h2 = this.fittingHeight(2);
|
||||
return Graphics.boxHeight - h1 - h2;
|
||||
};
|
||||
|
||||
Window_MenuStatus.prototype.maxCols = function () {
|
||||
return 4;
|
||||
};
|
||||
|
||||
Window_MenuStatus.prototype.numVisibleRows = function () {
|
||||
return 1;
|
||||
};
|
||||
|
||||
Window_MenuStatus.prototype.drawItemImage = function (index) {
|
||||
var actor = $gameParty.members()[index];
|
||||
var rect = this.itemRectForText(index);
|
||||
var w = Math.min(rect.width, 144);
|
||||
var h = Math.min(rect.height, 144);
|
||||
var lineHeight = this.lineHeight();
|
||||
this.changePaintOpacity(actor.isBattleMember());
|
||||
this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h);
|
||||
this.changePaintOpacity(true);
|
||||
};
|
||||
|
||||
Window_MenuStatus.prototype.drawItemStatus = function (index) {
|
||||
var actor = $gameParty.members()[index];
|
||||
var rect = this.itemRectForText(index);
|
||||
var x = rect.x;
|
||||
var y = rect.y;
|
||||
var width = rect.width;
|
||||
var bottom = y + rect.height;
|
||||
var lineHeight = this.lineHeight();
|
||||
this.drawActorName(actor, x, y + lineHeight * 0, width);
|
||||
this.drawActorLevel(actor, x, y + lineHeight * 1, width);
|
||||
this.drawActorClass(actor, x, bottom - lineHeight * 4, width);
|
||||
this.drawActorHp(actor, x, bottom - lineHeight * 3, width);
|
||||
this.drawActorMp(actor, x, bottom - lineHeight * 2, width);
|
||||
this.drawActorIcons(actor, x, bottom - lineHeight * 1, width);
|
||||
};
|
||||
|
||||
var _Window_MenuActor_initialize = Window_MenuActor.prototype.initialize;
|
||||
Window_MenuActor.prototype.initialize = function () {
|
||||
_Window_MenuActor_initialize.call(this);
|
||||
this.y = this.fittingHeight(2);
|
||||
};
|
||||
})();
|
||||
132
www/js/plugins/AltSaveScreen.js
Normal file
132
www/js/plugins/AltSaveScreen.js
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
//=============================================================================
|
||||
// AltSaveScreen.js
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc Alternative save/load screen layout.
|
||||
* @author Yoji Ojima
|
||||
*
|
||||
* @help This plugin does not provide plugin commands.
|
||||
*/
|
||||
|
||||
/*:ja
|
||||
* @plugindesc セーブ/ロード画面のレイアウトを変更します。
|
||||
* @author Yoji Ojima
|
||||
*
|
||||
* @help このプラグインには、プラグインコマンドはありません。
|
||||
*/
|
||||
|
||||
(function () {
|
||||
var _Scene_File_create = Scene_File.prototype.create;
|
||||
Scene_File.prototype.create = function () {
|
||||
_Scene_File_create.call(this);
|
||||
this._listWindow.height = this._listWindow.fittingHeight(8);
|
||||
var x = 0;
|
||||
var y = this._listWindow.y + this._listWindow.height;
|
||||
var width = Graphics.boxWidth;
|
||||
var height = Graphics.boxHeight - y;
|
||||
this._statusWindow = new Window_SavefileStatus(x, y, width, height);
|
||||
this._statusWindow.setMode(this.mode());
|
||||
this._listWindow.statusWindow = this._statusWindow;
|
||||
this._listWindow.callUpdateHelp();
|
||||
this.addWindow(this._statusWindow);
|
||||
};
|
||||
|
||||
var _Scene_File_start = Scene_File.prototype.start;
|
||||
Scene_File.prototype.start = function () {
|
||||
_Scene_File_start.call(this);
|
||||
this._listWindow.ensureCursorVisible();
|
||||
this._listWindow.callUpdateHelp();
|
||||
};
|
||||
|
||||
Window_SavefileList.prototype.windowWidth = function () {
|
||||
return Graphics.boxWidth;
|
||||
};
|
||||
|
||||
Window_SavefileList.prototype.maxCols = function () {
|
||||
return 4;
|
||||
};
|
||||
|
||||
Window_SavefileList.prototype.numVisibleRows = function () {
|
||||
return 5;
|
||||
};
|
||||
|
||||
Window_SavefileList.prototype.spacing = function () {
|
||||
return 8;
|
||||
};
|
||||
|
||||
Window_SavefileList.prototype.itemHeight = function () {
|
||||
return this.lineHeight() * 2;
|
||||
};
|
||||
|
||||
var _Window_SavefileList_callUpdateHelp =
|
||||
Window_SavefileList.prototype.callUpdateHelp;
|
||||
Window_SavefileList.prototype.callUpdateHelp = function () {
|
||||
_Window_SavefileList_callUpdateHelp.call(this);
|
||||
if (this.active && this.statusWindow) {
|
||||
this.statusWindow.setId(this.index() + 1);
|
||||
}
|
||||
};
|
||||
|
||||
function Window_SavefileStatus() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Window_SavefileStatus.prototype = Object.create(Window_Base.prototype);
|
||||
Window_SavefileStatus.prototype.constructor = Window_SavefileStatus;
|
||||
|
||||
Window_SavefileStatus.prototype.initialize = function (x, y, width, height) {
|
||||
Window_Base.prototype.initialize.call(this, x, y, width, height);
|
||||
this._id = 1;
|
||||
};
|
||||
|
||||
Window_SavefileStatus.prototype.setMode = function (mode) {
|
||||
this._mode = mode;
|
||||
};
|
||||
|
||||
Window_SavefileStatus.prototype.setId = function (id) {
|
||||
this._id = id;
|
||||
this.refresh();
|
||||
};
|
||||
|
||||
Window_SavefileStatus.prototype.refresh = function () {
|
||||
this.contents.clear();
|
||||
var id = this._id;
|
||||
var valid = DataManager.isThisGameFile(id);
|
||||
var info = DataManager.loadSavefileInfo(id);
|
||||
var rect = this.contents.rect;
|
||||
this.resetTextColor();
|
||||
if (this._mode === "load") {
|
||||
this.changePaintOpacity(valid);
|
||||
}
|
||||
this.drawFileId(id, rect.x, rect.y);
|
||||
if (info) {
|
||||
this.changePaintOpacity(valid);
|
||||
this.drawContents(info, rect, valid);
|
||||
this.changePaintOpacity(true);
|
||||
}
|
||||
};
|
||||
|
||||
Window_SavefileStatus.prototype.drawFileId = function (id, x, y) {
|
||||
this.drawText(TextManager.file + " " + id, x, y, 180);
|
||||
};
|
||||
|
||||
Window_SavefileStatus.prototype.drawContents = function (info, rect, valid) {
|
||||
var bottom = rect.y + rect.height;
|
||||
var playtimeY = bottom - this.lineHeight();
|
||||
this.drawText(info.title, rect.x + 192, rect.y, rect.width - 192);
|
||||
if (valid) {
|
||||
this.drawPartyfaces(info, rect.x, bottom - 144);
|
||||
}
|
||||
this.drawText(info.playtime, rect.x, playtimeY, rect.width, "right");
|
||||
};
|
||||
|
||||
Window_SavefileStatus.prototype.drawPartyfaces = function (info, x, y) {
|
||||
if (info && info.faces) {
|
||||
for (var i = 0; i < info.faces.length; i++) {
|
||||
var data = info.faces[i];
|
||||
this.drawFace(data[0], data[1], x + i * 150, y);
|
||||
}
|
||||
}
|
||||
};
|
||||
})();
|
||||
108
www/js/plugins/AnimationFrameRate.js
Normal file
108
www/js/plugins/AnimationFrameRate.js
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
//=============================================================================
|
||||
// AnimationFrameRate.js
|
||||
// by Tsukimi
|
||||
// Last Updated: 2018.02.11
|
||||
//=============================================================================
|
||||
|
||||
/*:en
|
||||
* @plugindesc AnimationFrameRate
|
||||
* @author Tsukimi
|
||||
*
|
||||
* @param framerate:1
|
||||
* @desc animation plays 60 animation frame per sec with name start with this symbol
|
||||
* @default !
|
||||
*
|
||||
* @param framerate:2
|
||||
* @desc animation plays 30 animation frame per sec with name start with this symbol
|
||||
* @default &
|
||||
*
|
||||
* @param framerate:3
|
||||
* @desc animation plays 20 animation frame per sec with name start with this symbol
|
||||
* @default $
|
||||
*
|
||||
* @param framerate:5
|
||||
* @desc animation plays 12 animation frame per sec with name start with this symbol
|
||||
* @default #
|
||||
*
|
||||
* @param framerate:6
|
||||
* @desc animation plays 10 animation frame per sec with name start with this symbol
|
||||
* @default %
|
||||
*
|
||||
* @help
|
||||
* RPG Maker MV plays animation as
|
||||
* 4 frame(time)/ 1 animation frame.
|
||||
* With this plugin, you can adjust the frame rate of each animation.
|
||||
*
|
||||
* -----------------
|
||||
*
|
||||
*/
|
||||
/*:ja
|
||||
* @plugindesc アニメフレームレート
|
||||
* @author ツキミ
|
||||
*
|
||||
* @param framerate:1
|
||||
* @desc 一秒あたり60フレーム再生したいアニメーションの接頭語
|
||||
* @default !
|
||||
*
|
||||
* @param framerate:2
|
||||
* @desc 一秒あたり30フレーム再生したいアニメーションの接頭語
|
||||
* @default &
|
||||
*
|
||||
* @param framerate:3
|
||||
* @desc 一秒あたり20フレーム再生したいアニメーションの接頭語
|
||||
* @default $
|
||||
*
|
||||
* @param framerate:5
|
||||
* @desc 一秒あたり12フレーム再生したいアニメーションの接頭語
|
||||
* @default #
|
||||
*
|
||||
* @param framerate:6
|
||||
* @desc 一秒あたり10フレーム再生したいアニメーションの接頭語
|
||||
* @default %
|
||||
*
|
||||
*
|
||||
* @help
|
||||
* ツクールMVではデフォルトで、
|
||||
* 1アニメーションフレームに 4フレーム(時間)かかりますが、
|
||||
* このプラグインを使えば、アニメーション毎のフレームレートが設定できます。
|
||||
*
|
||||
* (デフォ:一秒あたり15フレーム再生される)
|
||||
*
|
||||
* -----------------
|
||||
*
|
||||
*/
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var pluginName = "AnimationFrameRate";
|
||||
var getParam = function (paramNames) {
|
||||
if (!Array.isArray(paramNames)) paramNames = [paramNames];
|
||||
for (var i = 0; i < paramNames.length; i++) {
|
||||
var name = PluginManager.parameters(pluginName)[paramNames[i]];
|
||||
if (name) return name;
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
var FR1 = getParam("framerate:1").substr(0, 1);
|
||||
var FR2 = getParam("framerate:2").substr(0, 1);
|
||||
var FR3 = getParam("framerate:3").substr(0, 1);
|
||||
var FR5 = getParam("framerate:5").substr(0, 1);
|
||||
var FR6 = getParam("framerate:6").substr(0, 1);
|
||||
|
||||
var _Sprite_Animation_setupRate = Sprite_Animation.prototype.setupRate;
|
||||
Sprite_Animation.prototype.setupRate = function () {
|
||||
if (!this._animation) {
|
||||
_Sprite_Animation_setupRate.apply(this, arguments);
|
||||
return;
|
||||
}
|
||||
var initial = this._animation.name.substr(0, 1);
|
||||
if (initial === FR1) this._rate = 1;
|
||||
else if (initial === FR2) this._rate = 2;
|
||||
else if (initial === FR3) this._rate = 3;
|
||||
else if (initial === FR5) this._rate = 5;
|
||||
else if (initial === FR6) this._rate = 6;
|
||||
else _Sprite_Animation_setupRate.apply(this, arguments);
|
||||
};
|
||||
})();
|
||||
362
www/js/plugins/AudioSource.js
Normal file
362
www/js/plugins/AudioSource.js
Normal file
|
|
@ -0,0 +1,362 @@
|
|||
//=============================================================================
|
||||
// AudioSource.js
|
||||
// PUBLIC DOMAIN
|
||||
// ----------------------------------------------------------------------------
|
||||
// 2016/10/18 BGMとBGSの音源化を、一度指定すれば自動調節としました
|
||||
// 2016/10/21 音量・位相調節の距離測定単位をマス単位からドット単位に変更しました
|
||||
// 2016/12/04 セーブ・ロードに対応、BGS並行演奏プラグイン(ParallelBgs.js)との連携
|
||||
// 2017/01/07 アニメーションの音源化に対応、戦闘を挟んでも正常動作するようにした
|
||||
// 2017/01/09 ルート設定のSE音源化もoffに設定できるようにした
|
||||
// 2017/03/25 プラグインパラメータに0を指定できないバグを修正しました
|
||||
// 2017/06/04 BGMとBGSの再生コマンドを連打するとノイズが発生する不具合と、オプション音量を変更した瞬間音量調節が無効になるバグを修正しました
|
||||
// 2017/10/05 FootstepSound.jsとの連携
|
||||
// 2018/06/27 panが0と0以外の値をまたぐ時、ノイズが入る(環境がある)バグを対策
|
||||
// 2018/07/31 ロード直後、一瞬だけ音源処理が反映されないバグを修正しました
|
||||
// 2018/09/16 2018/06/27が無意味だったので打ち消し。ノイズが入ったら本体バージョンを1.6.1以上に上げましょう
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc 音源と聞き手の位置関係に応じて自動的に音量・位相を調節します。
|
||||
* @author くらむぼん
|
||||
*
|
||||
* @param listener
|
||||
* @desc 音の「聞き手」をscreenかplayerから選ぶ
|
||||
* @default screen
|
||||
*
|
||||
* @param decay
|
||||
* @desc 音源と聞き手の距離が一歩広がった時の音量変化倍率(%)
|
||||
* @default 85
|
||||
*
|
||||
* @param pan
|
||||
* @desc 音源が聞き手の一歩右に居る時の変化位相
|
||||
* @default 10
|
||||
*
|
||||
* @param cutoff
|
||||
* @desc 音を鳴らすことを許可する最小の音量(%)
|
||||
* @default 1
|
||||
*
|
||||
* @help
|
||||
* マップイベントの「ルート設定」内で効果音を鳴らすと、
|
||||
* そのイベントが配置されている座標から鳴ったかのように音量・位相を調節します。
|
||||
* 具体的には、「音源」と「聞き手」が離れているほど音量が小さくなり、
|
||||
* 「聞き手」より「音源」が右にあるほど位相が増加(=右から聞こえる)します。
|
||||
* ※イベントコマンドの「SEの演奏」では自動調節しません。うまく使い分けましょう。
|
||||
* また、「アニメーションの表示」の効果音も対象の位置から聞こえるようになります。
|
||||
*
|
||||
* さらに、プラグインコマンドによりBGMやBGSを特定の位置から鳴らすことができます。
|
||||
* トリアコンタンさんのBGS並行演奏プラグインとも連携可能にしてみました。
|
||||
* 詳しくは下の方の「プラグインコマンド」を見てください。
|
||||
*
|
||||
* なお基準となる音量は効果音(,BGM,BGS)の演奏を指定した時の音量です。
|
||||
* 音源と聞き手が同じかすぐ隣のマスに居る時は基準音量で鳴らされ、
|
||||
* そこから一歩離れるたびに音が小さくなっていきます。
|
||||
*
|
||||
*
|
||||
* プラグインパラメータ:
|
||||
* listener : 発信される音の「聞き手」を設定します。
|
||||
* screen 「画面の中央マス」が聞き手になります。
|
||||
* player 「プレイヤー」が聞き手になります。
|
||||
* decay : 音源と聞き手との間の距離が「一歩」広がるたびに音量がdecay%倍されます。
|
||||
* 基本的には0から100までの値を想定しています。100以上の値を入れると
|
||||
* 遠ざかるほど音が大きくなる、というすこし不思議な演出もできます。
|
||||
* pan : 音源が「一歩」右に移動すると、位相がpanだけ変化します。
|
||||
* 逆に音源が一歩左へ移動すると位相が-pan変化します。
|
||||
* cutoff : 音を鳴らすことを許可する最小の音量(%)です。
|
||||
* 計算後の音量がこの値を下回ると強制的に音量0%になります。
|
||||
*
|
||||
*
|
||||
* プラグインコマンド:
|
||||
* audiosource listener 1
|
||||
* 指定したID(この場合は1)のマップイベントを聞き手にします。
|
||||
* (ちなみに0を指定すると「このイベント」を聞き手にします)
|
||||
* 聞き手は常に一つですので、スクリーンorプレイヤーは聞き手ではなくなります。
|
||||
*
|
||||
* audiosource listener reset
|
||||
* マップイベントの聞き手化を解除し、スクリーンかプレイヤーに聞き手を戻します。
|
||||
*
|
||||
*
|
||||
* audiosource bgm 1
|
||||
* audiosource bgs 1
|
||||
* 現在流れているBGM/BGSの音量と位相を、
|
||||
* 「指定したIDのマップイベントから鳴っている」風に聞こえるように調節します。
|
||||
* (0を指定すると「このイベント」から鳴らします)
|
||||
* 設置されたラジオから曲が流れている演出などにお使いください。
|
||||
*
|
||||
* また、BGS並行演奏プラグインと連携する場合は、
|
||||
* BGSライン変更→audiosourceの順番で指定すれば
|
||||
* それぞれのBGSに音源を指定できます。
|
||||
* 例
|
||||
* ◆プラグインコマンド:PB_BGSライン変更 2
|
||||
* ◆プラグインコマンド:audiosource bgs 1
|
||||
*
|
||||
* audiosource bgm reset
|
||||
* audiosource bgs reset
|
||||
* BGM/BGSの音源化を解除し、通常通りの演奏に戻します。
|
||||
*
|
||||
*
|
||||
* audiosource se on
|
||||
* audiosource se off
|
||||
* 「ルート設定」や「アニメーションの表示」では自動的に効果音が
|
||||
* 対象キャラの位置から音が鳴っているように調節されますが、
|
||||
* 調節してほしくない時はこのプラグインコマンドでoffにしましょう。
|
||||
* 初期値はonです。
|
||||
*
|
||||
*
|
||||
* ライセンス:
|
||||
* このプラグインの利用法に制限はありません。お好きなようにどうぞ。
|
||||
*/
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
var parameters = PluginManager.parameters("AudioSource");
|
||||
var listener = parameters["listener"];
|
||||
var decay = toNumber(parameters["decay"], 85).clamp(0, Infinity);
|
||||
var pan = toNumber(parameters["pan"], 10);
|
||||
var cutoff = toNumber(parameters["cutoff"], 1).clamp(0, 100);
|
||||
|
||||
//効果音の音量調節(マップイベントのルート設定から鳴らした時のみ)
|
||||
var _Game_Character_processMoveCommand =
|
||||
Game_Character.prototype.processMoveCommand;
|
||||
Game_Character.prototype.processMoveCommand = function (command) {
|
||||
if (command.code === Game_Character.ROUTE_PLAY_SE)
|
||||
playAdjustSe(command.parameters[0], this);
|
||||
else _Game_Character_processMoveCommand.apply(this, arguments);
|
||||
};
|
||||
|
||||
//アニメーション中の効果音を音量調節
|
||||
Sprite_Animation.prototype.processTimingData = function (timing) {
|
||||
var duration = timing.flashDuration * this._rate;
|
||||
switch (timing.flashScope) {
|
||||
case 1:
|
||||
this.startFlash(timing.flashColor, duration);
|
||||
break;
|
||||
case 2:
|
||||
this.startScreenFlash(timing.flashColor, duration);
|
||||
break;
|
||||
case 3:
|
||||
this.startHiding(duration);
|
||||
break;
|
||||
}
|
||||
if (!this._duplicated && timing.se) {
|
||||
playAdjustSe(timing.se, this._target && this._target._character);
|
||||
}
|
||||
};
|
||||
|
||||
//戦闘終了直後、BGMとBGSの音量が初期値に戻っているので再度設定する
|
||||
//fadeInがcancelされてしまいそうだが、実際はfadeInの処理の方が遅延するのでうまくいく
|
||||
var _BattleManager_replayBgmAndBgs = BattleManager.replayBgmAndBgs;
|
||||
BattleManager.replayBgmAndBgs = function () {
|
||||
_BattleManager_replayBgmAndBgs.apply(this, arguments);
|
||||
AudioManager.updateAudioSource();
|
||||
};
|
||||
|
||||
//BGM、BGSの音量調節(毎フレーム)
|
||||
AudioManager.updateAudioSource = function () {
|
||||
updateParameters(
|
||||
this._currentBgm,
|
||||
$gameMap.event($gameSystem._bgmSource),
|
||||
true
|
||||
);
|
||||
if ($gameSystem._bgsSources) {
|
||||
if (!this.iterateAllBgs) return delete $gameSystem._bgsSources;
|
||||
this.iterateAllBgs(
|
||||
function () {
|
||||
updateParameters(
|
||||
this._currentBgs,
|
||||
$gameMap.event($gameSystem._bgsSources[this.getBgsLineIndex()])
|
||||
);
|
||||
}.bind(this)
|
||||
);
|
||||
} else
|
||||
updateParameters(
|
||||
this._currentBgs,
|
||||
$gameMap.event($gameSystem._bgsSource)
|
||||
);
|
||||
};
|
||||
|
||||
//BGM、BGSの音量が自動調節されている場合はイベントコマンドからのAudioBufferの調節を無効にする
|
||||
//(同一フレームに複数回の音量変化が含まれるとノイズが発生するため)
|
||||
var _AudioManager_updateBgmParameters = AudioManager.updateBgmParameters;
|
||||
AudioManager.updateBgmParameters = function (bgm) {
|
||||
if ($gameMap && $gameMap.event($gameSystem._bgmSource)) return;
|
||||
_AudioManager_updateBgmParameters.apply(this, arguments);
|
||||
};
|
||||
|
||||
var _AudioManager_updateBgsParameters = AudioManager.updateBgsParameters;
|
||||
AudioManager.updateBgsParameters = function (bgs) {
|
||||
if ($gameMap && $gameSystem) {
|
||||
if ($gameSystem._bgsSources && this.getBgsLineIndex) {
|
||||
if ($gameMap.event($gameSystem._bgsSources[this.getBgsLineIndex()]))
|
||||
return;
|
||||
} else {
|
||||
if ($gameMap.event($gameSystem._bgsSource)) return;
|
||||
}
|
||||
}
|
||||
_AudioManager_updateBgsParameters.apply(this, arguments);
|
||||
};
|
||||
|
||||
//BGM、BGSのオプション側の音量を変えた時にちゃんと音量調節されるようにする
|
||||
var _AudioManager_bgmVolume = Object.getOwnPropertyDescriptor(
|
||||
AudioManager,
|
||||
"bgmVolume"
|
||||
);
|
||||
Object.defineProperty(AudioManager, "bgmVolume", {
|
||||
get: function () {
|
||||
return _AudioManager_bgmVolume.get.call(this);
|
||||
},
|
||||
set: function (value) {
|
||||
_AudioManager_bgmVolume.set.call(this, value);
|
||||
if ($gameMap && $gameSystem) this.updateAudioSource();
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var _AudioManager_bgsVolume = Object.getOwnPropertyDescriptor(
|
||||
AudioManager,
|
||||
"bgsVolume"
|
||||
);
|
||||
Object.defineProperty(AudioManager, "bgsVolume", {
|
||||
get: function () {
|
||||
return _AudioManager_bgsVolume.get.call(this);
|
||||
},
|
||||
set: function (value) {
|
||||
_AudioManager_bgsVolume.set.call(this, value);
|
||||
if ($gameMap && $gameSystem) this.updateAudioSource();
|
||||
},
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
var bgmOnSave = null;
|
||||
var bgsOnSave = null;
|
||||
|
||||
var _Scene_Map_onMapLoaded = Scene_Map.prototype.onMapLoaded;
|
||||
Scene_Map.prototype.onMapLoaded = function () {
|
||||
_Scene_Map_onMapLoaded.apply(this, arguments);
|
||||
if (bgmOnSave) {
|
||||
AudioManager.playBgm(bgmOnSave);
|
||||
bgmOnSave = null;
|
||||
}
|
||||
if (bgsOnSave) {
|
||||
AudioManager.playBgs(bgsOnSave);
|
||||
bgsOnSave = null;
|
||||
}
|
||||
AudioManager.updateAudioSource();
|
||||
};
|
||||
|
||||
var _Game_System_onAfterLoad = Game_System.prototype.onAfterLoad;
|
||||
Game_System.prototype.onAfterLoad = function () {
|
||||
bgmOnSave = this._bgmOnSave;
|
||||
bgsOnSave = this._bgsOnSave;
|
||||
this._bgmOnSave = this._bgsOnSave = {};
|
||||
_Game_System_onAfterLoad.apply(this, arguments);
|
||||
this._bgmOnSave = bgmOnSave;
|
||||
this._bgsOnSave = bgsOnSave;
|
||||
};
|
||||
|
||||
var _Game_Map_update = Game_Map.prototype.update;
|
||||
Game_Map.prototype.update = function (sceneActive) {
|
||||
_Game_Map_update.apply(this, arguments);
|
||||
AudioManager.updateAudioSource();
|
||||
};
|
||||
|
||||
var _Game_Interpreter_pluginCommand =
|
||||
Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
_Game_Interpreter_pluginCommand.apply(this, arguments);
|
||||
if (command.toLowerCase() === "audiosource") {
|
||||
var eventId = +args[1] === 0 ? this._eventId : +args[1];
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "listener":
|
||||
$gameSystem._listenerEvent = eventId;
|
||||
break;
|
||||
case "bgm":
|
||||
$gameSystem._bgmSource = eventId;
|
||||
break;
|
||||
case "bgs":
|
||||
if ($gameSystem.getBgsLine) {
|
||||
$gameSystem._bgsSources = $gameSystem._bgsSources || [];
|
||||
$gameSystem._bgsSources[$gameSystem.getBgsLine()] = eventId;
|
||||
} else $gameSystem._bgsSource = eventId;
|
||||
break;
|
||||
case "se":
|
||||
$gameSystem._seSourceOff = args[1].toLowerCase() === "off";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function toNumber(str, def) {
|
||||
return isNaN(str) ? def : +(str || def);
|
||||
}
|
||||
|
||||
//BGMとBGSの音量と位相を調節する
|
||||
function updateParameters(audio, source, isBgm) {
|
||||
if (audio && source) {
|
||||
var lastVolume = audio.volume;
|
||||
var lastPan = audio.pan;
|
||||
adjust(audio, source);
|
||||
if (audio.volume < cutoff) audio.volume = 0;
|
||||
var buffer = AudioManager[isBgm ? "_bgmBuffer" : "_bgsBuffer"];
|
||||
if (buffer && buffer._gainNode)
|
||||
buffer._gainNode.gain.cancelScheduledValues(0);
|
||||
AudioManager.updateBufferParameters(
|
||||
buffer,
|
||||
AudioManager[isBgm ? "_bgmVolume" : "_bgsVolume"],
|
||||
audio
|
||||
);
|
||||
audio.volume = lastVolume;
|
||||
audio.pan = lastPan;
|
||||
}
|
||||
}
|
||||
|
||||
//SEの音量と位相を調節して再生する
|
||||
function playAdjustSe(se, source) {
|
||||
if (source && !$gameSystem._seSourceOff) {
|
||||
var lastVolume = se.volume;
|
||||
var lastPan = se.pan;
|
||||
adjust(se, source);
|
||||
if (se.volume >= cutoff) AudioManager.playSe(se);
|
||||
se.volume = lastVolume;
|
||||
se.pan = lastPan;
|
||||
} else AudioManager.playSe(se);
|
||||
}
|
||||
|
||||
//実際に音量調節を担当する関数。第一引数にオーディオデータ、第二引数に音源キャラクターを指定する
|
||||
function adjust(audio, source) {
|
||||
if (!source)
|
||||
throw new Error("audiosourceエラー:音源となるイベントが存在しません");
|
||||
var listenerX,
|
||||
listenerY,
|
||||
listenerEvent = $gameMap.event($gameSystem._listenerEvent);
|
||||
if (listenerEvent) {
|
||||
listenerX = listenerEvent._realX;
|
||||
listenerY = listenerEvent._realY;
|
||||
} else {
|
||||
switch (listener.toLowerCase()) {
|
||||
case "screen":
|
||||
listenerX = $gameMap.displayX() + $gamePlayer.centerX();
|
||||
listenerY = $gameMap.displayY() + $gamePlayer.centerY();
|
||||
break;
|
||||
case "player":
|
||||
listenerX = $gamePlayer._realX;
|
||||
listenerY = $gamePlayer._realY;
|
||||
break;
|
||||
default:
|
||||
throw new Error(
|
||||
"audiosourceエラー:listenerパラメータはscreenかplayerにしてください"
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
var dx = $gameMap.deltaX(source._realX, listenerX);
|
||||
var dy = $gameMap.deltaY(source._realY, listenerY);
|
||||
var d = Math.sqrt(dx * dx + dy * dy);
|
||||
if (d > 1) audio.volume *= Math.pow(decay / 100, d - 1);
|
||||
audio.pan = (dx * pan).clamp(-100, 100);
|
||||
}
|
||||
|
||||
//連携用の口
|
||||
AudioManager.playAdjustSe = playAdjustSe;
|
||||
})();
|
||||
253
www/js/plugins/BB_WindowSelector3.js
Normal file
253
www/js/plugins/BB_WindowSelector3.js
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
//=============================================================================
|
||||
// BB_WindowSelector3.js
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc ウインドウスキンと切り替えるプラグイン。
|
||||
* @author ビービー
|
||||
*
|
||||
* @param Variable ID
|
||||
* @desc 指定したIDの変数が2の時にWindow2が3のときにWindow3が表示されます。
|
||||
* それ以外のときはデフォルトのWindowが表示されます。default:0
|
||||
* @default 0
|
||||
*
|
||||
* @param Window1 Opacity
|
||||
* @desc 指定したIDの変数の数値によってウインドウの透明度を調節します。default:192
|
||||
* @default 192
|
||||
*
|
||||
* @param Window2 Opacity
|
||||
* @desc 指定したIDの変数の数値によってウインドウの透明度を調節します。default:192
|
||||
* @default 192
|
||||
*
|
||||
* @param Window3 Opacity
|
||||
* @desc 指定したIDの変数の数値によってウインドウの透明度を調節します。default:192
|
||||
* @default 192
|
||||
*
|
||||
* @param Window1 OutlineColor
|
||||
* @desc Windowの文字枠の色を変更します。R(赤),G(緑),B(青),A(強さ)の順番でカンマ(,)区切りで指定。default:rgba(0, 0, 0, 0.5)
|
||||
* @default rgba(0, 0, 0, 0.5)
|
||||
*
|
||||
* @param Window1 OutlineWidth
|
||||
* @desc Windowの文字枠の幅を変更します。default:4
|
||||
* @default 4
|
||||
*
|
||||
* @param Window2 OutlineColor
|
||||
* @desc Window2の文字枠の色を変更します。R(赤),G(緑),B(青),A(強さ)の順番でカンマ(,)区切りで指定。default:rgba(0, 0, 0, 0.5)
|
||||
* @default rgba(0, 0, 0, 0.5)
|
||||
*
|
||||
* @param Window2 OutlineWidth
|
||||
* @desc Windowの文字枠の幅を変更します。default:4
|
||||
* @default 4
|
||||
*
|
||||
* @param Window3 OutlineColor
|
||||
* @desc Window3の文字枠の色を変更します。R(赤),G(緑),B(青),A(強さ)の順番でカンマ(,)区切りで指定。default:rgba(0, 0, 0, 0.5)
|
||||
* @default rgba(0, 0, 0, 0.5)
|
||||
*
|
||||
* @param Window3 OutlineWidth
|
||||
* @desc Windowの文字枠の幅を変更します。default:4
|
||||
* @default 4
|
||||
*
|
||||
* @param Window1 DimmerColor
|
||||
* @desc Window1を暗くするに設定した時の背景色。
|
||||
* default:rgba(0, 0, 0, 0.6)
|
||||
* @default rgba(0, 0, 0, 0.6)
|
||||
*
|
||||
* @param Window1 DimGradationColor
|
||||
* @desc Window1を暗くするに設定した時の背景色グラデーション。
|
||||
* default:rgba(0, 0, 0, 0)
|
||||
* @default rgba(0, 0, 0, 0)
|
||||
*
|
||||
* @param Window2 DimmerColor
|
||||
* @desc Window2を暗くするに設定した時の背景色。
|
||||
* default:rgba(0, 0, 0, 0.6)
|
||||
* @default rgba(0, 0, 0, 0.6)
|
||||
*
|
||||
* @param Window2 DimGradationColor
|
||||
* @desc Window2を暗くするに設定した時の背景色グラデーション。
|
||||
* default:rgba(0, 0, 0, 0)
|
||||
* @default rgba(0, 0, 0, 0)
|
||||
*
|
||||
* @param Window3 DimmerColor
|
||||
* @desc Window3を暗くするに設定した時の背景色。
|
||||
* default:rgba(0, 0, 0, 0.6)
|
||||
* @default rgba(0, 0, 0, 0.6)
|
||||
*
|
||||
* @param Window3 DimGradationColor
|
||||
* @desc Window3を暗くするに設定した時の背景色グラデーション。
|
||||
* default:rgba(0, 0, 0, 0)
|
||||
* @default rgba(0, 0, 0, 0)
|
||||
*
|
||||
* @help Variable ID:パラメータで指定したIDの変数が2の時にWindow2が表示され、
|
||||
* 3のときにはWindow3が表示されます。それ以外のときはWindowを表示します。
|
||||
* --------------------------------------------------------------------------
|
||||
* Window1~3 Opacity:それぞれのウインドウの透明度を設定できます。
|
||||
* 透明度範囲=0~255。デフォルト=192。
|
||||
* --------------------------------------------------------------------------
|
||||
* ウインドウはそれぞれ文字枠色、文字枠幅を調節できます。
|
||||
* 変更されるのはメッセージウインドウのみです。
|
||||
*
|
||||
* OutlineColor:文字枠の色を変更します。
|
||||
* デフォルト:rgba(0, 0, 0, 0.5)
|
||||
* R(赤),G(緑),B(青),A(強さ)の順番でカンマ(,)区切りで指定。
|
||||
* RGB(赤緑青)は0~255(0=明るい,255=暗い)の間で指定、A(強さ)は0~1(0=透明,1=不透明)の間で指定。
|
||||
*
|
||||
* OutlineWidth:Windowの文字枠の幅を変更します。
|
||||
* デフォルト:4
|
||||
* --------------------------------------------------------------------------
|
||||
* ウインドウを暗くするに設定した場合の背景色を指定できます。
|
||||
*
|
||||
* DimmerColor:背景中央部分の色指定。
|
||||
* デフォルト:rgba(0, 0, 0, 0.6)
|
||||
* R(赤),G(緑),B(青),A(強さ)の順番でカンマ(,)区切りで指定。
|
||||
* RGB(赤緑青)は0~255(0=明るい,255=暗い)の間で指定、A(強さ)は0~1(0=透明,1=不透明)の間で指定。
|
||||
*
|
||||
* DimGradationColor:背景上下グラデーション部分の色指定。
|
||||
* デフォルト:rgba(0, 0, 0, 0)
|
||||
* R(赤),G(緑),B(青),A(強さ)の順番でカンマ(,)区切りで指定。
|
||||
* RGB(赤緑青)は0~255(0=明るい,255=暗い)の間で指定、A(強さ)は0~1(0=透明,1=不透明)の間で指定。
|
||||
* --------------------------------------------------------------------------
|
||||
* 利用規約:
|
||||
* 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
|
||||
* についても制限はありません。
|
||||
*
|
||||
* BLOG:http://bb-entertainment-blog.blogspot.jp/
|
||||
*
|
||||
*/
|
||||
|
||||
(function () {
|
||||
var parameters = PluginManager.parameters("BB_WindowSelector3");
|
||||
var BBWSvar = Number(parameters["Variable ID"] || "0");
|
||||
var BBWS1o = Number(parameters["Window1 Opacity"] || "192");
|
||||
var BBWS2o = Number(parameters["Window2 Opacity"] || "192");
|
||||
var BBWS3o = Number(parameters["Window3 Opacity"] || "192");
|
||||
var BBWS1oc = String(
|
||||
parameters["Window1 OutlineColor"] || "rgba(0, 0, 0, 0.5)"
|
||||
);
|
||||
var BBWS1ow = Number(parameters["Window1 OutlineWidth"] || "4");
|
||||
var BBWS2oc = String(
|
||||
parameters["Window2 OutlineColor"] || "rgba(0, 0, 0, 0.5)"
|
||||
);
|
||||
var BBWS2ow = Number(parameters["Window2 OutlineWidth"] || "4");
|
||||
var BBWS3oc = String(
|
||||
parameters["Window3 OutlineColor"] || "rgba(0, 0, 0, 0.5)"
|
||||
);
|
||||
var BBWS3ow = Number(parameters["Window3 OutlineWidth"] || "4");
|
||||
var BBWS1dm = String(
|
||||
parameters["Window1 DimmerColor"] || "rgba(0, 0, 0, 0.6)"
|
||||
);
|
||||
var BBWS2dm = String(
|
||||
parameters["Window1 DimGradationColor"] || "rgba(0, 0, 0, 0)"
|
||||
);
|
||||
var BBWS3dm = String(
|
||||
parameters["Window2 DimmerColor"] || "rgba(0, 0, 0, 0.6)"
|
||||
);
|
||||
var BBWS4dm = String(
|
||||
parameters["Window2 DimGradationColor"] || "rgba(0, 0, 0, 0)"
|
||||
);
|
||||
var BBWS5dm = String(
|
||||
parameters["Window3 DimmerColor"] || "rgba(0, 0, 0, 0.6)"
|
||||
);
|
||||
var BBWS6dm = String(
|
||||
parameters["Window3 DimGradationColor"] || "rgba(0, 0, 0, 0)"
|
||||
);
|
||||
|
||||
// 画像の読み込み
|
||||
var _Scene_Boot_prototype_loadSystemWindowImage =
|
||||
Scene_Boot.prototype.loadSystemWindowImage;
|
||||
Scene_Boot.prototype.loadSystemWindowImage = function () {
|
||||
ImageManager.loadSystem("Window");
|
||||
ImageManager.loadSystem("Window2");
|
||||
ImageManager.loadSystem("Window3");
|
||||
};
|
||||
|
||||
// ウインドウ画像の切り替え
|
||||
var _Window_Base_prototype_update = Window_Base.prototype.update;
|
||||
Window_Base.prototype.update = function () {
|
||||
Window.prototype.update.call(this);
|
||||
if ($gameVariables.value(BBWSvar) == 3) {
|
||||
this.windowskin = ImageManager.loadSystem("Window3");
|
||||
this.backOpacity = BBWS3o;
|
||||
this.contents.outlineColor = BBWS3oc;
|
||||
this.contents.outlineWidth = BBWS3ow;
|
||||
} else if ($gameVariables.value(BBWSvar) == 2) {
|
||||
this.windowskin = ImageManager.loadSystem("Window2");
|
||||
this.backOpacity = BBWS2o;
|
||||
this.contents.outlineColor = BBWS2oc;
|
||||
this.contents.outlineWidth = BBWS2ow;
|
||||
} else {
|
||||
this.windowskin = ImageManager.loadSystem("Window");
|
||||
this.backOpacity = BBWS1o;
|
||||
this.contents.outlineColor = BBWS1oc;
|
||||
this.contents.outlineWidth = BBWS1ow;
|
||||
}
|
||||
this.updateTone();
|
||||
this.updateOpen();
|
||||
this.updateClose();
|
||||
this.updateBackgroundDimmer();
|
||||
};
|
||||
|
||||
var _Window_Base_prototype_updateBackgroundDimmer =
|
||||
Window_Base.prototype.updateBackgroundDimmer;
|
||||
Window_Base.prototype.updateBackgroundDimmer = function () {
|
||||
if (this._dimmerSprite) {
|
||||
this._dimmerSprite.opacity = this.openness;
|
||||
this.refreshDimmerBitmap();
|
||||
}
|
||||
};
|
||||
|
||||
var _Window_Base_prototype_refreshDimmerBitmap =
|
||||
Window_Base.prototype.refreshDimmerBitmap;
|
||||
Window_Base.prototype.refreshDimmerBitmap = function () {
|
||||
if (this._dimmerSprite) {
|
||||
var bitmap = this._dimmerSprite.bitmap;
|
||||
var w = this.width;
|
||||
var h = this.height;
|
||||
var m = this.padding;
|
||||
if ($gameVariables.value(BBWSvar) == 3) {
|
||||
var c1 = this.dimColor5();
|
||||
var c2 = this.dimColor6();
|
||||
} else if ($gameVariables.value(BBWSvar) == 2) {
|
||||
var c1 = this.dimColor3();
|
||||
var c2 = this.dimColor4();
|
||||
} else {
|
||||
var c1 = this.dimColor1();
|
||||
var c2 = this.dimColor2();
|
||||
}
|
||||
bitmap.resize(w, h);
|
||||
bitmap.gradientFillRect(0, 0, w, m, c2, c1, true);
|
||||
bitmap.fillRect(0, m, w, h - m * 2, c1);
|
||||
bitmap.gradientFillRect(0, h - m, w, m, c1, c2, true);
|
||||
this._dimmerSprite.setFrame(0, 0, w, h);
|
||||
}
|
||||
};
|
||||
|
||||
var _Window_Base_prototype_dimColor1 = Window_Base.prototype.dimColor1;
|
||||
Window_Base.prototype.dimColor1 = function () {
|
||||
return BBWS1dm;
|
||||
};
|
||||
|
||||
var _Window_Base_prototype_dimColor21 = Window_Base.prototype.dimColor2;
|
||||
Window_Base.prototype.dimColor2 = function () {
|
||||
return BBWS2dm;
|
||||
};
|
||||
|
||||
var _Window_Base_prototype_dimColor3 = Window_Base.prototype.dimColor3;
|
||||
Window_Base.prototype.dimColor3 = function () {
|
||||
return BBWS3dm;
|
||||
};
|
||||
|
||||
var _Window_Base_prototype_dimColor4 = Window_Base.prototype.dimColor4;
|
||||
Window_Base.prototype.dimColor4 = function () {
|
||||
return BBWS4dm;
|
||||
};
|
||||
|
||||
var _Window_Base_prototype_dimColor5 = Window_Base.prototype.dimColor5;
|
||||
Window_Base.prototype.dimColor5 = function () {
|
||||
return BBWS5dm;
|
||||
};
|
||||
|
||||
var _Window_Base_prototype_dimColor6 = Window_Base.prototype.dimColor6;
|
||||
Window_Base.prototype.dimColor6 = function () {
|
||||
return BBWS6dm;
|
||||
};
|
||||
})();
|
||||
112
www/js/plugins/BMSP.js
Normal file
112
www/js/plugins/BMSP.js
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
//=============================================================================
|
||||
// BMSP.js (BMSPベースプラグイン)
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc BMSPベースプラグインです。
|
||||
* @author gentlawk
|
||||
* @website http://blueredzone.com
|
||||
* @url https://github.com/gentlawk/BMSP_MV
|
||||
* @license
|
||||
* Copyright(c) 2015 BlueRedZone, gentlawk
|
||||
* Released under the MIT license
|
||||
* https://github.com/gentlawk/BMSP_MV/blob/master/LICENSE
|
||||
*
|
||||
* @version 1.11
|
||||
*
|
||||
* @help
|
||||
* 使用方法:
|
||||
* BMSPプラグインシリーズのベースとなるプラグインです。
|
||||
*
|
||||
* ●追加位置
|
||||
* 全てのBMSPプラグインシリーズより上に配置してください。
|
||||
*/
|
||||
|
||||
function BMSP() {
|
||||
throw new Error("This is a static class");
|
||||
}
|
||||
|
||||
/*
|
||||
* プラグインの導入チェック
|
||||
*/
|
||||
PluginManager._versions = {};
|
||||
|
||||
PluginManager.version = function (name) {
|
||||
if (!(name.toLowerCase() in this._versions)) return 0;
|
||||
return this._versions[name.toLowerCase()];
|
||||
};
|
||||
|
||||
PluginManager.setVersion = function (name, version) {
|
||||
this._versions[name.toLowerCase()] = version;
|
||||
};
|
||||
|
||||
BMSP.checkPluginName = function (name) {
|
||||
return PluginManager._scripts.indexOf(name) >= 0;
|
||||
};
|
||||
|
||||
BMSP.checkPluginVersion = function (name, version) {
|
||||
var now = PluginManager.version(name);
|
||||
return now >= version;
|
||||
};
|
||||
|
||||
BMSP.includedPlugin = function (name, version) {
|
||||
if (!this.checkPluginName(name)) return false;
|
||||
if (version === undefined) return true;
|
||||
return this.checkPluginVersion(name, version);
|
||||
};
|
||||
|
||||
BMSP.requirePlugin = function (name, version) {
|
||||
if (!this.checkPluginName(name)) {
|
||||
throw new Error("no such plugin: " + name);
|
||||
}
|
||||
if (version === undefined) return;
|
||||
if (!this.checkPluginVersion(name, version)) {
|
||||
var now = PluginManager.version(name);
|
||||
throw new Error(
|
||||
"need version " + version + " and over: " + name + " version " + now
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* プラグインバージョン
|
||||
*/
|
||||
PluginManager.setVersion("BMSP", 1.11);
|
||||
|
||||
/*
|
||||
* オブジェクトのユニークID管理
|
||||
*/
|
||||
BMSP.getUniqueId = function () {
|
||||
return new Date().getTime() + Math.floor(Math.random() * 1000);
|
||||
};
|
||||
|
||||
BMSP.getObjectId = function (object) {
|
||||
if (!object) {
|
||||
return 0;
|
||||
}
|
||||
if (!("_bmsp_object_id" in object)) {
|
||||
object._bmsp_object_id = BMSP.getUniqueId();
|
||||
}
|
||||
return object._bmsp_object_id;
|
||||
};
|
||||
|
||||
/*
|
||||
* Ruby(他Perl等)ライクな剰余演算
|
||||
*/
|
||||
BMSP.rubyLikeMod = function (a, b) {
|
||||
return ((a % b) + b) % b;
|
||||
};
|
||||
|
||||
/*
|
||||
* シャローコピー
|
||||
*/
|
||||
BMSP.shallowCopy = function (object) {
|
||||
if (object instanceof Array) {
|
||||
return [].concat(object);
|
||||
}
|
||||
var copy = {};
|
||||
for (var prop in object) {
|
||||
copy[prop] = object[prop];
|
||||
}
|
||||
return copy;
|
||||
};
|
||||
288
www/js/plugins/BMSP_MapFog.js
Normal file
288
www/js/plugins/BMSP_MapFog.js
Normal file
|
|
@ -0,0 +1,288 @@
|
|||
//=============================================================================
|
||||
// BMSP_MapFog.js (マップフォグ)
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc マップにフォグを表示します。
|
||||
* @author gentlawk
|
||||
* @website http://blueredzone.com
|
||||
* @url https://github.com/gentlawk/BMSP_MV
|
||||
* @license
|
||||
* Copyright(c) 2015 BlueRedZone, gentlawk
|
||||
* Released under the MIT license
|
||||
* https://github.com/gentlawk/BMSP_MV/blob/master/LICENSE
|
||||
*
|
||||
* @version 1.03
|
||||
*
|
||||
* @param Label
|
||||
* @desc マップフォグメモのラベルです。
|
||||
* @default フォグ
|
||||
*
|
||||
* @help
|
||||
* マップのメモ:
|
||||
* <フォグ%n%:%name%, %sx%, %sy%, %opacity%, %z%, %blend%, %switchies%> # マップにフォグを追加します。
|
||||
* - %n% : フォグの番号です。1以上の整数を指定してください。
|
||||
* - %name% : 使用するファイル名です。(初期値: '')
|
||||
* - %sx% : X方向のスピードです。(初期値: 0)
|
||||
* - %sy% : Y方向のスピードです。(初期値: 0)
|
||||
* - %opacity% : 不透明度です。(初期値: 255)
|
||||
* - %z% : Z座標です。0が遠景直上、1がピクチャ直下、2がピクチャ直上です。(初期値: 1)
|
||||
* - %blend% : 合成方法です。0が通常、1が加算です。(初期値: 1)
|
||||
* - %switchies% : 表示条件スイッチIDリストです。条件にしたいスイッチのIDを「:」区切りで指定します。(初期値: 指定無し※常に表示)
|
||||
* ※メモのラベルはパラメータで変更可能です。
|
||||
* ※フォグ番号はマップごとに1から順番に存在しなければなりません。
|
||||
* ※%n%以外の各パラメータは省略可能です。省略した場合初期値が使用されます。
|
||||
* また、省略したパラメータ以降のパラメータも全て省略しなければなりません。
|
||||
*
|
||||
* プラグインコマンド:
|
||||
* MapFog %n% name %value% # フォグ番号%n%に使用するファイルを%value%に変更します。
|
||||
* MapFog %n% sx %value% # フォグ番号%n%のX方向速度を%value%に変更します。
|
||||
* MapFog %n% sy %value% # フォグ番号%n%のY方向速度を%value%に変更します。
|
||||
* MapFog %n% opacity %value% # フォグ番号%n%の不透明度を%value%に変更します。
|
||||
* MapFog %n% blend %value% # フォグ番号%n%の合成方法を%value%に変更します。
|
||||
* MapFog %n% visible %value% # フォグ番号%n%を%value%が1で表示、0で非表示にします。
|
||||
*
|
||||
* 使用方法:
|
||||
* マップのメモにフォグ設定を記述すると、マップにフォグを表示できます。
|
||||
* 1つのマップに表示するフォグの数は任意ですが、フォグ番号は1から順番にふる必要があります。
|
||||
* フォグの表示条件はマップ移動時のみ判定されます。
|
||||
* 同一マップ上でフォグの表示を切り替える場合はプラグインコマンドを使用して下さい。
|
||||
* マップフォグ画像は以下のディレクトリに配置してください(fogsディレクトリは新規作成してください)。
|
||||
* img/fogs
|
||||
*
|
||||
* ●使用例
|
||||
* フォグを表示
|
||||
* <フォグ1:fogfile>
|
||||
*
|
||||
* フォグを2つ表示
|
||||
* <フォグ1:fogfile1,1,0,255>
|
||||
* <フォグ2:fogfile2,0,0,255,0,0>
|
||||
*
|
||||
* スイッチ10がONの時フォグを表示
|
||||
* <フォグ1:fogfile,0,0,255,1,1,10>
|
||||
*
|
||||
* スイッチ10がONの時フォグ1を、スイッチ10と20がONの時フォグ2を表示
|
||||
* <フォグ1:fogfile1,0,0,255,1,1,10>
|
||||
* <フォグ2:fogfile2,0,0,255,1,1,10:20>
|
||||
*/
|
||||
|
||||
(function () {
|
||||
/*
|
||||
* プラグインバージョン
|
||||
*/
|
||||
PluginManager.setVersion("BMSP_MapFog", 1.03);
|
||||
|
||||
/*
|
||||
* 必須プラグインチェック
|
||||
*/
|
||||
var _Scene_Boot_start = Scene_Boot.prototype.start;
|
||||
Scene_Boot.prototype.start = function () {
|
||||
BMSP.requirePlugin("BMSP", 1.0);
|
||||
_Scene_Boot_start.call(this);
|
||||
};
|
||||
|
||||
/*
|
||||
* プラグインコマンド
|
||||
*/
|
||||
var _Game_Interpreter_pluginCommand =
|
||||
Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
_Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
if (command === "MapFog") {
|
||||
$gameMap.setFogParameter(args[1], Number(args[0]), args[2]);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* MapFog
|
||||
*/
|
||||
BMSP.MapFog = function () {
|
||||
throw new Error("This is a static class");
|
||||
};
|
||||
|
||||
var parameters = PluginManager.parameters("BMSP_MapFog");
|
||||
BMSP.MapFog._label = parameters["Label"];
|
||||
|
||||
BMSP.MapFog._cache_settings = {};
|
||||
|
||||
BMSP.MapFog.getSettings = function (map) {
|
||||
var objectId = BMSP.getObjectId(map);
|
||||
if (objectId in this._cache_settings) {
|
||||
return this._cache_settings[objectId];
|
||||
}
|
||||
var index = 1;
|
||||
var settings = {};
|
||||
while (this._label + index in map.meta) {
|
||||
settings[index] = map.meta[this._label + index].split(",");
|
||||
index++;
|
||||
}
|
||||
this._cache_settings[objectId] = settings;
|
||||
return settings;
|
||||
};
|
||||
|
||||
BMSP.MapFog.getSprite = function (index) {
|
||||
if (!SceneManager._scene || SceneManager._scene.constructor !== Scene_Map) {
|
||||
return null;
|
||||
}
|
||||
var fogData = SceneManager._scene._spriteset._fogData;
|
||||
for (var i in fogData) {
|
||||
var data = fogData[i];
|
||||
if (data.index == index) return data.sprite;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/*
|
||||
* ImageManager
|
||||
*/
|
||||
ImageManager.loadFog = function (filename, hue) {
|
||||
return this.loadBitmap("img/fogs/", filename, hue, true);
|
||||
};
|
||||
|
||||
var _Game_Map_setup = Game_Map.prototype.setup;
|
||||
Game_Map.prototype.setup = function (mapId) {
|
||||
_Game_Map_setup.call(this, mapId);
|
||||
this.setupFogs();
|
||||
};
|
||||
|
||||
Game_Map.prototype.setupFogs = function () {
|
||||
this._fogs = {};
|
||||
var settings = BMSP.MapFog.getSettings($dataMap);
|
||||
for (var index in settings) {
|
||||
var setting = settings[index];
|
||||
var cond = (setting[6] || "").split(":");
|
||||
var visible = true;
|
||||
if (cond[0] !== "") {
|
||||
visible = cond.every(function (id) {
|
||||
return $gameSwitches.value(id);
|
||||
});
|
||||
}
|
||||
this._fogs[index] = {
|
||||
name: setting[0] || "",
|
||||
sx: Number(setting[1] || 0),
|
||||
sy: Number(setting[2] || 0),
|
||||
opacity: Number(setting[3] || 255),
|
||||
z: Number(setting[4] || 1),
|
||||
blend: Number(setting[5] || 1),
|
||||
visible: visible,
|
||||
x: 0,
|
||||
y: 0,
|
||||
ox: 0,
|
||||
oy: 0,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Game_Map.prototype.fogs = function () {
|
||||
return this._fogs;
|
||||
};
|
||||
|
||||
var _Game_Map_update = Game_Map.prototype.update;
|
||||
Game_Map.prototype.update = function (sceneActive) {
|
||||
_Game_Map_update.call(this, sceneActive);
|
||||
this.updateFogs();
|
||||
};
|
||||
|
||||
Game_Map.prototype.updateFogs = function () {
|
||||
for (var index in this._fogs) {
|
||||
// change by triacontane
|
||||
this._fogs[index].ox += this._fogs[index].sx;
|
||||
this._fogs[index].oy += this._fogs[index].sy;
|
||||
this._fogs[index].x =
|
||||
this._displayX * this.tileWidth() + this._fogs[index].ox;
|
||||
this._fogs[index].y =
|
||||
this._displayY * this.tileHeight() + this._fogs[index].oy;
|
||||
}
|
||||
};
|
||||
|
||||
Game_Map.prototype.setFogParameter = function (name, index, value) {
|
||||
if (!(index in this._fogs)) return;
|
||||
if (value === undefined) return;
|
||||
var fog = this._fogs[index];
|
||||
switch (name) {
|
||||
case "name":
|
||||
fog[name] = value;
|
||||
break;
|
||||
case "sx":
|
||||
case "sy":
|
||||
case "opacity":
|
||||
case "blend":
|
||||
fog[name] = Number(value);
|
||||
break;
|
||||
case "visible":
|
||||
fog[name] = Boolean(Number(value));
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Spriteset_Map
|
||||
*/
|
||||
var _Spriteset_Map_initialize = Spriteset_Map.prototype.initialize;
|
||||
Spriteset_Map.prototype.initialize = function () {
|
||||
this._fogContainer = [];
|
||||
this._fogData = [];
|
||||
_Spriteset_Map_initialize.call(this);
|
||||
};
|
||||
|
||||
var _Spriteset_Map_createParallax = Spriteset_Map.prototype.createParallax;
|
||||
Spriteset_Map.prototype.createParallax = function () {
|
||||
_Spriteset_Map_createParallax.call(this);
|
||||
this.createFogs(0);
|
||||
};
|
||||
|
||||
var _Spriteset_Map_createPictures = Spriteset_Map.prototype.createPictures;
|
||||
Spriteset_Map.prototype.createPictures = function () {
|
||||
this.createFogs(1);
|
||||
_Spriteset_Map_createPictures.call(this);
|
||||
this.createFogs(2);
|
||||
};
|
||||
|
||||
var _Spriteset_Map_update = Spriteset_Map.prototype.update;
|
||||
Spriteset_Map.prototype.update = function () {
|
||||
_Spriteset_Map_update.call(this);
|
||||
this.updateFogs();
|
||||
};
|
||||
|
||||
Spriteset_Map.prototype.createFogs = function (z) {
|
||||
this._fogContainer[z] = new Sprite();
|
||||
var fogs = $gameMap.fogs();
|
||||
for (var index in fogs) {
|
||||
if (fogs[index].z !== z) continue;
|
||||
|
||||
var fogSprite = new TilingSprite();
|
||||
fogSprite.move(0, 0, Graphics.width, Graphics.height);
|
||||
this._fogContainer[z].addChild(fogSprite);
|
||||
this._fogData.push({
|
||||
index: index,
|
||||
sprite: fogSprite,
|
||||
name: null,
|
||||
});
|
||||
}
|
||||
if (z === 2) {
|
||||
this.addChild(this._fogContainer[z]);
|
||||
} else {
|
||||
this._baseSprite.addChild(this._fogContainer[z]);
|
||||
}
|
||||
};
|
||||
|
||||
Spriteset_Map.prototype.updateFogs = function () {
|
||||
var fogs = $gameMap.fogs();
|
||||
$gameMap.updateFogs(); // add by triacontane
|
||||
this._fogData.forEach(function (data) {
|
||||
var fog = fogs[data.index];
|
||||
var sprite = data.sprite;
|
||||
if (data.name !== fog.name) {
|
||||
data.name = fog.name;
|
||||
sprite.bitmap = ImageManager.loadFog(data.name);
|
||||
}
|
||||
if (sprite.bitmap) {
|
||||
sprite.origin.x = fog.x;
|
||||
sprite.origin.y = fog.y;
|
||||
sprite.opacity = fog.opacity;
|
||||
sprite.visible = fog.visible;
|
||||
sprite.blendMode = fog.blend;
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
})();
|
||||
175
www/js/plugins/BalloonPlaySe.js
Normal file
175
www/js/plugins/BalloonPlaySe.js
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
//=============================================================================
|
||||
// BalloonPlaySe.js
|
||||
// ----------------------------------------------------------------------------
|
||||
// (c) 2015-2017 Triacontane
|
||||
// This software is released under the MIT License.
|
||||
// http://opensource.org/licenses/mit-license.php
|
||||
// ----------------------------------------------------------------------------
|
||||
// Version
|
||||
// 1.0.0 2017/12/13 初版
|
||||
// ----------------------------------------------------------------------------
|
||||
// [Blog] : https://triacontane.blogspot.jp/
|
||||
// [Twitter]: https://twitter.com/triacontane/
|
||||
// [GitHub] : https://github.com/triacontane/
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc フキダシアイコンのSE演奏プラグイン
|
||||
* @author トリアコンタン
|
||||
*
|
||||
* @param SwitchId
|
||||
* @text 有効スイッチ番号
|
||||
* @desc プラグインの機能を有効にするスイッチ番号です。0にすると無条件で演奏されます。
|
||||
* @default 0
|
||||
* @type switch
|
||||
*
|
||||
* @param SeInfo
|
||||
* @text 効果音情報
|
||||
* @desc フキダシアイコン表示時に演奏される効果音情報です。対象のアイコンおよび対応する効果音を選択してください。
|
||||
* @default
|
||||
* @type struct<SE>[]
|
||||
*
|
||||
* @help BalloonPlaySe.js
|
||||
*
|
||||
* フキダシアイコンが表示される瞬間に対応する効果音を
|
||||
* 自動で演奏させることができます。
|
||||
*
|
||||
* このプラグインにはプラグインコマンドはありません。
|
||||
*
|
||||
* 利用規約:
|
||||
* 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
|
||||
* についても制限はありません。
|
||||
* このプラグインはもうあなたのものです。
|
||||
*/
|
||||
|
||||
/*~struct~SE:
|
||||
*
|
||||
* @param Balloon
|
||||
* @text フキダシアイコン
|
||||
* @desc SEを演奏する対象のフキダシアイコンです。
|
||||
* (1:びっくり 2:はてな 3:音符 4:ハート 5:怒り....)
|
||||
* @default 1
|
||||
* @type select
|
||||
* @option びっくり
|
||||
* @value 1
|
||||
* @option はてな
|
||||
* @value 2
|
||||
* @option 音符
|
||||
* @value 3
|
||||
* @option ハート
|
||||
* @value 4
|
||||
* @option 怒り
|
||||
* @value 5
|
||||
* @option 汗
|
||||
* @value 6
|
||||
* @option くしゃくしゃ
|
||||
* @value 7
|
||||
* @option 沈黙
|
||||
* @value 8
|
||||
* @option 電球
|
||||
* @value 9
|
||||
* @option Zzz
|
||||
* @value 10
|
||||
* @option ユーザ定義1
|
||||
* @value 11
|
||||
* @option ユーザ定義2
|
||||
* @value 12
|
||||
* @option ユーザ定義3
|
||||
* @value 13
|
||||
* @option ユーザ定義4
|
||||
* @value 14
|
||||
* @option ユーザ定義5
|
||||
* @value 15
|
||||
*
|
||||
* @param name
|
||||
* @text SEファイル名
|
||||
* @desc SEのファイル名です。
|
||||
* @require 1
|
||||
* @dir audio/se/
|
||||
* @type file
|
||||
* @default
|
||||
*
|
||||
* @param volume
|
||||
* @text SEボリューム
|
||||
* @desc SEのボリュームです。
|
||||
* @type number
|
||||
* @default 90
|
||||
* @min 0
|
||||
* @max 100
|
||||
*
|
||||
* @param pitch
|
||||
* @text SEピッチ
|
||||
* @desc SEのピッチです。
|
||||
* @type number
|
||||
* @default 100
|
||||
* @min 50
|
||||
* @max 150
|
||||
*
|
||||
* @param pan
|
||||
* @text SEバランス
|
||||
* @desc SEの左右バランスです。
|
||||
* @type number
|
||||
* @default 0
|
||||
* @min -100
|
||||
* @max 100
|
||||
*/
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
//=============================================================================
|
||||
// パラメータの取得と整形
|
||||
//=============================================================================
|
||||
var createParameter = function (pluginName) {
|
||||
var parameter = JSON.parse(
|
||||
JSON.stringify(PluginManager.parameters(pluginName), paramReplacer)
|
||||
);
|
||||
PluginManager._parameters[pluginName.toLowerCase()] = parameter;
|
||||
return parameter;
|
||||
};
|
||||
|
||||
var paramReplacer = function (key, value) {
|
||||
if (value === "null") {
|
||||
return value;
|
||||
}
|
||||
if (value[0] === '"' && value[value.length - 1] === '"') {
|
||||
return value;
|
||||
}
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (e) {
|
||||
// do nothing
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
var param = createParameter("BalloonPlaySe");
|
||||
if (!param.SeInfo) {
|
||||
param.SeInfo = [];
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_Balloon
|
||||
// フキダシアイコン表示時にSEを演奏します。
|
||||
//=============================================================================
|
||||
var _Sprite_Balloon_setup = Sprite_Balloon.prototype.setup;
|
||||
Sprite_Balloon.prototype.setup = function (balloonId) {
|
||||
_Sprite_Balloon_setup.apply(this, arguments);
|
||||
if (this.isNeedPlayBalloonSe()) {
|
||||
this.playBalloonSe(balloonId);
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Balloon.prototype.playBalloonSe = function (balloonId) {
|
||||
var balloonSe = param.SeInfo.filter(function (info) {
|
||||
return info.Balloon === balloonId;
|
||||
})[0];
|
||||
if (balloonSe) {
|
||||
AudioManager.playSe(balloonSe);
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Balloon.prototype.isNeedPlayBalloonSe = function () {
|
||||
return !param.SwitchId || $gameSwitches.value(param.SwitchId);
|
||||
};
|
||||
})();
|
||||
813
www/js/plugins/BattleEffectPopup.js
Normal file
813
www/js/plugins/BattleEffectPopup.js
Normal file
|
|
@ -0,0 +1,813 @@
|
|||
//=============================================================================
|
||||
// BattleEffectPopup.js
|
||||
// ----------------------------------------------------------------------------
|
||||
// (C)2016 Triacontane
|
||||
// This software is released under the MIT License.
|
||||
// http://opensource.org/licenses/mit-license.php
|
||||
// ----------------------------------------------------------------------------
|
||||
// Version
|
||||
// 1.8.1 2019/02/26 KMS_SomStyleDamage.jsとの競合を解消。こちらのポップアップもKMS_SomStyleDamage.jsと同じ動きをします。
|
||||
// 1.8.0 2018/10/13 パラメータの型指定機能に対応
|
||||
// コモンイベントが呼び出された場合は無効ポップアップを出さないよう仕様変更
|
||||
// 1.7.2 2018/10/07 プラグインコマンド「対象者ポップアップ」にて競合等の理由で対象が見付からない場合にエラーを回避するよう修正
|
||||
// 1.7.1 2017/08/03 YEP_BattleEngineCore.jsと併用したときに、メッセージの種類によってポップアップ位置が変化する問題を修正
|
||||
// 1.7.0 2017/06/13 行動がガード(耐性によって完全に防がれた)された場合のポップアップを追加
|
||||
// 1.6.0 2017/06/10 行動が無効だった場合のポップアップを追加
|
||||
// 1.5.1 2017/06/10 自動戦闘が有効なアクターがいる場合に一部機能が正常に動作しない問題を修正
|
||||
// 1.5.0 2017/05/30 弱点と耐性のポップアップで弱点や耐性と見なすための閾値を設定できる機能を追加
|
||||
// 1.4.0 2017/05/20 CounterExtend.jsとの併用でスキルによる反撃が表示されない問題を修正。
|
||||
// ポップアップのイタリック体および縁取り表示を行う機能を追加。
|
||||
// 1.3.1 2016/12/18 VE_BasicModule.jsとの競合を解消
|
||||
// 1.3.0 2016/07/14 アクターと敵キャラの通常ダメージにも専用のフラッシュ色を指定できるようになりました。
|
||||
// 1.2.3 2016/07/13 1.2.2の修正が不完全だったのを対応
|
||||
// 1.2.2 2016/07/13 YEP_BattleEngineCore.jsと併用したときに、Missが重複して表示される現象を修正
|
||||
// 1.2.1 2016/07/12 Z座標を指定しているプラグインとの競合を解消するかもしれない
|
||||
// 1.2.0 2016/07/10 行動失敗時(Miss!)も任意の文字または画像に置き換えられるようになりました。
|
||||
// 1.1.0 2016/07/09 ポップアップに任意の画像を指定できるようになりました。
|
||||
// フラッシュするフレーム数を指定できるようになりました。
|
||||
// 1.0.0 2016/07/06 初版
|
||||
// ----------------------------------------------------------------------------
|
||||
// [Blog] : https://triacontane.blogspot.jp/
|
||||
// [Twitter]: https://twitter.com/triacontane/
|
||||
// [GitHub] : https://github.com/triacontane/
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc 戦闘行動結果ポップアッププラグイン
|
||||
* @author トリアコンタン
|
||||
*
|
||||
* @param クリティカル
|
||||
* @desc クリティカル発生時のポップアップメッセージまたはファイル名です。(img/pictures/)拡張子不要
|
||||
* @default CRITICAL!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param クリティカルカラー
|
||||
* @desc クリティカル発生時の文字のフラッシュ色です。R(赤),G(緑),B(青),A(強さ)の順番でカンマ(,)区切りで指定。
|
||||
* @default 255,0,0,255
|
||||
*
|
||||
* @param 回避
|
||||
* @desc 回避発生時のポップアップメッセージまたはファイル名です。
|
||||
* @default Avoid!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param 回避カラー
|
||||
* @desc 回避発生時の文字のフラッシュ色です。
|
||||
* @default 0,128,255,255
|
||||
*
|
||||
* @param ミス
|
||||
* @desc ミス発生時のポップアップメッセージまたはファイル名です。通常のMissは表示されなくなります。
|
||||
* @default Miss!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param ミスカラー
|
||||
* @desc ミス発生時の文字のフラッシュ色です。
|
||||
* @default 0,0,0,0
|
||||
*
|
||||
* @param 無効
|
||||
* @desc 行動が無効(行動は成功したが有効な効果がなかった)だった時のポップアップメッセージまたはファイル名です。
|
||||
* @default Invalid!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param 無効カラー
|
||||
* @desc 無効発生時の文字のフラッシュ色です。
|
||||
* @default 0,0,0,0
|
||||
*
|
||||
* @param ガード
|
||||
* @desc 行動がガード(行動は成功したが相手の耐性によって完全に防がれた)された時のポップアップメッセージまたはファイル名です。
|
||||
* @default Guard!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param ガードカラー
|
||||
* @desc ガード発生時の文字のフラッシュ色です。
|
||||
* @default 0,128,255,255
|
||||
*
|
||||
* @param 魔法反射
|
||||
* @desc 魔法反射時のポップアップメッセージまたはファイル名です。
|
||||
* @default Reflection!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param 魔法反射カラー
|
||||
* @desc 魔法反射発生時の文字のフラッシュ色です。
|
||||
* @default 0,128,255,255
|
||||
*
|
||||
* @param 反撃
|
||||
* @desc 反撃時のポップアップメッセージまたはファイル名です。
|
||||
* @default Counter!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param 反撃カラー
|
||||
* @desc 反撃発生時の文字のフラッシュ色です。
|
||||
* @default 0,128,255,255
|
||||
*
|
||||
* @param 弱点
|
||||
* @desc 弱点時のポップアップメッセージまたはファイル名です。
|
||||
* @default Weakness!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param 弱点カラー
|
||||
* @desc 弱点発生時の文字のフラッシュ色です。
|
||||
* @default 0,255,128,255
|
||||
*
|
||||
* @param 弱点閾値
|
||||
* @desc この値以上なら弱点と見なします。百分率で指定します。
|
||||
* @default 200
|
||||
*
|
||||
* @param 耐性
|
||||
* @desc 弱点時のポップアップメッセージまたはファイル名です。
|
||||
* @default Resistance!
|
||||
* @require 1
|
||||
* @dir img/pictures/
|
||||
* @type file
|
||||
*
|
||||
* @param 耐性カラー
|
||||
* @desc 耐性発生時の文字のフラッシュ色です。
|
||||
* @default 0,0,128,255
|
||||
*
|
||||
* @param 耐性閾値
|
||||
* @desc この値以下なら耐性と見なします。百分率で指定します。
|
||||
* @default 50
|
||||
*
|
||||
* @param 味方ダメージカラー
|
||||
* @desc アクターダメージのフラッシュ色です。
|
||||
* @default 0,0,0,0
|
||||
*
|
||||
* @param 敵ダメージカラー
|
||||
* @desc 敵キャラダメージのフラッシュ色です。
|
||||
* @default 0,0,0,0
|
||||
*
|
||||
* @param フォントサイズ
|
||||
* @desc ポップアップのフォントサイズです。
|
||||
* @default 42
|
||||
*
|
||||
* @param メッセージ最大幅
|
||||
* @desc ポップアップメッセージの最大幅です。
|
||||
* @default 240
|
||||
*
|
||||
* @param フラッシュ時間
|
||||
* @desc フラッシュカラーがフェードアウトするまでのフレーム数です。
|
||||
* @default 60
|
||||
*
|
||||
* @param X座標補正
|
||||
* @desc X座標の補正値です。
|
||||
* @default 0
|
||||
*
|
||||
* @param Y座標補正
|
||||
* @desc Y座標の補正値です。
|
||||
* @default -40
|
||||
*
|
||||
* @param イタリック表示
|
||||
* @desc ポップアップがイタリック体で表示されます。
|
||||
* @default false
|
||||
* @type boolean
|
||||
*
|
||||
* @param 縁取り表示
|
||||
* @desc ポップアップが縁取り表示されます。
|
||||
* @default false
|
||||
* @type boolean
|
||||
*
|
||||
* @param 画像使用
|
||||
* @desc 各種ポップアップに任意のピクチャ(img/pictures)を使用します。メッセージの代わりにファイル名を入力してください。
|
||||
* @default false
|
||||
* @type boolean
|
||||
*
|
||||
* @noteParam BEPメッセージ
|
||||
* @noteRequire 1
|
||||
* @noteDir img/pictures/
|
||||
* @noteType file
|
||||
* @noteData items
|
||||
*
|
||||
* @help 戦闘中に行動の結果のメッセージをポップアップします。
|
||||
* ポップアップするのは動的に作成した文字列もしくは用意したピクチャです。
|
||||
* 表示条件は以下の通りです。
|
||||
*
|
||||
* ・失敗(通常のMissは表示されなくなります)
|
||||
* ・回避(通常のMissは表示されなくなります)
|
||||
* ・無効(行動は成功したが有効な効果がなかった)
|
||||
* ・ガード(行動は成功したが相手の耐性によって完全に防がれた)
|
||||
* ・クリティカル
|
||||
* ・反撃
|
||||
* ・魔法反射
|
||||
* ・弱点(ダメージ倍率が1.0を上回った場合)
|
||||
* ・耐性(ダメージ倍率が1.0を下回った場合)
|
||||
* ・ステート付与(ステートごとに設定できます)
|
||||
* ・コモンイベント(プラグインコマンドから実行します)
|
||||
*
|
||||
* ※ガードが表示されるのは、ステート有効度もしくは属性有効度が0%の効果が
|
||||
* 存在し、かつ他に有効な効果がない場合です。
|
||||
* なお、「ステート無効化」で防がれた場合は表示されません。
|
||||
*
|
||||
* また、ポップアップ時にフラッシュカラーを指定することができます。
|
||||
* フラッシュカラーの指定は「赤」「緑」「青」「強さ」の順番で
|
||||
* カンマ区切りで指定してください。
|
||||
*
|
||||
* ステート付与時にメッセージをポップアップをしたい場合
|
||||
* ステートのメモ欄に以下の通り指定してください。
|
||||
* <BEPメッセージ:state> # 付加時にメッセージ「state」が表示されます。
|
||||
* # 画像使用が有効な場合はファイル名を指定します。
|
||||
* <BEPカラー:255,255,255,255> # 付加時のフラッシュカラーを指定します。
|
||||
*
|
||||
* さらに、プラグインコマンドから任意の文字列を自由にポップアップできます。
|
||||
* このコマンドはバトルイベントのみ使用可能です。
|
||||
*
|
||||
* プラグインコマンド詳細
|
||||
* イベントコマンド「プラグインコマンド」から実行。
|
||||
* (パラメータの間は半角スペースで区切る)
|
||||
*
|
||||
* BEP対象者ポップアップ message 255,0,0,255 # 行動の対象者にmessageがポップ。
|
||||
* BEP_TARGET_POPUP message 255,0,0,255 # 上と同じ
|
||||
*
|
||||
* BEP使用者ポップアップ message 255,0,0,255 # 行動の使用者にmessageがポップ。
|
||||
* BEP_USER_POPUP message 255,0,0,255 # 上と同じ
|
||||
*
|
||||
* ※画像使用が有効な場合はファイル名を指定します。
|
||||
*
|
||||
* 競合に関する情報
|
||||
* 当プラグインは以下のプラグインより下に配置してください。
|
||||
*
|
||||
* YEP_BattleEngineCore.js
|
||||
*
|
||||
* 利用規約:
|
||||
* 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
|
||||
* についても制限はありません。
|
||||
* このプラグインはもうあなたのものです。
|
||||
*/
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
var pluginName = "BattleEffectPopup";
|
||||
var metaTagPrefix = "BEP";
|
||||
|
||||
var getCommandName = function (command) {
|
||||
return (command || "").toUpperCase();
|
||||
};
|
||||
|
||||
var getParamOther = function (paramNames) {
|
||||
if (!Array.isArray(paramNames)) paramNames = [paramNames];
|
||||
for (var i = 0; i < paramNames.length; i++) {
|
||||
var name = PluginManager.parameters(pluginName)[paramNames[i]];
|
||||
if (name) return name;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
var getParamString = function (paramNames) {
|
||||
var value = getParamOther(paramNames);
|
||||
return value === null ? "" : value;
|
||||
};
|
||||
|
||||
var getParamBoolean = function (paramNames) {
|
||||
var value = getParamOther(paramNames);
|
||||
return (
|
||||
(value || "").toUpperCase() === "ON" ||
|
||||
(value || "").toUpperCase() === "TRUE"
|
||||
);
|
||||
};
|
||||
|
||||
var getParamNumber = function (paramNames, min, max) {
|
||||
var value = getParamOther(paramNames);
|
||||
if (arguments.length < 2) min = -Infinity;
|
||||
if (arguments.length < 3) max = Infinity;
|
||||
return (parseInt(value, 10) || 0).clamp(min, max);
|
||||
};
|
||||
|
||||
var getParamArrayString = function (paramNames) {
|
||||
var values = getParamString(paramNames).split(",");
|
||||
for (var i = 0; i < values.length; i++) values[i] = values[i].trim();
|
||||
return values;
|
||||
};
|
||||
|
||||
var getParamArrayNumber = function (paramNames, min, max) {
|
||||
var values = getParamArrayString(paramNames);
|
||||
if (arguments.length < 2) min = -Infinity;
|
||||
if (arguments.length < 3) max = Infinity;
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
if (!isNaN(parseInt(values[i], 10))) {
|
||||
values[i] = (parseInt(values[i], 10) || 0).clamp(min, max);
|
||||
} else {
|
||||
values.splice(i--, 1);
|
||||
}
|
||||
}
|
||||
return values;
|
||||
};
|
||||
|
||||
var getArgString = function (arg, upperFlg) {
|
||||
arg = convertEscapeCharacters(arg);
|
||||
return upperFlg ? arg.toUpperCase() : arg;
|
||||
};
|
||||
|
||||
var getArgArrayNumber = function (args, min, max) {
|
||||
var values = getArgArrayString(args, false);
|
||||
if (arguments.length < 2) min = -Infinity;
|
||||
if (arguments.length < 3) max = Infinity;
|
||||
for (var i = 0; i < values.length; i++)
|
||||
values[i] = (parseInt(values[i], 10) || 0).clamp(min, max);
|
||||
return values;
|
||||
};
|
||||
|
||||
var getArgArrayString = function (args, upperFlg) {
|
||||
var values = getArgString(args, upperFlg).split(",");
|
||||
for (var i = 0; i < values.length; i++) values[i] = values[i].trim();
|
||||
return values;
|
||||
};
|
||||
|
||||
var convertEscapeCharacters = function (text) {
|
||||
if (text == null) text = "";
|
||||
var windowLayer = SceneManager._scene._windowLayer;
|
||||
return windowLayer
|
||||
? windowLayer.children[0].convertEscapeCharacters(text)
|
||||
: text;
|
||||
};
|
||||
|
||||
var getMetaValue = function (object, name) {
|
||||
var metaTagName = metaTagPrefix + (name ? name : "");
|
||||
return object.meta.hasOwnProperty(metaTagName)
|
||||
? object.meta[metaTagName]
|
||||
: undefined;
|
||||
};
|
||||
|
||||
var getMetaValues = function (object, names) {
|
||||
if (!Array.isArray(names)) return getMetaValue(object, names);
|
||||
for (var i = 0, n = names.length; i < n; i++) {
|
||||
var value = getMetaValue(object, names[i]);
|
||||
if (value !== undefined) return value;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// パラメータの取得と整形
|
||||
//=============================================================================
|
||||
var paramCritical = getParamString(["Critical", "クリティカル"]);
|
||||
var paramCriticalColor = getParamArrayNumber(
|
||||
["CriticalColor", "クリティカルカラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramAvoid = getParamString(["Avoid", "回避"]);
|
||||
var paramAvoidColor = getParamArrayNumber(
|
||||
["AvoidColor", "回避カラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramMiss = getParamString(["Miss", "ミス"]);
|
||||
var paramMissColor = getParamArrayNumber(["MissColor", "ミスカラー"], 0, 256);
|
||||
var paramInvalid = getParamString(["Invalid", "無効"]);
|
||||
var paramInvalidColor = getParamArrayNumber(
|
||||
["InvalidColor", "無効カラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramGuard = getParamString(["Guard", "ガード"]);
|
||||
var paramGuardColor = getParamArrayNumber(
|
||||
["GuardColor", "ガードカラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramReflection = getParamString(["Reflection", "魔法反射"]);
|
||||
var paramReflectionColor = getParamArrayNumber(
|
||||
["ReflectionColor", "魔法反射カラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramCounter = getParamString(["Counter", "反撃"]);
|
||||
var paramCounterColor = getParamArrayNumber(
|
||||
["CounterColor", "反撃カラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramWeakness = getParamString(["Weakness", "弱点"]);
|
||||
var paramWeaknessColor = getParamArrayNumber(
|
||||
["WeaknessColor", "弱点カラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramWeaknessLine = getParamNumber(["WeaknessLine", "弱点閾値"]);
|
||||
var paramResistance = getParamString(["Resistance", "耐性"]);
|
||||
var paramResistanceLine = getParamNumber(["ResistanceLine", "耐性閾値"]);
|
||||
var paramResistanceColor = getParamArrayNumber(
|
||||
["ResistanceColor", "耐性カラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramActorDamageColor = getParamArrayNumber(
|
||||
["ActorDamageColor", "味方ダメージカラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramEnemyDamageColor = getParamArrayNumber(
|
||||
["EnemyDamageColor", "敵ダメージカラー"],
|
||||
0,
|
||||
256
|
||||
);
|
||||
var paramFontSize = getParamNumber(["FontSize", "フォントサイズ"], 16, 128);
|
||||
var paramMaxWidth = getParamNumber(["MaxWidth", "メッセージ最大幅"], 1);
|
||||
var paramFlashDuration = getParamNumber(
|
||||
["FlashDuration", "フラッシュ時間"],
|
||||
1
|
||||
);
|
||||
var paramOffsetX = getParamNumber(["OffsetX", "X座標補正"]);
|
||||
var paramOffsetY = getParamNumber(["OffsetY", "Y座標補正"]);
|
||||
var paramUsingPicture = getParamBoolean(["UsingPicture", "画像使用"]);
|
||||
var paramUsingItalic = getParamBoolean(["UsingItalic", "イタリック表示"]);
|
||||
var paramUsingOutline = getParamBoolean(["UsingOutline", "縁取り表示"]);
|
||||
|
||||
//=============================================================================
|
||||
// Game_Interpreter
|
||||
// プラグインコマンドを追加定義します。
|
||||
//=============================================================================
|
||||
var _Game_Interpreter_pluginCommand =
|
||||
Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
_Game_Interpreter_pluginCommand.apply(this, arguments);
|
||||
if (!command.match(new RegExp("^" + metaTagPrefix))) return;
|
||||
this.pluginCommandBattleEffectPopup(
|
||||
command.replace(metaTagPrefix, ""),
|
||||
args
|
||||
);
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.pluginCommandBattleEffectPopup = function (
|
||||
command,
|
||||
args
|
||||
) {
|
||||
switch (getCommandName(command)) {
|
||||
case "使用者ポップアップ":
|
||||
case "_USER_POPUP":
|
||||
BattleManager._subject.startMessagePopup(
|
||||
getArgString(args[0]),
|
||||
getArgArrayNumber(args[1], 0, 256)
|
||||
);
|
||||
break;
|
||||
case "対象者ポップアップ":
|
||||
case "_TARGET_POPUP":
|
||||
var action = BattleManager._action;
|
||||
var unit = action.isForOpponent()
|
||||
? action.opponentsUnit()
|
||||
: action.friendsUnit();
|
||||
var index = BattleManager._subject._lastTargetIndex;
|
||||
var target = unit.members()[index];
|
||||
if (target) {
|
||||
target.startMessagePopup(
|
||||
getArgString(args[0]),
|
||||
getArgArrayNumber(args[1], 0, 256)
|
||||
);
|
||||
} else {
|
||||
console.error(
|
||||
"対象者ポップアップのターゲットが見付かりませんでした。index : " +
|
||||
index
|
||||
);
|
||||
console.error(unit.members());
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Game_Action
|
||||
// 弱点によってポップアップを設定します。
|
||||
//=============================================================================
|
||||
var _Game_Action_calcElementRate = Game_Action.prototype.calcElementRate;
|
||||
Game_Action.prototype.calcElementRate = function (target) {
|
||||
var result = _Game_Action_calcElementRate.apply(this, arguments);
|
||||
if (BattleManager.isInputting()) return result;
|
||||
if (result === 0) {
|
||||
target.appointMessagePopup(paramGuard, paramGuardColor);
|
||||
} else if (result >= paramWeaknessLine / 100) {
|
||||
target.appointMessagePopup(paramWeakness, paramWeaknessColor);
|
||||
} else if (result <= paramResistanceLine / 100) {
|
||||
target.appointMessagePopup(paramResistance, paramResistanceColor);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Game_Battler
|
||||
// ポップアップメッセージのリクエストに応答します。
|
||||
//=============================================================================
|
||||
Game_Battler.prototype.clearMessagePopup = function () {
|
||||
this._messagePopup = false;
|
||||
};
|
||||
|
||||
Game_Battler.prototype.isMessagePopupRequested = function () {
|
||||
return this._messagePopup;
|
||||
};
|
||||
|
||||
Game_Battler.prototype.startMessagePopup = function (message, flashColor) {
|
||||
if (message) {
|
||||
this._messagePopup = true;
|
||||
this._message = message;
|
||||
this._flashColor = flashColor;
|
||||
}
|
||||
};
|
||||
|
||||
Game_Battler.prototype.startAppointMessagePopup = function () {
|
||||
this.startMessagePopup(this._appointMessage, this._appointFlashColor);
|
||||
this._appointMessage = "";
|
||||
this._appointFlashColor = null;
|
||||
};
|
||||
|
||||
Game_Battler.prototype.appointMessagePopup = function (message, flashColor) {
|
||||
this._appointMessage = message;
|
||||
this._appointFlashColor = flashColor;
|
||||
};
|
||||
|
||||
Game_Battler.prototype.getMessagePopupText = function () {
|
||||
return this._message;
|
||||
};
|
||||
|
||||
Game_Battler.prototype.getMessagePopupFlashColor = function () {
|
||||
return this._flashColor;
|
||||
};
|
||||
|
||||
var _Game_Battler_stateRate = Game_Battler.prototype.stateRate;
|
||||
Game_Battler.prototype.stateRate = function (stateId) {
|
||||
var rate = _Game_Battler_stateRate.apply(this, arguments);
|
||||
if (rate === 0) {
|
||||
this.result().guarded = true;
|
||||
}
|
||||
return rate;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Game_ActionResult
|
||||
// 行動が無効だったかどうかを返します。
|
||||
//=============================================================================
|
||||
var _Game_ActionResult_clear = Game_ActionResult.prototype.clear;
|
||||
Game_ActionResult.prototype.clear = function () {
|
||||
_Game_ActionResult_clear.apply(this, arguments);
|
||||
this.guarded = false;
|
||||
};
|
||||
|
||||
Game_ActionResult.prototype.isInvalid = function () {
|
||||
return (
|
||||
!this.success &&
|
||||
!this.missed &&
|
||||
!this.evaded &&
|
||||
!$gameTemp.isCommonEventReserved()
|
||||
);
|
||||
};
|
||||
|
||||
Game_ActionResult.prototype.isGuarded = function () {
|
||||
return this.guarded && this.isInvalid();
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Window_BattleLog
|
||||
// ポップアップメッセージをリクエストします。
|
||||
//=============================================================================
|
||||
Window_BattleLog.prototype.popupMessage = function (
|
||||
target,
|
||||
message,
|
||||
flashColor
|
||||
) {
|
||||
target.startMessagePopup(message, flashColor);
|
||||
};
|
||||
|
||||
var _Window_BattleLog_displayDamage =
|
||||
Window_BattleLog.prototype.displayDamage;
|
||||
Window_BattleLog.prototype.displayDamage = function (target) {
|
||||
_Window_BattleLog_displayDamage.apply(this, arguments);
|
||||
if (target.result().isGuarded()) {
|
||||
this.pushPopupMessage(target, paramGuard, paramGuardColor);
|
||||
} else if (target.result().isInvalid()) {
|
||||
this.pushPopupMessage(target, paramInvalid, paramInvalidColor);
|
||||
}
|
||||
target.startAppointMessagePopup();
|
||||
};
|
||||
|
||||
var _Window_BattleLog_displayCritical =
|
||||
Window_BattleLog.prototype.displayCritical;
|
||||
Window_BattleLog.prototype.displayCritical = function (target) {
|
||||
_Window_BattleLog_displayCritical.apply(this, arguments);
|
||||
if (target.result().critical) {
|
||||
this.pushPopupMessage(target, paramCritical, paramCriticalColor);
|
||||
}
|
||||
};
|
||||
|
||||
var _Window_BattleLog_displayMiss = Window_BattleLog.prototype.displayMiss;
|
||||
Window_BattleLog.prototype.displayMiss = function (target) {
|
||||
_Window_BattleLog_displayMiss.apply(this, arguments);
|
||||
this.popupMiss(target);
|
||||
};
|
||||
|
||||
Window_BattleLog.prototype.popupMiss = function (target) {
|
||||
this.pushPopupMessage(target, paramMiss, paramMissColor);
|
||||
};
|
||||
|
||||
var _Window_BattleLog_displayEvasion =
|
||||
Window_BattleLog.prototype.displayEvasion;
|
||||
Window_BattleLog.prototype.displayEvasion = function (target) {
|
||||
_Window_BattleLog_displayEvasion.apply(this, arguments);
|
||||
this.popupEvasion(target);
|
||||
};
|
||||
|
||||
Window_BattleLog.prototype.popupEvasion = function (target) {
|
||||
this.pushPopupMessage(target, paramAvoid, paramAvoidColor);
|
||||
};
|
||||
|
||||
var _Window_BattleLog_displayCounter =
|
||||
Window_BattleLog.prototype.displayCounter;
|
||||
Window_BattleLog.prototype.displayCounter = function (target) {
|
||||
_Window_BattleLog_displayCounter.apply(this, arguments);
|
||||
this.popupCounter(target);
|
||||
};
|
||||
|
||||
Window_BattleLog.prototype.popupCounter = function (target) {
|
||||
this.pushPopupMessage(target, paramCounter, paramCounterColor);
|
||||
};
|
||||
|
||||
var _Window_BattleLog_displayReflection =
|
||||
Window_BattleLog.prototype.displayReflection;
|
||||
Window_BattleLog.prototype.displayReflection = function (target) {
|
||||
_Window_BattleLog_displayReflection.apply(this, arguments);
|
||||
this.popupReflection(target);
|
||||
};
|
||||
|
||||
Window_BattleLog.prototype.popupReflection = function (target) {
|
||||
this.pushPopupMessage(target, paramReflection, paramReflectionColor);
|
||||
};
|
||||
|
||||
var _Window_BattleLog_displayAddedStates =
|
||||
Window_BattleLog.prototype.displayAddedStates;
|
||||
Window_BattleLog.prototype.displayAddedStates = function (target) {
|
||||
_Window_BattleLog_displayAddedStates.apply(this, arguments);
|
||||
target
|
||||
.result()
|
||||
.addedStateObjects()
|
||||
.forEach(function (state) {
|
||||
var message = getMetaValues(state, ["Message", "メッセージ"]);
|
||||
if (message) {
|
||||
var flash = getMetaValues(state, ["FlashColor", "カラー"]);
|
||||
if (flash) flash = getArgArrayNumber(flash, 0, 256);
|
||||
this.pushPopupMessage(target, getArgString(message), flash);
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
|
||||
Window_BattleLog.prototype.pushPopupMessage = function (
|
||||
target,
|
||||
message,
|
||||
flashColor
|
||||
) {
|
||||
this.push("popupMessage", target, message, flashColor);
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_Battler
|
||||
// ポップアップメッセージを作成します。
|
||||
//=============================================================================
|
||||
var _Sprite_Battler_updateDamagePopup =
|
||||
Sprite_Battler.prototype.updateDamagePopup;
|
||||
Sprite_Battler.prototype.updateDamagePopup = function () {
|
||||
this.setupMessagePopup();
|
||||
_Sprite_Battler_updateDamagePopup.apply(this, arguments);
|
||||
};
|
||||
|
||||
var _Sprite_Battler_pushDamageSprite =
|
||||
Sprite_Battler.prototype.pushDamageSprite;
|
||||
Sprite_Battler.prototype.pushDamageSprite = function (sprite) {
|
||||
var damage = this._damages;
|
||||
this._damages = this._damages.filter(function (sprite) {
|
||||
return !sprite.isMessage();
|
||||
});
|
||||
_Sprite_Battler_pushDamageSprite.apply(this, arguments);
|
||||
damage.push(sprite);
|
||||
this._damages = damage;
|
||||
};
|
||||
|
||||
Sprite_Battler.prototype.setupMessagePopup = function () {
|
||||
if (this._battler.isMessagePopupRequested()) {
|
||||
if (this._battler.isSpriteVisible()) {
|
||||
var sprite = new Sprite_PopupMessage();
|
||||
sprite.x = this.x + this.messageOffsetX();
|
||||
sprite.y = this.y + this.messageOffsetY();
|
||||
sprite.setup(this._battler);
|
||||
if (!sprite.z) {
|
||||
this.setZPositionOfPopup(sprite);
|
||||
}
|
||||
this._damages.push(sprite);
|
||||
this.parent.addChild(sprite);
|
||||
}
|
||||
this._battler.clearMessagePopup();
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Battler.prototype.setZPositionOfPopup = function (sprite) {
|
||||
if (this.z > 0) sprite.z = this.z + 10;
|
||||
if (this._mainSprite && this._mainSprite.z > 0)
|
||||
sprite.z = this._mainSprite.z + 10;
|
||||
};
|
||||
|
||||
Sprite_Battler.prototype.messageOffsetX = function () {
|
||||
return paramOffsetX;
|
||||
};
|
||||
|
||||
Sprite_Battler.prototype.messageOffsetY = function () {
|
||||
return paramOffsetY;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_Damage
|
||||
// 回避メッセージが有効な場合のミス表示を抑制します。
|
||||
//=============================================================================
|
||||
var _Sprite_Damage_setup = Sprite_Damage.prototype.setup;
|
||||
Sprite_Damage.prototype.setup = function (target) {
|
||||
// for YEP_BattleEngineCore.js
|
||||
var result = target.shiftDamagePopup
|
||||
? target.shiftDamagePopup()
|
||||
: target.result();
|
||||
if ((!result.evaded || !paramAvoid) && (!result.missed || !paramMiss)) {
|
||||
if (target.shiftDamagePopup) {
|
||||
target._damagePopup.unshift(result);
|
||||
}
|
||||
_Sprite_Damage_setup.apply(this, arguments);
|
||||
}
|
||||
this.setupFlash(result, target);
|
||||
};
|
||||
|
||||
Sprite_Damage.prototype.setupFlash = function (result, target) {
|
||||
if (!result.missed && !result.evaded && result.hpAffected) {
|
||||
var color =
|
||||
target instanceof Game_Actor
|
||||
? paramActorDamageColor
|
||||
: paramEnemyDamageColor;
|
||||
if (color && color.length > 0) this.setupFlashEffect(color);
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Damage.prototype.setupFlashEffect = function (flashColor, duration) {
|
||||
this._flashColor = flashColor.clone();
|
||||
this._flashDuration = duration || paramFlashDuration;
|
||||
};
|
||||
|
||||
Sprite_Damage.prototype.isMessage = function () {
|
||||
return false;
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// Sprite_PopupMessage
|
||||
// ポップアップメッセージを表示するスプライトです。
|
||||
//=============================================================================
|
||||
function Sprite_PopupMessage() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Sprite_PopupMessage.prototype = Object.create(Sprite_Damage.prototype);
|
||||
Sprite_PopupMessage.prototype.constructor = Sprite_PopupMessage;
|
||||
|
||||
Sprite_PopupMessage.prototype.setup = function (target) {
|
||||
var text = target.getMessagePopupText();
|
||||
var bitmap = paramUsingPicture
|
||||
? this.setupStaticText(text)
|
||||
: this.setupDynamicText(text);
|
||||
var sprite = this.createChildSprite();
|
||||
sprite.bitmap = bitmap;
|
||||
sprite.dy = 0;
|
||||
var flashColor = target.getMessagePopupFlashColor();
|
||||
if (flashColor) {
|
||||
this.setupFlashEffect(flashColor);
|
||||
}
|
||||
// Resolve conflict for KMS_SomStyleDamage.js
|
||||
if (this.setupSomStyleDamageParameter) {
|
||||
this.setupSomStyleDamageParameter();
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_PopupMessage.prototype.setupDynamicText = function (text) {
|
||||
var bitmap = new Bitmap(paramMaxWidth, paramFontSize + 8);
|
||||
bitmap.fontSize = paramFontSize;
|
||||
if (paramUsingItalic) {
|
||||
bitmap.fontItalic = true;
|
||||
}
|
||||
if (paramUsingOutline) {
|
||||
bitmap.outlineWidth = Math.floor(bitmap.fontSize / 6);
|
||||
bitmap.outlineColor = "gray";
|
||||
}
|
||||
bitmap.drawText(text, 0, 0, bitmap.width, bitmap.height, "center");
|
||||
return bitmap;
|
||||
};
|
||||
|
||||
Sprite_PopupMessage.prototype.setupStaticText = function (textPicture) {
|
||||
return ImageManager.loadPicture(textPicture, 0);
|
||||
};
|
||||
|
||||
Sprite_PopupMessage.prototype.isMessage = function () {
|
||||
return true;
|
||||
};
|
||||
})();
|
||||
195
www/js/plugins/BootOpeningDemo.js
Normal file
195
www/js/plugins/BootOpeningDemo.js
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
//=============================================================================
|
||||
// BootOpeningDemo.js
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc You can start the opening demo before your title scene
|
||||
* @author Shirogane / smallomega.com
|
||||
*
|
||||
* @param firstMapId
|
||||
* @desc Opening demo map ID
|
||||
* @default 1
|
||||
* @param startX
|
||||
* @desc First X coordinate on demo map
|
||||
* @default 0
|
||||
* @param startY
|
||||
* @desc First Y coordinate on demo map
|
||||
* @default 0
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* プラグインコマンド:
|
||||
* BootOpeningDemo end # End the opening demo and change the title scene
|
||||
* BootOpeningDemo skipOK # You can skip to the title scene by the decide key or touch
|
||||
* BootOpeningDemo skipNG # You can not skip to the title scene by the decide key or touch
|
||||
*/
|
||||
|
||||
/*:ja
|
||||
* @plugindesc タイトル画面を出す前にオープニングデモから開始します
|
||||
* @author Shirogane / smallomega.com
|
||||
*
|
||||
* @param firstMapId
|
||||
* @desc オープニングデモに使用するマップID
|
||||
* @default 1
|
||||
* @param startX
|
||||
* @desc マップ上の開始座標X
|
||||
* @default 0
|
||||
* @param startY
|
||||
* @desc マップ上の開始座標Y
|
||||
* @default 0
|
||||
*
|
||||
*
|
||||
* @help
|
||||
*
|
||||
* プラグインコマンド:
|
||||
* BootOpeningDemo end # デモを終了してタイトル画面へ遷移します
|
||||
* BootOpeningDemo skipOK # 決定キー、タッチ操作でタイトル画面に遷移できるようになります
|
||||
* BootOpeningDemo skipNG # 決定キー、タッチ操作でタイトル画面に遷移できなくなります
|
||||
*/
|
||||
|
||||
(function () {
|
||||
var parameters = PluginManager.parameters("BootOpeningDemo");
|
||||
var firstMapId = Number(parameters["firstMapId"] || 0);
|
||||
var firstStartX = Number(parameters["firstStartX"] || 0);
|
||||
var firstStartY = Number(parameters["firstStartY"] || 0);
|
||||
var openingDemoEnd = false;
|
||||
var openingDemoSkipOk = false;
|
||||
|
||||
// プラグインコマンド
|
||||
var _Game_Interpreter_pluginCommand =
|
||||
Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
_Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
if (!openingDemoEnd) {
|
||||
if (command === "BootOpeningDemo") {
|
||||
switch (args[0]) {
|
||||
case "end":
|
||||
changeTitle();
|
||||
break;
|
||||
case "skipOK":
|
||||
openingDemoSkipOk = true;
|
||||
break;
|
||||
case "skipNG":
|
||||
openingDemoSkipOk = false;
|
||||
break;
|
||||
default:
|
||||
throw Error("(BootOpeningDemo) invalid argument : " + args[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 最初のシーンに遷移している部分を書き換え
|
||||
var _Scene_Boot_start = Scene_Boot.prototype.start;
|
||||
Scene_Boot.prototype.start = function () {
|
||||
if (DataManager.isBattleTest() || DataManager.isEventTest()) {
|
||||
// デバッグ機能だけは通常の動作
|
||||
_Scene_Boot_start.call(this);
|
||||
} else {
|
||||
// 開始フラグリセット
|
||||
openingDemoEnd = false;
|
||||
// 開始初期化処理
|
||||
Scene_Base.prototype.start.call(this);
|
||||
this.updateDocumentTitle();
|
||||
SoundManager.preloadImportantSounds();
|
||||
DataManager.createGameObjects();
|
||||
DataManager.selectSavefileForNewGame();
|
||||
Graphics.frameCount = 0;
|
||||
// エラーチェック
|
||||
if (firstMapId == 0) {
|
||||
throw new Error("(BootOpeningDemo) parameter firstMapId is invalid");
|
||||
}
|
||||
this.checkPlayerLocation();
|
||||
// マップ呼び出し
|
||||
$gamePlayer.reserveTransfer(firstMapId, firstStartX, firstStartY);
|
||||
SceneManager.goto(Scene_Map);
|
||||
}
|
||||
};
|
||||
|
||||
// デモ中は方向キー移動操作不可
|
||||
var _Game_Player_moveByInput = Game_Player.prototype.moveByInput;
|
||||
Game_Player.prototype.moveByInput = function () {
|
||||
if (openingDemoEnd) {
|
||||
return _Game_Player_moveByInput.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
// デモ中はマップのタッチ操作不可
|
||||
var _Scene_Map_isMapTouchOk = Scene_Map.prototype.isMapTouchOk;
|
||||
Scene_Map.prototype.isMapTouchOk = function () {
|
||||
// オープニングデモが終了していなければ実行しない
|
||||
if (openingDemoEnd) {
|
||||
return _Scene_Map_isMapTouchOk.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
// デモ中はメニュー操作不可
|
||||
var _Scene_Map_isMenuCalled = Scene_Map.prototype.isMenuCalled;
|
||||
Scene_Map.prototype.isMenuCalled = function () {
|
||||
// オープニングデモが終了していなければ常にfalse
|
||||
if (openingDemoEnd) {
|
||||
return _Scene_Map_isMenuCalled.call(this);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// 決定キーで遷移、タッチ操作で遷移
|
||||
var _Scene_Map_update = Scene_Map.prototype.update;
|
||||
Scene_Map.prototype.update = function () {
|
||||
_Scene_Map_update.call(this);
|
||||
// デモ中だけの処理でスキップ許可が出ていてシーン遷移中でない
|
||||
if (
|
||||
!openingDemoEnd &&
|
||||
openingDemoSkipOk &&
|
||||
!SceneManager.isSceneChanging()
|
||||
) {
|
||||
// 決定キーで遷移、タッチ操作で遷移
|
||||
if (TouchInput.isTriggered() || Input.isTriggered("ok")) {
|
||||
// タイトルへ遷移
|
||||
changeTitle();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// オープニングデモ中は禁止のイベントコマンドが使われていたらErrorにする
|
||||
var _Game_Interpreter_executeCommand =
|
||||
Game_Interpreter.prototype.executeCommand;
|
||||
Game_Interpreter.prototype.executeCommand = function () {
|
||||
if (!openingDemoEnd) {
|
||||
var command = this.currentCommand();
|
||||
if (command) {
|
||||
// 禁止コマンドチェック
|
||||
switch (command.code) {
|
||||
// 下記のコマンドをOPデモ中に実行したらErrorになります
|
||||
// 入力が必要なもの、シーンが遷移するもの、などが禁止になっています
|
||||
// なお、変数の操作やシステムの設定変更は可能ですが、タイトルに遷移した時点でリセットされます
|
||||
case 103: // 数値入力の処理
|
||||
case 104: // アイテム選択の処理
|
||||
case 301: // 戦闘の処理
|
||||
case 302: // ショップの処理
|
||||
case 303: // 名前入力の処理
|
||||
case 351: // メニュー画面を開く
|
||||
case 352: // セーブ画面を開く
|
||||
case 353: // ゲームオーバー
|
||||
case 354: // タイトル画面に戻す
|
||||
throw Error(
|
||||
"(BootOpeningDemo) invalid command : code " + command.code
|
||||
);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _Game_Interpreter_executeCommand.call(this);
|
||||
};
|
||||
|
||||
var changeTitle = function () {
|
||||
openingDemoEnd = true;
|
||||
// タイトル画面へ遷移、通常のScene_Bootを開始する
|
||||
SceneManager.goto(Scene_Title);
|
||||
Window_TitleCommand.initCommandPosition();
|
||||
};
|
||||
})();
|
||||
7449
www/js/plugins/CBR_eroStatus_1.js
Normal file
7449
www/js/plugins/CBR_eroStatus_1.js
Normal file
File diff suppressed because it is too large
Load diff
7449
www/js/plugins/CBR_eroStatus_2.js
Normal file
7449
www/js/plugins/CBR_eroStatus_2.js
Normal file
File diff suppressed because it is too large
Load diff
814
www/js/plugins/CBR_eroStatus_main.js
Normal file
814
www/js/plugins/CBR_eroStatus_main.js
Normal file
|
|
@ -0,0 +1,814 @@
|
|||
/*
|
||||
############################################
|
||||
作者: COBRA
|
||||
改造や配布好き勝手にしても大丈夫だよ
|
||||
寧ろ積極的に配布して皆のゲーム開発を快適にしてあげて
|
||||
http://cobrara.blogspot.jp/
|
||||
############################################
|
||||
*/
|
||||
|
||||
// Version 1.1.3
|
||||
// 2022/12/20 村人A機能追加
|
||||
// 2022/11/13 村人A機能追加
|
||||
// 2020/4/23 \C[0]に対応してませんでした
|
||||
// 2018/4/26 ロードした際ステータスの変更もロードされるよう修正
|
||||
// 2017/12/13 最新のバージョン(1.5)でデプロイメントすると1回目だけ画像が表示されない問題を修正
|
||||
// 2017/8/27 1.1.0 ページの表示・非表示機能を追加しました
|
||||
// 2017/7/30 1.0.4 最新のコアスクリプト(ver1.2c)にも対応しました
|
||||
// 2017/5/4 1.0.3 エロステータス画面を開いてる最中NPCが動いてしまう問題を修正しました
|
||||
// 2017/1/31 1.0.2 changeにおいて最後の項目に「@@,@_,@=」が含まれている場合エスケープされない問題を修正しました
|
||||
// 2017/1/30 1.0.1 ピクチャ名に変数が反映されないバグを修正しました
|
||||
// 2017/1/24 1.0.0
|
||||
|
||||
/*:
|
||||
* @plugindesc エロステータス作れちゃうプラグイン(本体)
|
||||
* @author COBRA
|
||||
* @help Version 1.1.3
|
||||
* 自由にいじれちゃうエロステータス画面
|
||||
*
|
||||
* 画像はimg/picturesにpngで保存してください
|
||||
*
|
||||
* 0pxの画像を表示しようとするとバグります
|
||||
*
|
||||
*
|
||||
* 詳しくはこちらで
|
||||
* http://cobrara.blogspot.jp/2017/01/blog-post_24.html
|
||||
*
|
||||
* 横幅:816 縦幅:624
|
||||
|
||||
|
||||
|
||||
* @param eroStaName
|
||||
* @desc メニューに表示される名前だよ
|
||||
* Default: エロステータス
|
||||
* @default エロステータス
|
||||
*
|
||||
*
|
||||
* @param
|
||||
*
|
||||
*
|
||||
* @param commonEvent
|
||||
* @desc エロステ画面を開く直前に実行されるコモンイベント、数値
|
||||
* Default:
|
||||
* @default
|
||||
*
|
||||
* @param param1ValId
|
||||
* @desc パラメータ1について
|
||||
* @default 1_名前1,2_名前2,3_名前3,4_名前4,5_名前5,6_名前6
|
||||
*
|
||||
* @param param2ValId
|
||||
* @desc パラメータ2について
|
||||
* @default 11_名前1,12_名前2,13_名前3,14_名前4,15_名前5,16_名前6
|
||||
*/
|
||||
|
||||
var CBR_eroStatus = [];
|
||||
var CBR_eroStatusState = {};
|
||||
|
||||
//表示するページ変える
|
||||
Game_System.prototype.CBR_eroSta_page = function (list) {
|
||||
this.availablePage = list;
|
||||
CBR_eroStatusState.num = this.availablePage;
|
||||
};
|
||||
|
||||
//起動・ロード・ニューゲーム時
|
||||
var _CBR_Game_System_initialize = Game_System.prototype.initialize;
|
||||
Game_System.prototype.initialize = function () {
|
||||
_CBR_Game_System_initialize.call(this);
|
||||
|
||||
//初期値
|
||||
CBR_eroStatus = [];
|
||||
CBR_eroStatusState.num = [];
|
||||
CBR_eroStatusState.numOrigin = [];
|
||||
CBR_eroStatusState.now = null;
|
||||
CBR_eroStatusState.name = null;
|
||||
CBR_eroStatusState.event = null;
|
||||
|
||||
this.availablePage = [];
|
||||
|
||||
//ページ数取得
|
||||
//こっちがあったら
|
||||
|
||||
for (var i = 0, len = $plugins.length; i < len; i++) {
|
||||
var temp = $plugins[i].name.match(/^CBR_eroStatus_(\d+)/); //プラグインが存在して
|
||||
if (temp) {
|
||||
CBR_eroStatusState.numOrigin[CBR_eroStatusState.numOrigin.length] =
|
||||
Number(temp[1]);
|
||||
CBR_eroStatusState.num[CBR_eroStatusState.num.length] = Number(temp[1]);
|
||||
}
|
||||
}
|
||||
|
||||
//変更箇所の保存
|
||||
CBR_eroStatusState.numOrigin.sort(function (a, b) {
|
||||
return a - b;
|
||||
}); //_nの小さい順に
|
||||
this._CBR_eroSta_change_list = [];
|
||||
|
||||
//numOriginに[1,2,4,8]ってページが入ってる
|
||||
|
||||
//numには表示すべき[2,4]だけが入ってる
|
||||
|
||||
//エロステには[obj,obj,obj,obj]とOriginに対応した順番で入ってる
|
||||
|
||||
this._CBR_eroSta_pageList = [];
|
||||
|
||||
var param = PluginManager.parameters("CBR_eroStatus_main");
|
||||
CBR_eroStatusState.name = "" + (param["eroStaName"] || "エロステータス");
|
||||
CBR_eroStatusState.event = Number(param["commonEvent"]) || null;
|
||||
CBR_eroStatusState.param1ValId =
|
||||
param["param1ValId"].split(",").map((str) =>
|
||||
str.split("_").map((s, i) => {
|
||||
return i == 0 ? Number(s) : s;
|
||||
})
|
||||
) || [];
|
||||
CBR_eroStatusState.param2ValId =
|
||||
param["param2ValId"].split(",").map((str) =>
|
||||
str.split("_").map((s, i) => {
|
||||
return i == 0 ? Number(s) : s;
|
||||
})
|
||||
) || [];
|
||||
|
||||
for (var i = 0, len = CBR_eroStatusState.numOrigin.length; i < len; i++) {
|
||||
//ページの数だけ
|
||||
var n = CBR_eroStatusState.numOrigin[i];
|
||||
var param = PluginManager.parameters("CBR_eroStatus_" + n);
|
||||
//nは_n.js 1,2,3
|
||||
//iはページの順番 0,1,2
|
||||
//保存する場合は0から99
|
||||
CBR_eroStatus[i] = { p: [], t: [] };
|
||||
|
||||
this._CBR_eroSta_change_list[i] = {
|
||||
p: [],
|
||||
t: [],
|
||||
};
|
||||
|
||||
for (var k = 1; k < 100; k++) {
|
||||
this.CBR_eroSta_add(
|
||||
"p",
|
||||
i,
|
||||
k - 1,
|
||||
param["picName_" + k],
|
||||
param["picX_" + k],
|
||||
param["picY_" + k],
|
||||
param["picOrigin_" + k],
|
||||
param["picShow_" + k],
|
||||
param["picOpacity_" + k],
|
||||
param["picZoom_" + k]
|
||||
);
|
||||
this.CBR_eroSta_add(
|
||||
"t",
|
||||
i,
|
||||
k - 1,
|
||||
param["txtSubject_" + k],
|
||||
param["txtX_" + k],
|
||||
param["txtY_" + k],
|
||||
param["txtOrigin_" + k],
|
||||
param["txtShow_" + k],
|
||||
param["txtAlign_" + k],
|
||||
param["txtSize_" + k]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this._CBR_eroSta_change_list = [];
|
||||
for (var i = 0, len = CBR_eroStatusState.numOrigin.length; i < len; i++) {
|
||||
//ページ分だけチェンジリスト作る
|
||||
this._CBR_eroSta_change_list[i] = {
|
||||
p: [],
|
||||
t: [],
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
//セーブデータ読み込み時に実行
|
||||
var _CBR_Game_System_onAfterLoad = Game_System.prototype.onAfterLoad;
|
||||
Game_System.prototype.onAfterLoad = function () {
|
||||
_CBR_Game_System_onAfterLoad.call(this);
|
||||
|
||||
if (this.availablePage.length) {
|
||||
CBR_eroStatusState.num = this.availablePage;
|
||||
}
|
||||
|
||||
for (var i = 0, len = CBR_eroStatusState.numOrigin.length; i < len; i++) {
|
||||
//ページ数分繰り返す
|
||||
for (var j = 0; j < 2; j++) {
|
||||
var ty = !j ? "p" : "t";
|
||||
var list = this._CBR_eroSta_change_list[i][ty]; //変更したいナンバーリスト
|
||||
for (var k = 0, len2 = list.length; k < len2; k++) {
|
||||
var koumokuList = list[k].list;
|
||||
for (var m = 0, len3 = koumokuList.length; m < len3; m++) {
|
||||
//チェンジする項目数
|
||||
if (!CBR_eroStatus[i][ty][list[k].page]) {
|
||||
//その項目のデフォが存在しなかったら作成
|
||||
this.CBR_eroSta_add(ty, i);
|
||||
}
|
||||
CBR_eroStatus[i][ty][list[k].num][koumokuList[m].name] =
|
||||
koumokuList[m].val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.CBR_eroSta_getPageIndex = function (num) {
|
||||
//aはaligin or opacity bはzoom
|
||||
var ary = CBR_eroStatusState.numOrigin;
|
||||
for (var i = 0, len = ary.length; i < len; i++) {
|
||||
if (ary[i] == num) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.CBR_eroSta_add = function (
|
||||
type,
|
||||
page,
|
||||
num,
|
||||
data,
|
||||
x,
|
||||
y,
|
||||
origin,
|
||||
show,
|
||||
a,
|
||||
b
|
||||
) {
|
||||
//aはaligin or opacity bはzoom
|
||||
if (type == "p") {
|
||||
CBR_eroStatus[page].p[num] = {
|
||||
name: data,
|
||||
x: this.CBR_eroSta_changeVal("x", x),
|
||||
y: this.CBR_eroSta_changeVal("y", y),
|
||||
origin: origin || "left",
|
||||
show: show == "on",
|
||||
opacity: this.CBR_eroSta_changeVal("opacity", a),
|
||||
zoom: this.CBR_eroSta_changeVal("zoom", b),
|
||||
};
|
||||
} else if (type == "t") {
|
||||
CBR_eroStatus[page].t[num] = {
|
||||
subject: data,
|
||||
x: this.CBR_eroSta_changeVal("x", x),
|
||||
y: this.CBR_eroSta_changeVal("y", y),
|
||||
origin: origin || "left",
|
||||
show: show == "on",
|
||||
align: a || "top",
|
||||
size: this.CBR_eroSta_changeVal("size", b),
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.CBR_eroSta_changeVal = function (name, val) {
|
||||
//チェンジする時 add時 ロード時のチェンジで反映させよう
|
||||
switch (name) {
|
||||
case "x":
|
||||
case "y":
|
||||
return Number(val) || 0;
|
||||
break;
|
||||
case "opacity":
|
||||
case "zoom":
|
||||
if (val) {
|
||||
return Number(val) / 100;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case "show":
|
||||
return val == "on";
|
||||
break;
|
||||
case "size":
|
||||
return Number(val) || 28;
|
||||
break;
|
||||
case "name":
|
||||
case "subject":
|
||||
return val || "";
|
||||
break;
|
||||
default:
|
||||
return val;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
Game_System.prototype.CBR_eroSta_change = function (ary) {
|
||||
var txt_ary = {
|
||||
fontsize: "fontSize",
|
||||
vardigit: "varDigit",
|
||||
};
|
||||
|
||||
var checkList = {
|
||||
p: ["name", "origin", "x", "y", "show", "opacity", "zoom"],
|
||||
t: ["subject", "origin", "x", "y", "show", "align", "size"],
|
||||
};
|
||||
|
||||
for (var i = 0, len = ary.length; i < len; i++) {
|
||||
//変更したいpage_type_nの分だけ
|
||||
var temp = ary[i].split(/@@|@_|@=|_|=/);
|
||||
var temp2 = ary[i].match(/@@|@_|@=|_|=/g);
|
||||
|
||||
var list = []; //aryを分割したものを入れる
|
||||
var temp3 = "";
|
||||
for (var k = 0, len2 = temp.length; k < len2; k++) {
|
||||
if (temp2[k]) {
|
||||
if (temp2[k].charAt(0) == "@") {
|
||||
temp3 += temp[k] + temp2[k].charAt(1);
|
||||
} else {
|
||||
list[list.length] = temp3 + temp[k];
|
||||
temp3 = "";
|
||||
}
|
||||
} else {
|
||||
list[list.length] = temp3 + temp[k];
|
||||
}
|
||||
}
|
||||
|
||||
list[0] = Number(list[0]);
|
||||
var page = null;
|
||||
for (var k = 0, len2 = CBR_eroStatusState.numOrigin.length; k < len2; k++) {
|
||||
//ページ数だけ回す
|
||||
if (CBR_eroStatusState.numOrigin[k] == list[0]) {
|
||||
//nと一致したら
|
||||
page = k;
|
||||
}
|
||||
}
|
||||
var type = list[1];
|
||||
var n = Number(list[2]) - 1;
|
||||
|
||||
//しつこい気もするけどエロステータス開く時の軽さを最優先で
|
||||
var obj = this._CBR_eroSta_change_list[page][type];
|
||||
|
||||
var objNum = false;
|
||||
for (var k = 0, len2 = obj.length; k < len2; k++) {
|
||||
//このページのchange数
|
||||
if (n == obj[k].num) {
|
||||
//nとチェンジしたい番号が一緒だったら
|
||||
objNum = k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (objNum === false) {
|
||||
objNum = len2;
|
||||
obj[objNum] = {
|
||||
num: n,
|
||||
list: [],
|
||||
};
|
||||
}
|
||||
|
||||
//変更したいパラメータ数だけ回す
|
||||
var chaList = obj[objNum].list;
|
||||
for (var k = 3, len2 = list.length; k + 1 < len2; k += 2) {
|
||||
var listNum = false;
|
||||
for (var m = 0, len3 = chaList.length; m < len3; m++) {
|
||||
//既に存在するチェンジ数
|
||||
if (list[k] == chaList[m].name) {
|
||||
//一致する箇所があるかどうか
|
||||
listNum = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (listNum === false) {
|
||||
//無かったら
|
||||
listNum = len3;
|
||||
for (var m = 0, len3 = checkList[type].length; m < len3; m++) {
|
||||
//ちゃんと項目通りかチェック
|
||||
if (list[k] == checkList[type][m]) {
|
||||
break;
|
||||
} else if (m + 1 == len3) {
|
||||
//もし無かったら
|
||||
alert("ERROR:CBR_eroSta_change引数");
|
||||
}
|
||||
}
|
||||
}
|
||||
list[k + 1] = this.CBR_eroSta_changeVal(list[k], list[k + 1]);
|
||||
chaList[listNum] = {
|
||||
name: list[k],
|
||||
val: list[k + 1],
|
||||
};
|
||||
CBR_eroStatus[page][type][n][list[k]] = list[k + 1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//########### Scene ###########
|
||||
function Scene_EroStatus() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
Scene_EroStatus.prototype = Object.create(Scene_MenuBase.prototype);
|
||||
Scene_EroStatus.prototype.constructor = Scene_EroStatus;
|
||||
|
||||
Scene_EroStatus.prototype.initialize = function () {
|
||||
Scene_MenuBase.prototype.initialize.call(this);
|
||||
};
|
||||
Scene_EroStatus.prototype.create = function () {
|
||||
Scene_MenuBase.prototype.create.call(this);
|
||||
if (CBR_eroStatusState.event) {
|
||||
$gameTemp.reserveCommonEvent(CBR_eroStatusState.event);
|
||||
}
|
||||
this._eroStatusWindow = new Window_EroStatus();
|
||||
this._eroStatusWindow.setHandler("cancel", this.popScene.bind(this));
|
||||
|
||||
this._eroStatusWindow._margin = 0; //背景ピッチリする為
|
||||
this._eroStatusWindow.margin = 0; //本当はこっちだけどね
|
||||
this._eroStatusWindow._windowFrameSprite.visible = false; //枠線を消す
|
||||
|
||||
this.addWindow(this._eroStatusWindow);
|
||||
};
|
||||
|
||||
Scene_EroStatus.prototype.update = function () {
|
||||
$gameMap.refreshIfNeeded();
|
||||
if (this.isActive()) {
|
||||
$gameMap.updateInterpreter();
|
||||
}
|
||||
$gameMap.updateVehicles();
|
||||
|
||||
Scene_Base.prototype.update.call(this);
|
||||
};
|
||||
|
||||
//########### window ###########
|
||||
function Window_EroStatus() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Window_EroStatus.prototype = Object.create(Window_Selectable.prototype);
|
||||
Window_EroStatus.prototype.constructor = Window_EroStatus;
|
||||
|
||||
Window_EroStatus.prototype.initialize = function () {
|
||||
//windowを作る
|
||||
var width = Graphics.boxWidth;
|
||||
var height = Graphics.boxHeight;
|
||||
Window_Selectable.prototype.initialize.call(this, 0, 0, width, height);
|
||||
CBR_eroStatusState.now = 0;
|
||||
this._CBR_complete = false;
|
||||
};
|
||||
|
||||
Window_EroStatus.prototype.CBR_complete = function () {
|
||||
//描写終わったかどうか
|
||||
return this._CBR_complete;
|
||||
};
|
||||
|
||||
Window_EroStatus.prototype.update = function () {
|
||||
//毎回image描写してもいいけどそれだと負荷が多くなるのでこの方法で
|
||||
Window_Selectable.prototype.update.call(this);
|
||||
|
||||
if (1 < CBR_eroStatusState.num.length && this.isOpenAndActive()) {
|
||||
//操作があった時
|
||||
//22/11/01 村人A修正
|
||||
if (
|
||||
Input.isRepeated("right") ||
|
||||
Input.isRepeated("left") ||
|
||||
TouchInput.isTriggered() ||
|
||||
Math.abs(TouchInput.wheelY) >= 20
|
||||
) {
|
||||
SoundManager.playCursor(2); //音楽鳴らす
|
||||
CBR_eroStatusState.now =
|
||||
CBR_eroStatusState.now + 1 < CBR_eroStatusState.num.length
|
||||
? CBR_eroStatusState.now + 1
|
||||
: 0;
|
||||
this._CBR_complete = false; //初期化
|
||||
//this._statusWindow.refresh();//切り替えしたんでリフレッシュ
|
||||
}
|
||||
}
|
||||
|
||||
var page = $gameSystem.CBR_eroSta_getPageIndex(
|
||||
CBR_eroStatusState.num[CBR_eroStatusState.now]
|
||||
);
|
||||
|
||||
if (!this.CBR_complete()) {
|
||||
//まだ画像の描写してないのなら
|
||||
var flag = false;
|
||||
var ary = CBR_eroStatus[page].p;
|
||||
var p_data = [];
|
||||
//ピクチャの数だけ
|
||||
for (var i = 0, len = ary.length; i < len; i++) {
|
||||
var name = ary[i].name;
|
||||
if (!name || !ary[i].show) {
|
||||
continue;
|
||||
}
|
||||
name = name.replace(
|
||||
/\\(\\)|\\([VNP])\[(\d+)\]|\\(<)(.+)\\>/g,
|
||||
function (a, b, c, d, e, f) {
|
||||
//汚いけどこれは毎回やらないとね
|
||||
if (b) {
|
||||
//\\
|
||||
return "\\";
|
||||
} else if (c) {
|
||||
//[VNP]
|
||||
d = Number(d);
|
||||
switch (c) {
|
||||
case "V":
|
||||
return $gameVariables.value(d);
|
||||
break;
|
||||
case "N":
|
||||
return $gameActors._data[d]._name;
|
||||
break;
|
||||
case "P":
|
||||
return $dataActors[$gameParty._actors[d - 1]].name;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
//script
|
||||
return eval(f);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (ary[i].var) {
|
||||
//変数があったら入れる
|
||||
var v = "" + $gameVariables.value(ary[i].var);
|
||||
if (ary[i].varDigit) {
|
||||
//2ケタの時は2まで
|
||||
if (v.length >= ary[i].varDigit) {
|
||||
name += v.substr(-1 * ary[i].varDigit, 1);
|
||||
} else {
|
||||
name = false;
|
||||
}
|
||||
} else {
|
||||
name += v;
|
||||
}
|
||||
}
|
||||
if (name) {
|
||||
var temp = ImageManager.loadPicture(name); //初回読み込み
|
||||
if (temp) {
|
||||
//if(temp._isLoading || temp._loadingState == 'requesting'){//前者は古いver用 ロード中ならアウト
|
||||
if (!temp.width) {
|
||||
//前者は古いver用 ロード中ならアウト
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
//その名前の画像が無かったら
|
||||
flag = true;
|
||||
this._CBR_complete = true;
|
||||
break;
|
||||
}
|
||||
p_data[i] = {
|
||||
w: temp.width,
|
||||
h: temp.height,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag) {
|
||||
//全ロードが終わってたら
|
||||
this.contents.clear();
|
||||
|
||||
//ピクチャの表示
|
||||
var ary = CBR_eroStatus[page].p;
|
||||
for (var i = 0, len = ary.length; i < len; i++) {
|
||||
var name = ary[i].name;
|
||||
if (!name || !ary[i].show) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//変数とか文字化
|
||||
name = name.replace(
|
||||
/\\(\\)|\\([VNP])\[(\d+)\]|\\(<)(.+)\\>/g,
|
||||
function (a, b, c, d, e, f) {
|
||||
if (b) {
|
||||
//\\
|
||||
return "\\";
|
||||
} else if (c) {
|
||||
//[VNP]
|
||||
d = Number(d);
|
||||
switch (c) {
|
||||
case "V":
|
||||
return $gameVariables.value(d);
|
||||
break;
|
||||
case "N":
|
||||
return $gameActors._data[d]._name;
|
||||
break;
|
||||
case "P":
|
||||
return $dataActors[$gameParty._actors[d - 1]].name;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
//script
|
||||
return eval(f);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (name) {
|
||||
this.changePaintOpacity(ary[i].opacity);
|
||||
|
||||
var x = ary[i].x;
|
||||
var y = ary[i].y;
|
||||
if (ary[i].origin == "center") {
|
||||
x -= (p_data[i].w * ary[i].zoom) / 2;
|
||||
y -= (p_data[i].h * ary[i].zoom) / 2;
|
||||
}
|
||||
this.drawPicture("pictures", name, 0, 0, x, y, 0, 0, ary[i].zoom, 0);
|
||||
}
|
||||
}
|
||||
|
||||
//テキストの表示
|
||||
this.resetTextColor();
|
||||
var ary = CBR_eroStatus[page].t;
|
||||
for (var i = 0, len = ary.length; i < len; i++) {
|
||||
var size = ary[i].size; // ary[i].fontSize;
|
||||
var temp = ary[i].subject;
|
||||
if (!temp || !ary[i].show) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//22/11/01 村人A修正
|
||||
if (page == 0) {
|
||||
if (i == 0) {
|
||||
let arr = CBR_eroStatusState.param1ValId.sort((a, b) => {
|
||||
return $gameVariables.value(a[0]) > $gameVariables.value(b[0])
|
||||
? -1
|
||||
: $gameVariables.value(a[0]) < $gameVariables.value(b[0])
|
||||
? 1
|
||||
: 0;
|
||||
});
|
||||
temp = arr[0][1];
|
||||
} else if (i == 3) {
|
||||
let arr = CBR_eroStatusState.param2ValId.sort((a, b) => {
|
||||
return $gameVariables.value(a[0]) > $gameVariables.value(b[0])
|
||||
? -1
|
||||
: $gameVariables.value(a[0]) < $gameVariables.value(b[0])
|
||||
? 1
|
||||
: 0;
|
||||
});
|
||||
temp = arr[0][1];
|
||||
}
|
||||
}
|
||||
|
||||
var opAry = temp.match(/(\\\{|\\\}|\\[CI]\[\d+\])+/g);
|
||||
|
||||
//先頭にある場合は"","tesa"になる
|
||||
var strAry = temp.split(/(?:\\\{|\\\}|\\[CI]\[\d+\])+/);
|
||||
|
||||
var str = "";
|
||||
var allW = 0;
|
||||
var maxSize = null;
|
||||
var dataFAry = [];
|
||||
var dataWAry = [];
|
||||
var drawI = [];
|
||||
var drawC = [];
|
||||
//分割した配列の数
|
||||
for (var k = 0, len2 = strAry.length; k < len2; k++) {
|
||||
//前方にある\{のフォントサイズを入れる
|
||||
dataFAry[k] = k ? dataFAry[k - 1] : 0;
|
||||
drawI[k] = [];
|
||||
|
||||
//変数とか文字化
|
||||
strAry[k] = strAry[k].replace(
|
||||
/\\(\\)|\\([VNP])\[(\d+)\]|\\(G)|\\(<)(.+)\\>/g,
|
||||
function (a, b, c, d, e, f, g) {
|
||||
if (b) {
|
||||
//\\
|
||||
return "\\";
|
||||
} else if (c) {
|
||||
//[VNP]
|
||||
d = Number(d);
|
||||
switch (c) {
|
||||
case "V":
|
||||
return $gameVariables.value(d);
|
||||
break;
|
||||
case "N":
|
||||
return $gameActors._data[d]._name;
|
||||
break;
|
||||
case "P":
|
||||
return $dataActors[$gameParty._actors[d - 1]].name;
|
||||
break;
|
||||
}
|
||||
} else if (e) {
|
||||
//G
|
||||
return $dataSystem.currencyUnit;
|
||||
} else {
|
||||
//script
|
||||
return eval(g);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//自身の前に区切りマッチがあったら
|
||||
if (0 < k) {
|
||||
var temp = opAry[k - 1].split("\\"); //\\{\\}を分割する
|
||||
for (var m = 1, len3 = temp.length; m < len3; m++) {
|
||||
switch (temp[m].charAt(0)) {
|
||||
case "{":
|
||||
dataFAry[k] += 6;
|
||||
break;
|
||||
case "}":
|
||||
dataFAry[k] -= 6;
|
||||
break;
|
||||
case "C":
|
||||
drawC[k] = Number(temp[m].match(/\[(\d+)\]/)[1]); //Cは複数あっても最後のが適応されれば良いわけで
|
||||
break;
|
||||
case "I":
|
||||
drawI[k][drawI[k].length] = Number(
|
||||
temp[m].match(/\[(\d+)\]/)[1]
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.contents.fontSize = size + dataFAry[k];
|
||||
this.contents.context.font = this.contents._makeFontNameText();
|
||||
dataWAry[k] = this.contents.context.measureText(strAry[k]).width; //何の為に+4するのか忘れた
|
||||
allW += dataWAry[k];
|
||||
|
||||
if (strAry[k]) {
|
||||
//先頭に\{や変数がある時の問題 アイコン乃場合もここを通さないと
|
||||
if (maxSize === null) {
|
||||
//まだ記録されてなかったら入れよう
|
||||
maxSize = dataFAry[k];
|
||||
} else {
|
||||
maxSize = maxSize < dataFAry[k] ? dataFAry[k] : maxSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var x = ary[i].x;
|
||||
if (ary[i].origin == "center") {
|
||||
x -= allW / 2;
|
||||
} else if (ary[i].origin == "right") {
|
||||
x -= allW;
|
||||
}
|
||||
for (var k = 0, len2 = strAry.length; k < len2; k++) {
|
||||
this.contents.fontSize = size + dataFAry[k];
|
||||
this.contents.context.font = this.contents._makeFontNameText();
|
||||
//bottom→下揃え原点の上 top→上揃え原点の下 center→原点
|
||||
var line = ary[i].y;
|
||||
var iconLine = ary[i].y;
|
||||
if (ary[i].align == "top") {
|
||||
line += (size + dataFAry[k]) / 2;
|
||||
} else if (ary[i].align == "bottom") {
|
||||
line -= (size + dataFAry[k]) / 2;
|
||||
iconLine -= Window_Base._iconWidth;
|
||||
} else {
|
||||
iconLine -= Window_Base._iconWidth / 2;
|
||||
}
|
||||
if (drawI[k].length) {
|
||||
for (var m = 0, len3 = drawI[k].length; m < len3; m++) {
|
||||
this.drawIcon(drawI[k][m], x, iconLine);
|
||||
x += Window_Base._iconWidth;
|
||||
}
|
||||
}
|
||||
if (drawC[k] || drawC[k] === 0) {
|
||||
this.changeTextColor(this.textColor(drawC[k]));
|
||||
}
|
||||
this.contents.drawText(strAry[k], x, line, dataWAry[k], 0, "left");
|
||||
x += dataWAry[k];
|
||||
}
|
||||
this.contents.fontSize = this.standardFontSize();
|
||||
}
|
||||
this.resetTextColor();
|
||||
this.changePaintOpacity(true);
|
||||
|
||||
this.activate();
|
||||
this._CBR_complete = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Window_EroStatus.prototype.drawPicture = function (
|
||||
dir,
|
||||
filename,
|
||||
sx,
|
||||
sy,
|
||||
x,
|
||||
y,
|
||||
w,
|
||||
h,
|
||||
zoom,
|
||||
hue
|
||||
) {
|
||||
var bitmap = ImageManager.loadBitmap("img/" + dir + "/", filename, hue, true);
|
||||
this.contents.blt(
|
||||
bitmap,
|
||||
sx,
|
||||
sy,
|
||||
bitmap.width,
|
||||
bitmap.height,
|
||||
x,
|
||||
y,
|
||||
bitmap.width * zoom,
|
||||
bitmap.height * zoom
|
||||
);
|
||||
};
|
||||
Window_EroStatus.prototype.standardPadding = function () {
|
||||
return 0;
|
||||
};
|
||||
Window_Status.prototype.lineColor = function () {
|
||||
return this.normalColor();
|
||||
};
|
||||
Window_Status.prototype.maxEquipmentLines = function () {
|
||||
return 6;
|
||||
};
|
||||
|
||||
//######### コマンドの追加 ##########
|
||||
Scene_Menu.prototype.commandEroSta = function () {
|
||||
SceneManager.push(Scene_EroStatus);
|
||||
};
|
||||
setTimeout(function () {
|
||||
var _Scene_Menu_createCommandWindow =
|
||||
Scene_Menu.prototype.createCommandWindow;
|
||||
Scene_Menu.prototype.createCommandWindow = function () {
|
||||
_Scene_Menu_createCommandWindow.call(this);
|
||||
this._commandWindow.setHandler("eroStatus", this.commandEroSta.bind(this));
|
||||
};
|
||||
}, 0);
|
||||
_Window_MenuCommand_addOriginalCommands =
|
||||
Window_MenuCommand.prototype.addOriginalCommands;
|
||||
Window_MenuCommand.prototype.addOriginalCommands = function () {
|
||||
_Window_MenuCommand_addOriginalCommands.call(this);
|
||||
this.addCommand(CBR_eroStatusState.name, "eroStatus", true);
|
||||
};
|
||||
145
www/js/plugins/CenterMessateWindow.js
Normal file
145
www/js/plugins/CenterMessateWindow.js
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
//============================================
|
||||
// CenterMessateWindow.js
|
||||
//============================================
|
||||
|
||||
/*:ja
|
||||
* @plugindesc マップと戦闘時の任意のタイミングで中央にメッセージの入ったウィンドウを表示するプラグインです。
|
||||
* @author 村人A
|
||||
*
|
||||
* @help
|
||||
* _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
||||
*
|
||||
* バージョン情報
|
||||
*
|
||||
* 2019/1/4 1.00リリース
|
||||
*
|
||||
* _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
||||
*
|
||||
*/
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const _alias_cmw_Game_Interpreter_pluginCommand =
|
||||
Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
_alias_cmw_Game_Interpreter_pluginCommand.call(this, command, args);
|
||||
if (command === "中央ウィンドウ表示") {
|
||||
SceneManager._scene._centermessageWindow.startMessage(args[0]);
|
||||
}
|
||||
};
|
||||
|
||||
const _alias_cmw_Game_Interpreter_updateWaitMode =
|
||||
Game_Interpreter.prototype.updateWaitMode;
|
||||
Game_Interpreter.prototype.updateWaitMode = function () {
|
||||
let waiting = _alias_cmw_Game_Interpreter_updateWaitMode.call(this);
|
||||
if (!waiting) {
|
||||
waiting = $gameSystem.isRunningCenterMessage;
|
||||
}
|
||||
return waiting;
|
||||
};
|
||||
|
||||
Scene_Base.prototype.createCenterMessageWindow = function () {
|
||||
this._centermessageWindow = new Window_CenterMessage();
|
||||
this.addChild(this._centermessageWindow);
|
||||
};
|
||||
|
||||
const _alias_cmw_Scene_Map_createAllWindows =
|
||||
Scene_Map.prototype.createAllWindows;
|
||||
Scene_Map.prototype.createAllWindows = function () {
|
||||
_alias_cmw_Scene_Map_createAllWindows.call(this);
|
||||
this.createCenterMessageWindow();
|
||||
};
|
||||
|
||||
const _alias_cmw_Scene_Map_update = Scene_Map.prototype.update;
|
||||
Scene_Map.prototype.update = function () {
|
||||
_alias_cmw_Scene_Map_update.call(this);
|
||||
this._centermessageWindow.update();
|
||||
};
|
||||
|
||||
const _alias_cmw_Scene_Battle_createAllWindows =
|
||||
Scene_Battle.prototype.createAllWindows;
|
||||
Scene_Battle.prototype.createAllWindows = function () {
|
||||
_alias_cmw_Scene_Battle_createAllWindows.call(this);
|
||||
this.createCenterMessageWindow();
|
||||
};
|
||||
|
||||
const _alias_cmw_Scene_Battle_update = Scene_Battle.prototype.update;
|
||||
Scene_Battle.prototype.update = function () {
|
||||
_alias_cmw_Scene_Battle_update.call(this);
|
||||
this._centermessageWindow.update();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window_CenterMessage
|
||||
//
|
||||
|
||||
function Window_CenterMessage() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
Window_CenterMessage.prototype = Object.create(Window_Base.prototype);
|
||||
Window_CenterMessage.prototype.constructor = Window_CenterMessage;
|
||||
|
||||
Window_CenterMessage.prototype.initialize = function () {
|
||||
Window_Base.prototype.initialize.call(
|
||||
this,
|
||||
0,
|
||||
0,
|
||||
Graphics.width,
|
||||
Graphics.height
|
||||
);
|
||||
this.openness = 0;
|
||||
};
|
||||
|
||||
Window_CenterMessage.prototype.isTriggered = function () {
|
||||
return (
|
||||
Input.isRepeated("ok") ||
|
||||
Input.isRepeated("cancel") ||
|
||||
TouchInput.isRepeated()
|
||||
);
|
||||
};
|
||||
|
||||
Window_CenterMessage.prototype.update = function () {
|
||||
Window_Base.prototype.update.call(this);
|
||||
if (this.isOpen() && this.isTriggered()) {
|
||||
this.close();
|
||||
}
|
||||
};
|
||||
|
||||
Window_CenterMessage.prototype.updateClose = function () {
|
||||
if (this._closing) {
|
||||
this.openness -= 32;
|
||||
if (this.isClosed()) {
|
||||
this._closing = false;
|
||||
$gameSystem.isRunningCenterMessage = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Window_CenterMessage.prototype.startMessage = function (text) {
|
||||
this._text = text;
|
||||
const w = this.textWidth(text);
|
||||
this.width = w + this.standardPadding() * 2;
|
||||
this.height = this.lineHeight() + this.standardPadding() * 2;
|
||||
this.x = (Graphics.width - this.width) / 2;
|
||||
this.y = (Graphics.height - this.height) / 2;
|
||||
this.contents.clear();
|
||||
this.drawTextEx(text, 0, 0);
|
||||
this.open();
|
||||
$gameSystem.isRunningCenterMessage = true;
|
||||
};
|
||||
|
||||
const _alias_cmw_Game_System_initialize = Game_System.prototype.initialize;
|
||||
Game_System.prototype.initialize = function () {
|
||||
_alias_cmw_Game_System_initialize.call(this);
|
||||
this.isRunningCenterMessage = false;
|
||||
};
|
||||
|
||||
const _alias_cmw_Game_Map_isEventRunning = Game_Map.prototype.isEventRunning;
|
||||
Game_Map.prototype.isEventRunning = function () {
|
||||
return (
|
||||
_alias_cmw_Game_Map_isEventRunning.call(this) ||
|
||||
$gameSystem.isRunningCenterMessage
|
||||
);
|
||||
};
|
||||
})();
|
||||
1954
www/js/plugins/Chronus.js
Normal file
1954
www/js/plugins/Chronus.js
Normal file
File diff suppressed because it is too large
Load diff
155
www/js/plugins/ClampVariables.js
Normal file
155
www/js/plugins/ClampVariables.js
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
//===============================================
|
||||
// ClampVariables.js
|
||||
//===============================================
|
||||
|
||||
/*:ja
|
||||
* @plugindesc ゲーム内変数に上下限を設定するプラグインです。
|
||||
* @author 村人A
|
||||
* @target MV
|
||||
*
|
||||
* @help
|
||||
* *このプラグインはアップルソフト様専用に作られたプラグインです。
|
||||
* *その他の方の無断の使用を禁止します。
|
||||
*
|
||||
* _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
||||
*
|
||||
* バージョン情報
|
||||
*
|
||||
* 2022/11/13 ver 1.0リリース
|
||||
*
|
||||
* _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
|
||||
*
|
||||
* ===================================
|
||||
* ヘルプ
|
||||
* ===================================
|
||||
*
|
||||
* プラグインパラメータにて設定した変数が操作された際に設定した上下限を超えないよ
|
||||
* うにします。
|
||||
* 各パラメータに半角カンマを挟んで
|
||||
*
|
||||
* 変数のID,上限,下限
|
||||
*
|
||||
* と設定してください。
|
||||
* 変数のIDを-1とするとそのパラメータは無効となります。
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param na1
|
||||
* @text 変数の上下限1
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na2
|
||||
* @text 変数の上下限2
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na3
|
||||
* @text 変数の上下限3
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na4
|
||||
* @text 変数の上下限4
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na5
|
||||
* @text 変数の上下限5
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na6
|
||||
* @text 変数の上下限6
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na7
|
||||
* @text 変数の上下限7
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na8
|
||||
* @text 変数の上下限8
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na9
|
||||
* @text 変数の上下限9
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
* @param na10
|
||||
* @text 変数の上下限10
|
||||
* @desc 変数の上下限を設定します。変数ID,上限,下限で設定します。
|
||||
* @default -1,100,0
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
{
|
||||
("use strict");
|
||||
|
||||
String.prototype.toNumArray = function () {
|
||||
if (this == "") {
|
||||
return [];
|
||||
}
|
||||
return this.split(",").map((str) => Number(str));
|
||||
};
|
||||
|
||||
const pluginName = "ClampVariables";
|
||||
const param = PluginManager.parameters(pluginName);
|
||||
const paramNum = 10;
|
||||
|
||||
const convertObjectParam = (ob) => {
|
||||
Object.keys(ob).forEach((key) => {
|
||||
if (key[0] == "n" && key[1] == "a" && key[2] == "a") {
|
||||
ob[key] = JSON.parse(ob[key]).map((str) => str.toNumArray());
|
||||
} else if (key[0] == "o" && key[1] == "n" && key[2] == "a") {
|
||||
ob[key] = JSON.parse(ob[key]).map((str) => Number(str));
|
||||
} else if (key[0] == "n" && key[1] == "a") {
|
||||
ob[key] = ob[key].toNumArray();
|
||||
} else if (key[0] == "n") {
|
||||
ob[key] = Number(ob[key]);
|
||||
} else if (key[0] == "s" && key[1] == "a" && key[2] == "a") {
|
||||
ob[key] = JSON.parse(ob[key]).map((str) => str.split(","));
|
||||
} else if (key[0] == "s" && key[1] == "a") {
|
||||
ob[key] = JSON.parse(ob[key]);
|
||||
} else if (key[0] == "s") {
|
||||
ob[key] = ob[key];
|
||||
} else if (key[0] == "b") {
|
||||
ob[key] = JSON.parse(ob[key]);
|
||||
} else if (key[0] == "o" && key[1] == "b" && key[2] == "a") {
|
||||
ob[key] = convertObjectArrayParam(ob[key]);
|
||||
} else if (key[0] == "o" && key[1] == "b") {
|
||||
ob[key] = convertObjectParam(JSON.parse(ob[key]));
|
||||
}
|
||||
});
|
||||
return ob;
|
||||
};
|
||||
|
||||
const convertObjectArrayParam = (object) => {
|
||||
let json = JSON.parse(object).map((str) => JSON.parse(str));
|
||||
json.map((ob) => convertObjectParam(ob));
|
||||
return json;
|
||||
};
|
||||
|
||||
const _ = convertObjectParam(param);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Game_Variables
|
||||
//
|
||||
|
||||
const _alias_Game_Variables_setValue = Game_Variables.prototype.setValue;
|
||||
Game_Variables.prototype.setValue = function (variableId, value) {
|
||||
for (let i = 1; i <= paramNum; i++) {
|
||||
const arr = _["na" + i];
|
||||
if (arr[0] == variableId) {
|
||||
value = value.clamp(arr[2], arr[1]);
|
||||
}
|
||||
}
|
||||
_alias_Game_Variables_setValue.call(this, variableId, value);
|
||||
};
|
||||
}
|
||||
148
www/js/plugins/CommonEventBeforeAfterMenu.js
Normal file
148
www/js/plugins/CommonEventBeforeAfterMenu.js
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
//=============================================================================
|
||||
// CommonEventBeforeAfterMenu.js ver.1.04
|
||||
//=============================================================================
|
||||
|
||||
/*:
|
||||
* @plugindesc メニューを開く直前、または閉じた直後に、指定したコモンイベントを実行します。
|
||||
* @author 奏ねこま(おとぶきねこま)
|
||||
* @url http://makonet.sakura.ne.jp/rpg_tkool
|
||||
* @target MZ
|
||||
*
|
||||
* @param Common Event ID (before Menu)
|
||||
* @desc メニューを開く直前に実行するコモンイベントのIDを指定してください。
|
||||
* @default 0
|
||||
*
|
||||
* @param Common Event ID (after Menu)
|
||||
* @desc メニューを閉じた直後に実行するコモンイベントのIDを指定してください。
|
||||
* @default 0
|
||||
*
|
||||
* @help
|
||||
* *このプラグインには、プラグインコマンドはありません。
|
||||
*
|
||||
* ----------------------------------------------------------------------------
|
||||
* 本プラグインの利用はRPGツクール/RPG Makerの正規ユーザーに限られます。
|
||||
* 商用、非商用、有償、無償、一般向け、成人向けを問わず利用可能です。
|
||||
* ご利用の際に連絡や報告は必要ありません。また、製作者名の記載等も不要です。
|
||||
* プラグインを導入した作品に同梱する形以外での再配布、転載はご遠慮ください。
|
||||
* 本プラグインにより生じたいかなる問題についても一切の責任を負いかねます。
|
||||
* ----------------------------------------------------------------------------
|
||||
* Version 1.04 2022/08/10 イベントコマンドからメニュー画面を開いた場合に
|
||||
* コモンイベントが正しく実行されない問題を修正
|
||||
* Version 1.03 2017/04/24 ウェイトを含んだコモンイベントを実行すると、
|
||||
* イベント後にメニューが開かない問題を修正
|
||||
* Version 1.02 2017/02/13 メニュー後コモンイベントが、マップ以外への
|
||||
* シーン遷移時にも実行予約されていた問題を修正
|
||||
* Version 1.01 2017/01/05 メニュー後コモンイベントIDを0に設定しても
|
||||
* コモンイベントの予約が実行されていた問題を修正
|
||||
* Version 1.00 2016/07/21 初版
|
||||
* ----------------------------------------------------------------------------
|
||||
* Copylight (c) 2022 Nekoma Otobuki
|
||||
* http://makonet.sakura.ne.jp/rpg_tkool/
|
||||
* https://twitter.com/koma_neko
|
||||
*/
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const _PNAME = "CommonEventBeforeAfterMenu";
|
||||
const _PARAMETERS = PluginManager.parameters(_PNAME);
|
||||
|
||||
const _COMMON_EVENT_ID_BM =
|
||||
+_PARAMETERS["Common Event ID (before Menu)"] || 0;
|
||||
const _COMMON_EVENT_ID_AM = +_PARAMETERS["Common Event ID (after Menu)"] || 0;
|
||||
|
||||
function _(f) {
|
||||
return (f[_PNAME] = f[_PNAME] || {});
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
// Scene_Map
|
||||
//==============================================================================
|
||||
|
||||
var _Scene_Map_isMenuCalled = Scene_Map.prototype.isMenuCalled;
|
||||
Scene_Map.prototype.isMenuCalled = function () {
|
||||
return _Scene_Map_isMenuCalled.call(this) || _(this).reserveCallMenu;
|
||||
};
|
||||
|
||||
var _Scene_Map_callMenu = Scene_Map.prototype.callMenu;
|
||||
Scene_Map.prototype.callMenu = function () {
|
||||
if (_COMMON_EVENT_ID_BM && !_(this).reserveCallMenu) {
|
||||
_(this).reserveCallMenu = true;
|
||||
$gameTemp.reserveCommonEvent(_COMMON_EVENT_ID_BM);
|
||||
} else {
|
||||
_(this).reserveCallMenu = false;
|
||||
_Scene_Map_callMenu.call(this);
|
||||
}
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Scene_Menu
|
||||
//==============================================================================
|
||||
|
||||
var _Scene_Menu_terminate = Scene_Menu.prototype.terminate;
|
||||
Scene_Menu.prototype.terminate = function () {
|
||||
if (
|
||||
_COMMON_EVENT_ID_AM &&
|
||||
!$gameTemp.isCalledMenuFromEvent &&
|
||||
SceneManager.isNextScene(Scene_Map)
|
||||
) {
|
||||
$gameTemp.reserveCommonEvent(_COMMON_EVENT_ID_AM);
|
||||
}
|
||||
$gameTemp.isCalledMenuFromEvent = false;
|
||||
_Scene_Menu_terminate.call(this);
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Game_Temp
|
||||
//==============================================================================
|
||||
|
||||
((__initialize) => {
|
||||
Game_Temp.prototype.initialize = function () {
|
||||
__initialize.apply(this, arguments);
|
||||
this.isCalledMenuFromEvent = false;
|
||||
};
|
||||
})(Game_Temp.prototype.initialize);
|
||||
|
||||
//==============================================================================
|
||||
// Game_Interpreter
|
||||
//==============================================================================
|
||||
|
||||
((__setup) => {
|
||||
let common1 = { code: 117, indent: 0, parameters: [_COMMON_EVENT_ID_BM] };
|
||||
let common2 = { code: 117, indent: 0, parameters: [_COMMON_EVENT_ID_AM] };
|
||||
|
||||
Game_Interpreter.prototype.setup = function (list, eventId) {
|
||||
let _list = list;
|
||||
if (_COMMON_EVENT_ID_BM || _COMMON_EVENT_ID_AM) {
|
||||
let hasCallMenu = list.some((event) => event.code == 351);
|
||||
if (hasCallMenu) {
|
||||
_list = [];
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].code == 351) {
|
||||
let indent = list[i].indent;
|
||||
if (_COMMON_EVENT_ID_BM) {
|
||||
common1.indent = indent;
|
||||
_list.push({ ...common1 });
|
||||
}
|
||||
_list.push(list[i]);
|
||||
if (_COMMON_EVENT_ID_AM) {
|
||||
common2.indent = indent;
|
||||
_list.push({ ...common2 });
|
||||
}
|
||||
} else {
|
||||
_list.push(list[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
__setup.call(this, _list, eventId);
|
||||
};
|
||||
})(Game_Interpreter.prototype.setup);
|
||||
|
||||
((__command351) => {
|
||||
Game_Interpreter.prototype.command351 = function () {
|
||||
$gameTemp.isCalledMenuFromEvent = true;
|
||||
return __command351.apply(this, arguments);
|
||||
};
|
||||
})(Game_Interpreter.prototype.command351);
|
||||
})();
|
||||
828
www/js/plugins/CommonPopupCore.js
Normal file
828
www/js/plugins/CommonPopupCore.js
Normal file
|
|
@ -0,0 +1,828 @@
|
|||
//
|
||||
// 汎用ポップアップコア ver1.06
|
||||
//
|
||||
// ------------------------------------------------------
|
||||
// Copyright (c) 2016 Yana
|
||||
// Released under the MIT license
|
||||
// http://opensource.org/licenses/mit-license.php
|
||||
// ------------------------------------------------------
|
||||
//
|
||||
// author Yana
|
||||
//
|
||||
|
||||
var Imported = Imported || {};
|
||||
Imported["CommonPopupCore"] = 1.06;
|
||||
|
||||
/*:
|
||||
* @plugindesc ver1.06/汎用的なポップアップの仕組みを提供するためのベースプラグインです。
|
||||
* @author Yana
|
||||
*
|
||||
* @param Text Back Color
|
||||
* @desc ポップアップの背景カラーです。
|
||||
* rgba(red,green,blue,alpha)で設定してください。
|
||||
* @default rgba(0,0,0,0.6)
|
||||
*
|
||||
* @param Text Back FileName
|
||||
* @desc ポップアップの背景画像名です。
|
||||
* %dがインデックスに変換されます。
|
||||
* @default popup_back%d
|
||||
*
|
||||
* @help プラグインコマンド
|
||||
* CommonPopup add param1 param2 param3 ・・・
|
||||
*
|
||||
* 必要なパラメータのみを指定できます。
|
||||
* 例:プレイヤーの上にテストと240フレームポップアップさせる
|
||||
* CommonPopup add text:テスト count:240 eventId:-1
|
||||
*
|
||||
* パラメータ詳細:
|
||||
* text:表示テキスト
|
||||
* eventId:表示するイベントのID
|
||||
* count:表示時間
|
||||
* delay:表示遅延
|
||||
* moveX:目標地点X(相対座標)
|
||||
* moveY:目標地点Y(相対座標)
|
||||
* sx:表示位置補正X
|
||||
* sy:表示位置補正Y
|
||||
* pattern:表示パターン 0がフェード、-1が横ストレッチ、-2が縦ストレッチ
|
||||
* back:-1:透明背景,0:背景カラーで塗りつぶし,1以上:画像インデックス
|
||||
* bx:内容の表示位置補正X
|
||||
* by:内容の表示位置補正Y
|
||||
* extend:表示タイミングの調整用配列で指定。 例:extend:[20,50] 20フレーム掛けて出現し、50フレーム目から消え始める。
|
||||
* fixed:画面に固定するか? true/falseで指定。
|
||||
* anchorX:
|
||||
* anchorY:
|
||||
* slideCount:新しいポップアップが発生した際、上にスライドさせる速度。
|
||||
*
|
||||
* イベントコマンドのスクリプトを使う場合、
|
||||
*
|
||||
* this.addPopup(["add","text:テスト","count:120"…]);
|
||||
*
|
||||
* のように記述すればスクリプトでポップアップを行うことができます。
|
||||
* 同じように、イベントコマンドの移動ルート内のスクリプトで使用する場合、
|
||||
*
|
||||
* $gameMap._interpreter.addPopup(["add","text:テスト","count:120"…]);
|
||||
*
|
||||
* のように記述すれば使用可能です。
|
||||
*
|
||||
* ------------------------------------------------------
|
||||
* 利用規約
|
||||
* ------------------------------------------------------
|
||||
* 当プラグインはMITライセンスで公開されています。
|
||||
* 使用に制限はありません。商用、アダルト、いずれにも使用できます。
|
||||
* 二次配布も制限はしませんが、サポートは行いません。
|
||||
* 著作表示は任意です。行わなくても利用できます。
|
||||
* 要するに、特に規約はありません。
|
||||
* バグ報告や使用方法等のお問合せはネ実ツクールスレ、または、Twitterにお願いします。
|
||||
* https://twitter.com/yanatsuki_
|
||||
* 素材利用は自己責任でお願いします。
|
||||
* ------------------------------------------------------
|
||||
* このプラグインは、汎用的なポップアップの仕組みを提供するプラグインです。
|
||||
* このプラグイン単体ではプラグインコマンドを追加する以外の機能はありません。
|
||||
* 追加機能として、
|
||||
* ・\I[x]で描画されるアイコンのサイズが文字サイズに追従する。
|
||||
* ・文字サイズ変更の制御文字、\FS[x]が追加される。
|
||||
* の2点が追加されます。
|
||||
* ------------------------------------------------------
|
||||
* 更新履歴:
|
||||
* ver1.06:180513
|
||||
* 一部の処理が正常に動作していなかったバグを修正。
|
||||
* ver1.05:170525
|
||||
* ポップアップ発生時にSEを再生する機能を追加。
|
||||
* ver1.04
|
||||
* YEP_MessageCoreとの競合回避処理を追加。
|
||||
* 動作パターンに縦ストレッチと横ストレッチを追加。
|
||||
* ポップアップ用のプラグインパラメータが正常に動作していなかったバグを修正。
|
||||
* ver1.03:
|
||||
* backのパラメータにpicturesフォルダのファイル名を指定できるように変更。
|
||||
* ver1.02:
|
||||
* スライドに上から下に動作するようにする機能を追加。
|
||||
* ver1.01:
|
||||
* containerが作成されていない状態で、ポップアップが登録される可能性のあるバグを修正しました。
|
||||
* ver1.00:
|
||||
* 公開
|
||||
*/
|
||||
|
||||
function Sprite_Popup() {
|
||||
this.initialize.apply(this, arguments);
|
||||
}
|
||||
|
||||
function CommonPopupManager() {
|
||||
throw new Error("This is a static class");
|
||||
}
|
||||
|
||||
(function () {
|
||||
var parameters = PluginManager.parameters("CommonPopupCore");
|
||||
var commonPopupTextBackColor = String(
|
||||
parameters["Text Back Color"] || "rgba(0, 0, 0, 0.6)"
|
||||
);
|
||||
var commonPopupTextBackFileName = String(
|
||||
parameters["Text Back FileName"] || "popup_back%d"
|
||||
);
|
||||
|
||||
var _cPU_GInterpreter_pluginCommand =
|
||||
Game_Interpreter.prototype.pluginCommand;
|
||||
Game_Interpreter.prototype.pluginCommand = function (command, args) {
|
||||
_cPU_GInterpreter_pluginCommand.call(this, command, args);
|
||||
if (command === "CommonPopup" || command === "ポップアップ") {
|
||||
switch (args[0]) {
|
||||
case "add":
|
||||
case "表示":
|
||||
this.addPopup(args);
|
||||
break;
|
||||
case "clear":
|
||||
case "消去":
|
||||
CommonPopupManager.clearPopup();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Array.prototype.setNullPos = function (object) {
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (this[i] === null || this[i] === undefined) {
|
||||
this[i] = object;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
this.push(object);
|
||||
};
|
||||
|
||||
Array.prototype.compact = function () {
|
||||
var result = [];
|
||||
for (var i = 0; i < this.length; i++) {
|
||||
if (this[i] !== null && this[i] !== undefined) {
|
||||
result.push(this[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
CommonPopupManager.initTempSprites = function () {
|
||||
this._tempCommonSprites = new Array(50);
|
||||
this._setedPopups = [];
|
||||
this._readyPopup = [];
|
||||
};
|
||||
|
||||
CommonPopupManager.window = function () {
|
||||
if (this._window) {
|
||||
return this._window;
|
||||
}
|
||||
this._window = new Window_Base(0, 0, Graphics.boxWidth, Graphics.boxHeight);
|
||||
return this._window;
|
||||
};
|
||||
|
||||
CommonPopupManager.testBitmap = function () {
|
||||
if (this._testBitmap) {
|
||||
return this._testBitmap;
|
||||
}
|
||||
this._testBitmap = new Bitmap(1, 1);
|
||||
return this._testBitmap;
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype = Object.create(Sprite.prototype);
|
||||
Sprite_Popup.prototype.constructor = Sprite_Popup;
|
||||
|
||||
Sprite_Popup.prototype.initialize = function (index) {
|
||||
Sprite.prototype.initialize.call(this);
|
||||
this._index = index;
|
||||
this._count = 0;
|
||||
this._enable = false;
|
||||
this.update();
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.setMembers = function (arg) {
|
||||
this._count = arg.count;
|
||||
this._arg = arg;
|
||||
this.anchor.x = arg.anchorX;
|
||||
this.anchor.y = arg.anchorY;
|
||||
this.x = arg.x;
|
||||
this.y = arg.y;
|
||||
this.z = 6;
|
||||
this.visible = true;
|
||||
this._enable = true;
|
||||
this.createBitmap();
|
||||
if (arg.slideCount) {
|
||||
CommonPopupManager._setedPopups.push([
|
||||
this._index,
|
||||
this.height,
|
||||
this._arg.slideCount,
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.createBitmap = function () {
|
||||
if (this._arg.bitmap) {
|
||||
this.bitmap = this._arg.bitmap;
|
||||
} else {
|
||||
CommonPopupManager.window().resetFontSettings();
|
||||
var text = this._arg.text;
|
||||
var width = CommonPopupManager.window().textWidth(text);
|
||||
var height = CommonPopupManager.window().contents.fontSize + 8;
|
||||
var sh = 8;
|
||||
if (this._arg.back === 0) {
|
||||
sh = 2;
|
||||
}
|
||||
CommonPopupManager.window().createContents();
|
||||
this.bitmap = new Bitmap(width + 24, height + sh);
|
||||
this.drawBackRect(width + 24, height + sh);
|
||||
CommonPopupManager.window().drawTextEx(this._arg.text, 12, 4);
|
||||
this.bitmap.blt(
|
||||
CommonPopupManager.window().contents,
|
||||
0,
|
||||
0,
|
||||
width + 24,
|
||||
height + sh,
|
||||
this._arg.bx,
|
||||
this._arg.by + 2
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.drawBackRect = function (width, height) {
|
||||
switch (this._arg.back) {
|
||||
case 0:
|
||||
var color1 = commonPopupTextBackColor;
|
||||
var color2 = "rgba(0,0,0,0)";
|
||||
var dSize = width / 4;
|
||||
this.bitmap.gradientFillRect(0, 0, dSize, height, color2, color1);
|
||||
this.bitmap.fillRect(dSize, 0, dSize * 2, height, color1);
|
||||
this.bitmap.gradientFillRect(
|
||||
dSize * 3,
|
||||
0,
|
||||
dSize,
|
||||
height,
|
||||
color1,
|
||||
color2
|
||||
);
|
||||
break;
|
||||
case -1:
|
||||
break;
|
||||
default:
|
||||
var bitmap = CommonPopupManager.makeBitmap(this._arg);
|
||||
var w = this._bitmap.width;
|
||||
var h = this._bitmap.height;
|
||||
if (typeof this._arg.back === "string") {
|
||||
w = bitmap.width > this._bitmap.width ? bitmap.width : w;
|
||||
h = bitmap.height > this._bitmap.height ? bitmap.height : h;
|
||||
if (w > this._bitmap.width || h > this._bitmap.height) {
|
||||
this.bitmap = new Bitmap(w, h);
|
||||
}
|
||||
}
|
||||
this.bitmap.blt(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, w, h);
|
||||
bitmap.clear();
|
||||
bitmap = null;
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.update = function () {
|
||||
Sprite.prototype.update.call(this);
|
||||
if (CommonPopupManager._tempCommonSprites[this._index] && !this._enable) {
|
||||
if (CommonPopupManager._tempCommonSprites[this._index].delay === 0) {
|
||||
this.setMembers(CommonPopupManager._tempCommonSprites[this._index]);
|
||||
if (this._arg && this._arg.se.name) AudioManager.playSe(this._arg.se);
|
||||
} else {
|
||||
CommonPopupManager._tempCommonSprites[this._index].delay--;
|
||||
}
|
||||
}
|
||||
if (this._count > 0) {
|
||||
this._count--;
|
||||
if (!this._arg) {
|
||||
this.terminate();
|
||||
return;
|
||||
}
|
||||
switch (this._arg.pattern) {
|
||||
case 0:
|
||||
case "0":
|
||||
case "Normal":
|
||||
this.updateSlide();
|
||||
break;
|
||||
case -1:
|
||||
case "-1":
|
||||
case "Stretch":
|
||||
this.updateTurn();
|
||||
break;
|
||||
case -2:
|
||||
case "-2":
|
||||
case "GrowUp":
|
||||
this.updateGrowUp();
|
||||
break;
|
||||
default:
|
||||
this.updateAnime();
|
||||
}
|
||||
if (this._count === 0) this.terminate();
|
||||
}
|
||||
if (this._arg && this._arg.slideCount) this.updateMoveSlide();
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.updateMoveSlide = function () {
|
||||
if (CommonPopupManager._setedPopups) {
|
||||
var array = CommonPopupManager._setedPopups.clone().reverse();
|
||||
var n = 0;
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
if (this._index === array[i][0]) {
|
||||
if (this._arg.slideAction === "Down") {
|
||||
this.y = this.y + n;
|
||||
} else {
|
||||
this.y = this.y - n;
|
||||
}
|
||||
}
|
||||
var sprite = CommonPopupManager._tempCommonSprites[array[i][0]];
|
||||
if (sprite.pattern === -2 || sprite.pattern === "GrowUp") {
|
||||
n += array[i][1] * sprite.rate;
|
||||
} else {
|
||||
n +=
|
||||
array[i][1] *
|
||||
((this._arg.slideCount - array[i][2]) / this._arg.slideCount);
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < CommonPopupManager._setedPopups.length; i++) {
|
||||
CommonPopupManager._setedPopups[i][2]--;
|
||||
if (CommonPopupManager._setedPopups[i][2] < 0) {
|
||||
CommonPopupManager._setedPopups[i][2] = 0;
|
||||
}
|
||||
}
|
||||
array = null;
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.updateSlide = function () {
|
||||
var originalWait = this._arg.count;
|
||||
var cnt = originalWait - this._count;
|
||||
this.opacity = 255;
|
||||
var act = [originalWait * 0.25, originalWait * 0.75];
|
||||
if (this._arg.extend !== "") {
|
||||
act = this._arg.extend;
|
||||
}
|
||||
//var oa = Math.max(originalWait - act[1],1);
|
||||
//var n1 = Math.max(originalWait / oa,0.1);
|
||||
var opTime1 = act[0];
|
||||
var moveX = 0;
|
||||
var moveY = 0;
|
||||
if (act[2]) {
|
||||
opTime1 = originalWait - act[2];
|
||||
}
|
||||
var opTime2 = originalWait - act[1];
|
||||
var n = 0;
|
||||
if (act[3]) {
|
||||
opTime2 = act[3];
|
||||
}
|
||||
// 登場演出
|
||||
if (cnt < act[0]) {
|
||||
var up = this._arg.moveY / act[0];
|
||||
var slide = this._arg.moveX / act[0];
|
||||
this.opacity = Math.floor(255 * (cnt / opTime1));
|
||||
moveX = Math.floor(slide * cnt);
|
||||
moveY = Math.floor(up * cnt);
|
||||
// 退場演出
|
||||
} else if (cnt >= act[1]) {
|
||||
var up = this._arg.moveY / (originalWait - act[1]);
|
||||
var slide = this._arg.moveX / (originalWait - act[1]);
|
||||
this.opacity = Math.floor(255 * (this._count / opTime2));
|
||||
if (this._arg.enableOutEffect) {
|
||||
moveX = Math.floor(this._arg.moveX * (this._count / opTime2)); //Math.floor((originalWait / n1) * slide);
|
||||
moveY = Math.floor(this._arg.moveY * (this._count / opTime2)); //Math.floor((originalWait / n1) * up);
|
||||
} else {
|
||||
moveX = this._arg.moveX; //Math.floor((originalWait / n1) * slide);
|
||||
moveY = this._arg.moveY; //Math.floor((originalWait / n1) * up);
|
||||
}
|
||||
} else {
|
||||
moveX = this._arg.moveX; //Math.floor((originalWait / n1) * slide);
|
||||
moveY = this._arg.moveY; //Math.floor((originalWait / n1) * up);
|
||||
}
|
||||
this._times = cnt;
|
||||
this.setPosition(moveX, moveY);
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.updateTurn = function () {
|
||||
var originalWait = this._arg.count;
|
||||
var cnt = originalWait - this._count;
|
||||
var act = [originalWait * 0.25, originalWait * 0.75];
|
||||
if (this._arg.extend) act = this._arg.extend;
|
||||
if (this._count === 0) this.scale.x = 0;
|
||||
//var oa = Math.max(originalWait - act[1],1);
|
||||
//var n1 = Math.max(originalWait / oa,0.1);
|
||||
//var up = (this._arg.moveY / (originalWait / n1));
|
||||
//var slide = (this._arg.moveX / (originalWait / n1));
|
||||
var moveX = 0;
|
||||
var moveY = 0;
|
||||
if (cnt < act[0]) {
|
||||
var up = this._arg.moveY / act[0];
|
||||
var slide = this._arg.moveX / act[0];
|
||||
var rate = cnt / act[0];
|
||||
this.scale.x = rate;
|
||||
moveX = Math.floor(slide * cnt);
|
||||
moveY = Math.floor(up * cnt);
|
||||
} else if (cnt > act[1]) {
|
||||
var a1 = originalWait - act[1];
|
||||
var rate = this._count / a1;
|
||||
this.scale.x = rate;
|
||||
if (this._arg.enableOutEffect) {
|
||||
moveX = Math.floor(this._arg.moveX * (this._count / a1)); //Math.floor((originalWait / n1) * slide);
|
||||
moveY = Math.floor(this._arg.moveY * (this._count / a1)); //Math.floor((originalWait / n1) * up);
|
||||
} else {
|
||||
moveX = this._arg.moveX; //Math.floor((originalWait / n1) * up);
|
||||
moveY = this._arg.moveY; //Math.floor((originalWait / n1) * slide);
|
||||
}
|
||||
} else {
|
||||
this.scale.x = 1.0;
|
||||
moveX = this._arg.moveX; //Math.floor((originalWait / n1) * up);
|
||||
moveY = this._arg.moveY; //Math.floor((originalWait / n1) * slide);
|
||||
}
|
||||
this._times = cnt;
|
||||
this.setPosition(moveX, moveY);
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.updateGrowUp = function () {
|
||||
var originalWait = this._arg.count;
|
||||
var cnt = originalWait - this._count;
|
||||
var act = [originalWait * 0.25, originalWait * 0.75];
|
||||
if (this._arg.extend) act = this._arg.extend;
|
||||
if (this._count === 0) this.scale.y = 0;
|
||||
//var oa = Math.max(originalWait - act[1],1);
|
||||
//var n1 = Math.max(originalWait / oa,0.1);
|
||||
//var up = (this._arg.moveY / (originalWait / n1));
|
||||
//var slide = (this._arg.moveX / (originalWait / n1));
|
||||
var moveX = 0;
|
||||
var moveY = 0;
|
||||
if (cnt < act[0]) {
|
||||
var up = this._arg.moveY / act[0];
|
||||
var slide = this._arg.moveX / act[0];
|
||||
var rate = cnt / act[0];
|
||||
this.scale.y = rate;
|
||||
moveX = Math.floor(slide * cnt);
|
||||
moveY = Math.floor(up * cnt);
|
||||
this._arg.rate = rate;
|
||||
} else if (cnt >= act[1]) {
|
||||
var a1 = originalWait - act[1];
|
||||
var rate = this._count / a1;
|
||||
this.scale.y = rate;
|
||||
this._arg.rate = rate;
|
||||
if (this._arg.enableOutEffect) {
|
||||
moveX = Math.floor(this._arg.moveX * (this._count / a1)); //Math.floor((originalWait / n1) * slide);
|
||||
moveY = Math.floor(this._arg.moveY * (this._count / a1)); //Math.floor((originalWait / n1) * up);
|
||||
} else {
|
||||
moveX = this._arg.moveX; //Math.floor((originalWait / n1) * up);
|
||||
moveY = this._arg.moveY; //Math.floor((originalWait / n1) * slide);
|
||||
}
|
||||
} else {
|
||||
this.scale.y = 1.0;
|
||||
moveX = this._arg.moveX; //Math.floor((originalWait / n1) * up);
|
||||
moveY = this._arg.moveY; //Math.floor((originalWait / n1) * slide);
|
||||
}
|
||||
this._times = cnt;
|
||||
this.setPosition(moveX, moveY);
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.setPosition = function (x, y) {
|
||||
this.x = this._arg.x + x + this._arg.sx;
|
||||
this.y = this._arg.y + y + this._arg.sy;
|
||||
if (this._arg.battler) {
|
||||
if ($gameParty.inBattle()) {
|
||||
this.x += this._arg.battler.x;
|
||||
this.y += this._arg.battler.y;
|
||||
} else {
|
||||
this.x += this._arg.battler._realX * $gameMap.tileWidth();
|
||||
this.y += this._arg.battler._realY * $gameMap.tileHeight();
|
||||
}
|
||||
}
|
||||
var xx = this.x;
|
||||
var yy = this.y;
|
||||
if (this._arg.fixed) {
|
||||
var dx = $gameMap._displayX;
|
||||
var dy = $gameMap._displayY;
|
||||
xx = this.x - dx * $gameMap.tileWidth();
|
||||
yy = this.y - dy * $gameMap.tileHeight();
|
||||
if (xx < 0 || yy < 0) {
|
||||
if (xx < 0 && $gameMap.isLoopHorizontal()) dx -= $dataMap.width;
|
||||
if (yy < 0 && $gameMap.isLoopVertical()) dy -= $dataMap.height;
|
||||
xx = this.x - dx * $gameMap.tileWidth();
|
||||
yy = this.y - dy * $gameMap.tileHeight();
|
||||
}
|
||||
}
|
||||
this.x = xx;
|
||||
this.y = yy;
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.updateAnime = function () {
|
||||
var anime = $dataAnimations[Number(this._arg.pattern)];
|
||||
var frameId = Math.floor(
|
||||
(anime.frames.length * (this._arg.count - this._count)) / this._arg.count
|
||||
);
|
||||
if (frameId !== anime.frames.length) {
|
||||
var array = anime.frames[frameId][0];
|
||||
var x = array[1];
|
||||
var y = array[2];
|
||||
this.x = this._arg.x + x + this._arg.sx;
|
||||
this.y = this._arg.y + y + this._arg.sy;
|
||||
this.scale = new Point(array[3] / 100, array[3] / 100);
|
||||
this.rotation = array[4];
|
||||
this.opacity = array[6];
|
||||
this.blendMode = array[7];
|
||||
}
|
||||
};
|
||||
|
||||
Sprite_Popup.prototype.terminate = function () {
|
||||
this.bitmap = null;
|
||||
this.visible = false;
|
||||
this._enable = false;
|
||||
this._count = 0;
|
||||
this._arg = null;
|
||||
|
||||
if (CommonPopupManager._tempCommonSprites[this._index]) {
|
||||
CommonPopupManager._tempCommonSprites[this._index].terminate = true;
|
||||
}
|
||||
if (CommonPopupManager._setedPopups) {
|
||||
for (var i = 0; i < CommonPopupManager._setedPopups.length; i++) {
|
||||
if (CommonPopupManager._setedPopups[i][0] === this._index) {
|
||||
delete CommonPopupManager._setedPopups[i];
|
||||
}
|
||||
}
|
||||
CommonPopupManager._setedPopups =
|
||||
CommonPopupManager._setedPopups.compact();
|
||||
}
|
||||
};
|
||||
|
||||
Game_Interpreter.prototype.addPopup = function (argParam) {
|
||||
var eventId = 0;
|
||||
for (var i = 0; i < argParam.length; i++) {
|
||||
if (argParam[i].match(/^eventId:(.+)/g)) {
|
||||
eventId = Number(RegExp.$1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
var character = this.character(eventId);
|
||||
var arg = CommonPopupManager.setPopup(argParam, character);
|
||||
if (arg.back > 0 || typeof arg.back === "string") {
|
||||
CommonPopupManager.bltCheck(CommonPopupManager.makeBitmap(arg));
|
||||
CommonPopupManager._readyPopup.push(arg);
|
||||
} else {
|
||||
CommonPopupManager._tempCommonSprites.setNullPos(arg);
|
||||
}
|
||||
};
|
||||
|
||||
CommonPopupManager.setPopup = function (argParam, character) {
|
||||
var arg = {
|
||||
x: null,
|
||||
y: null,
|
||||
text: "", // 表示テキスト
|
||||
eventId: -1, // 表示するイベントのID
|
||||
count: 60, // 表示時間
|
||||
delay: 0, // 表示遅延
|
||||
moveX: 0, // 目標地点X(相対座標)
|
||||
moveY: -48, // 目標地点Y(相対座標)
|
||||
sx: 0, // 表示位置補正X
|
||||
sy: 0, // 表示位置補正Y
|
||||
pattern: 0, // 表示パターン
|
||||
back: -1, // 背景に使う画像インデックス
|
||||
bx: 0, // 内容の表示位置補正X
|
||||
by: 0, // 内容の表示位置補正Y
|
||||
extend: "", //
|
||||
fixed: true, //
|
||||
anchorX: 0.5,
|
||||
anchorY: 0.5,
|
||||
battler: null,
|
||||
se: { name: "", volume: 90, pitch: 100, pan: 0 },
|
||||
enableOutEffect: true,
|
||||
};
|
||||
var array = [
|
||||
"x",
|
||||
"y",
|
||||
"text",
|
||||
"eventId",
|
||||
"count",
|
||||
"delay",
|
||||
"moveX",
|
||||
"moveY",
|
||||
"sx",
|
||||
"sy",
|
||||
"pattern",
|
||||
"back",
|
||||
"bx",
|
||||
"by",
|
||||
"extend",
|
||||
"fixed",
|
||||
"anchorX",
|
||||
"anchorY",
|
||||
"slideCount",
|
||||
];
|
||||
for (var i = 0; i < argParam.length; i++) {
|
||||
if (i > 0) {
|
||||
for (var j = 0; j < array.length; j++) {
|
||||
var r = new RegExp("^(" + array[j] + ")" + ":(.+)");
|
||||
if (argParam[i].match(r)) {
|
||||
var code = RegExp.$1;
|
||||
var value = RegExp.$2;
|
||||
if (code === "text" || code === "extend") {
|
||||
arg[code] = value;
|
||||
} else if (code === "fixed") {
|
||||
arg[code] = value === "true";
|
||||
} else if (code === "back") {
|
||||
arg[code] = Number(value) !== NaN ? value : Number(value);
|
||||
} else {
|
||||
arg[code] = Number(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (arg.x === null) {
|
||||
if (character) {
|
||||
var screenX = $gameParty.inBattle() ? 0 : character.screenX();
|
||||
var displayX = $gameParty.inBattle() ? 0 : $gameMap._displayX * 48;
|
||||
arg.x = screenX + displayX;
|
||||
} else {
|
||||
arg.x = 0;
|
||||
}
|
||||
}
|
||||
if (arg.y === null) {
|
||||
if (character) {
|
||||
var screenY = $gameParty.inBattle() ? 0 : character.screenY();
|
||||
var displayY = $gameParty.inBattle() ? 0 : $gameMap._displayY * 48;
|
||||
arg.y = screenY + displayY;
|
||||
} else {
|
||||
arg.y = 0;
|
||||
}
|
||||
}
|
||||
if (arg.extend) {
|
||||
arg.extend = eval(arg.extend);
|
||||
}
|
||||
|
||||
arg.terminate = false;
|
||||
return arg;
|
||||
};
|
||||
|
||||
CommonPopupManager.setPopUpdate = function () {
|
||||
if (this._readyPopup) {
|
||||
for (var i = 0; i < this._readyPopup.length; i++) {
|
||||
if (this._readyPopup[i]) {
|
||||
var arg = this._readyPopup[i];
|
||||
if (ImageManager.isReady()) {
|
||||
this.startPopup(arg);
|
||||
delete this._readyPopup[i];
|
||||
this._readyPopup.compact();
|
||||
return;
|
||||
} else {
|
||||
this.bltCheck(this.makeBitmap(arg));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CommonPopupManager.makeBitmap = function (arg) {
|
||||
if (typeof arg.back === "number") {
|
||||
var fileName = commonPopupTextBackFileName;
|
||||
fileName = fileName.replace(/%d/g, arg.back);
|
||||
return ImageManager.loadSystem(fileName);
|
||||
} else {
|
||||
var fileName = arg.back;
|
||||
return ImageManager.loadPicture(fileName);
|
||||
}
|
||||
};
|
||||
|
||||
CommonPopupManager.bltCheck = function (bitmap) {
|
||||
this.testBitmap().blt(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0);
|
||||
//this.testBitmap().clear();
|
||||
//bitmap.clear();
|
||||
bitmap = null;
|
||||
};
|
||||
|
||||
CommonPopupManager.startPopup = function (arg) {
|
||||
CommonPopupManager._tempCommonSprites.setNullPos(arg);
|
||||
};
|
||||
|
||||
CommonPopupManager.clearPopup = function (tag) {
|
||||
if (!CommonPopupManager._tempCommonSprites) {
|
||||
CommonPopupManager.initTempSprites();
|
||||
}
|
||||
|
||||
for (var i = 0; i < CommonPopupManager._tempCommonSprites.length; i++) {
|
||||
if (CommonPopupManager._tempCommonSprites[i]) {
|
||||
if (!tag || tag === CommonPopupManager._tempCommonSprites[i].tag) {
|
||||
CommonPopupManager._tempCommonSprites[i].delay = 0;
|
||||
CommonPopupManager._tempCommonSprites[i].count = 1;
|
||||
var sprite = CommonPopupManager._tempCommonSprites[i].sprite;
|
||||
if (sprite) sprite._count = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var _cPU_SsBase_initialize = Spriteset_Base.prototype.initialize;
|
||||
Spriteset_Base.prototype.initialize = function () {
|
||||
_cPU_SsBase_initialize.call(this);
|
||||
this.createSpritePopup();
|
||||
};
|
||||
|
||||
var _cPU_SsBase_update = Spriteset_Base.prototype.update;
|
||||
Spriteset_Base.prototype.update = function () {
|
||||
_cPU_SsBase_update.call(this);
|
||||
if (this._popupContainer === undefined) {
|
||||
return;
|
||||
}
|
||||
if (CommonPopupManager._tempCommonSprites) {
|
||||
for (var i = 0; i < CommonPopupManager._tempCommonSprites.length; i++) {
|
||||
if (CommonPopupManager._tempCommonSprites[i]) {
|
||||
if (CommonPopupManager._tempCommonSprites[i].terminate) {
|
||||
var sprite = CommonPopupManager._tempCommonSprites[i].sprite;
|
||||
this._popupContainer.removeChild(sprite);
|
||||
delete CommonPopupManager._tempCommonSprites[i];
|
||||
} else if (!CommonPopupManager._tempCommonSprites[i].sprite) {
|
||||
var sprite = new Sprite_Popup(i);
|
||||
this._popupContainer.addChild(sprite);
|
||||
CommonPopupManager._tempCommonSprites[i].sprite = sprite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var _cPU_SBase_update = Scene_Base.prototype.update;
|
||||
Scene_Base.prototype.update = function () {
|
||||
_cPU_SBase_update.call(this);
|
||||
if (CommonPopupManager) {
|
||||
CommonPopupManager.setPopUpdate();
|
||||
}
|
||||
};
|
||||
|
||||
Spriteset_Base.prototype.createSpritePopup = function () {
|
||||
var width = Graphics.boxWidth;
|
||||
var height = Graphics.boxHeight;
|
||||
var x = (Graphics.width - width) / 2;
|
||||
var y = (Graphics.height - height) / 2;
|
||||
this._popupContainer = new Sprite();
|
||||
this._popupContainer.setFrame(x, y, width, height);
|
||||
this.addChild(this._popupContainer);
|
||||
};
|
||||
|
||||
var _cPU_SBase_terminate = Scene_Base.prototype.terminate;
|
||||
Scene_Base.prototype.terminate = function () {
|
||||
_cPU_SBase_terminate.call(this);
|
||||
this.terminatePopup();
|
||||
};
|
||||
|
||||
Scene_Base.prototype.terminatePopup = function () {
|
||||
if (!CommonPopupManager._tempCommonSprites) {
|
||||
CommonPopupManager.initTempSprites();
|
||||
}
|
||||
for (var i = 0; i < CommonPopupManager._tempCommonSprites.length; i++) {
|
||||
if (CommonPopupManager._tempCommonSprites[i]) {
|
||||
var sprite = CommonPopupManager._tempCommonSprites[i].sprite;
|
||||
if (sprite) sprite.terminate();
|
||||
delete CommonPopupManager._tempCommonSprites[i];
|
||||
}
|
||||
}
|
||||
CommonPopupManager._setedPopupss = [];
|
||||
CommonPopupManager._readyPopup = [];
|
||||
};
|
||||
|
||||
var _cPU_SMap_launchBattle = Scene_Map.prototype.launchBattle;
|
||||
Scene_Map.prototype.launchBattle = function () {
|
||||
_cPU_SMap_launchBattle.call(this);
|
||||
this.terminatePopup();
|
||||
};
|
||||
|
||||
// 再定義 文字サイズに合わせてアイコンのサイズを調整する
|
||||
Window_Base.prototype.drawIcon = function (iconIndex, x, y) {
|
||||
var bitmap = ImageManager.loadSystem("IconSet");
|
||||
var pw = Window_Base._iconWidth;
|
||||
var ph = Window_Base._iconHeight;
|
||||
var sx = (iconIndex % 16) * pw;
|
||||
var sy = Math.floor(iconIndex / 16) * ph;
|
||||
var n = Math.floor(
|
||||
(this.contents.fontSize / this.standardFontSize()) *
|
||||
Window_Base._iconWidth
|
||||
);
|
||||
var nn = (32 - n) / 2;
|
||||
this.contents.blt(bitmap, sx, sy, pw, ph, x, y, n, n);
|
||||
};
|
||||
|
||||
// 再定義 processDrawIconをストレッチされた文字サイズに合わせたズレに調整する
|
||||
Window_Base.prototype.processDrawIcon = function (iconIndex, textState) {
|
||||
this.drawIcon(iconIndex, textState.x + 2, textState.y + 2);
|
||||
var n = Math.floor(
|
||||
(this.contents.fontSize / this.standardFontSize()) *
|
||||
Window_Base._iconWidth
|
||||
);
|
||||
textState.x += n + 4;
|
||||
};
|
||||
|
||||
if (!Imported.YEP_MessageCore) {
|
||||
// \FS[FontSize]の制御文字を追加する部分です。
|
||||
var _cPU_Window_Base_processEscapeCharacter =
|
||||
Window_Base.prototype.processEscapeCharacter;
|
||||
Window_Base.prototype.processEscapeCharacter = function (code, textState) {
|
||||
if (code === "FS") {
|
||||
var param = this.obtainEscapeParam(textState);
|
||||
if (param != "") {
|
||||
this.makeFontSize(param);
|
||||
}
|
||||
} else {
|
||||
_cPU_Window_Base_processEscapeCharacter.call(this, code, textState);
|
||||
}
|
||||
};
|
||||
}
|
||||
Window_Base.prototype.makeFontSize = function (fontSize) {
|
||||
this.contents.fontSize = fontSize;
|
||||
};
|
||||
})();
|
||||
135
www/js/plugins/Community_Basic.js
Normal file
135
www/js/plugins/Community_Basic.js
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/*:
|
||||
* @plugindesc Plugin used to set basic parameters.
|
||||
* @author RM CoreScript team
|
||||
*
|
||||
* @help This plugin does not provide plugin commands.
|
||||
*
|
||||
* @param cacheLimit
|
||||
* @desc For setting the upper limit of image memory cache. (MPix)
|
||||
* @default 10
|
||||
*
|
||||
* @param screenWidth
|
||||
* @desc For setting the screen width.
|
||||
* @default 816
|
||||
*
|
||||
* @param screenHeight
|
||||
* @desc For setting the screen height.
|
||||
* @default 624
|
||||
*
|
||||
* @param changeWindowWidthTo
|
||||
* @desc If set, change window width to this value
|
||||
*
|
||||
* @param changeWindowHeightTo
|
||||
* @desc If set, change window height to this value
|
||||
*
|
||||
* @param renderingMode
|
||||
* @desc Rendering mode (canvas/webgl/auto)
|
||||
* @default auto
|
||||
*
|
||||
* @param alwaysDash
|
||||
* @desc To set initial value as to whether the player always dashes. (on/off)
|
||||
* @default off
|
||||
*/
|
||||
|
||||
/*:ja
|
||||
* @plugindesc 基本的なパラメーターを設定するプラグインです。
|
||||
* @author RM CoreScript team
|
||||
*
|
||||
* @help このプラグインにはプラグインコマンドはありません。
|
||||
*
|
||||
* @param cacheLimit
|
||||
* @desc 画像のメモリへのキャッシュの上限値 (MPix)
|
||||
* @default 10
|
||||
*
|
||||
* @param screenWidth
|
||||
* @desc 画面サイズの幅
|
||||
* @default 816
|
||||
*
|
||||
* @param screenHeight
|
||||
* @desc 画面サイズの高さ
|
||||
* @default 624
|
||||
*
|
||||
* @param changeWindowWidthTo
|
||||
* @desc 値が設定された場合、ウインドウの幅を指定した値に変更
|
||||
*
|
||||
* @param changeWindowHeightTo
|
||||
* @desc 値が設定された場合、ウインドウの高さを指定した値に変更
|
||||
*
|
||||
* @param renderingMode
|
||||
* @desc レンダリングモード (canvas/webgl/auto)
|
||||
* @default auto
|
||||
*
|
||||
* @param alwaysDash
|
||||
* @desc プレイヤーが常時ダッシュするかどうかの初期値 (on/off)
|
||||
* @default off
|
||||
*/
|
||||
|
||||
(function () {
|
||||
function toNumber(str, def) {
|
||||
return isNaN(str) ? def : +(str || def);
|
||||
}
|
||||
|
||||
var parameters = PluginManager.parameters("Community_Basic");
|
||||
var cacheLimit = toNumber(parameters["cacheLimit"], 10);
|
||||
var screenWidth = toNumber(parameters["screenWidth"], 816);
|
||||
var screenHeight = toNumber(parameters["screenHeight"], 624);
|
||||
var renderingMode = parameters["renderingMode"].toLowerCase();
|
||||
var alwaysDash = parameters["alwaysDash"].toLowerCase() === "on";
|
||||
var windowWidthTo = toNumber(parameters["changeWindowWidthTo"], 0);
|
||||
var windowHeightTo = toNumber(parameters["changeWindowHeightTo"], 0);
|
||||
|
||||
var windowWidth;
|
||||
var windowHeight;
|
||||
|
||||
if (windowWidthTo) {
|
||||
windowWidth = windowWidthTo;
|
||||
} else if (screenWidth !== SceneManager._screenWidth) {
|
||||
windowWidth = screenWidth;
|
||||
}
|
||||
|
||||
if (windowHeightTo) {
|
||||
windowHeight = windowHeightTo;
|
||||
} else if (screenHeight !== SceneManager._screenHeight) {
|
||||
windowHeight = screenHeight;
|
||||
}
|
||||
|
||||
ImageCache.limit = cacheLimit * 1000 * 1000;
|
||||
SceneManager._screenWidth = screenWidth;
|
||||
SceneManager._screenHeight = screenHeight;
|
||||
SceneManager._boxWidth = screenWidth;
|
||||
SceneManager._boxHeight = screenHeight;
|
||||
|
||||
SceneManager.preferableRendererType = function () {
|
||||
if (Utils.isOptionValid("canvas")) {
|
||||
return "canvas";
|
||||
} else if (Utils.isOptionValid("webgl")) {
|
||||
return "webgl";
|
||||
} else if (renderingMode === "canvas") {
|
||||
return "canvas";
|
||||
} else if (renderingMode === "webgl") {
|
||||
return "webgl";
|
||||
} else {
|
||||
return "auto";
|
||||
}
|
||||
};
|
||||
|
||||
var _ConfigManager_applyData = ConfigManager.applyData;
|
||||
ConfigManager.applyData = function (config) {
|
||||
_ConfigManager_applyData.apply(this, arguments);
|
||||
if (config["alwaysDash"] === undefined) {
|
||||
this.alwaysDash = alwaysDash;
|
||||
}
|
||||
};
|
||||
|
||||
var _SceneManager_initNwjs = SceneManager.initNwjs;
|
||||
SceneManager.initNwjs = function () {
|
||||
_SceneManager_initNwjs.apply(this, arguments);
|
||||
|
||||
if (Utils.isNwjs() && windowWidth && windowHeight) {
|
||||
var dw = windowWidth - window.innerWidth;
|
||||
var dh = windowHeight - window.innerHeight;
|
||||
window.moveBy(-dw / 2, -dh / 2);
|
||||
window.resizeBy(dw, dh);
|
||||
}
|
||||
};
|
||||
})();
|
||||
1176
www/js/plugins/DebtRepaymentAndSNSScreen.js
Normal file
1176
www/js/plugins/DebtRepaymentAndSNSScreen.js
Normal file
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue