forked from 0xDC00/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPC_Steam_Unity_Shin.chan.Summer.Vacation.js
More file actions
136 lines (108 loc) · 4.4 KB
/
Copy pathPC_Steam_Unity_Shin.chan.Summer.Vacation.js
File metadata and controls
136 lines (108 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// ==UserScript==
// @name Shin chan: Summer Vacation
// @version
// @author [DC]
// @description Steam
// * Neos Corporation
// * Unity (il2cpp)
//
// https://store.steampowered.com/app/2061250/Shin_chan_Me_and_the_Professor_on_Summer_Vacation_The_Endless_SevenDay_Journey/
// ==/UserScript==
const Mono = require('./libMono.js');
const handlerLine = trans.send((s) => s, '250+');
const Enum = Mono.use('System.Enum');
const CharacterType = Mono.use('', 'Ola.CharacterType');
let _characterType = Enum.Parse(CharacterType.value, "ShinChan");
const _characterTypeOffset = _characterType.unbox().sub(_characterType).toInt32();
function characterTypeToString(value) {
if (value.isNull() === true) return '';
_characterType = Enum.Parse(CharacterType.value, "ShinChan");
_characterType.add(_characterTypeOffset).writePointer(value);
return Enum.ToString.call(_characterType).readMonoString();
}
// public void Play(string text, PopupConstants.WindowType windowType, CharacterType characterType, Action onFinish, string optionTalkerNameId = "", [Optional] Action onOpened, bool endSentenceImmediately = false, float autoPlaySpan = 0f, bool isCustomShowWaitInputMark = false)
// Ola.UIPopupTalkerWidget
// public void SetData(CharacterType characterType, string optionTalkerNameId)
// private void SetupName(CharacterType characterType, string optionTalkerNameId)
Mono.setHook('', 'Ola.PopupView', 'Play', -1, {
onEnter(args) {
console.log('onEnter: PopupView.Play');
const text = args[1];
const characterType = args[3];
const name = characterTypeToString(characterType);
const s = text.readMonoString()
.replace(/\[\/?CHARA_.*?\]/g, '')
;
handlerLine(name + '\r\n' + s);
}
});
// Ola.SubtitleWidget
// public void AddSubtitle(SoundType soundType, string soundName, float time, string text, string mapName = "")
Mono.setHook('', 'Ola.SubtitleWidget', 'AddSubtitle', -1, {
onEnter(args) {
console.log('onEnter: SubtitleWidget.AddSubtitle');
const text = args[4];
const s = text.readMonoString().replace(/<br>/g, ' ');
handlerLine(s);
}
});
// public void SetTextQuestion(string text)
Mono.setHook('', 'Ola.PopupChoiceView', 'SetTextQuestion', -1, {
onEnter(args) {
console.log('onEnter: PopupChoiceView.SetTextQuestion');
const text = args[1];
const s = text.readMonoString();
handlerLine(s);
}
});
// public void SetTextItemName(string text)
Mono.setHook('', 'Ola.UINormalItemElement', 'SetTextItemName', -1, {
onEnter(args) {
console.log('onEnter: UINormalItemElement.SetTextItemName');
const text = args[1];
const s = text.readMonoString();
handlerLine(s);
}
});
// public UIButtonGuideWidget SetText(string text)
Mono.setHook('', 'Ola.UIButtonGuideWidget', 'SetText', -1, {
onEnter(args) {
console.log('onEnter: UIButtonGuideWidget.SetText');
const text = args[1];
const s = text.readMonoString();
handlerLine(s);
}
});
const MasterData = Mono.use('', 'MasterData.MasterTextCollection');
const MasterTextCollection_address = MasterData.Localize.address;
// public void SetText(UIDiaryNormalItem.TextType type, string text)
Mono.setHook('', 'Ola.UIDiaryNormalItem', 'SetText', -1, {
onEnter(args) {
console.log('onEnter: UIDiaryNormalItem.SetText');
const hook = Interceptor.attach(MasterTextCollection_address, {
onLeave(retVal) {
hook.detach();
const s = retVal.readMonoString().replace(/<.*?>/g, '');;
handlerLine(s);
}
})
}
});
// public UISubMenuTextWidget SetText()
Mono.setHook('', 'Ola.SubMenu.UISubMenuTextWidget', 'SetText', -1, {
onEnter(args) {
console.log('onEnter: UISubMenuTextWidget.SetText');
const s = args[0].wrap().uiText.ToString();
handlerLine(s);
}
});
// private void ChangeItemDetail(ItemView.CategoryType categoryType, ItemView.UIData uiData, bool isFocus = false)
Mono.setHook('', 'Ola.ItemView', 'ChangeItemDetail', -1, {
onEnter(args) {
console.log('onEnter: ItemView.ChangeItemDetail');
const uiData = args[2].wrap();
const name = uiData.get_TextItemName().readMonoString();
const desc = uiData.get_TextItemDescription().readMonoString();
handlerLine(name + '\r\n' + desc);
}
});