From 58032876ef7ef5d8978989144dfa20e84457ee37 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 24 Sep 2018 11:57:10 +1000 Subject: [PATCH] Rename Item to MenuItem, to avoid potential duplicate issues in the future --- qcsrc/menu/item.qc | 30 ++++++++-------- qcsrc/menu/item.qh | 50 +++++++++++++------------- qcsrc/menu/item/container.qh | 2 +- qcsrc/menu/item/image.qh | 2 +- qcsrc/menu/item/inputbox.qc | 2 +- qcsrc/menu/item/label.qh | 2 +- qcsrc/menu/item/listbox.qh | 2 +- qcsrc/menu/xonotic/crosshairpreview.qh | 2 +- qcsrc/menu/xonotic/picker.qh | 2 +- 9 files changed, 47 insertions(+), 47 deletions(-) diff --git a/qcsrc/menu/item.qc b/qcsrc/menu/item.qc index a5c7cfa85..6d725259d 100644 --- a/qcsrc/menu/item.qc +++ b/qcsrc/menu/item.qc @@ -3,26 +3,26 @@ #include "item/container.qh" #include "item/borderimage.qh" - METHOD(Item, destroy, void(Item this)) + METHOD(MenuItem, destroy, void(MenuItem this)) { // free memory associated with this } - METHOD(Item, relinquishFocus, void(Item this)) + METHOD(MenuItem, relinquishFocus, void(MenuItem this)) { entity par = this.parent; if (!par) return; if (par.instanceOfContainer) par.setFocus(par, NULL); } - METHOD(Item, resizeNotify, void(Item this, vector relOrigin, vector relSize, vector absOrigin, vector absSize)) + METHOD(MenuItem, resizeNotify, void(MenuItem this, vector relOrigin, vector relSize, vector absOrigin, vector absSize)) { this.origin = absOrigin; this.size = absSize; } int autocvar_menu_showboxes; - METHOD(Item, draw, void(Item this)) + METHOD(MenuItem, draw, void(MenuItem this)) { if (!autocvar_menu_showboxes) return; vector rgb = '1 0 1'; @@ -53,53 +53,53 @@ } } - METHOD(Item, showNotify, void(Item this)) + METHOD(MenuItem, showNotify, void(MenuItem this)) {} - METHOD(Item, hideNotify, void(Item this)) + METHOD(MenuItem, hideNotify, void(MenuItem this)) {} - METHOD(Item, keyDown, float(Item this, float scan, float ascii, float shift)) + METHOD(MenuItem, keyDown, float(MenuItem this, float scan, float ascii, float shift)) { return 0; // unhandled } - METHOD(Item, keyUp, float(Item this, float scan, float ascii, float shift)) + METHOD(MenuItem, keyUp, float(MenuItem this, float scan, float ascii, float shift)) { return 0; // unhandled } - METHOD(Item, mouseMove, float(Item this, vector pos)) + METHOD(MenuItem, mouseMove, float(MenuItem this, vector pos)) { return 0; // unhandled } - METHOD(Item, mousePress, bool(Item this, vector pos)) + METHOD(MenuItem, mousePress, bool(MenuItem this, vector pos)) { return false; // unhandled } - METHOD(Item, mouseDrag, float(Item this, vector pos)) + METHOD(MenuItem, mouseDrag, float(MenuItem this, vector pos)) { return 0; // unhandled } - METHOD(Item, mouseRelease, float(Item this, vector pos)) + METHOD(MenuItem, mouseRelease, float(MenuItem this, vector pos)) { return 0; // unhandled } void m_play_focus_sound(); - METHOD(Item, focusEnter, void(Item this)) + METHOD(MenuItem, focusEnter, void(MenuItem this)) { if (this.allowFocusSound) m_play_focus_sound(); } - METHOD(Item, focusLeave, void(Item this)) + METHOD(MenuItem, focusLeave, void(MenuItem this)) {} - METHOD(Item, toString, string(Item this)) + METHOD(MenuItem, toString, string(MenuItem this)) { return string_null; } diff --git a/qcsrc/menu/item.qh b/qcsrc/menu/item.qh index 6cee17b3f..dd1d0679b 100644 --- a/qcsrc/menu/item.qh +++ b/qcsrc/menu/item.qh @@ -5,28 +5,28 @@ #include "draw.qh" #include "menu.qh" -CLASS(Item, Object) - METHOD(Item, draw, void(Item)); - METHOD(Item, keyDown, float(Item, float, float, float)); - METHOD(Item, keyUp, float(Item, float, float, float)); - METHOD(Item, mouseMove, float(Item, vector)); - METHOD(Item, mousePress, bool(Item this, vector pos)); - METHOD(Item, mouseDrag, float(Item, vector)); - METHOD(Item, mouseRelease, float(Item, vector)); - METHOD(Item, focusEnter, void(Item)); - METHOD(Item, focusLeave, void(Item)); - METHOD(Item, resizeNotify, void(Item, vector, vector, vector, vector)); - METHOD(Item, relinquishFocus, void(Item)); - METHOD(Item, showNotify, void(Item)); - METHOD(Item, hideNotify, void(Item)); - METHOD(Item, toString, string(Item)); - METHOD(Item, destroy, void(Item)); - ATTRIB(Item, focused, float, 0); - ATTRIB(Item, focusable, float, 0); - ATTRIB(Item, allowFocusSound, float, 0); - ATTRIB(Item, parent, entity); - ATTRIB(Item, preferredFocusPriority, float, 0); - ATTRIB(Item, origin, vector, '0 0 0'); - ATTRIB(Item, size, vector, '0 0 0'); - ATTRIB(Item, tooltip, string); -ENDCLASS(Item) +CLASS(MenuItem, Object) + METHOD(MenuItem, draw, void(MenuItem)); + METHOD(MenuItem, keyDown, float(MenuItem, float, float, float)); + METHOD(MenuItem, keyUp, float(MenuItem, float, float, float)); + METHOD(MenuItem, mouseMove, float(MenuItem, vector)); + METHOD(MenuItem, mousePress, bool(MenuItem this, vector pos)); + METHOD(MenuItem, mouseDrag, float(MenuItem, vector)); + METHOD(MenuItem, mouseRelease, float(MenuItem, vector)); + METHOD(MenuItem, focusEnter, void(MenuItem)); + METHOD(MenuItem, focusLeave, void(MenuItem)); + METHOD(MenuItem, resizeNotify, void(MenuItem, vector, vector, vector, vector)); + METHOD(MenuItem, relinquishFocus, void(MenuItem)); + METHOD(MenuItem, showNotify, void(MenuItem)); + METHOD(MenuItem, hideNotify, void(MenuItem)); + METHOD(MenuItem, toString, string(MenuItem)); + METHOD(MenuItem, destroy, void(MenuItem)); + ATTRIB(MenuItem, focused, float, 0); + ATTRIB(MenuItem, focusable, float, 0); + ATTRIB(MenuItem, allowFocusSound, float, 0); + ATTRIB(MenuItem, parent, entity); + ATTRIB(MenuItem, preferredFocusPriority, float, 0); + ATTRIB(MenuItem, origin, vector, '0 0 0'); + ATTRIB(MenuItem, size, vector, '0 0 0'); + ATTRIB(MenuItem, tooltip, string); +ENDCLASS(MenuItem) diff --git a/qcsrc/menu/item/container.qh b/qcsrc/menu/item/container.qh index b73752685..bc2d8e6d0 100644 --- a/qcsrc/menu/item/container.qh +++ b/qcsrc/menu/item/container.qh @@ -2,7 +2,7 @@ #include -CLASS(Container, Item) +CLASS(Container, MenuItem) METHOD(Container, draw, void(entity)); METHOD(Container, keyUp, float(entity, float, float, float)); METHOD(Container, keyDown, float(entity, float, float, float)); diff --git a/qcsrc/menu/item/image.qh b/qcsrc/menu/item/image.qh index 726f32860..0db9c3719 100644 --- a/qcsrc/menu/item/image.qh +++ b/qcsrc/menu/item/image.qh @@ -1,7 +1,7 @@ #pragma once #include "../item.qh" -CLASS(Image, Item) +CLASS(Image, MenuItem) METHOD(Image, configureImage, void(entity, string)); METHOD(Image, draw, void(entity)); METHOD(Image, toString, string(entity)); diff --git a/qcsrc/menu/item/inputbox.qc b/qcsrc/menu/item/inputbox.qc index d02f4661f..3272ed54f 100644 --- a/qcsrc/menu/item/inputbox.qc +++ b/qcsrc/menu/item/inputbox.qc @@ -356,7 +356,7 @@ } // skipping SUPER(InputBox).draw(me); - Item_draw(me); + MenuItem_draw(me); } void InputBox_showNotify(entity me) diff --git a/qcsrc/menu/item/label.qh b/qcsrc/menu/item/label.qh index f91ae8ad3..2439d1d5b 100644 --- a/qcsrc/menu/item/label.qh +++ b/qcsrc/menu/item/label.qh @@ -1,7 +1,7 @@ #pragma once #include "../item.qh" -CLASS(Label, Item) +CLASS(Label, MenuItem) METHOD(Label, configureLabel, void(entity, string, float, float)); METHOD(Label, draw, void(entity)); METHOD(Label, resizeNotify, void(entity, vector, vector, vector, vector)); diff --git a/qcsrc/menu/item/listbox.qh b/qcsrc/menu/item/listbox.qh index b3f5164a4..f60066cd7 100644 --- a/qcsrc/menu/item/listbox.qh +++ b/qcsrc/menu/item/listbox.qh @@ -1,7 +1,7 @@ #pragma once #include "../item.qh" -CLASS(ListBox, Item) +CLASS(ListBox, MenuItem) METHOD(ListBox, resizeNotify, void(entity, vector, vector, vector, vector)); METHOD(ListBox, configureListBox, void(entity, float, float)); METHOD(ListBox, draw, void(entity)); diff --git a/qcsrc/menu/xonotic/crosshairpreview.qh b/qcsrc/menu/xonotic/crosshairpreview.qh index 7bf363def..7499f4462 100644 --- a/qcsrc/menu/xonotic/crosshairpreview.qh +++ b/qcsrc/menu/xonotic/crosshairpreview.qh @@ -1,7 +1,7 @@ #pragma once #include "../item.qh" -CLASS(XonoticCrosshairPreview, Item) +CLASS(XonoticCrosshairPreview, MenuItem) METHOD(XonoticCrosshairPreview, configureXonoticCrosshairPreview, void(entity)); METHOD(XonoticCrosshairPreview, draw, void(entity)); ATTRIB(XonoticCrosshairPreview, src, string); diff --git a/qcsrc/menu/xonotic/picker.qh b/qcsrc/menu/xonotic/picker.qh index c98e9fc9b..bbff7d551 100644 --- a/qcsrc/menu/xonotic/picker.qh +++ b/qcsrc/menu/xonotic/picker.qh @@ -1,7 +1,7 @@ #pragma once #include "../item.qh" -CLASS(XonoticPicker, Item) +CLASS(XonoticPicker, MenuItem) METHOD(XonoticPicker, configureXonoticPicker, void(entity)); METHOD(XonoticPicker, mousePress, bool(XonoticPicker this, vector pos)); METHOD(XonoticPicker, mouseRelease, float(entity, vector)); -- 2.39.2