|
|
@@ -13,6 +13,7 @@ import { AnalyticsManager, BlockSelectionClickProperties } from '../../Utils/Ana
|
|
|
|
|
|
import EventBus, { GameEvents } from '../../Core/EventBus';
|
|
|
import { NewbieGuideManager } from '../../Core/NewbieGuideManager';
|
|
|
+import { SaveDataManager } from '../../LevelSystem/SaveDataManager';
|
|
|
import { InGameManager } from '../../LevelSystem/IN_game';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@@ -277,7 +278,7 @@ export class GameBlockSelection extends Component {
|
|
|
// 引导期间按钮原始颜色缓存
|
|
|
private originalButtonColors: Map<Node, Color> = new Map();
|
|
|
|
|
|
- // 引导期禁用颜色(HEX: 4D4545)
|
|
|
+ // 引导期禁用颜色置灰(HEX: 4D4545)
|
|
|
private readonly GUIDE_DISABLED_COLOR: Color = new Color(0x4D, 0x45, 0x45, 255);
|
|
|
|
|
|
onEnable() {
|
|
|
@@ -821,7 +822,17 @@ export class GameBlockSelection extends Component {
|
|
|
}
|
|
|
|
|
|
private updateGuideButtonStates = () => {
|
|
|
- const restrict = this.isGuideRestrictActive();
|
|
|
+ // 每关开始时检测:第一关禁用按钮,其它关卡不禁用
|
|
|
+ let restrict = false;
|
|
|
+ try {
|
|
|
+ const sdm = SaveDataManager.getInstance();
|
|
|
+ const currentLevel = sdm ? sdm.getCurrentLevel() : 1;
|
|
|
+ restrict = currentLevel === 1;
|
|
|
+ } catch (e) {
|
|
|
+ // 获取关卡失败时默认不禁用
|
|
|
+ restrict = false;
|
|
|
+ }
|
|
|
+
|
|
|
this.applyGuideDisabledVisual(this.addCoinButton, restrict);
|
|
|
this.applyGuideDisabledVisual(this.refreshButton, restrict);
|
|
|
};
|