新增大航海设置
This commit is contained in:
parent
39941bfdfd
commit
3f1392bf02
15
src/App.vue
15
src/App.vue
@ -37,7 +37,8 @@ if (window.localStorage.getItem("settings")) {
|
||||
// 如果没有,使用默认值并且保存
|
||||
settings.value = {
|
||||
waveData: waveData,
|
||||
strengthData: strengthData
|
||||
strengthData: strengthData,
|
||||
guardLevel: 0
|
||||
};
|
||||
window.localStorage.setItem('settings', JSON.stringify(settings.value));
|
||||
}
|
||||
@ -268,7 +269,15 @@ const addRelationAndSave = () => {
|
||||
|
||||
<div class="settings-window" v-show="showSettings">
|
||||
<button @click="showSettings = false" style="float: right">关</button>
|
||||
<button @click="saveSettings" style="float: right">存</button>
|
||||
<div>
|
||||
<h2>大航海</h2>
|
||||
<p>
|
||||
大航海等级达到
|
||||
<input v-model="settings.guardLevel">
|
||||
才可互动
|
||||
</p>
|
||||
|
||||
<h2>强度规则</h2>
|
||||
|
||||
<p>礼物规则 <u title="收到指定礼物后将更新强度">?</u></p>
|
||||
@ -298,8 +307,6 @@ const addRelationAndSave = () => {
|
||||
B<input type="checkbox" v-model="followBStrength" />
|
||||
</div>
|
||||
|
||||
<button @click="saveSettings">保存</button>
|
||||
|
||||
<h2>波形规则</h2>
|
||||
<div>
|
||||
<div v-for="relation in relations" :key="relation.gift">
|
||||
@ -352,6 +359,8 @@ const addRelationAndSave = () => {
|
||||
<hr />
|
||||
|
||||
<h2>游戏玩法</h2>
|
||||
<h3>大航海</h3>
|
||||
<p>等级达到 <input class="tag" v-model="settings.guardLevel" size="1" disabled> 才可互动</p>
|
||||
<h3>强度控制</h3>
|
||||
<p>
|
||||
赠送
|
||||
|
@ -10,11 +10,13 @@ const notyf = new Notyf({ duration: 4000 })
|
||||
interface SettingsType {
|
||||
strengthData: typeof strengthData;
|
||||
waveData: typeof waveData;
|
||||
guardLevel: number;
|
||||
}
|
||||
|
||||
let settings: Ref<SettingsType> = ref({
|
||||
waveData: waveData,
|
||||
strengthData: strengthData
|
||||
strengthData: strengthData,
|
||||
guardLevel: 0
|
||||
});
|
||||
|
||||
if (window.localStorage.getItem("settings")) {
|
||||
@ -24,7 +26,8 @@ if (window.localStorage.getItem("settings")) {
|
||||
// 如果没有,使用默认值
|
||||
settings.value = {
|
||||
waveData: waveData,
|
||||
strengthData: strengthData
|
||||
strengthData: strengthData,
|
||||
guardLevel: 0
|
||||
};
|
||||
}
|
||||
|
||||
@ -54,7 +57,7 @@ function createSocket(authBody: string, wssLinks: string[]) {
|
||||
|
||||
settings = window.localStorage.getItem("settings") ? ref(JSON.parse(window.localStorage.getItem("settings") || '{}')) : null
|
||||
|
||||
if (res.cmd == "LIVE_OPEN_PLATFORM_SEND_GIFT") {
|
||||
if (res.cmd == "LIVE_OPEN_PLATFORM_SEND_GIFT" && res.data.guard_level > settings.value.guardLevel) {
|
||||
if (settings && res.data.gift_id.toString() === settings.value.strengthData[0]) {
|
||||
// 牛哇牛哇:加强度1
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user