From: Rudolf Polzer Date: Thu, 17 Jun 2010 07:37:41 +0000 (+0200) Subject: auto-super.pl run X-Git-Tag: xonotic-v0.1.0preview~541^2~23^2~1 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=6d81ab64afd3d9980ff963edb261c03554fdfddb auto-super.pl run --- diff --git a/qcsrc/menu/anim/animation.c b/qcsrc/menu/anim/animation.c index d6fb114c2c..99ccc78968 100644 --- a/qcsrc/menu/anim/animation.c +++ b/qcsrc/menu/anim/animation.c @@ -27,44 +27,44 @@ void setterDummy(entity, float); #endif #ifdef IMPLEMENTATION -void configureAnimationAnimation(entity me, entity obj, void(entity, float) objSetter, float animStartTime, float animDuration, float animStartValue, float animEndValue) +void Animation_configureAnimation(entity me, entity obj, void(entity, float) objSetter, float animStartTime, float animDuration, float animStartValue, float animEndValue) { me.setObjectSetter(me, obj, objSetter); me.setTimeStartDuration(me, animStartTime, animDuration); me.setValueStartEnd(me, animStartValue, animEndValue); } -void setTimeStartEndAnimation(entity me, float s, float e) +void Animation_setTimeStartEnd(entity me, float s, float e) { me.startTime = s; me.duration = e - s; } -void setTimeStartDurationAnimation(entity me, float s, float d) +void Animation_setTimeStartDuration(entity me, float s, float d) { me.startTime = s; me.duration = d; } -void setValueStartEndAnimation(entity me, float s, float e) +void Animation_setValueStartEnd(entity me, float s, float e) { me.startValue = s; me.delta = e - s; } -void setValueStartDeltaAnimation(entity me, float s, float d) +void Animation_setValueStartDelta(entity me, float s, float d) { me.startValue = s; me.delta = d; } -void setObjectSetterAnimation(entity me, entity o, void(entity, float) s) +void Animation_setObjectSetter(entity me, entity o, void(entity, float) s) { me.object = o; me.setter = s; } -void tickAnimation(entity me, float tickTime) +void Animation_tick(entity me, float tickTime) { if (me.isStopped(me) || me.isFinished(me) || (tickTime < me.startTime)) return; @@ -77,32 +77,32 @@ void tickAnimation(entity me, float tickTime) me.setter(me.object, me.value); } -float calcValueAnimation(entity me, float tickTime, float animDuration, float animStartValue, float animDelta) +float Animation_calcValue(entity me, float tickTime, float animDuration, float animStartValue, float animDelta) { return animStartValue; } -float isStoppedAnimation(entity me) +float Animation_isStopped(entity me) { return me.stopped; } -void stopAnimAnimation(entity me) +void Animation_stopAnim(entity me) { me.stopped = TRUE; } -void resumeAnimAnimation(entity me) +void Animation_resumeAnim(entity me) { me.stopped = FALSE; } -float isFinishedAnimation(entity me) +float Animation_isFinished(entity me) { return me.finished; } -void finishAnimAnimation(entity me) +void Animation_finishAnim(entity me) { me.value = me.delta + me.startValue; me.finished = TRUE; diff --git a/qcsrc/menu/anim/animhost.c b/qcsrc/menu/anim/animhost.c index 41a26d5e0d..fc345e4458 100644 --- a/qcsrc/menu/anim/animhost.c +++ b/qcsrc/menu/anim/animhost.c @@ -19,7 +19,7 @@ ENDCLASS(AnimHost) #endif #ifdef IMPLEMENTATION -void addAnimAnimHost(entity me, entity other) +void AnimHost_addAnim(entity me, entity other) { if(other.parent) error("Can't add already added anim!"); @@ -43,7 +43,7 @@ void addAnimAnimHost(entity me, entity other) me.lastChild = other; } -void removeAnimAnimHost(entity me, entity other) +void AnimHost_removeAnim(entity me, entity other) { if(other.parent != me) error("Can't remove from wrong AnimHost!"); @@ -67,7 +67,7 @@ void removeAnimAnimHost(entity me, entity other) me.lastChild = p; } -void removeAllAnimAnimHost(entity me) +void AnimHost_removeAllAnim(entity me) { entity e, tmp; for(e = me.firstChild; e; e = e.nextSibling) @@ -78,7 +78,7 @@ void removeAllAnimAnimHost(entity me) } } -void removeObjAnimAnimHost(entity me, entity obj) +void AnimHost_removeObjAnim(entity me, entity obj) { entity e, tmp; for(e = me.firstChild; e; e = e.nextSibling) @@ -92,7 +92,7 @@ void removeObjAnimAnimHost(entity me, entity obj) } } -void stopAllAnimAnimHost(entity me) +void AnimHost_stopAllAnim(entity me) { entity e; for(e = me.firstChild; e; e = e.nextSibling) @@ -101,7 +101,7 @@ void stopAllAnimAnimHost(entity me) } } -void stopObjAnimAnimHost(entity me, entity obj) +void AnimHost_stopObjAnim(entity me, entity obj) { entity e; for(e = me.firstChild; e; e = e.nextSibling) @@ -113,7 +113,7 @@ void stopObjAnimAnimHost(entity me, entity obj) } } -void resumeAllAnimAnimHost(entity me) +void AnimHost_resumeAllAnim(entity me) { entity e; for(e = me.firstChild; e; e = e.nextSibling) @@ -122,7 +122,7 @@ void resumeAllAnimAnimHost(entity me) } } -void resumeObjAnimAnimHost(entity me, entity obj) +void AnimHost_resumeObjAnim(entity me, entity obj) { entity e; for(e = me.firstChild; e; e = e.nextSibling) @@ -134,7 +134,7 @@ void resumeObjAnimAnimHost(entity me, entity obj) } } -void finishAllAnimAnimHost(entity me) +void AnimHost_finishAllAnim(entity me) { entity e, tmp; for(e = me.firstChild; e; e = e.nextSibling) @@ -146,7 +146,7 @@ void finishAllAnimAnimHost(entity me) } } -void finishObjAnimAnimHost(entity me, entity obj) +void AnimHost_finishObjAnim(entity me, entity obj) { entity e, tmp; for(e = me.firstChild; e; e = e.nextSibling) @@ -161,7 +161,7 @@ void finishObjAnimAnimHost(entity me, entity obj) } } -void tickAllAnimHost(entity me) +void AnimHost_tickAll(entity me) { entity e, tmp; for(e = me.firstChild; e; e = e.nextSibling) diff --git a/qcsrc/menu/anim/easing.c b/qcsrc/menu/anim/easing.c index f14a4be0a6..94ea9cf087 100644 --- a/qcsrc/menu/anim/easing.c +++ b/qcsrc/menu/anim/easing.c @@ -30,12 +30,12 @@ entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, return me; } -float calcValueEasing(entity me, float tickTime, float animDuration, float animStart, float animDelta) +float Easing_calcValue(entity me, float tickTime, float animDuration, float animStart, float animDelta) { return me.math(tickTime, animDuration, animStart, animDelta); } -void setMathEasing(entity me, float(float, float, float, float) func) +void Easing_setMath(entity me, float(float, float, float, float) func) { me.math = func; } diff --git a/qcsrc/menu/anim/keyframe.c b/qcsrc/menu/anim/keyframe.c index 95fbf63cce..c1c3876695 100644 --- a/qcsrc/menu/anim/keyframe.c +++ b/qcsrc/menu/anim/keyframe.c @@ -31,7 +31,7 @@ entity makeKeyframe(entity obj, void(entity, float) objSetter, float animDuratio return me; } -entity addEasingKeyframe(entity me, float animDurationTime, float animEnd, float(float, float, float, float) func) +entity Keyframe_addEasing(entity me, float animDurationTime, float animEnd, float(float, float, float, float) func) { entity other; other = makeEasing(me.object, me.setter, func, getNewChildStart(me), getNewChildDuration(me, animDurationTime), getNewChildValue(me), animEnd); @@ -65,7 +65,7 @@ float getNewChildValue(entity me) return me.startValue; } -void addAnimKeyframe(entity me, entity other) +void Keyframe_addAnim(entity me, entity other) { if(other.parent) error("Can't add already added anim!"); @@ -92,7 +92,7 @@ void addAnimKeyframe(entity me, entity other) me.lastChild = other; } -float calcValueKeyframe(entity me, float tickTime, float animDuration, float animStartValue, float animDelta) +float Keyframe_calcValue(entity me, float tickTime, float animDuration, float animStartValue, float animDelta) { if (me.currentChild) if (me.currentChild.isFinished(me.currentChild)) diff --git a/qcsrc/menu/auto-super.pl b/qcsrc/menu/auto-super.pl new file mode 100644 index 0000000000..00926d0617 --- /dev/null +++ b/qcsrc/menu/auto-super.pl @@ -0,0 +1,101 @@ +my %classoffile = (); +my %classes = (); +my %baseclass = (); +my %methods = (); +my %attrs = (); +my %methodnames = (); +my %old2new = (); + +print STDERR "Scanning...\n"; +for my $f(@ARGV) +{ + open my $fh, '<', $f; + while(<$fh>) + { + if(/^CLASS\(([^)]*)\)(?:\s*EXTENDS\(([^)]*)\))?/) + { + $classes{$1} = defined($2) ? $2 : "Object"; + $classoffile{$f} = $1; + } + if(/^\s*METHOD\(([^),]*),\s*([^),]*)/) + { + $methods{$1}{$2} = $1; + $methodnames{"$1"."_"."$2"} = $f; + $old2new{"$2$1"} = "$1"."_"."$2"; + } + if(/^\s*ATTRIB(?:ARRAY)?\(([^),]*),\s*([^),]*)/) + { + $attrs{$1}{$2} = $1; + } + } + close $fh; +} + +# propagate down methods etc. +print STDERR "Propagating...\n"; +for my $class(keys %classes) +{ + print STDERR "$class"; + my $base = $class; + for(;;) + { + $base = $classes{$base}; + last if not defined $base; + print STDERR " -> $base"; + while(my ($method, $definingclass) = each %{$methods{$base}}) + { + $methods{$class}{$method} = $definingclass + if not defined $methods{$class}{$method}; + } + while(my ($attr, $definingclass) = each %{$attrs{$base}}) + { + $attrs{$class}{$attr} = $definingclass + if not defined $attrs{$class}{$attr}; + } + } + print STDERR "\n"; +} + +# change all calls to base method to super, complain about skipping +print STDERR "Fixing...\n"; +for my $f(@ARGV) +{ + open my $fh, '<', $f; + my $s = do { undef local $/; <$fh>; }; + my $s0 = $s; + close $fh; + + my $class = $classoffile{$f}; + my $base = $classes{$class}; + next if not defined $base; + + for(keys %old2new) + { + $s =~ s/\b$_\b/$old2new{$_}/g; + } + + my @methods_super = map { [ $methods{$base}{$_} . "_" . $_, "SUPER($class).$_" ]; } keys %{$methods{$base}}; + for(@methods_super) + { + my ($search, $replace) = @$_; + my $n = ($s =~ s/\b$search\b/$replace/g); + print STDERR "[$f] $search -> $replace... $n replacements\n" + if $n; + } + + for(grep { $methodnames{$_} ne $f } keys %methodnames) + { + if($s =~ /\b$_\b/) + { + print STDERR "[$f] calls non-super external method directly: $_\n"; + } + } + + if($s ne $s0) + { + print STDERR "Rewriting $f...\n"; + open my $fh, '>', $f; + print $fh $s; + close $fh; + } +} diff --git a/qcsrc/menu/item.c b/qcsrc/menu/item.c index b249ce9eb7..497d1cf661 100644 --- a/qcsrc/menu/item.c +++ b/qcsrc/menu/item.c @@ -26,76 +26,76 @@ ENDCLASS(Item) #endif #ifdef IMPLEMENTATION -void destroyItem(entity me) +void Item_destroy(entity me) { // free memory associated with me } -void relinquishFocusItem(entity me) +void Item_relinquishFocus(entity me) { if(me.parent) if(me.parent.instanceOfContainer) me.parent.setFocus(me.parent, NULL); } -void resizeNotifyItem(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void Item_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.origin = absOrigin; me.size = absSize; // me.tooltip = "The quick brown fox jumped over the lazy sleeping dog's back then sat on a tack. Franz jagt im komplett verwahrlosten Taxi quer durch Bayern."; } -void drawItem(entity me) +void Item_draw(entity me) { } -void showNotifyItem(entity me) +void Item_showNotify(entity me) { } -void hideNotifyItem(entity me) +void Item_hideNotify(entity me) { } -float keyDownItem(entity me, float scan, float ascii, float shift) +float Item_keyDown(entity me, float scan, float ascii, float shift) { return 0; // unhandled } -float keyUpItem(entity me, float scan, float ascii, float shift) +float Item_keyUp(entity me, float scan, float ascii, float shift) { return 0; // unhandled } -float mouseMoveItem(entity me, vector pos) +float Item_mouseMove(entity me, vector pos) { return 0; // unhandled } -float mousePressItem(entity me, vector pos) +float Item_mousePress(entity me, vector pos) { return 0; // unhandled } -float mouseDragItem(entity me, vector pos) +float Item_mouseDrag(entity me, vector pos) { return 0; // unhandled } -float mouseReleaseItem(entity me, vector pos) +float Item_mouseRelease(entity me, vector pos) { return 0; // unhandled } -void focusEnterItem(entity me) +void Item_focusEnter(entity me) { } -void focusLeaveItem(entity me) +void Item_focusLeave(entity me) { } -string toStringItem(entity me) +string Item_toString(entity me) { return string_null; } diff --git a/qcsrc/menu/item/borderimage.c b/qcsrc/menu/item/borderimage.c index 1bb458ad1d..0229b53a55 100644 --- a/qcsrc/menu/item/borderimage.c +++ b/qcsrc/menu/item/borderimage.c @@ -18,7 +18,7 @@ ENDCLASS(BorderImage) #endif #ifdef IMPLEMENTATION -void resizeNotifyBorderImage(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void BorderImage_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.isNexposeeTitleBar = 0; if(me.zoomedOutTitleBar) @@ -30,12 +30,12 @@ void resizeNotifyBorderImage(entity me, vector relOrigin, vector relSize, vector { vector scrs; scrs = eX * conwidth + eY * conheight; - resizeNotifyLabel(me, relOrigin, relSize, boxToGlobal(me.parent.Nexposee_smallOrigin, '0 0 0', scrs), boxToGlobalSize(me.parent.Nexposee_smallSize, scrs)); + SUPER(BorderImage).resizeNotify(me, relOrigin, relSize, boxToGlobal(me.parent.Nexposee_smallOrigin, '0 0 0', scrs), boxToGlobalSize(me.parent.Nexposee_smallSize, scrs)); me.realOrigin_y = me.realFontSize_y * me.zoomedOutTitleBarPosition; me.realOrigin_Nexposeed = me.realOrigin; me.realFontSize_Nexposeed = me.realFontSize; } - resizeNotifyLabel(me, relOrigin, relSize, absOrigin, absSize); + SUPER(BorderImage).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.borderVec = me.borderHeight / absSize_y * (eY + eX * (absSize_y / absSize_x)); me.realOrigin_y = 0.5 * (me.borderVec_y - me.realFontSize_y); if(me.closeButton) @@ -48,14 +48,14 @@ void resizeNotifyBorderImage(entity me, vector relOrigin, vector relSize, vector me.closeButton.colorF = me.color; } } -void configureBorderImageBorderImage(entity me, string theTitle, float sz, vector theColor, string path, float theBorderHeight) +void BorderImage_configureBorderImage(entity me, string theTitle, float sz, vector theColor, string path, float theBorderHeight) { me.configureLabel(me, theTitle, sz, 0.5); me.src = path; me.color = theColor; me.borderHeight = theBorderHeight; } -void drawBorderImage(entity me) +void BorderImage_draw(entity me) { //print(vtos(me.borderVec), "\n"); @@ -76,7 +76,7 @@ void drawBorderImage(entity me) draw_fontscale = globalToBoxSize(boxToGlobalSize(df, me.realFontSize), rf); } - drawLabel(me); + SUPER(BorderImage).draw(me); if(me.isNexposeeTitleBar) { diff --git a/qcsrc/menu/item/button.c b/qcsrc/menu/item/button.c index 096c75b805..728413135a 100644 --- a/qcsrc/menu/item/button.c +++ b/qcsrc/menu/item/button.c @@ -35,20 +35,20 @@ ENDCLASS(Button) #endif #ifdef IMPLEMENTATION -void resizeNotifyButton(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void Button_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { if(me.srcMulti) me.keepspaceLeft = 0; else me.keepspaceLeft = min(0.8, absSize_y / absSize_x); - resizeNotifyLabel(me, relOrigin, relSize, absOrigin, absSize); + SUPER(Button).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); } -void configureButtonButton(entity me, string txt, float sz, string gfx) +void Button_configureButton(entity me, string txt, float sz, string gfx) { - configureLabelLabel(me, txt, sz, me.srcMulti ? 0.5 : 0); + SUPER(Button).configureLabel(me, txt, sz, me.srcMulti ? 0.5 : 0); me.src = gfx; } -float keyDownButton(entity me, float key, float ascii, float shift) +float Button_keyDown(entity me, float key, float ascii, float shift) { if(key == K_ENTER || key == K_SPACE) { @@ -57,7 +57,7 @@ float keyDownButton(entity me, float key, float ascii, float shift) } return 0; } -float mouseDragButton(entity me, vector pos) +float Button_mouseDrag(entity me, vector pos) { me.pressed = 1; if(pos_x < 0) me.pressed = 0; @@ -66,14 +66,14 @@ float mouseDragButton(entity me, vector pos) if(pos_y >= 1) me.pressed = 0; return 1; } -float mousePressButton(entity me, vector pos) +float Button_mousePress(entity me, vector pos) { me.mouseDrag(me, pos); // verify coordinates if(cvar("menu_sounds")) localsound("sound/misc/menu2.wav"); return 1; } -float mouseReleaseButton(entity me, vector pos) +float Button_mouseRelease(entity me, vector pos) { me.mouseDrag(me, pos); // verify coordinates if(me.pressed) @@ -84,12 +84,12 @@ float mouseReleaseButton(entity me, vector pos) } return 1; } -void showNotifyButton(entity me) +void Button_showNotify(entity me) { me.focusable = !me.disabled; } .float playedfocus; -void drawButton(entity me) +void Button_draw(entity me) { vector bOrigin, bSize; float save; @@ -150,7 +150,7 @@ void drawButton(entity me) draw_alpha = save; - drawLabel(me); + SUPER(Button).draw(me); if(me.clickTime > 0 && me.clickTime <= frametime) { diff --git a/qcsrc/menu/item/checkbox.c b/qcsrc/menu/item/checkbox.c index 40fa6675bd..5ae92d6122 100644 --- a/qcsrc/menu/item/checkbox.c +++ b/qcsrc/menu/item/checkbox.c @@ -14,7 +14,7 @@ ENDCLASS(CheckBox) #endif #ifdef IMPLEMENTATION -void setCheckedCheckBox(entity me, float val) +void CheckBox_setChecked(entity me, float val) { me.checked = val; } @@ -22,16 +22,16 @@ void CheckBox_Click(entity me, entity other) { me.setChecked(me, !me.checked); } -string toStringCheckBox(entity me) +string CheckBox_toString(entity me) { - return strcat(toStringLabel(me), ", ", me.checked ? "checked" : "unchecked"); + return strcat(SUPER(CheckBox).toString(me), ", ", me.checked ? "checked" : "unchecked"); } -void configureCheckBoxCheckBox(entity me, string txt, float sz, string gfx) +void CheckBox_configureCheckBox(entity me, string txt, float sz, string gfx) { me.configureButton(me, txt, sz, gfx); me.align = 0; } -void drawCheckBox(entity me) +void CheckBox_draw(entity me) { float s; s = me.pressed; @@ -42,7 +42,7 @@ void drawCheckBox(entity me) } else me.srcSuffix = (me.checked ? "1" : "0"); - drawButton(me); + SUPER(CheckBox).draw(me); me.pressed = s; } #endif diff --git a/qcsrc/menu/item/container.c b/qcsrc/menu/item/container.c index 53e3eaa1ac..b29eea0b80 100644 --- a/qcsrc/menu/item/container.c +++ b/qcsrc/menu/item/container.c @@ -36,7 +36,7 @@ ENDCLASS(Container) #endif #ifdef IMPLEMENTATION -void showNotifyContainer(entity me) +void Container_showNotify(entity me) { entity e; if(me.shown) @@ -47,7 +47,7 @@ void showNotifyContainer(entity me) e.showNotify(e); } -void hideNotifyContainer(entity me) +void Container_hideNotify(entity me) { entity e; if not(me.shown) @@ -58,7 +58,7 @@ void hideNotifyContainer(entity me) e.hideNotify(e); } -void setAlphaOfContainer(entity me, entity other, float theAlpha) +void Container_setAlphaOf(entity me, entity other, float theAlpha) { if(theAlpha <= 0) { @@ -73,7 +73,7 @@ void setAlphaOfContainer(entity me, entity other, float theAlpha) other.Container_alpha = theAlpha; } -void resizeNotifyLieContainer(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize, .vector originField, .vector sizeField) +void Container_resizeNotifyLie(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize, .vector originField, .vector sizeField) { entity e; vector o, s; @@ -98,15 +98,15 @@ void resizeNotifyLieContainer(entity me, vector relOrigin, vector relSize, vecto } } while(d); - resizeNotifyItem(me, relOrigin, relSize, absOrigin, absSize); + SUPER(Container).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); } -void resizeNotifyContainer(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void Container_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.resizeNotifyLie(me, relOrigin, relSize, absOrigin, absSize, Container_origin, Container_size); } -entity itemFromPointContainer(entity me, vector pos) +entity Container_itemFromPoint(entity me, vector pos) { entity e; vector o, s; @@ -123,7 +123,7 @@ entity itemFromPointContainer(entity me, vector pos) return NULL; } -void drawContainer(entity me) +void Container_draw(entity me) { vector oldshift; vector oldscale; @@ -155,12 +155,12 @@ void drawContainer(entity me) } }; -void focusLeaveContainer(entity me) +void Container_focusLeave(entity me) { me.setFocus(me, NULL); } -float keyUpContainer(entity me, float scan, float ascii, float shift) +float Container_keyUp(entity me, float scan, float ascii, float shift) { entity f; f = me.focusedChild; @@ -169,7 +169,7 @@ float keyUpContainer(entity me, float scan, float ascii, float shift) return 0; } -float keyDownContainer(entity me, float scan, float ascii, float shift) +float Container_keyDown(entity me, float scan, float ascii, float shift) { entity f; f = me.focusedChild; @@ -178,7 +178,7 @@ float keyDownContainer(entity me, float scan, float ascii, float shift) return 0; } -float mouseMoveContainer(entity me, vector pos) +float Container_mouseMove(entity me, vector pos) { entity f; f = me.focusedChild; @@ -186,7 +186,7 @@ float mouseMoveContainer(entity me, vector pos) return f.mouseMove(f, globalToBox(pos, f.Container_origin, f.Container_size)); return 0; } -float mousePressContainer(entity me, vector pos) +float Container_mousePress(entity me, vector pos) { entity f; f = me.focusedChild; @@ -194,7 +194,7 @@ float mousePressContainer(entity me, vector pos) return f.mousePress(f, globalToBox(pos, f.Container_origin, f.Container_size)); return 0; } -float mouseDragContainer(entity me, vector pos) +float Container_mouseDrag(entity me, vector pos) { entity f; f = me.focusedChild; @@ -202,7 +202,7 @@ float mouseDragContainer(entity me, vector pos) return f.mouseDrag(f, globalToBox(pos, f.Container_origin, f.Container_size)); return 0; } -float mouseReleaseContainer(entity me, vector pos) +float Container_mouseRelease(entity me, vector pos) { entity f; f = me.focusedChild; @@ -211,12 +211,12 @@ float mouseReleaseContainer(entity me, vector pos) return 0; } -void addItemCenteredContainer(entity me, entity other, vector theSize, float theAlpha) +void Container_addItemCentered(entity me, entity other, vector theSize, float theAlpha) { me.addItem(me, other, '0.5 0.5 0' - 0.5 * theSize, theSize, theAlpha); } -void addItemContainer(entity me, entity other, vector theOrigin, vector theSize, float theAlpha) +void Container_addItem(entity me, entity other, vector theOrigin, vector theSize, float theAlpha) { if(other.parent) error("Can't add already added item!"); @@ -258,7 +258,7 @@ void addItemContainer(entity me, entity other, vector theOrigin, vector theSize, draw_NeedResizeNotify = 1; } -void removeItemContainer(entity me, entity other) +void Container_removeItem(entity me, entity other) { if(other.parent != me) error("Can't remove from wrong container!"); @@ -285,7 +285,7 @@ void removeItemContainer(entity me, entity other) me.lastChild = p; } -void setFocusContainer(entity me, entity other) +void Container_setFocus(entity me, entity other) { if(other) if not(me.focused) @@ -306,7 +306,7 @@ void setFocusContainer(entity me, entity other) me.focusedChild = other; } -void moveItemAfterContainer(entity me, entity other, entity dest) +void Container_moveItemAfter(entity me, entity other, entity dest) { // first: remove other from the chain entity n, p, f, l; @@ -347,7 +347,7 @@ void moveItemAfterContainer(entity me, entity other, entity dest) me.lastChild = other; } -entity preferredFocusedGrandChildContainer(entity me) +entity Container_preferredFocusedGrandChild(entity me) { entity e, e2; entity best; diff --git a/qcsrc/menu/item/dialog.c b/qcsrc/menu/item/dialog.c index 7733a60302..8202fbbb67 100644 --- a/qcsrc/menu/item/dialog.c +++ b/qcsrc/menu/item/dialog.c @@ -71,11 +71,11 @@ void Dialog_Close(entity button, entity me) me.close(me); } -void fillDialog(entity me) +void Dialog_fill(entity me) { } -void addItemSimpleDialog(entity me, float row, float col, float rowspan, float colspan, entity e, vector v) +void Dialog_addItemSimple(entity me, float row, float col, float rowspan, float colspan, entity e, vector v) { //print(vtos(me.itemSpacing), " ", vtos(me.itemSize), "\n"); vector o, s; @@ -88,41 +88,41 @@ void addItemSimpleDialog(entity me, float row, float col, float rowspan, float c me.addItem(me, e, o, s, 1); } -void gotoRCDialog(entity me, float row, float col) +void Dialog_gotoRC(entity me, float row, float col) { me.currentRow = row; me.currentColumn = col; } -void TRDialog(entity me) +void Dialog_TR(entity me) { me.currentRow += 1; me.currentColumn = me.firstColumn; } -void TDDialog(entity me, float rowspan, float colspan, entity e) +void Dialog_TD(entity me, float rowspan, float colspan, entity e) { me.addItemSimple(me, me.currentRow, me.currentColumn, rowspan, colspan, e, '0 0 0'); me.currentColumn += colspan; } -void TDNoMarginDialog(entity me, float rowspan, float colspan, entity e, vector v) +void Dialog_TDNoMargin(entity me, float rowspan, float colspan, entity e, vector v) { me.addItemSimple(me, me.currentRow, me.currentColumn, rowspan, colspan, e, v); me.currentColumn += colspan; } -void setFirstColumnDialog(entity me, float col) +void Dialog_setFirstColumn(entity me, float col) { me.firstColumn = col; } -void TDemptyDialog(entity me, float colspan) +void Dialog_TDempty(entity me, float colspan) { me.currentColumn += colspan; } -void configureDialogDialog(entity me) +void Dialog_configureDialog(entity me) { entity closebutton; float absWidth, absHeight; @@ -164,7 +164,7 @@ void configureDialogDialog(entity me) me.frame.closeButton = closebutton; } -void closeDialog(entity me) +void Dialog_close(entity me) { if(me.parent.instanceOfNexposee) { @@ -176,7 +176,7 @@ void closeDialog(entity me) } } -float keyDownDialog(entity me, float key, float ascii, float shift) +float Dialog_keyDown(entity me, float key, float ascii, float shift) { if(me.closable) { @@ -186,6 +186,6 @@ float keyDownDialog(entity me, float key, float ascii, float shift) return 1; } } - return keyDownInputContainer(me, key, ascii, shift); + return SUPER(Dialog).keyDown(me, key, ascii, shift); } #endif diff --git a/qcsrc/menu/item/gecko.c b/qcsrc/menu/item/gecko.c index de0502fe63..ea8b1d314a 100644 --- a/qcsrc/menu/item/gecko.c +++ b/qcsrc/menu/item/gecko.c @@ -83,7 +83,7 @@ float mouseDragGecko(entity me, vector pos) void resizeNotifyGecko(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyItem(me, relOrigin, relSize, absOrigin, absSize); + SUPER(Gecko).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); gecko_resize( me.texturePath, absSize_x, absSize_y ); me.textureExtent = gecko_get_texture_extent( me.texturePath ); } diff --git a/qcsrc/menu/item/image.c b/qcsrc/menu/item/image.c index c60ec232f2..c64561b39b 100644 --- a/qcsrc/menu/item/image.c +++ b/qcsrc/menu/item/image.c @@ -14,19 +14,19 @@ ENDCLASS(Image) #endif #ifdef IMPLEMENTATION -string toStringImage(entity me) +string Image_toString(entity me) { return me.src; } -void configureImageImage(entity me, string path) +void Image_configureImage(entity me, string path) { me.src = path; } -void drawImage(entity me) +void Image_draw(entity me) { draw_Picture(me.imgOrigin, me.src, me.imgSize, me.color, 1); } -void updateAspectImage(entity me) +void Image_updateAspect(entity me) { float asp; if(me.size_x <= 0 || me.size_y <= 0) @@ -59,9 +59,9 @@ void updateAspectImage(entity me) me.imgOrigin = '0.5 0.5 0' - 0.5 * me.imgSize; } } -void resizeNotifyImage(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void Image_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyItem(me, relOrigin, relSize, absOrigin, absSize); + SUPER(Image).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.updateAspect(me); } #endif diff --git a/qcsrc/menu/item/inputbox.c b/qcsrc/menu/item/inputbox.c index 03e1605daf..cb1b32e8b1 100644 --- a/qcsrc/menu/item/inputbox.c +++ b/qcsrc/menu/item/inputbox.c @@ -31,18 +31,18 @@ void InputBox_Clear_Click(entity btn, entity me); #endif #ifdef IMPLEMENTATION -void configureInputBoxInputBox(entity me, string theText, float theCursorPos, float theFontSize, string gfx) +void InputBox_configureInputBox(entity me, string theText, float theCursorPos, float theFontSize, string gfx) { - configureLabelLabel(me, theText, theFontSize, 0.0); + SUPER(InputBox).configureLabel(me, theText, theFontSize, 0.0); me.src = gfx; me.cursorPos = theCursorPos; } -void setTextInputBox(entity me, string txt) +void InputBox_setText(entity me, string txt) { if(me.text) strunzone(me.text); - setTextLabel(me, strzone(txt)); + SUPER(InputBox).setText(me, strzone(txt)); } void InputBox_Clear_Click(entity btn, entity me) @@ -50,7 +50,7 @@ void InputBox_Clear_Click(entity btn, entity me) me.setText(me, ""); } -float mouseDragInputBox(entity me, vector pos) +float InputBox_mouseDrag(entity me, vector pos) { float p; me.dragScrollPos = pos; @@ -60,20 +60,20 @@ float mouseDragInputBox(entity me, vector pos) return 1; } -float mousePressInputBox(entity me, vector pos) +float InputBox_mousePress(entity me, vector pos) { me.dragScrollTimer = time; me.pressed = 1; - return mouseDragInputBox(me, pos); + return InputBox_mouseDrag(me, pos); } -float mouseReleaseInputBox(entity me, vector pos) +float InputBox_mouseRelease(entity me, vector pos) { me.pressed = 0; - return mouseDragInputBox(me, pos); + return InputBox_mouseDrag(me, pos); } -void enterTextInputBox(entity me, string ch) +void InputBox_enterText(entity me, string ch) { float i; for(i = 0; i < strlen(ch); ++i) @@ -85,7 +85,7 @@ void enterTextInputBox(entity me, string ch) me.cursorPos += strlen(ch); } -float keyDownInputBox(entity me, float key, float ascii, float shift) +float InputBox_keyDown(entity me, float key, float ascii, float shift) { me.lastChangeTime = time; me.dragScrollTimer = time; @@ -125,7 +125,7 @@ float keyDownInputBox(entity me, float key, float ascii, float shift) return 0; } -void drawInputBox(entity me) +void InputBox_draw(entity me) { #define CURSOR "_" float cursorPosInWidths, totalSizeInWidths; @@ -303,14 +303,14 @@ void drawInputBox(entity me) } else draw_Text(me.realOrigin - eX * me.scrollPos, me.text, me.realFontSize, '1 1 1', 1, 0); - // skipping drawLabel(me); + // skipping SUPER(InputBox).draw(me); if(!me.focused || (time - me.lastChangeTime) < floor(time - me.lastChangeTime) + 0.5) draw_Text(me.realOrigin + eX * (cursorPosInWidths - me.scrollPos), CURSOR, me.realFontSize, '1 1 1', 1, 0); draw_ClearClip(); } -void showNotifyInputBox(entity me) +void InputBox_showNotify(entity me) { me.focusable = !me.disabled; } diff --git a/qcsrc/menu/item/inputcontainer.c b/qcsrc/menu/item/inputcontainer.c index 91e0012c88..e1b14d3b16 100644 --- a/qcsrc/menu/item/inputcontainer.c +++ b/qcsrc/menu/item/inputcontainer.c @@ -15,9 +15,9 @@ ENDCLASS(InputContainer) #endif #ifdef IMPLEMENTATION -void resizeNotifyInputContainer(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void InputContainer_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyContainer(me, relOrigin, relSize, absOrigin, absSize); + SUPER(InputContainer).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); /* if(me.parent.instanceOfInputContainer) me.isTabRoot = 0; @@ -26,16 +26,16 @@ void resizeNotifyInputContainer(entity me, vector relOrigin, vector relSize, vec */ } -void focusLeaveInputContainer(entity me) +void InputContainer_focusLeave(entity me) { - focusLeaveContainer(me); + SUPER(InputContainer).focusLeave(me); me.mouseFocusedChild = NULL; } -float keyDownInputContainer(entity me, float scan, float ascii, float shift) +float InputContainer_keyDown(entity me, float scan, float ascii, float shift) { entity f, ff; - if(keyDownContainer(me, scan, ascii, shift)) + if(SUPER(InputContainer).keyDown(me, scan, ascii, shift)) return 1; if(scan == K_ESCAPE) { @@ -102,7 +102,7 @@ float keyDownInputContainer(entity me, float scan, float ascii, float shift) return 0; } -float _changeFocusXYInputContainer(entity me, vector pos) +float InputContainer__changeFocusXY(entity me, vector pos) { entity e, ne; e = me.mouseFocusedChild; @@ -124,37 +124,37 @@ float _changeFocusXYInputContainer(entity me, vector pos) return (ne != NULL); } -float mouseDragInputContainer(entity me, vector pos) +float InputContainer_mouseDrag(entity me, vector pos) { - if(mouseDragContainer(me, pos)) + if(SUPER(InputContainer).mouseDrag(me, pos)) return 1; if(pos_x >= 0 && pos_y >= 0 && pos_x < 1 && pos_y < 1) return 1; return 0; } -float mouseMoveInputContainer(entity me, vector pos) +float InputContainer_mouseMove(entity me, vector pos) { if(me._changeFocusXY(me, pos)) - if(mouseMoveContainer(me, pos)) + if(SUPER(InputContainer).mouseMove(me, pos)) return 1; if(pos_x >= 0 && pos_y >= 0 && pos_x < 1 && pos_y < 1) return 1; return 0; } -float mousePressInputContainer(entity me, vector pos) +float InputContainer_mousePress(entity me, vector pos) { me.mouseFocusedChild = NULL; // force focusing if(me._changeFocusXY(me, pos)) - if(mousePressContainer(me, pos)) + if(SUPER(InputContainer).mousePress(me, pos)) return 1; if(pos_x >= 0 && pos_y >= 0 && pos_x < 1 && pos_y < 1) return 1; return 0; } -float mouseReleaseInputContainer(entity me, vector pos) +float InputContainer_mouseRelease(entity me, vector pos) { float r; - r = mouseReleaseContainer(me, pos); + r = SUPER(InputContainer).mouseRelease(me, pos); if(me.focused) // am I still eligible for this? (UGLY HACK, but a mouse event could have changed focus away) if(me._changeFocusXY(me, pos)) return 1; diff --git a/qcsrc/menu/item/label.c b/qcsrc/menu/item/label.c index 1ac50be751..5a6bb1c697 100644 --- a/qcsrc/menu/item/label.c +++ b/qcsrc/menu/item/label.c @@ -26,18 +26,18 @@ ENDCLASS(Label) #endif #ifdef IMPLEMENTATION -string toStringLabel(entity me) +string Label_toString(entity me) { return me.text; } -void setTextLabel(entity me, string txt) +void Label_setText(entity me, string txt) { me.text = txt; me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(draw_TextWidth(me.text, me.allowColors, me.realFontSize), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft; } -void resizeNotifyLabel(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void Label_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyItem(me, relOrigin, relSize, absOrigin, absSize); + SUPER(Label).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); // absSize_y is height of label me.realFontSize_y = me.fontSize / absSize_y; me.realFontSize_x = me.fontSize / absSize_x; @@ -48,13 +48,13 @@ void resizeNotifyLabel(entity me, vector relOrigin, vector relSize, vector absOr me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(draw_TextWidth(me.text, me.allowColors, me.realFontSize), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft; me.realOrigin_y = 0.5 * (1 - me.realFontSize_y); } -void configureLabelLabel(entity me, string txt, float sz, float algn) +void Label_configureLabel(entity me, string txt, float sz, float algn) { me.fontSize = sz; me.align = algn; me.setText(me, txt); } -void drawLabel(entity me) +void Label_draw(entity me) { string t; vector o; diff --git a/qcsrc/menu/item/listbox.c b/qcsrc/menu/item/listbox.c index d85b1d5285..3dd873c33a 100644 --- a/qcsrc/menu/item/listbox.c +++ b/qcsrc/menu/item/listbox.c @@ -41,21 +41,21 @@ ENDCLASS(ListBox) #endif #ifdef IMPLEMENTATION -void setSelectedListBox(entity me, float i) +void ListBox_setSelected(entity me, float i) { me.selectedItem = floor(0.5 + bound(0, i, me.nItems - 1)); } -void resizeNotifyListBox(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void ListBox_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyItem(me, relOrigin, relSize, absOrigin, absSize); + SUPER(ListBox).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.controlWidth = me.scrollbarWidth / absSize_x; } -void configureListBoxListBox(entity me, float theScrollbarWidth, float theItemHeight) +void ListBox_configureListBox(entity me, float theScrollbarWidth, float theItemHeight) { me.scrollbarWidth = theScrollbarWidth; me.itemHeight = theItemHeight; } -float keyDownListBox(entity me, float key, float ascii, float shift) +float ListBox_keyDown(entity me, float key, float ascii, float shift) { me.dragScrollTimer = time; if(key == K_MWHEELUP) @@ -90,7 +90,7 @@ float keyDownListBox(entity me, float key, float ascii, float shift) return 0; return 1; } -float mouseDragListBox(entity me, vector pos) +float ListBox_mouseDrag(entity me, vector pos) { float hit; float i; @@ -124,7 +124,7 @@ float mouseDragListBox(entity me, vector pos) } return 1; } -float mousePressListBox(entity me, vector pos) +float ListBox_mousePress(entity me, vector pos) { if(pos_x < 0) return 0; if(pos_y < 0) return 0; @@ -164,7 +164,7 @@ float mousePressListBox(entity me, vector pos) } return 1; } -float mouseReleaseListBox(entity me, vector pos) +float ListBox_mouseRelease(entity me, vector pos) { vector absSize; if(me.pressed == 1) @@ -188,7 +188,7 @@ float mouseReleaseListBox(entity me, vector pos) me.pressed = 0; return 1; } -void updateControlTopBottomListBox(entity me) +void ListBox_updateControlTopBottom(entity me) { float f; // scrollPos is in 0..1 and indicates where the "page" currently shown starts. @@ -238,7 +238,7 @@ void updateControlTopBottomListBox(entity me) } } } -void drawListBox(entity me) +void ListBox_draw(entity me) { float i; vector absSize, fillSize; @@ -282,12 +282,12 @@ void drawListBox(entity me) draw_ClearClip(); } -void clickListBoxItemListBox(entity me, float i, vector where) +void ListBox_clickListBoxItem(entity me, float i, vector where) { // itemclick, itemclick, does whatever itemclick does } -void drawListBoxItemListBox(entity me, float i, vector absSize, float selected) +void ListBox_drawListBoxItem(entity me, float i, vector absSize, float selected) { draw_Text('0 0 0', strcat("Item ", ftos(i)), eX * (8 / absSize_x) + eY * (8 / absSize_y), (selected ? '0 1 0' : '1 1 1'), 1, 0); } diff --git a/qcsrc/menu/item/modalcontroller.c b/qcsrc/menu/item/modalcontroller.c index 9befdabbfb..4bc2fb9bde 100644 --- a/qcsrc/menu/item/modalcontroller.c +++ b/qcsrc/menu/item/modalcontroller.c @@ -59,7 +59,7 @@ void DialogCloseButton_Click(entity button, entity tab); // assumes a button has .float ModalController_factor; .entity ModalController_controllingButton; -void initializeDialogModalController(entity me, entity root) +void ModalController_initializeDialog(entity me, entity root) { me.hideAll(me, 1); me.showChild(me, root, '0 0 0', '0 0 0', 1); // someone else animates for us @@ -95,12 +95,12 @@ void DialogCloseButton_Click(entity button, entity tab) tab.parent.hideChild(tab.parent, tab, 0); } -void resizeNotifyModalController(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void ModalController_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.resizeNotifyLie(me, relOrigin, relSize, absOrigin, absSize, ModalController_initialOrigin, ModalController_initialSize); } -void switchStateModalController(entity me, entity other, float state, float skipAnimation) +void ModalController_switchState(entity me, entity other, float state, float skipAnimation) { float previousState; previousState = other.ModalController_state; @@ -131,7 +131,7 @@ void switchStateModalController(entity me, entity other, float state, float skip other.ModalController_factor = 1; } -void drawModalController(entity me) +void ModalController_draw(entity me) { entity e; entity front; @@ -222,10 +222,10 @@ void drawModalController(entity me) me.setFocus(me, NULL); else me.setFocus(me, front); - drawContainer(me); + SUPER(ModalController).draw(me); }; -void addTabModalController(entity me, entity other, entity tabButton) +void ModalController_addTab(entity me, entity other, entity tabButton) { me.addItem(me, other, '0 0 0', '1 1 1', 1); tabButton.onClick = TabButton_Click; @@ -239,15 +239,15 @@ void addTabModalController(entity me, entity other, entity tabButton) } } -void addItemModalController(entity me, entity other, vector theOrigin, vector theSize, float theAlpha) +void ModalController_addItem(entity me, entity other, vector theOrigin, vector theSize, float theAlpha) { - addItemContainer(me, other, theOrigin, theSize, (other == me.firstChild) ? theAlpha : 0); + SUPER(ModalController).addItem(me, other, theOrigin, theSize, (other == me.firstChild) ? theAlpha : 0); other.ModalController_initialSize = other.Container_size; other.ModalController_initialOrigin = other.Container_origin; other.ModalController_initialAlpha = theAlpha; // hope Container never modifies this } -void showChildModalController(entity me, entity other, vector theOrigin, vector theSize, float skipAnimation) +void ModalController_showChild(entity me, entity other, vector theOrigin, vector theSize, float skipAnimation) { if(other.ModalController_state == 0 || skipAnimation) { @@ -261,14 +261,14 @@ void showChildModalController(entity me, entity other, vector theOrigin, vector } // zoom in from button (factor increases) } -void hideAllModalController(entity me, float skipAnimation) +void ModalController_hideAll(entity me, float skipAnimation) { entity e; for(e = me.firstChild; e; e = e.nextSibling) me.hideChild(me, e, skipAnimation); } -void hideChildModalController(entity me, entity other, float skipAnimation) +void ModalController_hideChild(entity me, entity other, float skipAnimation) { if(other.ModalController_state || skipAnimation) { diff --git a/qcsrc/menu/item/nexposee.c b/qcsrc/menu/item/nexposee.c index 75ebf3701c..c9232b192d 100644 --- a/qcsrc/menu/item/nexposee.c +++ b/qcsrc/menu/item/nexposee.c @@ -46,7 +46,7 @@ void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the c .vector Nexposee_align; .float Nexposee_animationFactor; -void closeNexposee(entity me) +void Nexposee_close(entity me) { // user must override this } @@ -58,7 +58,7 @@ void ExposeeCloseButton_Click(entity button, entity other) other.animationState = 3; } -void resizeNotifyNexposee(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void Nexposee_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.calc(me); me.resizeNotifyLie(me, relOrigin, relSize, absOrigin, absSize, Nexposee_initialOrigin, Nexposee_initialSize); @@ -82,7 +82,7 @@ void Nexposee_Calc_Scale(entity me, float scale) } } -void calcNexposee(entity me) +void Nexposee_calc(entity me) { /* * patented by Apple @@ -127,7 +127,7 @@ void calcNexposee(entity me) Nexposee_Calc_Scale(me, scale); } -void setNexposeeNexposee(entity me, entity other, vector scalecenter, float a0, float a1) +void Nexposee_setNexposee(entity me, entity other, vector scalecenter, float a0, float a1) { other.Nexposee_scaleCenter = scalecenter; other.Nexposee_smallAlpha = a0; @@ -135,7 +135,7 @@ void setNexposeeNexposee(entity me, entity other, vector scalecenter, float a0, other.Nexposee_mediumAlpha = a1; } -void drawNexposee(entity me) +void Nexposee_draw(entity me) { float a; float a0; @@ -161,7 +161,7 @@ void drawNexposee(entity me) { me.animationFactor = 1; me.animationState = 2; - setFocusContainer(me, me.selectedChild); + SUPER(Nexposee).setFocus(me, me.selectedChild); } break; case 2: @@ -206,19 +206,19 @@ void drawNexposee(entity me) e.Container_fontscale = globalToBoxSize(e.Container_size, e.Nexposee_initialSize); } - drawContainer(me); + SUPER(Nexposee).draw(me); }; -float mousePressNexposee(entity me, vector pos) +float Nexposee_mousePress(entity me, vector pos) { if(me.animationState == 0) { me.mouseFocusedChild = NULL; - mouseMoveNexposee(me, pos); + Nexposee_mouseMove(me, pos); if(me.mouseFocusedChild) { me.animationState = 1; - setFocusContainer(me, NULL); + SUPER(Nexposee).setFocus(me, NULL); } else me.close(me); @@ -226,38 +226,38 @@ float mousePressNexposee(entity me, vector pos) } else if(me.animationState == 2) { - if not(mousePressContainer(me, pos)) + if not(SUPER(Nexposee).mousePress(me, pos)) { me.animationState = 3; - setFocusContainer(me, NULL); + SUPER(Nexposee).setFocus(me, NULL); } return 1; } return 0; } -float mouseReleaseNexposee(entity me, vector pos) +float Nexposee_mouseRelease(entity me, vector pos) { if(me.animationState == 2) - return mouseReleaseContainer(me, pos); + return SUPER(Nexposee).mouseRelease(me, pos); return 0; } -float mouseDragNexposee(entity me, vector pos) +float Nexposee_mouseDrag(entity me, vector pos) { if(me.animationState == 2) - return mouseDragContainer(me, pos); + return SUPER(Nexposee).mouseDrag(me, pos); return 0; } -float mouseMoveNexposee(entity me, vector pos) +float Nexposee_mouseMove(entity me, vector pos) { entity e; me.mousePosition = pos; e = me.mouseFocusedChild; me.mouseFocusedChild = me.itemFromPoint(me, pos); if(me.animationState == 2) - return mouseMoveContainer(me, pos); + return SUPER(Nexposee).mouseMove(me, pos); if(me.animationState == 0) { if(me.mouseFocusedChild) @@ -268,18 +268,18 @@ float mouseMoveNexposee(entity me, vector pos) return 0; } -float keyUpNexposee(entity me, float scan, float ascii, float shift) +float Nexposee_keyUp(entity me, float scan, float ascii, float shift) { if(me.animationState == 2) - return keyUpContainer(me, scan, ascii, shift); + return SUPER(Nexposee).keyUp(me, scan, ascii, shift); return 0; } -float keyDownNexposee(entity me, float scan, float ascii, float shift) +float Nexposee_keyDown(entity me, float scan, float ascii, float shift) { float nexposeeKey; if(me.animationState == 2) - if(keyDownContainer(me, scan, ascii, shift)) + if(SUPER(Nexposee).keyDown(me, scan, ascii, shift)) return 1; if(scan == K_TAB) { @@ -329,27 +329,27 @@ float keyDownNexposee(entity me, float scan, float ascii, float shift) me.selectedChild = me.focusedChild; if not(me.selectedChild) me.animationState = 0; - setFocusContainer(me, NULL); + SUPER(Nexposee).setFocus(me, NULL); return 1; } return 0; } -void addItemNexposee(entity me, entity other, vector theOrigin, vector theSize, float theAlpha) +void Nexposee_addItem(entity me, entity other, vector theOrigin, vector theSize, float theAlpha) { - addItemContainer(me, other, theOrigin, theSize, theAlpha); + SUPER(Nexposee).addItem(me, other, theOrigin, theSize, theAlpha); other.Nexposee_initialSize = other.Container_size; other.Nexposee_initialOrigin = other.Container_origin; other.Nexposee_initialAlpha = other.Container_alpha; } -void focusEnterNexposee(entity me) +void Nexposee_focusEnter(entity me) { if(me.animationState == 2) - setFocusContainer(me, me.selectedChild); + SUPER(Nexposee).setFocus(me, me.selectedChild); } -void pullNexposeeNexposee(entity me, entity other, vector theAlign) +void Nexposee_pullNexposee(entity me, entity other, vector theAlign) { other.Nexposee_align = theAlign; } diff --git a/qcsrc/menu/item/radiobutton.c b/qcsrc/menu/item/radiobutton.c index 34ef101a70..80fd5329b4 100644 --- a/qcsrc/menu/item/radiobutton.c +++ b/qcsrc/menu/item/radiobutton.c @@ -10,7 +10,7 @@ ENDCLASS(RadioButton) #endif #ifdef IMPLEMENTATION -void configureRadioButtonRadioButton(entity me, string txt, float sz, string gfx, float theGroup, float doAllowDeselect) +void RadioButton_configureRadioButton(entity me, string txt, float sz, string gfx, float theGroup, float doAllowDeselect) { me.configureCheckBox(me, txt, sz, gfx); me.align = 0; diff --git a/qcsrc/menu/item/slider.c b/qcsrc/menu/item/slider.c index eeac0edd84..92f3b55fe1 100644 --- a/qcsrc/menu/item/slider.c +++ b/qcsrc/menu/item/slider.c @@ -44,44 +44,44 @@ ENDCLASS(Slider) #endif #ifdef IMPLEMENTATION -void setValueSlider(entity me, float val) +void Slider_setValue(entity me, float val) { if (me.animated) { anim.stopObjAnim(anim, me); anim.removeObjAnim(anim, me); - makeHostedEasing(me, setSliderValueSlider, easingQuadInOut, 1, me.sliderValue, val); + makeHostedEasing(me, Slider_setSliderValue, easingQuadInOut, 1, me.sliderValue, val); } else { me.setSliderValue(me, val); } me.value = val; } -void setSliderValueSlider(entity me, float val) +void Slider_setSliderValue(entity me, float val) { me.sliderValue = val; } -string toStringSlider(entity me) +string Slider_toString(entity me) { return strcat(ftos(me.value), " (", me.valueToText(me, me.value), ")"); } -void resizeNotifySlider(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void Slider_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyLabel(me, relOrigin, relSize, absOrigin, absSize); + SUPER(Slider).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.controlWidth = absSize_y / absSize_x; } -string valueToTextSlider(entity me, float val) +string Slider_valueToText(entity me, float val) { if(almost_in_bounds(me.valueMin, val, me.valueMax)) return ftos_decimals(val * me.valueDisplayMultiplier, me.valueDigits); return ""; } -void configureSliderVisualsSlider(entity me, float sz, float theAlign, float theTextSpace, string gfx) +void Slider_configureSliderVisuals(entity me, float sz, float theAlign, float theTextSpace, string gfx) { - configureLabelLabel(me, string_null, sz, theAlign); + SUPER(Slider).configureLabel(me, string_null, sz, theAlign); me.textSpace = theTextSpace; me.keepspaceLeft = (theTextSpace == 0) ? 0 : (1 - theTextSpace); me.src = gfx; } -void configureSliderValuesSlider(entity me, float theValueMin, float theValue, float theValueMax, float theValueStep, float theValueKeyStep, float theValuePageStep) +void Slider_configureSliderValues(entity me, float theValueMin, float theValue, float theValueMax, float theValueStep, float theValueKeyStep, float theValuePageStep) { me.value = theValue; me.sliderValue = theValue; @@ -98,7 +98,7 @@ void configureSliderValuesSlider(entity me, float theValueMin, float theValue, f if(fabs(floor(me.valueStep * 1 + 0.5) - (me.valueStep * 1)) < 0.01) // about a whole number me.valueDigits = 0; } -float keyDownSlider(entity me, float key, float ascii, float shift) +float Slider_keyDown(entity me, float key, float ascii, float shift) { float inRange; if(me.disabled) @@ -149,7 +149,7 @@ float keyDownSlider(entity me, float key, float ascii, float shift) // TODO more keys return 0; } -float mouseDragSlider(entity me, vector pos) +float Slider_mouseDrag(entity me, vector pos) { float hit; float v, animed; @@ -182,7 +182,7 @@ float mouseDragSlider(entity me, vector pos) return 1; } -float mousePressSlider(entity me, vector pos) +float Slider_mousePress(entity me, vector pos) { float controlCenter; if(me.disabled) @@ -239,18 +239,18 @@ float mousePressSlider(entity me, vector pos) localsound("sound/misc/menu2.wav"); return 1; } -float mouseReleaseSlider(entity me, vector pos) +float Slider_mouseRelease(entity me, vector pos) { me.pressed = 0; if(me.disabled) return 0; return 1; } -void showNotifySlider(entity me) +void Slider_showNotify(entity me) { me.focusable = !me.disabled; } -void drawSlider(entity me) +void Slider_draw(entity me) { float controlLeft; float save; @@ -273,7 +273,7 @@ void drawSlider(entity me) } me.setText(me, me.valueToText(me, me.value)); draw_alpha = save; - drawLabel(me); + SUPER(Slider).draw(me); me.text = string_null; // TEMPSTRING! } #endif diff --git a/qcsrc/menu/item/textslider.c b/qcsrc/menu/item/textslider.c index b6a3454811..c4a7af7a89 100644 --- a/qcsrc/menu/item/textslider.c +++ b/qcsrc/menu/item/textslider.c @@ -15,7 +15,7 @@ ENDCLASS(TextSlider) #endif #ifdef IMPLEMENTATION -string valueToIdentifierTextSlider(entity me, float val) +string TextSlider_valueToIdentifier(entity me, float val) { if(val >= me.nValues) return "custom"; @@ -23,7 +23,7 @@ string valueToIdentifierTextSlider(entity me, float val) return "custom"; return me.(valueIdentifiers[val]); } -string valueToTextTextSlider(entity me, float val) +string TextSlider_valueToText(entity me, float val) { if(val >= me.nValues) return "custom"; @@ -31,28 +31,28 @@ string valueToTextTextSlider(entity me, float val) return "custom"; return me.(valueStrings[val]); } -void setValueFromIdentifierTextSlider(entity me, string id) +void TextSlider_setValueFromIdentifier(entity me, string id) { float i; for(i = 0; i < me.nValues; ++i) if(me.valueToIdentifier(me, i) == id) { - setValueSlider( me, i ); + SUPER(TextSlider).setValue( me, i ); return; } - setValueSlider( me, -1 ); + SUPER(TextSlider).setValue( me, -1 ); } -string getIdentifierTextSlider(entity me) +string TextSlider_getIdentifier(entity me) { return me.valueToIdentifier(me, me.value); } -void addValueTextSlider(entity me, string theString, string theIdentifier) +void TextSlider_addValue(entity me, string theString, string theIdentifier) { me.(valueStrings[me.nValues]) = theString; me.(valueIdentifiers[me.nValues]) = theIdentifier; me.nValues += 1; } -void configureTextSliderValuesTextSlider(entity me, string theDefault) +void TextSlider_configureTextSliderValues(entity me, string theDefault) { me.configureSliderValues(me, 0, 0, me.nValues - 1, 1, 1, 1); me.setValueFromIdentifier(me, theDefault); diff --git a/qcsrc/menu/xonotic/bigbutton.c b/qcsrc/menu/xonotic/bigbutton.c index 8a2a11757d..b877a83137 100644 --- a/qcsrc/menu/xonotic/bigbutton.c +++ b/qcsrc/menu/xonotic/bigbutton.c @@ -16,7 +16,7 @@ entity makeXonoticBigButton(string theText, vector theColor) return me; } -void configureXonoticBigButtonXonoticBigButton(entity me, string theText, vector theColor) +void XonoticBigButton_configureXonoticBigButton(entity me, string theText, vector theColor) { me.configureXonoticButton(me, theText, theColor); } diff --git a/qcsrc/menu/xonotic/bigcommandbutton.c b/qcsrc/menu/xonotic/bigcommandbutton.c index a667f0e612..e9ef75ba5c 100644 --- a/qcsrc/menu/xonotic/bigcommandbutton.c +++ b/qcsrc/menu/xonotic/bigcommandbutton.c @@ -16,7 +16,7 @@ entity makeXonoticBigCommandButton(string theText, vector theColor, string theCo return me; } -void configureXonoticBigCommandButtonXonoticBigCommandButton(entity me, string theText, vector theColor, string theCommand, float theFlags) +void XonoticBigCommandButton_configureXonoticBigCommandButton(entity me, string theText, vector theColor, string theCommand, float theFlags) { me.configureXonoticCommandButton(me, theText, theColor, theCommand, theFlags); } diff --git a/qcsrc/menu/xonotic/button.c b/qcsrc/menu/xonotic/button.c index 2112c2c500..5522905bc2 100644 --- a/qcsrc/menu/xonotic/button.c +++ b/qcsrc/menu/xonotic/button.c @@ -23,7 +23,7 @@ entity makeXonoticButton(string theText, vector theColor) return me; } -void configureXonoticButtonXonoticButton(entity me, string theText, vector theColor) +void XonoticButton_configureXonoticButton(entity me, string theText, vector theColor) { if(theColor == '0 0 0') { diff --git a/qcsrc/menu/xonotic/campaign.c b/qcsrc/menu/xonotic/campaign.c index 1550d3f6fc..bd31f435e2 100644 --- a/qcsrc/menu/xonotic/campaign.c +++ b/qcsrc/menu/xonotic/campaign.c @@ -96,7 +96,7 @@ entity makeXonoticCampaignList() me.configureXonoticCampaignList(me); return me; } -void configureXonoticCampaignListXonoticCampaignList(entity me) +void XonoticCampaignList_configureXonoticCampaignList(entity me) { me.configureXonoticListBox(me); me.campaignGlob = search_begin("maps/campaign*.txt", TRUE, TRUE); @@ -104,13 +104,13 @@ void configureXonoticCampaignListXonoticCampaignList(entity me) me.campaignGo(me, 0); // takes care of enabling/disabling buttons too } -void destroyXonoticCampaignList(entity me) +void XonoticCampaignList_destroy(entity me) { if(me.campaignGlob >= 0) search_end(me.campaignGlob); } -void loadCvarsXonoticCampaignList(entity me) +void XonoticCampaignList_loadCvars(entity me) { // read campaign cvars if(campaign_name) @@ -133,7 +133,7 @@ void loadCvarsXonoticCampaignList(entity me) me.labelTitle.setText(me.labelTitle, campaign_title); } -void saveCvarsXonoticCampaignList(entity me) +void XonoticCampaignList_saveCvars(entity me) { // write campaign cvars // no reason to do this! @@ -141,7 +141,7 @@ void saveCvarsXonoticCampaignList(entity me) // cvar_set(me.cvarName, ftos(me.campaignIndex)); // NOTE: only server QC does that! } -void campaignGoXonoticCampaignList(entity me, float step) +void XonoticCampaignList_campaignGo(entity me, float step) { float canNext, canPrev; string s; @@ -203,17 +203,17 @@ void MultiCampaign_Prev(entity btn, entity me) me.campaignGo(me, -1); } -void drawXonoticCampaignList(entity me) +void XonoticCampaignList_draw(entity me) { if(cvar(me.cvarName) != me.campaignIndex || cvar_string("g_campaign_name") != campaign_name) me.loadCvars(me); - drawListBox(me); + SUPER(XonoticCampaignList).draw(me); } -void resizeNotifyXonoticCampaignList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticCampaignList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.itemAbsSize = '0 0 0'; - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticCampaignList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize_y * me.itemHeight)); me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth))); @@ -233,7 +233,7 @@ void resizeNotifyXonoticCampaignList(entity me, vector relOrigin, vector relSize rewrapCampaign(me.columnNameSize, me.rowsPerItem - 3, me.emptyLineHeight, me.realFontSize); } -void clickListBoxItemXonoticCampaignList(entity me, float i, vector where) +void XonoticCampaignList_clickListBoxItem(entity me, float i, vector where) { if(i == me.lastClickedMap) if(time < me.lastClickedTime + 0.3) @@ -246,7 +246,7 @@ void clickListBoxItemXonoticCampaignList(entity me, float i, vector where) me.lastClickedMap = i; me.lastClickedTime = time; } -void drawListBoxItemXonoticCampaignList(entity me, float i, vector absSize, float isSelected) +void XonoticCampaignList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { string s; float p; @@ -307,18 +307,18 @@ void CampaignList_LoadMap(entity btn, entity me) CampaignSetup(me.selectedItem); } -void setSelectedXonoticCampaignList(entity me, float i) +void XonoticCampaignList_setSelected(entity me, float i) { // prevent too late items from being played - setSelectedListBox(me, min(i, me.campaignIndex)); + SUPER(XonoticCampaignList).setSelected(me, min(i, me.campaignIndex)); } -float keyDownXonoticCampaignList(entity me, float scan, float ascii, float shift) +float XonoticCampaignList_keyDown(entity me, float scan, float ascii, float shift) { if(scan == K_ENTER || scan == K_SPACE) CampaignList_LoadMap(me, me); else - return keyDownListBox(me, scan, ascii, shift); + return SUPER(XonoticCampaignList).keyDown(me, scan, ascii, shift); return 1; } #endif diff --git a/qcsrc/menu/xonotic/charmap.c b/qcsrc/menu/xonotic/charmap.c index 5547403251..21a4aad6f3 100644 --- a/qcsrc/menu/xonotic/charmap.c +++ b/qcsrc/menu/xonotic/charmap.c @@ -47,13 +47,13 @@ string CharMap_CellToChar(float c) } } -void configureXonoticCharmapXonoticCharmap(entity me, entity theTextbox) +void XonoticCharmap_configureXonoticCharmap(entity me, entity theTextbox) { me.controlledTextbox = theTextbox; me.configureImage(me, me.image); } -float mouseMoveXonoticCharmap(entity me, vector coords) +float XonoticCharmap_mouseMove(entity me, vector coords) { float x, y, c; x = floor(coords_x * 16); @@ -68,11 +68,11 @@ float mouseMoveXonoticCharmap(entity me, vector coords) me.mouseSelectedCharacterCell = me.selectedCharacterCell = c; return 1; } -float mouseDragXonoticCharmap(entity me, vector coords) +float XonoticCharmap_mouseDrag(entity me, vector coords) { return me.mouseMove(me, coords); } -float mousePressXonoticCharmap(entity me, vector coords) +float XonoticCharmap_mousePress(entity me, vector coords) { me.mouseMove(me, coords); if(me.mouseSelectedCharacterCell >= 0) @@ -82,7 +82,7 @@ float mousePressXonoticCharmap(entity me, vector coords) } return 1; } -float mouseReleaseXonoticCharmap(entity me, vector coords) +float XonoticCharmap_mouseRelease(entity me, vector coords) { if(!me.pressed) return 0; @@ -92,7 +92,7 @@ float mouseReleaseXonoticCharmap(entity me, vector coords) me.pressed = 0; return 1; } -float keyDownXonoticCharmap(entity me, float key, float ascii, float shift) +float XonoticCharmap_keyDown(entity me, float key, float ascii, float shift) { switch(key) { @@ -123,11 +123,11 @@ float keyDownXonoticCharmap(entity me, float key, float ascii, float shift) return me.controlledTextbox.keyDown(me.controlledTextbox, key, ascii, shift); } } -void focusLeaveXonoticCharmap(entity me) +void XonoticCharmap_focusLeave(entity me) { me.controlledTextbox.saveCvars(me.controlledTextbox); } -void drawXonoticCharmap(entity me) +void XonoticCharmap_draw(entity me) { if(me.focused) { @@ -139,6 +139,6 @@ void drawXonoticCharmap(entity me) draw_Picture(c, me.image2, '0.0625 0.1 0', '1 1 1', 1); } } - drawImage(me); + SUPER(XonoticCharmap).draw(me); } #endif diff --git a/qcsrc/menu/xonotic/checkbox.c b/qcsrc/menu/xonotic/checkbox.c index ad8216a9fe..c28edcc070 100644 --- a/qcsrc/menu/xonotic/checkbox.c +++ b/qcsrc/menu/xonotic/checkbox.c @@ -56,7 +56,7 @@ entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar me.configureXonoticCheckBox(me, theYesValue, theNoValue, theCvar, theText); return me; } -void configureXonoticCheckBoxXonoticCheckBox(entity me, float theYesValue, float theNoValue, string theCvar, string theText) +void XonoticCheckBox_configureXonoticCheckBox(entity me, float theYesValue, float theNoValue, string theCvar, string theText) { me.yesValue = theYesValue; me.noValue = theNoValue; @@ -69,7 +69,7 @@ void configureXonoticCheckBoxXonoticCheckBox(entity me, float theYesValue, float } me.configureCheckBox(me, theText, me.fontSize, me.image); } -void setCheckedXonoticCheckBox(entity me, float val) +void XonoticCheckBox_setChecked(entity me, float val) { if(val != me.checked) { @@ -77,7 +77,7 @@ void setCheckedXonoticCheckBox(entity me, float val) me.saveCvars(me); } } -void loadCvarsXonoticCheckBox(entity me) +void XonoticCheckBox_loadCvars(entity me) { float m, d; @@ -88,7 +88,7 @@ void loadCvarsXonoticCheckBox(entity me) d = (cvar(me.cvarName) - m) / (me.yesValue - m); me.checked = (d > 0); } -void saveCvarsXonoticCheckBox(entity me) +void XonoticCheckBox_saveCvars(entity me) { if not(me.cvarName) return; diff --git a/qcsrc/menu/xonotic/checkbox_slider_invalid.c b/qcsrc/menu/xonotic/checkbox_slider_invalid.c index ea05c3fd06..a9d2becc3d 100644 --- a/qcsrc/menu/xonotic/checkbox_slider_invalid.c +++ b/qcsrc/menu/xonotic/checkbox_slider_invalid.c @@ -30,7 +30,7 @@ entity makeXonoticSliderCheckBox(float theOffValue, float isInverted, entity the me.configureXonoticSliderCheckBox(me, theOffValue, isInverted, theControlledSlider, theText); return me; } -void configureXonoticSliderCheckBoxXonoticSliderCheckBox(entity me, float theOffValue, float isInverted, entity theControlledSlider, string theText) +void XonoticSliderCheckBox_configureXonoticSliderCheckBox(entity me, float theOffValue, float isInverted, entity theControlledSlider, string theText) { me.offValue = theOffValue; me.inverted = isInverted; @@ -43,14 +43,14 @@ void configureXonoticSliderCheckBoxXonoticSliderCheckBox(entity me, float theOff me.configureCheckBox(me, theText, me.fontSize, me.image); me.tooltip = theControlledSlider.tooltip; } -void drawXonoticSliderCheckBox(entity me) +void XonoticSliderCheckBox_draw(entity me) { me.checked = ((me.controlledSlider.value == me.offValue) != me.inverted); if(me.controlledSlider.value == median(me.controlledSlider.valueMin, me.controlledSlider.value, me.controlledSlider.valueMax)) me.savedValue = me.controlledSlider.value; - drawCheckBox(me); + SUPER(XonoticSliderCheckBox).draw(me); } -void setCheckedXonoticSliderCheckBox(entity me, float val) +void XonoticSliderCheckBox_setChecked(entity me, float val) { if(me.checked == val) return; diff --git a/qcsrc/menu/xonotic/colorbutton.c b/qcsrc/menu/xonotic/colorbutton.c index 84281b6af3..2ca8c86c40 100644 --- a/qcsrc/menu/xonotic/colorbutton.c +++ b/qcsrc/menu/xonotic/colorbutton.c @@ -26,7 +26,7 @@ entity makeXonoticColorButton(float theGroup, float theColor, float theValue) me.configureXonoticColorButton(me, theGroup, theColor, theValue); return me; } -void configureXonoticColorButtonXonoticColorButton(entity me, float theGroup, float theColor, float theValue) +void XonoticColorButton_configureXonoticColorButton(entity me, float theGroup, float theColor, float theValue) { me.cvarName = "_cl_color"; me.cvarValueFloat = theValue; @@ -36,7 +36,7 @@ void configureXonoticColorButtonXonoticColorButton(entity me, float theGroup, fl me.srcMulti = 1; me.src2 = me.image2; } -void setCheckedXonoticColorButton(entity me, float val) +void XonoticColorButton_setChecked(entity me, float val) { if(val != me.checked) { @@ -44,7 +44,7 @@ void setCheckedXonoticColorButton(entity me, float val) me.saveCvars(me); } } -void loadCvarsXonoticColorButton(entity me) +void XonoticColorButton_loadCvars(entity me) { if not(me.cvarName) return; @@ -54,7 +54,7 @@ void loadCvarsXonoticColorButton(entity me) else me.checked = (cvar(me.cvarName) & 15) == me.cvarValueFloat; } -void saveCvarsXonoticColorButton(entity me) +void XonoticColorButton_saveCvars(entity me) { if not(me.cvarName) return; @@ -68,9 +68,9 @@ void saveCvarsXonoticColorButton(entity me) } // TODO on an apply button, read _cl_color and execute the color command for it } -void drawXonoticColorButton(entity me) +void XonoticColorButton_draw(entity me) { me.color2 = colormapPaletteColor(me.cvarValueFloat, me.cvarPart); - drawCheckBox(me); + SUPER(XonoticColorButton).draw(me); } #endif diff --git a/qcsrc/menu/xonotic/colorpicker.c b/qcsrc/menu/xonotic/colorpicker.c index a8403aee95..b888358c37 100644 --- a/qcsrc/menu/xonotic/colorpicker.c +++ b/qcsrc/menu/xonotic/colorpicker.c @@ -24,13 +24,13 @@ entity makeXonoticColorpicker(entity theTextbox) return me; } -void configureXonoticColorpickerXonoticColorpicker(entity me, entity theTextbox) +void XonoticColorpicker_configureXonoticColorpicker(entity me, entity theTextbox) { me.controlledTextbox = theTextbox; me.configureImage(me, me.image); } -float mousePressXonoticColorpicker(entity me, vector coords) +float XonoticColorpicker_mousePress(entity me, vector coords) { me.mouseDrag(me, coords); return 1; @@ -51,7 +51,7 @@ vector hslimage_color(vector v, vector margin) return hsl_to_rgb(v_x * 6 * eX + eY + v_y / 0.875 * eZ); } -float mouseDragXonoticColorpicker(entity me, vector coords) +float XonoticColorpicker_mouseDrag(entity me, vector coords) { float i; for(;;) @@ -97,23 +97,23 @@ float mouseDragXonoticColorpicker(entity me, vector coords) return 1; } -float mouseReleaseXonoticColorpicker(entity me, vector coords) +float XonoticColorpicker_mouseRelease(entity me, vector coords) { me.mouseDrag(me, coords); return 1; } -void focusLeaveXonoticColorpicker(entity me) +void XonoticColorpicker_focusLeave(entity me) { me.controlledTextbox.saveCvars(me.controlledTextbox); } -float keyDownXonoticColorpicker(entity me, float key, float ascii, float shift) +float XonoticColorpicker_keyDown(entity me, float key, float ascii, float shift) { return me.controlledTextbox.keyDown(me.controlledTextbox, key, ascii, shift); } -void drawXonoticColorpicker(entity me) +void XonoticColorpicker_draw(entity me) { - drawImage(me); + SUPER(XonoticColorpicker).draw(me); float B, C, aC; C = cvar("r_textcontrast"); diff --git a/qcsrc/menu/xonotic/commandbutton.c b/qcsrc/menu/xonotic/commandbutton.c index b54805c738..8ee4e7de3a 100644 --- a/qcsrc/menu/xonotic/commandbutton.c +++ b/qcsrc/menu/xonotic/commandbutton.c @@ -33,7 +33,7 @@ void XonoticCommandButton_Click(entity me, entity other) m_goto(string_null); } -void configureXonoticCommandButtonXonoticCommandButton(entity me, string theText, vector theColor, string theCommand, float theFlags) +void XonoticCommandButton_configureXonoticCommandButton(entity me, string theText, vector theColor, string theCommand, float theFlags) { me.configureXonoticButton(me, theText, theColor); me.onClickCommand = theCommand; diff --git a/qcsrc/menu/xonotic/credits.c b/qcsrc/menu/xonotic/credits.c index 9beb213c22..5c2f1585c4 100644 --- a/qcsrc/menu/xonotic/credits.c +++ b/qcsrc/menu/xonotic/credits.c @@ -26,18 +26,18 @@ entity makeXonoticCreditsList() me.configureXonoticCreditsList(me); return me; } -void configureXonoticCreditsListXonoticCreditsList(entity me) +void XonoticCreditsList_configureXonoticCreditsList(entity me) { me.configureXonoticListBox(me); // load the file me.bufferIndex = buf_load("xonotic-credits.txt"); me.nItems = buf_getsize(me.bufferIndex); } -void destroyXonoticCreditsList(entity me) +void XonoticCreditsList_destroy(entity me) { buf_del(me.bufferIndex); } -void drawXonoticCreditsList(entity me) +void XonoticCreditsList_draw(entity me) { float i; if(me.scrolling) @@ -47,17 +47,17 @@ void drawXonoticCreditsList(entity me) i = max(i, ceil(me.scrollPos / me.itemHeight)); me.setSelected(me, i); } - drawListBox(me); + SUPER(XonoticCreditsList).draw(me); } -void resizeNotifyXonoticCreditsList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticCreditsList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticCreditsList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); 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); } -void drawListBoxItemXonoticCreditsList(entity me, float i, vector absSize, float isSelected) +void XonoticCreditsList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { // layout: Ping, Credits name, Map name, NP, TP, MP string s; @@ -87,7 +87,7 @@ void drawListBoxItemXonoticCreditsList(entity me, float i, vector absSize, float draw_CenterText(me.realUpperMargin * eY + 0.5 * eX, s, me.realFontSize, theColor, theAlpha, 0); } -float keyDownXonoticCreditsList(entity me, float scan, float ascii, float shift) +float XonoticCreditsList_keyDown(entity me, float scan, float ascii, float shift) { float i; me.dragScrollTimer = time; @@ -102,7 +102,7 @@ float keyDownXonoticCreditsList(entity me, float scan, float ascii, float shift) else if(scan == K_DOWNARROW) me.scrollPos = min(me.scrollPos + me.itemHeight, me.nItems * me.itemHeight - 1); else - return keyDownListBox(me, scan, ascii, shift); + return SUPER(XonoticCreditsList).keyDown(me, scan, ascii, shift); i = min(me.selectedItem, floor((me.scrollPos + 1) / me.itemHeight - 1)); i = max(i, ceil(me.scrollPos / me.itemHeight)); diff --git a/qcsrc/menu/xonotic/crosshairbutton.c b/qcsrc/menu/xonotic/crosshairbutton.c index 209677ff5d..b290f3d218 100644 --- a/qcsrc/menu/xonotic/crosshairbutton.c +++ b/qcsrc/menu/xonotic/crosshairbutton.c @@ -25,7 +25,7 @@ entity makeXonoticCrosshairButton(float theGroup, float theCrosshair) me.configureXonoticCrosshairButton(me, theGroup, theCrosshair); return me; } -void configureXonoticCrosshairButtonXonoticCrosshairButton(entity me, float theGroup, float theCrosshair) +void XonoticCrosshairButton_configureXonoticCrosshairButton(entity me, float theGroup, float theCrosshair) { me.cvarName = "crosshair"; me.cvarValueFloat = theCrosshair; @@ -34,7 +34,7 @@ void configureXonoticCrosshairButtonXonoticCrosshairButton(entity me, float theG me.srcMulti = 1; me.src3 = strzone(strcat("/gfx/crosshair", ftos(me.cvarValueFloat))); } -void setCheckedXonoticCrosshairButton(entity me, float val) +void XonoticCrosshairButton_setChecked(entity me, float val) { if(val != me.checked) { @@ -42,14 +42,14 @@ void setCheckedXonoticCrosshairButton(entity me, float val) me.saveCvars(me); } } -void loadCvarsXonoticCrosshairButton(entity me) +void XonoticCrosshairButton_loadCvars(entity me) { if not(me.cvarName) return; me.checked = (cvar(me.cvarName) == me.cvarValueFloat); } -void saveCvarsXonoticCrosshairButton(entity me) +void XonoticCrosshairButton_saveCvars(entity me) { if not(me.cvarName) return; @@ -58,7 +58,7 @@ void saveCvarsXonoticCrosshairButton(entity me) cvar_set(me.cvarName, ftos(me.cvarValueFloat)); // TODO on an apply button, read _cl_color and execute the color command for it } -void drawXonoticCrosshairButton(entity me) +void XonoticCrosshairButton_draw(entity me) { vector sz, rgb; float a; @@ -72,7 +72,7 @@ void drawXonoticCrosshairButton(entity me) rgb = '1 1 1'; } - drawCheckBox(me); + SUPER(XonoticCrosshairButton).draw(me); sz = draw_PictureSize(me.src3); sz = globalToBoxSize(sz, draw_scale); diff --git a/qcsrc/menu/xonotic/cvarlist.c b/qcsrc/menu/xonotic/cvarlist.c index cf3cd940fa..387396bbaf 100644 --- a/qcsrc/menu/xonotic/cvarlist.c +++ b/qcsrc/menu/xonotic/cvarlist.c @@ -43,7 +43,7 @@ entity makeXonoticCvarList() me.configureXonoticCvarList(me); return me; } -void configureXonoticCvarListXonoticCvarList(entity me) +void XonoticCvarList_configureXonoticCvarList(entity me) { me.configureXonoticListBox(me); @@ -51,15 +51,15 @@ void configureXonoticCvarListXonoticCvarList(entity me) buf_cvarlist(me.handle, "", "_"); me.nItems = buf_getsize(me.handle); } -void destroyXonoticCvarList(entity me) +void XonoticCvarList_destroy(entity me) { buf_del(me.handle); } -void setSelectedXonoticCvarList(entity me, float i) +void XonoticCvarList_setSelected(entity me, float i) { string s; - setSelectedListBox(me, i); + SUPER(XonoticCvarList).setSelected(me, i); if(me.nItems == 0) return; @@ -107,9 +107,9 @@ void CvarList_Filter_Change(entity box, entity me) me.setSelected(me, 0); } -void resizeNotifyXonoticCvarList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticCvarList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticCvarList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / (absSize_y * me.itemHeight); me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth)); @@ -122,7 +122,7 @@ void resizeNotifyXonoticCvarList(entity me, vector relOrigin, vector relSize, ve me.setSelected(me, me.selectedItem); } -void drawListBoxItemXonoticCvarList(entity me, float i, vector absSize, float isSelected) +void XonoticCvarList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { string k, v, d; float t; @@ -155,9 +155,9 @@ void drawListBoxItemXonoticCvarList(entity me, float i, vector absSize, float is draw_Text(me.realUpperMargin * eY + me.columnValueOrigin * eX, s, me.realFontSize, theColor, theAlpha, 0); } -float keyDownXonoticCvarList(entity me, float scan, float ascii, float shift) +float XonoticCvarList_keyDown(entity me, float scan, float ascii, float shift) { - if(keyDownListBox(me, scan, ascii, shift)) + if(SUPER(XonoticCvarList).keyDown(me, scan, ascii, shift)) return 1; else if(!me.controlledTextbox) return 0; diff --git a/qcsrc/menu/xonotic/demolist.c b/qcsrc/menu/xonotic/demolist.c index 7a2d338ea3..0882a3ed4a 100644 --- a/qcsrc/menu/xonotic/demolist.c +++ b/qcsrc/menu/xonotic/demolist.c @@ -39,13 +39,13 @@ entity makeXonoticDemoList() return me; } -void configureXonoticDemoListXonoticDemoList(entity me) +void XonoticDemoList_configureXonoticDemoList(entity me) { me.configureXonoticListBox(me); me.getDemos(me); } -string demoNameXonoticDemoList(entity me, float i ) +string XonoticDemoList_demoName(entity me, float i ) { string s; s = search_getfilename(me.listDemo, i); @@ -54,7 +54,7 @@ string demoNameXonoticDemoList(entity me, float i ) } -void getDemosXonoticDemoList(entity me) +void XonoticDemoList_getDemos(entity me) { string s; @@ -74,15 +74,15 @@ void getDemosXonoticDemoList(entity me) me.nItems=search_getsize(me.listDemo); } -void destroyXonoticDemoList(entity me) +void XonoticDemoList_destroy(entity me) { search_end(me.listDemo); } -void resizeNotifyXonoticDemoList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticDemoList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.itemAbsSize = '0 0 0'; - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticDemoList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize_y * me.itemHeight)); me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth))); @@ -92,7 +92,7 @@ void resizeNotifyXonoticDemoList(entity me, vector relOrigin, vector relSize, ve me.columnNameSize = 1 - 2 * me.realFontSize_x; } -void drawListBoxItemXonoticDemoList(entity me, float i, vector absSize, float isSelected) +void XonoticDemoList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { string s; if(isSelected) @@ -103,7 +103,7 @@ void drawListBoxItemXonoticDemoList(entity me, float i, vector absSize, float is draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); } -void showNotifyXonoticDemoList(entity me) +void XonoticDemoList_showNotify(entity me) { me.getDemos(me); } @@ -121,7 +121,7 @@ void DemoList_Filter_Change(entity box, entity me) me.getDemos(me); } -void startDemoXonoticDemoList(entity me) +void XonoticDemoList_startDemo(entity me) { string s; s = me.demoName(me,me.selectedItem); @@ -140,7 +140,7 @@ void TimeDemo_Click(entity btn, entity me) localcmd("timedemo demos/", s, ".dem\nwait\ntogglemenu\n"); } -void clickListBoxItemXonoticDemoList(entity me, float i, vector where) +void XonoticDemoList_clickListBoxItem(entity me, float i, vector where) { if(i == me.lastClickedDemo) if(time < me.lastClickedTime + 0.3) @@ -153,14 +153,14 @@ void clickListBoxItemXonoticDemoList(entity me, float i, vector where) me.lastClickedTime = time; } -float keyDownXonoticDemoList(entity me, float scan, float ascii, float shift) +float XonoticDemoList_keyDown(entity me, float scan, float ascii, float shift) { if(scan == K_ENTER) { me.startDemo(me); return 1; } else - return keyDownListBox(me, scan, ascii, shift); + return SUPER(XonoticDemoList).keyDown(me, scan, ascii, shift); } #endif diff --git a/qcsrc/menu/xonotic/dialog.c b/qcsrc/menu/xonotic/dialog.c index badfbaf444..7087d83cb9 100644 --- a/qcsrc/menu/xonotic/dialog.c +++ b/qcsrc/menu/xonotic/dialog.c @@ -33,10 +33,10 @@ entity currentDialog; #endif #ifdef IMPLEMENTATION -void configureDialogXonoticDialog(entity me) +void XonoticDialog_configureDialog(entity me) { currentDialog = me; - configureDialogDialog(me); + SUPER(XonoticDialog).configureDialog(me); me.tooltip = getZonedTooltipForIdentifier(me.classname); } #endif diff --git a/qcsrc/menu/xonotic/dialog_credits.c b/qcsrc/menu/xonotic/dialog_credits.c index bcd3545d9c..07c2fc4f29 100644 --- a/qcsrc/menu/xonotic/dialog_credits.c +++ b/qcsrc/menu/xonotic/dialog_credits.c @@ -12,7 +12,7 @@ ENDCLASS(XonoticCreditsDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticCreditsDialog(entity me) +void XonoticCreditsDialog_fill(entity me) { entity e; me.TR(me); @@ -22,7 +22,7 @@ void fillXonoticCreditsDialog(entity me) e.onClick = Dialog_Close; e.onClickEntity = me; } -void focusEnterXonoticCreditsDialog(entity me) +void XonoticCreditsDialog_focusEnter(entity me) { me.creditsList.scrolling = time + 1; } diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_chat.c b/qcsrc/menu/xonotic/dialog_hudpanel_chat.c index 693c7ad700..cd9f3854b9 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_chat.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_chat.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDChatDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDChatDialog(entity me) +void XonoticHUDChatDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c b/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c index 246fd65f5c..e2e896b384 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDHealthArmorDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDHealthArmorDialog(entity me) +void XonoticHUDHealthArmorDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_inventory.c b/qcsrc/menu/xonotic/dialog_hudpanel_inventory.c index 2234bfc158..b67210a1e3 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_inventory.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_inventory.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDInventoryDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDInventoryDialog(entity me) +void XonoticHUDInventoryDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_modicons.c b/qcsrc/menu/xonotic/dialog_hudpanel_modicons.c index a03a325cb6..8635dae06c 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_modicons.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_modicons.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDModIconsDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDModIconsDialog(entity me) +void XonoticHUDModIconsDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_notification.c b/qcsrc/menu/xonotic/dialog_hudpanel_notification.c index 45accec2d2..503d50a47f 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_notification.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_notification.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDNotificationDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDNotificationDialog(entity me) +void XonoticHUDNotificationDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_powerups.c b/qcsrc/menu/xonotic/dialog_hudpanel_powerups.c index e33c0c8bac..b6d42326de 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_powerups.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_powerups.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDPowerupsDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDPowerupsDialog(entity me) +void XonoticHUDPowerupsDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c b/qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c index 51b7c57496..9b66fc3cba 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDPressedKeysDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDPressedKeysDialog(entity me) +void XonoticHUDPressedKeysDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c b/qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c index 9b70a43399..7fe0f682e9 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_racetimer.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDRaceTimerDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDRaceTimerDialog(entity me) +void XonoticHUDRaceTimerDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_radar.c b/qcsrc/menu/xonotic/dialog_hudpanel_radar.c index 0ed16f4126..a0ead55ef9 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_radar.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_radar.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDRadarDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDRadarDialog(entity me) +void XonoticHUDRadarDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_score.c b/qcsrc/menu/xonotic/dialog_hudpanel_score.c index b7d8018956..05fdb74f10 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_score.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_score.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDScoreDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDScoreDialog(entity me) +void XonoticHUDScoreDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_timer.c b/qcsrc/menu/xonotic/dialog_hudpanel_timer.c index 5bf62a2627..6bfa03b995 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_timer.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_timer.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDTimerDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDTimerDialog(entity me) +void XonoticHUDTimerDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_vote.c b/qcsrc/menu/xonotic/dialog_hudpanel_vote.c index df50e039e0..e96af574aa 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_vote.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_vote.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDVoteDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDVoteDialog(entity me) +void XonoticHUDVoteDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c b/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c index 7e1be44ddf..1a55bced0b 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c @@ -11,7 +11,7 @@ ENDCLASS(XonoticHUDWeaponIconsDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDWeaponIconsDialog(entity me) +void XonoticHUDWeaponIconsDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_hudsetup_exit.c b/qcsrc/menu/xonotic/dialog_hudsetup_exit.c index 37dee5faf9..da75603f49 100644 --- a/qcsrc/menu/xonotic/dialog_hudsetup_exit.c +++ b/qcsrc/menu/xonotic/dialog_hudsetup_exit.c @@ -12,7 +12,7 @@ ENDCLASS(XonoticHUDExitDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticHUDExitDialog(entity me) +void XonoticHUDExitDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer.c b/qcsrc/menu/xonotic/dialog_multiplayer.c index 6bbe66dd16..e755710c5b 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer.c @@ -10,7 +10,7 @@ ENDCLASS(XonoticMultiplayerDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticMultiplayerDialog(entity me) +void XonoticMultiplayerDialog_fill(entity me) { entity mc, e; mc = makeXonoticTabController(me.rows - 2); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create.c b/qcsrc/menu/xonotic/dialog_multiplayer_create.c index 51ed2d442b..3aea0e4858 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create.c @@ -26,7 +26,7 @@ entity makeXonoticServerCreateTab() return me; } -void fillXonoticServerCreateTab(entity me) +void XonoticServerCreateTab_fill(entity me) { entity e, e0; float n; @@ -195,7 +195,7 @@ void GameType_ConfigureSliders(entity e, entity l, entity l2, string pLabel, flo } } -void gameTypeChangeNotifyXonoticServerCreateTab(entity me) +void XonoticServerCreateTab_gameTypeChangeNotify(entity me) { // tell the map list to update float gt; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c b/qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c index 160f15d265..2d75d43652 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c @@ -13,12 +13,12 @@ ENDCLASS(XonoticAdvancedDialog) #endif #ifdef IMPLEMENTATION -void showNotifyXonoticAdvancedDialog(entity me) +void XonoticAdvancedDialog_showNotify(entity me) { loadAllCvars(me); } -void fillXonoticAdvancedDialog(entity me) +void XonoticAdvancedDialog_fill(entity me) { entity e; me.TR(me); @@ -69,10 +69,10 @@ void fillXonoticAdvancedDialog(entity me) e.onClickEntity = me; } -void closeXonoticAdvancedDialog(entity me) +void XonoticAdvancedDialog_close(entity me) { if(me.refilterEntity) me.refilterEntity.refilter(me.refilterEntity); - closeDialog(me); + SUPER(XonoticAdvancedDialog).close(me); } #endif diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c b/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c index e4056ba7ef..05ed89887d 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c @@ -40,7 +40,7 @@ ENDCLASS(XonoticMapInfoDialog) #endif #ifdef IMPLEMENTATION -void loadMapInfoXonoticMapInfoDialog(entity me, float i, entity mlb) +void XonoticMapInfoDialog_loadMapInfo(entity me, float i, entity mlb) { me.currentMapIndex = i; me.startButton.onClickEntity = mlb; @@ -86,7 +86,7 @@ void loadMapInfoXonoticMapInfoDialog(entity me, float i, entity mlb) MapInfo_ClearTemps(); } -void fillXonoticMapInfoDialog(entity me) +void XonoticMapInfoDialog_fill(entity me) { entity e; float w, wgt; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c index 12d7e4fccb..517f68bd31 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c @@ -14,7 +14,7 @@ ENDCLASS(XonoticMutatorsDialog) #endif #ifdef IMPLEMENTATION -void showNotifyXonoticMutatorsDialog(entity me) +void XonoticMutatorsDialog_showNotify(entity me) { loadAllCvars(me); } @@ -60,7 +60,7 @@ string WeaponArenaString() return weaponarenastring; } -string toStringXonoticMutatorsDialog(entity me) +string XonoticMutatorsDialog_toString(entity me) { string s; s = ""; @@ -157,7 +157,7 @@ void preDrawLaserWeaponArenaLaserButton(entity me) -void fillXonoticMutatorsDialog(entity me) +void XonoticMutatorsDialog_fill(entity me) { entity e, s, w; float i, j; @@ -276,10 +276,10 @@ void fillXonoticMutatorsDialog(entity me) e.onClickEntity = me; } -void closeXonoticMutatorsDialog(entity me) +void XonoticMutatorsDialog_close(entity me) { if(me.refilterEntity) me.refilterEntity.refilter(me.refilterEntity); - closeDialog(me); + SUPER(XonoticMutatorsDialog).close(me); } #endif diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_demo.c b/qcsrc/menu/xonotic/dialog_multiplayer_demo.c index 20d8c9d42f..ec57b7fca8 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_demo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_demo.c @@ -18,7 +18,7 @@ entity makeXonoticDemoBrowserTab() me.configureDialog(me); return me; } -void fillXonoticDemoBrowserTab(entity me) +void XonoticDemoBrowserTab_fill(entity me) { entity e; entity btn; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join.c b/qcsrc/menu/xonotic/dialog_multiplayer_join.c index 130f2dea0e..799d33455f 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join.c @@ -18,7 +18,7 @@ entity makeXonoticServerListTab() me.configureDialog(me); return me; } -void fillXonoticServerListTab(entity me) +void XonoticServerListTab_fill(entity me) { entity e, slist, btn; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c index 0eb42c144e..7770230d31 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c @@ -45,7 +45,7 @@ void Join_Click(entity btn, entity me); #endif #ifdef IMPLEMENTATION -void loadServerInfoXonoticServerInfoDialog(entity me, float i) +void XonoticServerInfoDialog_loadServerInfo(entity me, float i) { float m; string s, typestr, versionstr, numh, maxp; @@ -108,7 +108,7 @@ void loadServerInfoXonoticServerInfoDialog(entity me, float i) me.pingLabel.setText(me.pingLabel, me.currentServerPing); } -void fillXonoticServerInfoDialog(entity me) +void XonoticServerInfoDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c index 68842113e7..4769c58780 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c @@ -23,15 +23,15 @@ entity makeXonoticPlayerSettingsTab() me.configureDialog(me); return me; } -void drawXonoticPlayerSettingsTab(entity me) +void XonoticPlayerSettingsTab_draw(entity me) { if(cvar_string("_cl_name") == "Player") me.playerNameLabel.alpha = ((mod(time * 2, 2) < 1) ? 1 : 0); else me.playerNameLabel.alpha = me.playerNameLabelAlpha; - drawContainer(me); + SUPER(XonoticPlayerSettingsTab).draw(me); } -void fillXonoticPlayerSettingsTab(entity me) +void XonoticPlayerSettingsTab_fill(entity me) { entity e, pms, sl, label, e0, box; float i, r, m, n; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_waypoint.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_waypoint.c index 82c3bf5975..584e1d9b1c 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_waypoint.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_waypoint.c @@ -12,15 +12,15 @@ ENDCLASS(XonoticWaypointDialog) #endif #ifdef IMPLEMENTATION -void showNotifyXonoticWaypointDialog(entity me) +void XonoticWaypointDialog_showNotify(entity me) { loadAllCvars(me); } -string toStringXonoticWaypointDialog(entity me) +string XonoticWaypointDialog_toString(entity me) { return "XXX"; } -void fillXonoticWaypointDialog(entity me) +void XonoticWaypointDialog_fill(entity me) { entity e, sl; diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c index 0b31a823f1..ca6d705c6f 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c @@ -13,15 +13,15 @@ ENDCLASS(XonoticWeaponsDialog) #endif #ifdef IMPLEMENTATION -void showNotifyXonoticWeaponsDialog(entity me) +void XonoticWeaponsDialog_showNotify(entity me) { loadAllCvars(me); } -string toStringXonoticWeaponsDialog(entity me) +string XonoticWeaponsDialog_toString(entity me) { return me.weaponsList.toString(me.weaponsList); } -void fillXonoticWeaponsDialog(entity me) +void XonoticWeaponsDialog_fill(entity me) { entity e; diff --git a/qcsrc/menu/xonotic/dialog_news.c b/qcsrc/menu/xonotic/dialog_news.c index 67de2d2145..cfe91afcee 100644 --- a/qcsrc/menu/xonotic/dialog_news.c +++ b/qcsrc/menu/xonotic/dialog_news.c @@ -10,7 +10,7 @@ ENDCLASS(XonoticNewsDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticNewsDialog(entity me) +void XonoticNewsDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_quit.c b/qcsrc/menu/xonotic/dialog_quit.c index a58b2e4555..0229e02676 100644 --- a/qcsrc/menu/xonotic/dialog_quit.c +++ b/qcsrc/menu/xonotic/dialog_quit.c @@ -10,7 +10,7 @@ ENDCLASS(XonoticQuitDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticQuitDialog(entity me) +void XonoticQuitDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_settings.c b/qcsrc/menu/xonotic/dialog_settings.c index f0adf0488a..1f19bf6565 100644 --- a/qcsrc/menu/xonotic/dialog_settings.c +++ b/qcsrc/menu/xonotic/dialog_settings.c @@ -10,7 +10,7 @@ ENDCLASS(XonoticSettingsDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticSettingsDialog(entity me) +void XonoticSettingsDialog_fill(entity me) { entity mc; mc = makeXonoticTabController(me.rows - 2); diff --git a/qcsrc/menu/xonotic/dialog_settings_audio.c b/qcsrc/menu/xonotic/dialog_settings_audio.c index 7c3c754d4c..7d1f17f0f2 100644 --- a/qcsrc/menu/xonotic/dialog_settings_audio.c +++ b/qcsrc/menu/xonotic/dialog_settings_audio.c @@ -18,7 +18,7 @@ entity makeXonoticAudioSettingsTab() return me; } -void fillXonoticAudioSettingsTab(entity me) +void XonoticAudioSettingsTab_fill(entity me) { entity e, s, sl; diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.c b/qcsrc/menu/xonotic/dialog_settings_effects.c index eb080a50f5..fcb2b8ccfd 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.c +++ b/qcsrc/menu/xonotic/dialog_settings_effects.c @@ -29,7 +29,7 @@ float someShadowCvarIsEnabled(entity box) return FALSE; } -void fillXonoticEffectsSettingsTab(entity me) +void XonoticEffectsSettingsTab_fill(entity me) { entity e, s; float n; diff --git a/qcsrc/menu/xonotic/dialog_settings_input.c b/qcsrc/menu/xonotic/dialog_settings_input.c index bd6ade81b9..00a056fcad 100644 --- a/qcsrc/menu/xonotic/dialog_settings_input.c +++ b/qcsrc/menu/xonotic/dialog_settings_input.c @@ -17,7 +17,7 @@ entity makeXonoticInputSettingsTab() me.configureDialog(me); return me; } -void fillXonoticInputSettingsTab(entity me) +void XonoticInputSettingsTab_fill(entity me) { entity e; entity kb; diff --git a/qcsrc/menu/xonotic/dialog_settings_input_userbind.c b/qcsrc/menu/xonotic/dialog_settings_input_userbind.c index 38660b89a8..3cdfa95b73 100644 --- a/qcsrc/menu/xonotic/dialog_settings_input_userbind.c +++ b/qcsrc/menu/xonotic/dialog_settings_input_userbind.c @@ -22,7 +22,7 @@ void XonoticUserbindEditDialog_Save(entity btn, entity me) Dialog_Close(btn, me); } -void loadUserBindXonoticUserbindEditDialog(entity me, string theName, string theCommandPress, string theCommandRelease) +void XonoticUserbindEditDialog_loadUserBind(entity me, string theName, string theCommandPress, string theCommandRelease) { me.nameBox.setText(me.nameBox, theName); me.nameBox.keyDown(me.nameBox, K_END, 0, 0); @@ -32,7 +32,7 @@ void loadUserBindXonoticUserbindEditDialog(entity me, string theName, string the me.nameBox.keyDown(me.commandReleaseBox, K_END, 0, 0); } -void fillXonoticUserbindEditDialog(entity me) +void XonoticUserbindEditDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_settings_misc.c b/qcsrc/menu/xonotic/dialog_settings_misc.c index 2494d4593f..2dcf83f1f0 100644 --- a/qcsrc/menu/xonotic/dialog_settings_misc.c +++ b/qcsrc/menu/xonotic/dialog_settings_misc.c @@ -17,7 +17,7 @@ entity makeXonoticMiscSettingsTab() me.configureDialog(me); return me; } -void fillXonoticMiscSettingsTab(entity me) +void XonoticMiscSettingsTab_fill(entity me) { entity e; entity sk; diff --git a/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c b/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c index c8bc46cdca..0d846caf2a 100644 --- a/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c +++ b/qcsrc/menu/xonotic/dialog_settings_misc_cvars.c @@ -12,15 +12,15 @@ ENDCLASS(XonoticCvarsDialog) #endif #ifdef IMPLEMENTATION -void showNotifyXonoticCvarsDialog(entity me) +void XonoticCvarsDialog_showNotify(entity me) { loadAllCvars(me); } -string toStringXonoticCvarsDialog(entity me) +string XonoticCvarsDialog_toString(entity me) { return "XXX"; } -void fillXonoticCvarsDialog(entity me) +void XonoticCvarsDialog_fill(entity me) { entity e, cvarlist, btn; cvarlist = makeXonoticCvarList(); diff --git a/qcsrc/menu/xonotic/dialog_settings_network.c b/qcsrc/menu/xonotic/dialog_settings_network.c index 929da470df..6e0c472afb 100644 --- a/qcsrc/menu/xonotic/dialog_settings_network.c +++ b/qcsrc/menu/xonotic/dialog_settings_network.c @@ -18,7 +18,7 @@ entity makeXonoticNetworkSettingsTab() return me; } -void fillXonoticNetworkSettingsTab(entity me) +void XonoticNetworkSettingsTab_fill(entity me) { entity e; diff --git a/qcsrc/menu/xonotic/dialog_settings_video.c b/qcsrc/menu/xonotic/dialog_settings_video.c index 5eb228ae93..dd2f960c73 100644 --- a/qcsrc/menu/xonotic/dialog_settings_video.c +++ b/qcsrc/menu/xonotic/dialog_settings_video.c @@ -18,7 +18,7 @@ entity makeXonoticVideoSettingsTab() me.configureDialog(me); return me; } -void fillXonoticVideoSettingsTab(entity me) +void XonoticVideoSettingsTab_fill(entity me) { entity e; diff --git a/qcsrc/menu/xonotic/dialog_singleplayer.c b/qcsrc/menu/xonotic/dialog_singleplayer.c index e8b1d943a7..560192ff1d 100644 --- a/qcsrc/menu/xonotic/dialog_singleplayer.c +++ b/qcsrc/menu/xonotic/dialog_singleplayer.c @@ -50,7 +50,7 @@ void InstantAction_LoadMap(entity btn, entity dummy) fclose(fh); } -void fillXonoticSingleplayerDialog(entity me) +void XonoticSingleplayerDialog_fill(entity me) { entity e, btnPrev, btnNext, lblTitle; diff --git a/qcsrc/menu/xonotic/dialog_singleplayer_winner.c b/qcsrc/menu/xonotic/dialog_singleplayer_winner.c index b0df2d3d29..5d377e6d0a 100644 --- a/qcsrc/menu/xonotic/dialog_singleplayer_winner.c +++ b/qcsrc/menu/xonotic/dialog_singleplayer_winner.c @@ -10,7 +10,7 @@ ENDCLASS(XonoticWinnerDialog) #endif #ifdef IMPLEMENTATION -void fillXonoticWinnerDialog(entity me) +void XonoticWinnerDialog_fill(entity me) { entity e; diff --git a/qcsrc/menu/xonotic/dialog_teamselect.c b/qcsrc/menu/xonotic/dialog_teamselect.c index 4a2f81231f..e0908ee364 100644 --- a/qcsrc/menu/xonotic/dialog_teamselect.c +++ b/qcsrc/menu/xonotic/dialog_teamselect.c @@ -23,7 +23,7 @@ entity makeTeamButton(string theName, vector theColor, string commandtheName) return b; } -void showNotifyXonoticTeamSelectDialog(entity me) +void XonoticTeamSelectDialog_showNotify(entity me) { float teams, nTeams; teams = cvar("_teams_available"); @@ -34,7 +34,7 @@ void showNotifyXonoticTeamSelectDialog(entity me) me.team4.disabled = !(teams & 8); nTeams += !!(teams & 8); } -void fillXonoticTeamSelectDialog(entity me) +void XonoticTeamSelectDialog_fill(entity me) { entity e; me.TR(me); diff --git a/qcsrc/menu/xonotic/gametypebutton.c b/qcsrc/menu/xonotic/gametypebutton.c index f88cb0029c..c1dc04c730 100644 --- a/qcsrc/menu/xonotic/gametypebutton.c +++ b/qcsrc/menu/xonotic/gametypebutton.c @@ -30,7 +30,7 @@ entity makeXonoticGametypeButton(float theGroup, string theCvar, string theText) me.configureXonoticGametypeButton(me, theGroup, theCvar, theText); return me; } -void configureXonoticGametypeButtonXonoticGametypeButton(entity me, float theGroup, string theCvar, string theText) +void XonoticGametypeButton_configureXonoticGametypeButton(entity me, float theGroup, string theCvar, string theText) { if(theCvar) { @@ -43,7 +43,7 @@ void configureXonoticGametypeButtonXonoticGametypeButton(entity me, float theGro me.onClick = GameTypeButton_Click; me.onClickEntity = NULL; } -void setCheckedXonoticGametypeButton(entity me, float val) +void XonoticGametypeButton_setChecked(entity me, float val) { if(val != me.checked) { @@ -51,14 +51,14 @@ void setCheckedXonoticGametypeButton(entity me, float val) me.saveCvars(me); } } -void loadCvarsXonoticGametypeButton(entity me) +void XonoticGametypeButton_loadCvars(entity me) { if not(me.cvarName) return; me.checked = cvar(me.cvarName); } -void saveCvarsXonoticGametypeButton(entity me) +void XonoticGametypeButton_saveCvars(entity me) { if not(me.cvarName) return; diff --git a/qcsrc/menu/xonotic/image.c b/qcsrc/menu/xonotic/image.c index 65f5ee9d81..9f0de67b8a 100644 --- a/qcsrc/menu/xonotic/image.c +++ b/qcsrc/menu/xonotic/image.c @@ -13,7 +13,7 @@ entity makeXonoticImage(string theImage, float theAspect) me.configureXonoticImage(me, theImage, theAspect); return me; } -void configureXonoticImageXonoticImage(entity me, string theImage, float theAspect) +void XonoticImage_configureXonoticImage(entity me, string theImage, float theAspect) { me.configureImage(me, theImage); me.forcedAspect = theAspect; diff --git a/qcsrc/menu/xonotic/inputbox.c b/qcsrc/menu/xonotic/inputbox.c index 0793ae1812..26dc4536c4 100644 --- a/qcsrc/menu/xonotic/inputbox.c +++ b/qcsrc/menu/xonotic/inputbox.c @@ -32,7 +32,7 @@ entity makeXonoticInputBox(float doEditColorCodes, string theCvar) me.configureXonoticInputBox(me, doEditColorCodes, theCvar); return me; } -void configureXonoticInputBoxXonoticInputBox(entity me, float doEditColorCodes, string theCvar) +void XonoticInputBox_configureXonoticInputBox(entity me, float doEditColorCodes, string theCvar) { me.configureInputBox(me, "", 0, me.fontSize, me.image); me.editColorCodes = doEditColorCodes; @@ -44,33 +44,33 @@ void configureXonoticInputBoxXonoticInputBox(entity me, float doEditColorCodes, } me.cursorPos = strlen(me.text); } -void focusLeaveXonoticInputBox(entity me) +void XonoticInputBox_focusLeave(entity me) { me.saveCvars(me); } -void setTextXonoticInputBox(entity me, string new) +void XonoticInputBox_setText(entity me, string new) { if(me.text != new) { - setTextInputBox(me, new); + SUPER(XonoticInputBox).setText(me, new); me.onChange(me, me.onChangeEntity); } else - setTextInputBox(me, new); + SUPER(XonoticInputBox).setText(me, new); } -void loadCvarsXonoticInputBox(entity me) +void XonoticInputBox_loadCvars(entity me) { if not(me.cvarName) return; - setTextInputBox(me, cvar_string(me.cvarName)); + SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName)); } -void saveCvarsXonoticInputBox(entity me) +void XonoticInputBox_saveCvars(entity me) { if not(me.cvarName) return; cvar_set(me.cvarName, me.text); } -float keyDownXonoticInputBox(entity me, float key, float ascii, float shift) +float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift) { float r; r = 0; @@ -83,7 +83,7 @@ float keyDownXonoticInputBox(entity me, float key, float ascii, float shift) } me.onEnter(me, me.onEnterEntity); } - if(keyDownInputBox(me, key, ascii, shift)) + if(SUPER(XonoticInputBox).keyDown(me, key, ascii, shift)) r = 1; return r; } diff --git a/qcsrc/menu/xonotic/keybinder.c b/qcsrc/menu/xonotic/keybinder.c index 6b490be231..bb16e08889 100644 --- a/qcsrc/menu/xonotic/keybinder.c +++ b/qcsrc/menu/xonotic/keybinder.c @@ -68,7 +68,7 @@ entity makeXonoticKeyBinder() me.configureXonoticKeyBinder(me); return me; } -void configureXonoticKeyBinderXonoticKeyBinder(entity me) +void XonoticKeyBinder_configureXonoticKeyBinder(entity me) { me.configureXonoticListBox(me); if(Xonotic_KeyBinds_Count < 0) @@ -76,9 +76,9 @@ void configureXonoticKeyBinderXonoticKeyBinder(entity me) me.nItems = Xonotic_KeyBinds_Count; me.setSelected(me, 0); } -void resizeNotifyXonoticKeyBinder(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticKeyBinder_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticKeyBinder).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / (absSize_y * me.itemHeight); me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth)); @@ -103,7 +103,7 @@ void KeyBinder_Bind_Change(entity btn, entity me) me.keyGrabButton.forcePressed = 1; keyGrabber = me; } -void keyGrabbedXonoticKeyBinder(entity me, float key, float ascii) +void XonoticKeyBinder_keyGrabbed(entity me, float key, float ascii) { float n, j, k, nvalid; string func; @@ -135,7 +135,7 @@ void keyGrabbedXonoticKeyBinder(entity me, float key, float ascii) } localcmd("\nbind \"", keynumtostring(key), "\" \"", func, "\"\n"); } -void editUserbindXonoticKeyBinder(entity me, string theName, string theCommandPress, string theCommandRelease) +void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease) { string func, descr; @@ -195,7 +195,7 @@ void KeyBinder_Bind_Clear(entity btn, entity me) } } -void clickListBoxItemXonoticKeyBinder(entity me, float i, vector where) +void XonoticKeyBinder_clickListBoxItem(entity me, float i, vector where) { if(i == me.lastClickedServer) if(time < me.lastClickedTime + 0.3) @@ -206,7 +206,7 @@ void clickListBoxItemXonoticKeyBinder(entity me, float i, vector where) me.lastClickedServer = i; me.lastClickedTime = time; } -void setSelectedXonoticKeyBinder(entity me, float i) +void XonoticKeyBinder_setSelected(entity me, float i) { // handling of "unselectable" items i = floor(0.5 + bound(0, i, me.nItems - 1)); @@ -231,9 +231,9 @@ void setSelectedXonoticKeyBinder(entity me, float i) me.previouslySelected = i; if(me.userbindEditButton) me.userbindEditButton.disabled = (substring(Xonotic_KeyBinds_Descriptions[i], 0, 1) != "$"); - setSelectedListBox(me, i); + SUPER(XonoticKeyBinder).setSelected(me, i); } -float keyDownXonoticKeyBinder(entity me, float key, float ascii, float shift) +float XonoticKeyBinder_keyDown(entity me, float key, float ascii, float shift) { float r; r = 1; @@ -248,12 +248,12 @@ float keyDownXonoticKeyBinder(entity me, float key, float ascii, float shift) KeyBinder_Bind_Clear(me, me); break; default: - r = keyDownListBox(me, key, ascii, shift); + r = SUPER(XonoticKeyBinder).keyDown(me, key, ascii, shift); break; } return r; } -void drawListBoxItemXonoticKeyBinder(entity me, float i, vector absSize, float isSelected) +void XonoticKeyBinder_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { string s; float j, k, n; diff --git a/qcsrc/menu/xonotic/listbox.c b/qcsrc/menu/xonotic/listbox.c index ce08d4bf4d..23fa58d832 100644 --- a/qcsrc/menu/xonotic/listbox.c +++ b/qcsrc/menu/xonotic/listbox.c @@ -25,13 +25,13 @@ entity makeXonoticListBox() me.configureXonoticListBox(me); return me; } -void configureXonoticListBoxXonoticListBox(entity me) +void XonoticListBox_configureXonoticListBox(entity me) { me.configureListBox(me, me.scrollbarWidth, 1); // item height gets set up later } -void resizeNotifyXonoticListBox(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticListBox_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.itemHeight = me.rowsPerItem * me.fontSize / absSize_y; - resizeNotifyListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticListBox).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); } #endif diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c index 00da54b59e..f1cbfffc75 100644 --- a/qcsrc/menu/xonotic/mainwindow.c +++ b/qcsrc/menu/xonotic/mainwindow.c @@ -25,7 +25,7 @@ void DemoButton_Click(entity me, entity other) me.setText(me, "Do not press this button again!"); } -void configureMainWindowMainWindow(entity me) +void MainWindow_configureMainWindow(entity me) { entity n, i; diff --git a/qcsrc/menu/xonotic/maplist.c b/qcsrc/menu/xonotic/maplist.c index 9bce96dfd7..7a5a4ba150 100644 --- a/qcsrc/menu/xonotic/maplist.c +++ b/qcsrc/menu/xonotic/maplist.c @@ -51,7 +51,7 @@ void MapList_LoadMap(entity btn, entity me); #endif #ifdef IMPLEMENTATION -void destroyXonoticMapList(entity me) +void XonoticMapList_destroy(entity me) { MapInfo_Shutdown(); } @@ -64,22 +64,22 @@ entity makeXonoticMapList() return me; } -void configureXonoticMapListXonoticMapList(entity me) +void XonoticMapList_configureXonoticMapList(entity me) { me.configureXonoticListBox(me); me.refilter(me); } -void loadCvarsXonoticMapList(entity me) +void XonoticMapList_loadCvars(entity me) { me.refilter(me); } -float g_maplistCacheQueryXonoticMapList(entity me, float i) +float XonoticMapList_g_maplistCacheQuery(entity me, float i) { return stof(substring(me.g_maplistCache, i, 1)); } -void g_maplistCacheToggleXonoticMapList(entity me, float i) +void XonoticMapList_g_maplistCacheToggle(entity me, float i) { string a, b, c, s, bspname; float n; @@ -113,17 +113,17 @@ void g_maplistCacheToggleXonoticMapList(entity me, float i) } } -void drawXonoticMapList(entity me) +void XonoticMapList_draw(entity me) { if(me.startButton) me.startButton.disabled = ((me.selectedItem < 0) || (me.selectedItem >= me.nItems)); - drawListBox(me); + SUPER(XonoticMapList).draw(me); } -void resizeNotifyXonoticMapList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticMapList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.itemAbsSize = '0 0 0'; - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticMapList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize_y * me.itemHeight)); me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth))); @@ -139,7 +139,7 @@ void resizeNotifyXonoticMapList(entity me, vector relOrigin, vector relSize, vec me.checkMarkOrigin = eY + eX * (me.columnPreviewOrigin + me.columnPreviewSize) - me.checkMarkSize; } -void clickListBoxItemXonoticMapList(entity me, float i, vector where) +void XonoticMapList_clickListBoxItem(entity me, float i, vector where) { if(where_x <= me.columnPreviewOrigin + me.columnPreviewSize) { @@ -163,7 +163,7 @@ void clickListBoxItemXonoticMapList(entity me, float i, vector where) } } -void drawListBoxItemXonoticMapList(entity me, float i, vector absSize, float isSelected) +void XonoticMapList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { // layout: Ping, Map name, Map name, NP, TP, MP string s; @@ -197,7 +197,7 @@ void drawListBoxItemXonoticMapList(entity me, float i, vector absSize, float isS MapInfo_ClearTemps(); } -void refilterXonoticMapList(entity me) +void XonoticMapList_refilter(entity me) { float i, j, n; string s; @@ -233,7 +233,7 @@ void refilterXonoticMapList(entity me) } } -void refilterCallbackXonoticMapList(entity me, entity cb) +void XonoticMapList_refilterCallback(entity me, entity cb) { me.refilter(me); } @@ -292,7 +292,7 @@ void MapList_LoadMap(entity btn, entity me) } } -float keyDownXonoticMapList(entity me, float scan, float ascii, float shift) +float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift) { string ch, save; if(scan == K_ENTER) @@ -348,7 +348,7 @@ float keyDownXonoticMapList(entity me, float scan, float ascii, float shift) me.setSelected(me, MapInfo_FindName_firstResult); } else - return keyDownListBox(me, scan, ascii, shift); + return SUPER(XonoticMapList).keyDown(me, scan, ascii, shift); return 1; } diff --git a/qcsrc/menu/xonotic/nexposee.c b/qcsrc/menu/xonotic/nexposee.c index 32253b0c0e..b375393c02 100644 --- a/qcsrc/menu/xonotic/nexposee.c +++ b/qcsrc/menu/xonotic/nexposee.c @@ -15,11 +15,11 @@ entity makeXonoticNexposee() return me; } -void configureXonoticNexposeeXonoticNexposee(entity me) +void XonoticNexposee_configureXonoticNexposee(entity me) { } -void closeXonoticNexposee(entity me) +void XonoticNexposee_close(entity me) { m_goto(string_null); // hide } diff --git a/qcsrc/menu/xonotic/playerlist.c b/qcsrc/menu/xonotic/playerlist.c index 4406e58055..f409a1b99d 100644 --- a/qcsrc/menu/xonotic/playerlist.c +++ b/qcsrc/menu/xonotic/playerlist.c @@ -34,7 +34,7 @@ entity makeXonoticPlayerList() return me; } -void setPlayerListXonoticPlayerList(entity me, string plist) +void XonoticPlayerList_setPlayerList(entity me, string plist) { dprint(plist,"------------\n"); @@ -71,15 +71,15 @@ void setPlayerListXonoticPlayerList(entity me, string plist) me.playerList = buf; } -string getPlayerListXonoticPlayerList(entity me, float i, float key) +string XonoticPlayerList_getPlayerList(entity me, float i, float key) { return bufstr_get(me.playerList, i * PLAYERPARM_COUNT + key); } -void resizeNotifyXonoticPlayerList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticPlayerList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.itemAbsSize = '0 0 0'; - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticPlayerList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize_y * me.itemHeight)); me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth))); @@ -93,7 +93,7 @@ void resizeNotifyXonoticPlayerList(entity me, vector relOrigin, vector relSize, me.columnScoreOrigin = me.columnNameOrigin + me.columnNameSize + me.realFontSize_x; } -void drawListBoxItemXonoticPlayerList(entity me, float i, vector absSize, float isSelected) +void XonoticPlayerList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { string s; string score; diff --git a/qcsrc/menu/xonotic/playermodel.c b/qcsrc/menu/xonotic/playermodel.c index 27d5721afd..585a5f7fc1 100644 --- a/qcsrc/menu/xonotic/playermodel.c +++ b/qcsrc/menu/xonotic/playermodel.c @@ -42,7 +42,7 @@ entity makeXonoticPlayerModelSelector() #define BUFMODELS_DESC 4 #define BUFMODELS_COUNT 5 -void configureXonoticPlayerModelSelectorXonoticPlayerModelSelector(entity me) +void XonoticPlayerModelSelector_configureXonoticPlayerModelSelector(entity me) { float sortbuf, glob, i; string fn; @@ -87,13 +87,13 @@ void configureXonoticPlayerModelSelectorXonoticPlayerModelSelector(entity me) get_model_parameters(string_null, 0); me.loadCvars(me); } -void destroyXonoticPlayerModelSelector(entity me) +void XonoticPlayerModelSelector_destroy(entity me) { buf_del(me.bufModels); me.bufModels = -1; } -void loadCvarsXonoticPlayerModelSelector(entity me) +void XonoticPlayerModelSelector_loadCvars(entity me) { float i; if(me.currentModel) @@ -112,7 +112,7 @@ void loadCvarsXonoticPlayerModelSelector(entity me) me.go(me, 0); // this will set the other vars for currentSkin and currentModel } -void goXonoticPlayerModelSelector(entity me, float d) +void XonoticPlayerModelSelector_go(entity me, float d) { me.idxModels = mod(me.idxModels + d + me.numModels, me.numModels); @@ -149,19 +149,19 @@ void PlayerModelSelector_Prev_Click(entity btn, entity me) me.saveCvars(me); } -void saveCvarsXonoticPlayerModelSelector(entity me) +void XonoticPlayerModelSelector_saveCvars(entity me) { // we can't immediately apply here because of flood control cvar_set("_cl_playermodel", me.currentModel); cvar_set("_cl_playerskin", ftos(me.currentSkin)); } -void drawXonoticPlayerModelSelector(entity me) +void XonoticPlayerModelSelector_draw(entity me) { float i, n; vector o; - drawImage(me); + SUPER(XonoticPlayerModelSelector).draw(me); // draw text on the image, handle \n in the description draw_CenterText('0.5 0 0', me.currentModelTitle, me.realFontSize * (me.titleFontSize / me.fontSize), SKINCOLOR_MODELTITLE, SKINALPHA_MODELTITLE, FALSE); @@ -174,9 +174,9 @@ void drawXonoticPlayerModelSelector(entity me) } } -void resizeNotifyXonoticPlayerModelSelector(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticPlayerModelSelector_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyImage(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticPlayerModelSelector).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / absSize_y; me.realFontSize_x = me.fontSize / absSize_x; } diff --git a/qcsrc/menu/xonotic/radiobutton.c b/qcsrc/menu/xonotic/radiobutton.c index 0281a542db..8c353eae67 100644 --- a/qcsrc/menu/xonotic/radiobutton.c +++ b/qcsrc/menu/xonotic/radiobutton.c @@ -30,7 +30,7 @@ entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, s me.configureXonoticRadioButton(me, theGroup, theCvar, theValue, theText); return me; } -void configureXonoticRadioButtonXonoticRadioButton(entity me, float theGroup, string theCvar, string theValue, string theText) +void XonoticRadioButton_configureXonoticRadioButton(entity me, float theGroup, string theCvar, string theValue, string theText) { if(theCvar) { @@ -41,7 +41,7 @@ void configureXonoticRadioButtonXonoticRadioButton(entity me, float theGroup, st } me.configureRadioButton(me, theText, me.fontSize, me.image, theGroup, 0); } -void setCheckedXonoticRadioButton(entity me, float val) +void XonoticRadioButton_setChecked(entity me, float val) { if(val != me.checked) { @@ -49,7 +49,7 @@ void setCheckedXonoticRadioButton(entity me, float val) me.saveCvars(me); } } -void loadCvarsXonoticRadioButton(entity me) +void XonoticRadioButton_loadCvars(entity me) { if(me.cvarValue) { @@ -72,7 +72,7 @@ void loadCvarsXonoticRadioButton(entity me) } } } -void drawXonoticRadioButton(entity me) +void XonoticRadioButton_draw(entity me) { if not(me.cvarValue) if not(me.cvarName) @@ -89,9 +89,9 @@ void drawXonoticRadioButton(entity me) if(!found) me.setChecked(me, 1); } - drawCheckBox(me); + SUPER(XonoticRadioButton).draw(me); } -void saveCvarsXonoticRadioButton(entity me) +void XonoticRadioButton_saveCvars(entity me) { if(me.cvarValue) { diff --git a/qcsrc/menu/xonotic/rootdialog.c b/qcsrc/menu/xonotic/rootdialog.c index d784cba449..efc00822d8 100644 --- a/qcsrc/menu/xonotic/rootdialog.c +++ b/qcsrc/menu/xonotic/rootdialog.c @@ -14,7 +14,7 @@ ENDCLASS(XonoticRootDialog) #endif #ifdef IMPLEMENTATION -void closeXonoticRootDialog(entity me) +void XonoticRootDialog_close(entity me) { m_goto(string_null); } diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index d4b01e2820..c205fba705 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -141,7 +141,7 @@ entity makeXonoticServerList() me.configureXonoticServerList(me); return me; } -void configureXonoticServerListXonoticServerList(entity me) +void XonoticServerList_configureXonoticServerList(entity me) { me.configureXonoticListBox(me); @@ -149,11 +149,11 @@ void configureXonoticServerListXonoticServerList(entity me) me.nItems = 0; } -void setSelectedXonoticServerList(entity me, float i) +void XonoticServerList_setSelected(entity me, float i) { float save; save = me.selectedItem; - setSelectedListBox(me, i); + SUPER(XonoticServerList).setSelected(me, i); /* if(me.selectedItem == save) return; @@ -171,7 +171,7 @@ void setSelectedXonoticServerList(entity me, float i) me.ipAddressBox.cursorPos = strlen(me.selectedServer); me.ipAddressBoxFocused = -1; } -void refreshServerListXonoticServerList(entity me, float mode) +void XonoticServerList_refreshServerList(entity me, float mode) { // 0: just reparametrize // 1: also ask for new servers @@ -234,7 +234,7 @@ void refreshServerListXonoticServerList(entity me, float mode) refreshhostcache(); } } -void focusEnterXonoticServerList(entity me) +void XonoticServerList_focusEnter(entity me) { if(time < me.nextRefreshTime) { @@ -244,7 +244,7 @@ void focusEnterXonoticServerList(entity me) me.nextRefreshTime = time + 10; me.refreshServerList(me, 1); } -void drawXonoticServerList(entity me) +void XonoticServerList_draw(entity me) { float i, found, owned; @@ -317,7 +317,7 @@ void drawXonoticServerList(entity me) me.ipAddressBoxFocused = me.ipAddressBox.focused; } - drawListBox(me); + SUPER(XonoticServerList).draw(me); } void ServerList_PingSort_Click(entity btn, entity me) { @@ -413,7 +413,7 @@ void ServerList_ShowFull_Click(entity box, entity me) me.ipAddressBox.cursorPos = 0; me.ipAddressBoxFocused = -1; } -void setSortOrderXonoticServerList(entity me, float field, float direction) +void XonoticServerList_setSortOrder(entity me, float field, float direction) { if(me.currentSortField == field) direction = -me.currentSortOrder; @@ -430,7 +430,7 @@ void setSortOrderXonoticServerList(entity me, float field, float direction) me.selectedServer = string_null; me.refreshServerList(me, 0); } -void positionSortButtonXonoticServerList(entity me, entity btn, float theOrigin, float theSize, string theTitle, void(entity, entity) theFunc) +void XonoticServerList_positionSortButton(entity me, entity btn, float theOrigin, float theSize, string theTitle, void(entity, entity) theFunc) { vector originInLBSpace, sizeInLBSpace; originInLBSpace = eY * (-me.itemHeight); @@ -447,9 +447,9 @@ void positionSortButtonXonoticServerList(entity me, entity btn, float theOrigin, btn.onClickEntity = me; btn.resized = 1; } -void resizeNotifyXonoticServerList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticServerList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticServerList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / (absSize_y * me.itemHeight); me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth)); @@ -502,7 +502,7 @@ void ServerList_Info_Click(entity btn, entity me) main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem); DialogOpenButton_Click(me, main.serverInfoDialog); } -void clickListBoxItemXonoticServerList(entity me, float i, vector where) +void XonoticServerList_clickListBoxItem(entity me, float i, vector where) { if(i == me.lastClickedServer) if(time < me.lastClickedTime + 0.3) @@ -513,7 +513,7 @@ void clickListBoxItemXonoticServerList(entity me, float i, vector where) me.lastClickedServer = i; me.lastClickedTime = time; } -void drawListBoxItemXonoticServerList(entity me, float i, vector absSize, float isSelected) +void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { // layout: Ping, Server name, Map name, NP, TP, MP string s; @@ -574,7 +574,7 @@ void drawListBoxItemXonoticServerList(entity me, float i, vector absSize, float draw_Text(me.realUpperMargin * eY + (me.columnPlayersOrigin + (me.columnPlayersSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0); } -float keyDownXonoticServerList(entity me, float scan, float ascii, float shift) +float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift) { float i; vector org, sz; @@ -601,7 +601,7 @@ float keyDownXonoticServerList(entity me, float scan, float ascii, float shift) me.ipAddressBoxFocused = -1; } } - else if(keyDownListBox(me, scan, ascii, shift)) + else if(SUPER(XonoticServerList).keyDown(me, scan, ascii, shift)) return 1; else if(!me.controlledTextbox) return 0; diff --git a/qcsrc/menu/xonotic/skinlist.c b/qcsrc/menu/xonotic/skinlist.c index 78ff80ca40..bcb62251aa 100644 --- a/qcsrc/menu/xonotic/skinlist.c +++ b/qcsrc/menu/xonotic/skinlist.c @@ -50,14 +50,14 @@ entity makeXonoticSkinList() return me; } -void configureXonoticSkinListXonoticSkinList(entity me) +void XonoticSkinList_configureXonoticSkinList(entity me) { me.configureXonoticListBox(me); me.getSkins(me); me.loadCvars(me); } -void loadCvarsXonoticSkinList(entity me) +void XonoticSkinList_loadCvars(entity me) { string s; float i, n; @@ -73,17 +73,17 @@ void loadCvarsXonoticSkinList(entity me) } } -void saveCvarsXonoticSkinList(entity me) +void XonoticSkinList_saveCvars(entity me) { cvar_set("menu_skin", me.skinParameter(me, me.selectedItem, SKINPARM_NAME)); } -string skinParameterXonoticSkinList(entity me, float i, float key) +string XonoticSkinList_skinParameter(entity me, float i, float key) { return bufstr_get(me.skinlist, i * SKINPARM_COUNT + key); } -void getSkinsXonoticSkinList(entity me) +void XonoticSkinList_getSkins(entity me) { float glob, buf, i, n, fh; string s; @@ -128,15 +128,15 @@ void getSkinsXonoticSkinList(entity me) me.nItems = n; } -void destroyXonoticSkinList(entity me) +void XonoticSkinList_destroy(entity me) { buf_del(me.skinlist); } -void resizeNotifyXonoticSkinList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticSkinList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { me.itemAbsSize = '0 0 0'; - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticSkinList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); me.realFontSize_y = me.fontSize / (me.itemAbsSize_y = (absSize_y * me.itemHeight)); me.realFontSize_x = me.fontSize / (me.itemAbsSize_x = (absSize_x * (1 - me.controlWidth))); @@ -149,7 +149,7 @@ void resizeNotifyXonoticSkinList(entity me, vector relOrigin, vector relSize, ve me.columnNameSize = 1 - me.columnPreviewSize - 2 * me.realFontSize_x; } -void drawListBoxItemXonoticSkinList(entity me, float i, vector absSize, float isSelected) +void XonoticSkinList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { string s; @@ -169,7 +169,7 @@ void drawListBoxItemXonoticSkinList(entity me, float i, vector absSize, float is draw_Text(me.realUpperMargin2 * eY + (me.columnNameOrigin + 1.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_SKINLIST_AUTHOR, SKINALPHA_TEXT, 0); } -void setSkinXonoticSkinList(entity me) +void XonoticSkinList_setSkin(entity me) { me.saveCvars(me); localcmd("\nmenu_restart\ntogglemenu\ndefer 0.1 \"menu_cmd skinselect\"\n"); @@ -180,7 +180,7 @@ void SetSkin_Click(entity btn, entity me) me.setSkin(me); } -void clickListBoxItemXonoticSkinList(entity me, float i, vector where) +void XonoticSkinList_clickListBoxItem(entity me, float i, vector where) { if(i == me.lastClickedSkin) if(time < me.lastClickedTime + 0.3) @@ -193,13 +193,13 @@ void clickListBoxItemXonoticSkinList(entity me, float i, vector where) me.lastClickedTime = time; } -float keyDownXonoticSkinList(entity me, float scan, float ascii, float shift) +float XonoticSkinList_keyDown(entity me, float scan, float ascii, float shift) { if(scan == K_ENTER) { me.setSkin(me); return 1; } else - return keyDownListBox(me, scan, ascii, shift); + return SUPER(XonoticSkinList).keyDown(me, scan, ascii, shift); } #endif diff --git a/qcsrc/menu/xonotic/slider.c b/qcsrc/menu/xonotic/slider.c index 134557da7d..46a01bb5ac 100644 --- a/qcsrc/menu/xonotic/slider.c +++ b/qcsrc/menu/xonotic/slider.c @@ -31,7 +31,7 @@ entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueSte me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar); return me; } -void configureXonoticSliderXonoticSlider(entity me, float theValueMin, float theValueMax, float theValueStep, string theCvar) +void XonoticSlider_configureXonoticSlider(entity me, float theValueMin, float theValueMax, float theValueStep, string theCvar) { float v, vk, vp; v = theValueMin; @@ -49,22 +49,22 @@ void configureXonoticSliderXonoticSlider(entity me, float theValueMin, float the me.tooltip = getZonedTooltipForIdentifier(theCvar); } } -void setValueXonoticSlider(entity me, float val) +void XonoticSlider_setValue(entity me, float val) { if(val != me.value) { - setValueSlider( me, val ); + SUPER(XonoticSlider).setValue( me, val ); me.saveCvars(me); } } -void loadCvarsXonoticSlider(entity me) +void XonoticSlider_loadCvars(entity me) { if not(me.cvarName) return; me.setValue( me, cvar(me.cvarName) ); } -void saveCvarsXonoticSlider(entity me) +void XonoticSlider_saveCvars(entity me) { if not(me.cvarName) return; diff --git a/qcsrc/menu/xonotic/slider_decibels.c b/qcsrc/menu/xonotic/slider_decibels.c index ba7cffc22f..0e4b4e3720 100644 --- a/qcsrc/menu/xonotic/slider_decibels.c +++ b/qcsrc/menu/xonotic/slider_decibels.c @@ -16,7 +16,7 @@ entity makeXonoticDecibelsSlider(float theValueMin, float theValueMax, float the me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar); return me; } -void loadCvarsXonoticDecibelsSlider(entity me) +void XonoticDecibelsSlider_loadCvars(entity me) { float v; @@ -25,13 +25,13 @@ void loadCvarsXonoticDecibelsSlider(entity me) v = cvar(me.cvarName); if(v >= 0.98) - setValueSlider( me, 0 ); + Slider_setValue( me, 0 ); else if(v < 0.0005) - setValueSlider( me, -1000000 ); + Slider_setValue( me, -1000000 ); else - setValueSlider( me, 0.1 * floor(0.5 + 10.0 * log10(cvar(me.cvarName)) * 10) ); + Slider_setValue( me, 0.1 * floor(0.5 + 10.0 * log10(cvar(me.cvarName)) * 10) ); } -void saveCvarsXonoticDecibelsSlider(entity me) +void XonoticDecibelsSlider_saveCvars(entity me) { if not(me.cvarName) return; @@ -44,13 +44,13 @@ void saveCvarsXonoticDecibelsSlider(entity me) cvar_set(me.cvarName, ftos(pow(10, me.value / 10))); } -string valueToTextXonoticDecibelsSlider(entity me, float v) +string XonoticDecibelsSlider_valueToText(entity me, float v) { if(v < -33) return "OFF"; else if(v >= -0.1) return "MAX"; - return strcat(valueToTextSlider(me, v), " dB"); + return strcat(SUPER(XonoticDecibelsSlider).valueToText(me, v), " dB"); } #endif diff --git a/qcsrc/menu/xonotic/slider_resolution.c b/qcsrc/menu/xonotic/slider_resolution.c index ed6db5b69e..de34a410d9 100644 --- a/qcsrc/menu/xonotic/slider_resolution.c +++ b/qcsrc/menu/xonotic/slider_resolution.c @@ -60,12 +60,12 @@ entity makeXonoticResolutionSlider() me.configureXonoticResolutionSlider(me); return me; } -void addResolutionXonoticResolutionSlider(entity me, float w, float h, float pixelheight) +void XonoticResolutionSlider_addResolution(entity me, float w, float h, float pixelheight) { me.addValue(me, strzone(strcat(ftos(w), "x", ftos(h))), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight)))); // FIXME (in case you ever want to dynamically instantiate this): THIS IS NEVER FREED } -void configureXonoticResolutionSliderXonoticResolutionSlider(entity me) +void XonoticResolutionSlider_configureXonoticResolutionSlider(entity me) { float i; vector r0, r; @@ -90,11 +90,11 @@ void configureXonoticResolutionSliderXonoticResolutionSlider(entity me) me.configureXonoticTextSliderValues(me); } -void loadCvarsXonoticResolutionSlider(entity me) +void XonoticResolutionSlider_loadCvars(entity me) { me.setValueFromIdentifier(me, strcat(cvar_string("menu_vid_width"), " ", cvar_string("menu_vid_height"), " ", cvar_string("menu_vid_pixelheight"))); } -void saveCvarsXonoticResolutionSlider(entity me) +void XonoticResolutionSlider_saveCvars(entity me) { if(me.value >= 0 || me.value < me.nValues) { diff --git a/qcsrc/menu/xonotic/tab.c b/qcsrc/menu/xonotic/tab.c index d771d7157b..d1a867a2f8 100644 --- a/qcsrc/menu/xonotic/tab.c +++ b/qcsrc/menu/xonotic/tab.c @@ -22,9 +22,9 @@ ENDCLASS(XonoticTab) #endif #ifdef IMPLEMENTATION -void showNotifyXonoticTab(entity me) +void XonoticTab_showNotify(entity me) { loadAllCvars(me); - showNotifyContainer(me); + SUPER(XonoticTab).showNotify(me); } #endif diff --git a/qcsrc/menu/xonotic/tabcontroller.c b/qcsrc/menu/xonotic/tabcontroller.c index e454e23e06..1faa625aee 100644 --- a/qcsrc/menu/xonotic/tabcontroller.c +++ b/qcsrc/menu/xonotic/tabcontroller.c @@ -17,11 +17,11 @@ entity makeXonoticTabController(float theRows) me.configureXonoticTabController(me, theRows); return me; } -void configureXonoticTabControllerXonoticTabController(entity me, float theRows) +void XonoticTabController_configureXonoticTabController(entity me, float theRows) { me.rows = theRows; } -entity makeTabButtonXonoticTabController(entity me, string theTitle, entity tab) +entity XonoticTabController_makeTabButton(entity me, string theTitle, entity tab) { entity b; if(me.rows != tab.rows) diff --git a/qcsrc/menu/xonotic/textlabel.c b/qcsrc/menu/xonotic/textlabel.c index 020f79035f..757e07ff1b 100644 --- a/qcsrc/menu/xonotic/textlabel.c +++ b/qcsrc/menu/xonotic/textlabel.c @@ -17,12 +17,12 @@ entity makeXonoticTextLabel(float theAlign, string theText) me.configureXonoticTextLabel(me, theAlign, theText); return me; } -void configureXonoticTextLabelXonoticTextLabel(entity me, float theAlign, string theText) +void XonoticTextLabel_configureXonoticTextLabel(entity me, float theAlign, string theText) { me.configureLabel(me, theText, me.fontSize, theAlign); } -void drawXonoticTextLabel(entity me) +void XonoticTextLabel_draw(entity me) { - drawLabel(me); + SUPER(XonoticTextLabel).draw(me); } #endif diff --git a/qcsrc/menu/xonotic/textslider.c b/qcsrc/menu/xonotic/textslider.c index 2236bc51fe..69270a67ac 100644 --- a/qcsrc/menu/xonotic/textslider.c +++ b/qcsrc/menu/xonotic/textslider.c @@ -32,7 +32,7 @@ entity makeXonoticTextSlider(string theCvar) me.configureXonoticTextSlider(me, theCvar); return me; } -void configureXonoticTextSliderXonoticTextSlider(entity me, string theCvar) +void XonoticTextSlider_configureXonoticTextSlider(entity me, string theCvar) { me.configureSliderVisuals(me, me.fontSize, me.align, me.valueSpace, me.image); if(theCvar) @@ -42,15 +42,15 @@ void configureXonoticTextSliderXonoticTextSlider(entity me, string theCvar) // don't load it yet } } -void setValueXonoticTextSlider(entity me, float val) +void XonoticTextSlider_setValue(entity me, float val) { if(val != me.value) { - setValueSlider( me, val ); + SUPER(XonoticTextSlider).setValue( me, val ); me.saveCvars(me); } } -void loadCvarsXonoticTextSlider(entity me) +void XonoticTextSlider_loadCvars(entity me) { if not(me.cvarName) return; @@ -62,7 +62,7 @@ void loadCvarsXonoticTextSlider(entity me) s = strcat(s, " ", cvar_string(argv(i))); me.setValueFromIdentifier(me, s); } -void saveCvarsXonoticTextSlider(entity me) +void XonoticTextSlider_saveCvars(entity me) { if not(me.cvarName) return; @@ -94,7 +94,7 @@ void saveCvarsXonoticTextSlider(entity me) } } } -void configureXonoticTextSliderValuesXonoticTextSlider(entity me) +void XonoticTextSlider_configureXonoticTextSliderValues(entity me) { me.configureTextSliderValues(me, string_null); me.loadCvars(me); diff --git a/qcsrc/menu/xonotic/weaponslist.c b/qcsrc/menu/xonotic/weaponslist.c index 012f7bc7e6..bd2acdf5a6 100644 --- a/qcsrc/menu/xonotic/weaponslist.c +++ b/qcsrc/menu/xonotic/weaponslist.c @@ -25,11 +25,11 @@ entity makeXonoticWeaponsList() me.configureXonoticWeaponsList(me); return me; } -void configureXonoticWeaponsListXonoticWeaponsList(entity me) +void XonoticWeaponsList_configureXonoticWeaponsList(entity me) { me.configureXonoticListBox(me); } -void drawXonoticWeaponsList(entity me) +void XonoticWeaponsList_draw(entity me) { // read in cvar? string s, t; @@ -41,7 +41,7 @@ void drawXonoticWeaponsList(entity me) cvar_set("cl_weaponpriority", W_NameWeaponOrder(t)); } me.nItems = tokenize_console(t); - drawListBox(me); + SUPER(XonoticWeaponsList).draw(me); } void WeaponsList_MoveUp_Click(entity box, entity me) { @@ -59,24 +59,24 @@ void WeaponsList_MoveDown_Click(entity box, entity me) me.selectedItem += 1; } } -void resizeNotifyXonoticWeaponsList(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) +void XonoticWeaponsList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize) { - resizeNotifyXonoticListBox(me, relOrigin, relSize, absOrigin, absSize); + SUPER(XonoticWeaponsList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize); 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); } -float mouseDragXonoticWeaponsList(entity me, vector pos) +float XonoticWeaponsList_mouseDrag(entity me, vector pos) { float f, i; i = me.selectedItem; - f = mouseDragListBox(me, pos); + f = SUPER(XonoticWeaponsList).mouseDrag(me, pos); if(me.selectedItem != i) cvar_set("cl_weaponpriority", swapInPriorityList(cvar_string("cl_weaponpriority"), me.selectedItem, i)); return f; } -string toStringXonoticWeaponsList(entity me) +string XonoticWeaponsList_toString(entity me) { float n, i; string s; @@ -90,7 +90,7 @@ string toStringXonoticWeaponsList(entity me) } return substring(s, 0, strlen(s) - 2); } -void drawListBoxItemXonoticWeaponsList(entity me, float i, vector absSize, float isSelected) +void XonoticWeaponsList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) { entity e; if(isSelected) @@ -99,7 +99,7 @@ void drawListBoxItemXonoticWeaponsList(entity me, float i, vector absSize, float draw_Text(me.realUpperMargin * eY, e.message, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); } -float keyDownXonoticWeaponsList(entity me, float scan, float ascii, float shift) +float XonoticWeaponsList_keyDown(entity me, float scan, float ascii, float shift) { if(ascii == 43) // + { @@ -111,7 +111,7 @@ float keyDownXonoticWeaponsList(entity me, float scan, float ascii, float shift) WeaponsList_MoveDown_Click(NULL, me); return 1; } - else if(keyDownListBox(me, scan, ascii, shift)) + else if(SUPER(XonoticWeaponsList).keyDown(me, scan, ascii, shift)) return 1; return 0; }