diff options
| author | daoge <3523206925@qq.com> | 2026-03-03 03:04:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 03:04:10 +0800 |
| commit | b3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch) | |
| tree | 267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.Client/Common/UI/UIControl_BeaconEffectButton.cpp | |
| parent | 84c31a2331f7a0ec85b9d438992e244f60e5020f (diff) | |
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a43994725008e35fceb984d5549df9c8cea470.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.Client/Common/UI/UIControl_BeaconEffectButton.cpp')
| -rw-r--r-- | Minecraft.Client/Common/UI/UIControl_BeaconEffectButton.cpp | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/Minecraft.Client/Common/UI/UIControl_BeaconEffectButton.cpp b/Minecraft.Client/Common/UI/UIControl_BeaconEffectButton.cpp new file mode 100644 index 00000000..7ee79307 --- /dev/null +++ b/Minecraft.Client/Common/UI/UIControl_BeaconEffectButton.cpp @@ -0,0 +1,121 @@ +#include "stdafx.h" +#include "UI.h" +#include "UIControl_BeaconEffectButton.h" + +UIControl_BeaconEffectButton::UIControl_BeaconEffectButton() +{ + m_data = 0; + m_icon = 0; + m_selected = false; + m_active = false; + m_focus = false; +} + +bool UIControl_BeaconEffectButton::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName) +{ + bool success = UIControl::setupControl(scene,parent,controlName); + + m_funcChangeState = registerFastName(L"ChangeState"); + m_funcSetIcon = registerFastName(L"SetIcon"); + + return success; +} + +void UIControl_BeaconEffectButton::SetData(int data, int icon, bool active, bool selected) +{ + m_data = data; + m_active = active; + m_selected = selected; + + SetIcon(icon); + UpdateButtonState(); +} + +int UIControl_BeaconEffectButton::GetData() +{ + return m_data; +} + +void UIControl_BeaconEffectButton::SetButtonSelected(bool selected) +{ + if(selected != m_selected) + { + m_selected = selected; + + UpdateButtonState(); + } +} + +bool UIControl_BeaconEffectButton::IsButtonSelected() +{ + return m_selected; +} + +void UIControl_BeaconEffectButton::SetButtonActive(bool active) +{ + if(m_active != active) + { + m_active = active; + + UpdateButtonState(); + } +} + +void UIControl_BeaconEffectButton::setFocus(bool focus) +{ + if(m_focus != focus) + { + m_focus = focus; + + UpdateButtonState(); + } +} + +void UIControl_BeaconEffectButton::SetIcon(int icon) +{ + if(icon != m_icon) + { + m_icon = icon; + + IggyDataValue result; + IggyDataValue value[1]; + + value[0].type = IGGY_DATATYPE_number; + value[0].number = m_icon; + IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcSetIcon , 1 , value ); + } +} + +void UIControl_BeaconEffectButton::UpdateButtonState() +{ + EState state = eState_Disabled; + + if(!m_active) + { + state = eState_Disabled; + } + else if(m_selected) + { + state = eState_Pressed; + } + else if(m_focus) + { + state = eState_Enabled_Selected; + } + else + { + state = eState_Enabled_Unselected; + } + + if(state != m_lastState) + { + IggyDataValue result; + IggyDataValue value[1]; + + value[0].type = IGGY_DATATYPE_number; + value[0].number = state; + IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_funcChangeState , 1 , value ); + + if(out == IGGY_RESULT_SUCCESS) m_lastState = state; + } +}
\ No newline at end of file |
