]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename .description and .descriptionWrapped
authorotta8634 <k9wolf@pm.me>
Sat, 15 Feb 2025 11:14:07 +0000 (19:14 +0800)
committerotta8634 <k9wolf@pm.me>
Sat, 15 Feb 2025 11:14:07 +0000 (19:14 +0800)
.m_description already exists, might as well re-use it in qcsrc/menu/xonotic/guide/description.q*.

qcsrc/menu/xonotic/guide/description.qc
qcsrc/menu/xonotic/guide/description.qh

index b0f2dc234dced83e0278fa7c7d6216895f87e856..05df251e1d80e77672ead3b4d8609a0576b3b5d8 100644 (file)
@@ -2,18 +2,18 @@
 
 void XonoticGuideDescription_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
 {
-       tokenizebyseparator(me.descriptionWrapped, "\n");
+       tokenizebyseparator(me.m_descriptionWrapped, "\n");
        draw_Text(me.realFontSize.x * eX + me.realUpperMargin * eY, argv(i), me.realFontSize, '1 1 1', 1, true);
 }
 
 void XonoticGuideDescription_setDescription(entity me, string desc)
 {
-       string current = me.description;
+       string current = me.m_description;
        if (current && current != desc)
                strunzone(current);
-       me.description = strzone(desc);
+       me.m_description = strzone(desc);
 
-       string currentWrapped = me.descriptionWrapped;
+       string currentWrapped = me.m_descriptionWrapped;
        if (currentWrapped)
                strunzone(currentWrapped);
 
@@ -30,7 +30,7 @@ void XonoticGuideDescription_setDescription(entity me, string desc)
                }
                wrapped = strcat(wrapped, line);
        }
-       me.descriptionWrapped = strzone(wrapped);
+       me.m_descriptionWrapped = strzone(wrapped);
 
        me.nItems = tokenizebyseparator(wrapped, "\n");
 }
@@ -42,5 +42,5 @@ void XonoticGuideDescription_resizeNotify(entity me, vector relOrigin, vector re
        me.realFontSize_y = me.fontSize / (absSize.y * me.itemHeight);
        me.realFontSize_x = me.fontSize / (absSize.x * (1 - me.controlWidth));
        me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
-       me.setDescription(me, me.description);
+       me.setDescription(me, me.m_description);
 }
index 81e9644d0863d4b3b9eeb1c3648760e1c53982ae..cc66f9a1de480b6be78d4c091e4144bfda95be5b 100644 (file)
@@ -6,8 +6,8 @@ CLASS(XonoticGuideDescription, XonoticListBox)
        ATTRIB(XonoticGuideDescription, realUpperMargin, float, 0);
        ATTRIB(XonoticGuideDescription, rowsPerItem, float, 1);
        ATTRIB(XonoticGuideDescription, selectionDoesntMatter, bool, true);
-       ATTRIB(XonoticGuideDescription, description, string, string_null);
-       ATTRIB(XonoticGuideDescription, descriptionWrapped, string, string_null);
+       ATTRIB(XonoticGuideDescription, m_description, string, string_null);
+       ATTRIB(XonoticGuideDescription, m_descriptionWrapped, string, string_null);
 
        METHOD(XonoticGuideDescription, drawListBoxItem, void(entity, int, vector, bool, bool));
        METHOD(XonoticGuideDescription, setDescription, void(entity, string));