1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Merge branch 'plannedobsolescence' into 'master'

Allow compilation with MYGUI_DONT_USE_OBSOLETE

See merge request OpenMW/openmw!3232
This commit is contained in:
psi29a 2023-07-16 08:44:59 +00:00
commit abb71eeb53
26 changed files with 51 additions and 39 deletions

View File

@ -26,7 +26,7 @@ namespace MWGui
bool exit() override { return false; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n

View File

@ -768,7 +768,11 @@ namespace MWGui
void reset(float left, float top, MyGUI::Colour colour)
{
#if MYGUI_VERSION <= MYGUI_DEFINE_VERSION(3, 4, 1)
mC = MyGUI::texture_utility::toColourARGB(colour) | 0xFF000000;
#else
mC = MyGUI::texture_utility::toNativeColour(colour, MyGUI::VertexColourType::ColourARGB) | 0xFF000000;
#endif
MyGUI::texture_utility::convertColour(mC, mVertexColourType);
mCursor.left = mOrigin.left + left;

View File

@ -33,7 +33,7 @@ namespace MWGui
bool exit() override { return false; }
// Events
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
typedef MyGUI::delegates::MultiDelegate<int> EventHandle_Int;
/** Event : Button was clicked.\n
signature : void method(int index)\n
@ -77,7 +77,7 @@ namespace MWGui
bool exit() override { return false; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n
@ -114,7 +114,7 @@ namespace MWGui
bool exit() override { return false; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n
@ -158,7 +158,7 @@ namespace MWGui
ESM::Class::Specialization getSpecializationId() const { return mSpecializationId; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Cancel button clicked.\n
signature : void method()\n
@ -191,7 +191,7 @@ namespace MWGui
ESM::Attribute::AttributeID getAttributeId() const { return mAttributeId; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Cancel button clicked.\n
signature : void method()\n
@ -222,7 +222,7 @@ namespace MWGui
ESM::RefId getSkillId() const { return mSkillId; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Cancel button clicked.\n
signature : void method()\n
@ -281,7 +281,7 @@ namespace MWGui
void setNextButtonShow(bool shown);
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n

View File

@ -12,7 +12,7 @@ namespace MWGui
void askForConfirmation(const std::string& message);
bool exit() override;
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Ok button was clicked.\n
signature : void method()\n

View File

@ -16,7 +16,7 @@ namespace MWGui
CountDialog();
void openCountDialog(const std::string& item, const std::string& message, const int maxCount);
typedef MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, int> EventHandle_WidgetInt;
typedef MyGUI::delegates::MultiDelegate<MyGUI::Widget*, int> EventHandle_WidgetInt;
/** Event : Ok button was clicked.\n
signature : void method(MyGUI::Widget* _sender, int _count)\n

View File

@ -79,7 +79,7 @@ namespace MWGui
struct Topic : Link
{
typedef MyGUI::delegates::CMultiDelegate1<const std::string&> EventHandle_TopicId;
typedef MyGUI::delegates::MultiDelegate<const std::string&> EventHandle_TopicId;
EventHandle_TopicId eventTopicActivated;
Topic(const std::string& id)
: mTopicId(id)
@ -91,7 +91,7 @@ namespace MWGui
struct Choice : Link
{
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_ChoiceId;
typedef MyGUI::delegates::MultiDelegate<int> EventHandle_ChoiceId;
EventHandle_ChoiceId eventChoiceActivated;
Choice(int id)
: mChoiceId(id)
@ -103,7 +103,7 @@ namespace MWGui
struct Goodbye : Link
{
typedef MyGUI::delegates::CMultiDelegate0 Event_Activated;
typedef MyGUI::delegates::MultiDelegate<> Event_Activated;
Event_Activated eventActivated;
void activated() override;
};
@ -145,7 +145,7 @@ namespace MWGui
bool exit() override;
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
void notifyLinkClicked(TypesetBook::InteractiveId link);

View File

@ -50,7 +50,7 @@ namespace MWGui
void setSize(const MyGUI::IntSize& value) override;
void setCoord(const MyGUI::IntCoord& value) override;
MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, const MWWorld::Ptr&> eventItemClicked;
MyGUI::delegates::MultiDelegate<MyGUI::Widget*, const MWWorld::Ptr&> eventItemClicked;
private:
struct Line

View File

@ -22,8 +22,8 @@ namespace MWGui
bool exit() override;
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::CMultiDelegate1<MWWorld::Ptr> EventHandle_Item;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<MWWorld::Ptr> EventHandle_Item;
EventHandle_Item eventItemSelected;
EventHandle_Void eventDialogCanceled;

View File

@ -20,8 +20,8 @@ namespace MWGui
/// Takes ownership of \a model
void setModel(std::unique_ptr<ItemModel> model);
typedef MyGUI::delegates::CMultiDelegate1<ItemModel::ModelIndex> EventHandle_ModelIndex;
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<ItemModel::ModelIndex> EventHandle_ModelIndex;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/// Fired when an item was clicked
EventHandle_ModelIndex eventItemClicked;
/// Fired when the background was clicked (useful for drag and drop)

View File

@ -63,7 +63,7 @@ namespace MWGui
RangeType getMarkers(const ESM::RefId& cellId) const;
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
EventHandle_Void eventMarkersChanged;
private:
@ -214,7 +214,7 @@ namespace MWGui
void setText(const std::string& text);
std::string getText();
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
EventHandle_Void eventDeleteClicked;
EventHandle_Void eventOkClicked;

View File

@ -40,7 +40,7 @@ namespace MWGui
/// @param reset Reset the pressed button to -1 after reading it.
int readPressedButton(bool reset = true);
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
typedef MyGUI::delegates::MultiDelegate<int> EventHandle_Int;
// Note: this delegate unassigns itself after it was fired, i.e. works once.
EventHandle_Int eventButtonPressed;

View File

@ -52,7 +52,7 @@ namespace MWGui
bool exit() override { return false; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n

View File

@ -48,8 +48,8 @@ namespace MWGui
void onFrame(float duration) override;
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<int> EventHandle_Int;
/** Event : Back button clicked.\n
signature : void method()\n

View File

@ -35,7 +35,7 @@ namespace MWGui
void newEffect(const ESM::MagicEffect* effect);
void editEffect(ESM::ENAMstruct effect);
typedef MyGUI::delegates::CMultiDelegate1<ESM::ENAMstruct> EventHandle_Effect;
typedef MyGUI::delegates::MultiDelegate<ESM::ENAMstruct> EventHandle_Effect;
EventHandle_Effect eventEffectAdded;
EventHandle_Effect eventEffectModified;

View File

@ -43,7 +43,7 @@ namespace MWGui
/// simplified update called each frame
void incrementalUpdate();
typedef MyGUI::delegates::CMultiDelegate1<SpellModel::ModelIndex> EventHandle_ModelIndex;
typedef MyGUI::delegates::MultiDelegate<SpellModel::ModelIndex> EventHandle_ModelIndex;
/// Fired when a spell was clicked
EventHandle_ModelIndex eventSpellClicked;

View File

@ -66,7 +66,7 @@ namespace MWGui
eventDone(this);
}
void TextInputDialog::onTextAccepted(MyGUI::Edit* _sender)
void TextInputDialog::onTextAccepted(MyGUI::EditBox* _sender)
{
onOkClicked(_sender);

View File

@ -26,7 +26,7 @@ namespace MWGui
protected:
void onOkClicked(MyGUI::Widget* _sender);
void onTextAccepted(MyGUI::Edit* _sender);
void onTextAccepted(MyGUI::EditBox* _sender);
private:
MyGUI::EditBox* mTextEdit;

View File

@ -18,8 +18,8 @@ namespace MWGui
bool isRunning() const;
// signals
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
typedef MyGUI::delegates::CMultiDelegate2<int, int> EventHandle_IntInt;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_Void;
typedef MyGUI::delegates::MultiDelegate<int, int> EventHandle_IntInt;
EventHandle_IntInt eventProgressChanged;
EventHandle_Void eventInterrupted;

View File

@ -44,7 +44,7 @@ namespace MWGui
void onDeleteCustomData(const MWWorld::Ptr& ptr) override;
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_TradeDone;
typedef MyGUI::delegates::MultiDelegate<> EventHandle_TradeDone;
EventHandle_TradeDone eventTradeDone;
private:

View File

@ -106,7 +106,7 @@ namespace MWGui
const SkillValue& getSkillValue() const { return mValue; }
// Events
typedef MyGUI::delegates::CMultiDelegate1<MWSkill*> EventHandle_SkillVoid;
typedef MyGUI::delegates::MultiDelegate<MWSkill*> EventHandle_SkillVoid;
/** Event : Skill clicked.\n
signature : void method(MWSkill* _sender)\n
@ -145,7 +145,7 @@ namespace MWGui
const AttributeValue& getAttributeValue() const { return mValue; }
// Events
typedef MyGUI::delegates::CMultiDelegate1<MWAttribute*> EventHandle_AttributeVoid;
typedef MyGUI::delegates::MultiDelegate<MWAttribute*> EventHandle_AttributeVoid;
/** Event : Attribute clicked.\n
signature : void method(MWAttribute* _sender)\n

View File

@ -20,7 +20,7 @@ namespace MWGui
virtual MyGUI::Widget* getDefaultKeyFocus() { return nullptr; }
// Events
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
typedef MyGUI::delegates::MultiDelegate<WindowBase*> EventHandle_WindowBase;
/// Open this object in the GUI, for windows that support it
virtual void setPtr(const MWWorld::Ptr& ptr) {}

View File

@ -73,7 +73,11 @@ namespace LuaUi
w->eventMouseButtonPressed.clear();
w->eventMouseButtonReleased.clear();
w->eventMouseMove.clear();
#if MYGUI_VERSION <= MYGUI_DEFINE_VERSION(3, 4, 2)
w->eventMouseDrag.m_event.clear();
#else
w->eventMouseDrag.clear();
#endif
w->eventMouseSetFocus.clear();
w->eventMouseLostFocus.clear();

View File

@ -16,7 +16,11 @@ namespace LuaUi
for (auto& [w, _] : mActionWidgets)
{
w->eventMouseButtonPressed.clear();
#if MYGUI_VERSION <= MYGUI_DEFINE_VERSION(3, 4, 2)
w->eventMouseDrag.m_event.clear();
#else
w->eventMouseDrag.clear();
#endif
}
mActionWidgets.clear();

View File

@ -41,8 +41,8 @@ namespace Gui
= std::to_string(std::clamp(Settings::Manager::getInt("font size", "GUI"), 12, 18));
return fontSize;
}
};
#endif
};
}
#endif

View File

@ -15,8 +15,8 @@ namespace Gui
public:
MWList();
typedef MyGUI::delegates::CMultiDelegate2<const std::string&, int> EventHandle_StringInt;
typedef MyGUI::delegates::CMultiDelegate1<MyGUI::Widget*> EventHandle_Widget;
typedef MyGUI::delegates::MultiDelegate<const std::string&, int> EventHandle_StringInt;
typedef MyGUI::delegates::MultiDelegate<MyGUI::Widget*> EventHandle_Widget;
/**
* Event: Item selected with the mouse.

View File

@ -26,7 +26,7 @@ namespace Gui
void initialiseOverride() override;
void shutdownOverride() override;
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_ValueChanged;
typedef MyGUI::delegates::MultiDelegate<int> EventHandle_ValueChanged;
EventHandle_ValueChanged eventValueChanged;
/// @note Does not trigger eventValueChanged