#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;
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;
#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!");
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!");
me.lastChild = p;
}
-void removeAllAnimAnimHost(entity me)
+void AnimHost_removeAllAnim(entity me)
{
entity e, tmp;
for(e = me.firstChild; e; e = e.nextSibling)
}
}
-void removeObjAnimAnimHost(entity me, entity obj)
+void AnimHost_removeObjAnim(entity me, entity obj)
{
entity e, tmp;
for(e = me.firstChild; e; e = e.nextSibling)
}
}
-void stopAllAnimAnimHost(entity me)
+void AnimHost_stopAllAnim(entity me)
{
entity e;
for(e = me.firstChild; e; e = e.nextSibling)
}
}
-void stopObjAnimAnimHost(entity me, entity obj)
+void AnimHost_stopObjAnim(entity me, entity obj)
{
entity e;
for(e = me.firstChild; e; e = e.nextSibling)
}
}
-void resumeAllAnimAnimHost(entity me)
+void AnimHost_resumeAllAnim(entity me)
{
entity e;
for(e = me.firstChild; e; e = e.nextSibling)
}
}
-void resumeObjAnimAnimHost(entity me, entity obj)
+void AnimHost_resumeObjAnim(entity me, entity obj)
{
entity e;
for(e = me.firstChild; e; e = e.nextSibling)
}
}
-void finishAllAnimAnimHost(entity me)
+void AnimHost_finishAllAnim(entity me)
{
entity e, tmp;
for(e = me.firstChild; e; e = e.nextSibling)
}
}
-void finishObjAnimAnimHost(entity me, entity obj)
+void AnimHost_finishObjAnim(entity me, entity obj)
{
entity e, tmp;
for(e = me.firstChild; e; e = e.nextSibling)
}
}
-void tickAllAnimHost(entity me)
+void AnimHost_tickAll(entity me)
{
entity e, tmp;
for(e = me.firstChild; e; e = e.nextSibling)
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;
}
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);
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!");
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))
--- /dev/null
+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;
+ }
+}
#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;
}
#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)
{
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)
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");
draw_fontscale = globalToBoxSize(boxToGlobalSize(df, me.realFontSize), rf);
}
- drawLabel(me);
+ SUPER(BorderImage).draw(me);
if(me.isNexposeeTitleBar)
{
#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)
{
}
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;
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)
}
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;
draw_alpha = save;
- drawLabel(me);
+ SUPER(Button).draw(me);
if(me.clickTime > 0 && me.clickTime <= frametime)
{
#endif
#ifdef IMPLEMENTATION
-void setCheckedCheckBox(entity me, float val)
+void CheckBox_setChecked(entity me, float val)
{
me.checked = val;
}
{
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;
}
else
me.srcSuffix = (me.checked ? "1" : "0");
- drawButton(me);
+ SUPER(CheckBox).draw(me);
me.pressed = s;
}
#endif
#endif
#ifdef IMPLEMENTATION
-void showNotifyContainer(entity me)
+void Container_showNotify(entity me)
{
entity e;
if(me.shown)
e.showNotify(e);
}
-void hideNotifyContainer(entity me)
+void Container_hideNotify(entity me)
{
entity e;
if not(me.shown)
e.hideNotify(e);
}
-void setAlphaOfContainer(entity me, entity other, float theAlpha)
+void Container_setAlphaOf(entity me, entity other, float theAlpha)
{
if(theAlpha <= 0)
{
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;
}
}
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;
return NULL;
}
-void drawContainer(entity me)
+void Container_draw(entity me)
{
vector oldshift;
vector oldscale;
}
};
-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;
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;
return 0;
}
-float mouseMoveContainer(entity me, vector pos)
+float Container_mouseMove(entity me, vector pos)
{
entity f;
f = me.focusedChild;
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;
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;
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;
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!");
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!");
me.lastChild = p;
}
-void setFocusContainer(entity me, entity other)
+void Container_setFocus(entity me, entity other)
{
if(other)
if not(me.focused)
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;
me.lastChild = other;
}
-entity preferredFocusedGrandChildContainer(entity me)
+entity Container_preferredFocusedGrandChild(entity me)
{
entity e, e2;
entity best;
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;
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;
me.frame.closeButton = closebutton;
}
-void closeDialog(entity me)
+void Dialog_close(entity me)
{
if(me.parent.instanceOfNexposee)
{
}
}
-float keyDownDialog(entity me, float key, float ascii, float shift)
+float Dialog_keyDown(entity me, float key, float ascii, float shift)
{
if(me.closable)
{
return 1;
}
}
- return keyDownInputContainer(me, key, ascii, shift);
+ return SUPER(Dialog).keyDown(me, key, ascii, shift);
}
#endif
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 );
}
#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)
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
#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)
me.setText(me, "");
}
-float mouseDragInputBox(entity me, vector pos)
+float InputBox_mouseDrag(entity me, vector pos)
{
float p;
me.dragScrollPos = 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)
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;
return 0;
}
-void drawInputBox(entity me)
+void InputBox_draw(entity me)
{
#define CURSOR "_"
float cursorPosInWidths, totalSizeInWidths;
}
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;
}
#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;
*/
}
-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)
{
return 0;
}
-float _changeFocusXYInputContainer(entity me, vector pos)
+float InputContainer__changeFocusXY(entity me, vector pos)
{
entity e, ne;
e = me.mouseFocusedChild;
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;
#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;
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;
#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)
return 0;
return 1;
}
-float mouseDragListBox(entity me, vector pos)
+float ListBox_mouseDrag(entity me, vector pos)
{
float hit;
float i;
}
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;
}
return 1;
}
-float mouseReleaseListBox(entity me, vector pos)
+float ListBox_mouseRelease(entity me, vector pos)
{
vector absSize;
if(me.pressed == 1)
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.
}
}
}
-void drawListBox(entity me)
+void ListBox_draw(entity me)
{
float i;
vector absSize, fillSize;
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);
}
.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
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;
other.ModalController_factor = 1;
}
-void drawModalController(entity me)
+void ModalController_draw(entity me)
{
entity e;
entity front;
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;
}
}
-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)
{
} // 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)
{
.vector Nexposee_align;
.float Nexposee_animationFactor;
-void closeNexposee(entity me)
+void Nexposee_close(entity me)
{
// user must override this
}
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);
}
}
-void calcNexposee(entity me)
+void Nexposee_calc(entity me)
{
/*
* patented by Apple
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;
other.Nexposee_mediumAlpha = a1;
}
-void drawNexposee(entity me)
+void Nexposee_draw(entity me)
{
float a;
float a0;
{
me.animationFactor = 1;
me.animationState = 2;
- setFocusContainer(me, me.selectedChild);
+ SUPER(Nexposee).setFocus(me, me.selectedChild);
}
break;
case 2:
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);
}
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)
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)
{
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;
}
#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;
#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;
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)
// TODO more keys
return 0;
}
-float mouseDragSlider(entity me, vector pos)
+float Slider_mouseDrag(entity me, vector pos)
{
float hit;
float v, animed;
return 1;
}
-float mousePressSlider(entity me, vector pos)
+float Slider_mousePress(entity me, vector pos)
{
float controlCenter;
if(me.disabled)
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;
}
me.setText(me, me.valueToText(me, me.value));
draw_alpha = save;
- drawLabel(me);
+ SUPER(Slider).draw(me);
me.text = string_null; // TEMPSTRING!
}
#endif
#endif
#ifdef IMPLEMENTATION
-string valueToIdentifierTextSlider(entity me, float val)
+string TextSlider_valueToIdentifier(entity me, float val)
{
if(val >= me.nValues)
return "custom";
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";
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);
return me;
}
-void configureXonoticBigButtonXonoticBigButton(entity me, string theText, vector theColor)
+void XonoticBigButton_configureXonoticBigButton(entity me, string theText, vector theColor)
{
me.configureXonoticButton(me, theText, theColor);
}
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);
}
return me;
}
-void configureXonoticButtonXonoticButton(entity me, string theText, vector theColor)
+void XonoticButton_configureXonoticButton(entity me, string theText, vector theColor)
{
if(theColor == '0 0 0')
{
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);
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)
me.labelTitle.setText(me.labelTitle, campaign_title);
}
-void saveCvarsXonoticCampaignList(entity me)
+void XonoticCampaignList_saveCvars(entity me)
{
// write campaign cvars
// no reason to do this!
// 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;
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)));
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)
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;
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
}
}
-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);
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)
}
return 1;
}
-float mouseReleaseXonoticCharmap(entity me, vector coords)
+float XonoticCharmap_mouseRelease(entity me, vector coords)
{
if(!me.pressed)
return 0;
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)
{
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)
{
draw_Picture(c, me.image2, '0.0625 0.1 0', '1 1 1', 1);
}
}
- drawImage(me);
+ SUPER(XonoticCharmap).draw(me);
}
#endif
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;
}
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)
{
me.saveCvars(me);
}
}
-void loadCvarsXonoticCheckBox(entity me)
+void XonoticCheckBox_loadCvars(entity me)
{
float m, d;
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;
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;
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;
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;
me.srcMulti = 1;
me.src2 = me.image2;
}
-void setCheckedXonoticColorButton(entity me, float val)
+void XonoticColorButton_setChecked(entity me, float val)
{
if(val != me.checked)
{
me.saveCvars(me);
}
}
-void loadCvarsXonoticColorButton(entity me)
+void XonoticColorButton_loadCvars(entity me)
{
if not(me.cvarName)
return;
else
me.checked = (cvar(me.cvarName) & 15) == me.cvarValueFloat;
}
-void saveCvarsXonoticColorButton(entity me)
+void XonoticColorButton_saveCvars(entity me)
{
if not(me.cvarName)
return;
}
// 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
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;
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(;;)
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");
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;
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)
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;
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;
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));
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;
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)
{
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;
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;
rgb = '1 1 1';
}
- drawCheckBox(me);
+ SUPER(XonoticCrosshairButton).draw(me);
sz = draw_PictureSize(me.src3);
sz = globalToBoxSize(sz, draw_scale);
me.configureXonoticCvarList(me);
return me;
}
-void configureXonoticCvarListXonoticCvarList(entity me)
+void XonoticCvarList_configureXonoticCvarList(entity me)
{
me.configureXonoticListBox(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;
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));
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;
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;
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);
}
-void getDemosXonoticDemoList(entity me)
+void XonoticDemoList_getDemos(entity me)
{
string s;
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)));
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)
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);
}
me.getDemos(me);
}
-void startDemoXonoticDemoList(entity me)
+void XonoticDemoList_startDemo(entity me)
{
string s;
s = me.demoName(me,me.selectedItem);
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)
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
#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
#endif
#ifdef IMPLEMENTATION
-void fillXonoticCreditsDialog(entity me)
+void XonoticCreditsDialog_fill(entity me)
{
entity e;
me.TR(me);
e.onClick = Dialog_Close;
e.onClickEntity = me;
}
-void focusEnterXonoticCreditsDialog(entity me)
+void XonoticCreditsDialog_focusEnter(entity me)
{
me.creditsList.scrolling = time + 1;
}
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDChatDialog(entity me)
+void XonoticHUDChatDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDHealthArmorDialog(entity me)
+void XonoticHUDHealthArmorDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDInventoryDialog(entity me)
+void XonoticHUDInventoryDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDModIconsDialog(entity me)
+void XonoticHUDModIconsDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDNotificationDialog(entity me)
+void XonoticHUDNotificationDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDPowerupsDialog(entity me)
+void XonoticHUDPowerupsDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDPressedKeysDialog(entity me)
+void XonoticHUDPressedKeysDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDRaceTimerDialog(entity me)
+void XonoticHUDRaceTimerDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDRadarDialog(entity me)
+void XonoticHUDRadarDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDScoreDialog(entity me)
+void XonoticHUDScoreDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDTimerDialog(entity me)
+void XonoticHUDTimerDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDVoteDialog(entity me)
+void XonoticHUDVoteDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDWeaponIconsDialog(entity me)
+void XonoticHUDWeaponIconsDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticHUDExitDialog(entity me)
+void XonoticHUDExitDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticMultiplayerDialog(entity me)
+void XonoticMultiplayerDialog_fill(entity me)
{
entity mc, e;
mc = makeXonoticTabController(me.rows - 2);
return me;
}
-void fillXonoticServerCreateTab(entity me)
+void XonoticServerCreateTab_fill(entity me)
{
entity e, e0;
float n;
}
}
-void gameTypeChangeNotifyXonoticServerCreateTab(entity me)
+void XonoticServerCreateTab_gameTypeChangeNotify(entity me)
{
// tell the map list to update
float gt;
#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);
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
#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;
MapInfo_ClearTemps();
}
-void fillXonoticMapInfoDialog(entity me)
+void XonoticMapInfoDialog_fill(entity me)
{
entity e;
float w, wgt;
#endif
#ifdef IMPLEMENTATION
-void showNotifyXonoticMutatorsDialog(entity me)
+void XonoticMutatorsDialog_showNotify(entity me)
{
loadAllCvars(me);
}
return weaponarenastring;
}
-string toStringXonoticMutatorsDialog(entity me)
+string XonoticMutatorsDialog_toString(entity me)
{
string s;
s = "";
-void fillXonoticMutatorsDialog(entity me)
+void XonoticMutatorsDialog_fill(entity me)
{
entity e, s, w;
float i, j;
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
me.configureDialog(me);
return me;
}
-void fillXonoticDemoBrowserTab(entity me)
+void XonoticDemoBrowserTab_fill(entity me)
{
entity e;
entity btn;
me.configureDialog(me);
return me;
}
-void fillXonoticServerListTab(entity me)
+void XonoticServerListTab_fill(entity me)
{
entity e, slist, btn;
#endif
#ifdef IMPLEMENTATION
-void loadServerInfoXonoticServerInfoDialog(entity me, float i)
+void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
{
float m;
string s, typestr, versionstr, numh, maxp;
me.pingLabel.setText(me.pingLabel, me.currentServerPing);
}
-void fillXonoticServerInfoDialog(entity me)
+void XonoticServerInfoDialog_fill(entity me)
{
entity e;
me.TR(me);
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;
#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;
#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;
#endif
#ifdef IMPLEMENTATION
-void fillXonoticNewsDialog(entity me)
+void XonoticNewsDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticQuitDialog(entity me)
+void XonoticQuitDialog_fill(entity me)
{
entity e;
me.TR(me);
#endif
#ifdef IMPLEMENTATION
-void fillXonoticSettingsDialog(entity me)
+void XonoticSettingsDialog_fill(entity me)
{
entity mc;
mc = makeXonoticTabController(me.rows - 2);
return me;
}
-void fillXonoticAudioSettingsTab(entity me)
+void XonoticAudioSettingsTab_fill(entity me)
{
entity e, s, sl;
return FALSE;
}
-void fillXonoticEffectsSettingsTab(entity me)
+void XonoticEffectsSettingsTab_fill(entity me)
{
entity e, s;
float n;
me.configureDialog(me);
return me;
}
-void fillXonoticInputSettingsTab(entity me)
+void XonoticInputSettingsTab_fill(entity me)
{
entity e;
entity kb;
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);
me.nameBox.keyDown(me.commandReleaseBox, K_END, 0, 0);
}
-void fillXonoticUserbindEditDialog(entity me)
+void XonoticUserbindEditDialog_fill(entity me)
{
entity e;
me.TR(me);
me.configureDialog(me);
return me;
}
-void fillXonoticMiscSettingsTab(entity me)
+void XonoticMiscSettingsTab_fill(entity me)
{
entity e;
entity sk;
#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();
return me;
}
-void fillXonoticNetworkSettingsTab(entity me)
+void XonoticNetworkSettingsTab_fill(entity me)
{
entity e;
me.configureDialog(me);
return me;
}
-void fillXonoticVideoSettingsTab(entity me)
+void XonoticVideoSettingsTab_fill(entity me)
{
entity e;
fclose(fh);
}
-void fillXonoticSingleplayerDialog(entity me)
+void XonoticSingleplayerDialog_fill(entity me)
{
entity e, btnPrev, btnNext, lblTitle;
#endif
#ifdef IMPLEMENTATION
-void fillXonoticWinnerDialog(entity me)
+void XonoticWinnerDialog_fill(entity me)
{
entity e;
return b;
}
-void showNotifyXonoticTeamSelectDialog(entity me)
+void XonoticTeamSelectDialog_showNotify(entity me)
{
float teams, nTeams;
teams = cvar("_teams_available");
me.team4.disabled = !(teams & 8); nTeams += !!(teams & 8);
}
-void fillXonoticTeamSelectDialog(entity me)
+void XonoticTeamSelectDialog_fill(entity me)
{
entity e;
me.TR(me);
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)
{
me.onClick = GameTypeButton_Click;
me.onClickEntity = NULL;
}
-void setCheckedXonoticGametypeButton(entity me, float val)
+void XonoticGametypeButton_setChecked(entity me, float val)
{
if(val != me.checked)
{
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;
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;
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;
}
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;
}
me.onEnter(me, me.onEnterEntity);
}
- if(keyDownInputBox(me, key, ascii, shift))
+ if(SUPER(XonoticInputBox).keyDown(me, key, ascii, shift))
r = 1;
return r;
}
me.configureXonoticKeyBinder(me);
return me;
}
-void configureXonoticKeyBinderXonoticKeyBinder(entity me)
+void XonoticKeyBinder_configureXonoticKeyBinder(entity me)
{
me.configureXonoticListBox(me);
if(Xonotic_KeyBinds_Count < 0)
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));
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;
}
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;
}
}
-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)
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));
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;
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;
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
me.setText(me, "Do not press this button again!");
}
-void configureMainWindowMainWindow(entity me)
+void MainWindow_configureMainWindow(entity me)
{
entity n, i;
#endif
#ifdef IMPLEMENTATION
-void destroyXonoticMapList(entity me)
+void XonoticMapList_destroy(entity me)
{
MapInfo_Shutdown();
}
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;
}
}
-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)));
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)
{
}
}
-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;
MapInfo_ClearTemps();
}
-void refilterXonoticMapList(entity me)
+void XonoticMapList_refilter(entity me)
{
float i, j, n;
string s;
}
}
-void refilterCallbackXonoticMapList(entity me, entity cb)
+void XonoticMapList_refilterCallback(entity me, entity cb)
{
me.refilter(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)
me.setSelected(me, MapInfo_FindName_firstResult);
}
else
- return keyDownListBox(me, scan, ascii, shift);
+ return SUPER(XonoticMapList).keyDown(me, scan, ascii, shift);
return 1;
}
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
}
return me;
}
-void setPlayerListXonoticPlayerList(entity me, string plist)
+void XonoticPlayerList_setPlayerList(entity me, string plist)
{
dprint(plist,"------------\n");
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)));
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;
#define BUFMODELS_DESC 4
#define BUFMODELS_COUNT 5
-void configureXonoticPlayerModelSelectorXonoticPlayerModelSelector(entity me)
+void XonoticPlayerModelSelector_configureXonoticPlayerModelSelector(entity me)
{
float sortbuf, glob, i;
string fn;
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)
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);
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);
}
}
-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;
}
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)
{
}
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)
{
me.saveCvars(me);
}
}
-void loadCvarsXonoticRadioButton(entity me)
+void XonoticRadioButton_loadCvars(entity me)
{
if(me.cvarValue)
{
}
}
}
-void drawXonoticRadioButton(entity me)
+void XonoticRadioButton_draw(entity me)
{
if not(me.cvarValue)
if not(me.cvarName)
if(!found)
me.setChecked(me, 1);
}
- drawCheckBox(me);
+ SUPER(XonoticRadioButton).draw(me);
}
-void saveCvarsXonoticRadioButton(entity me)
+void XonoticRadioButton_saveCvars(entity me)
{
if(me.cvarValue)
{
#endif
#ifdef IMPLEMENTATION
-void closeXonoticRootDialog(entity me)
+void XonoticRootDialog_close(entity me)
{
m_goto(string_null);
}
me.configureXonoticServerList(me);
return me;
}
-void configureXonoticServerListXonoticServerList(entity me)
+void XonoticServerList_configureXonoticServerList(entity me)
{
me.configureXonoticListBox(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;
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
refreshhostcache();
}
}
-void focusEnterXonoticServerList(entity me)
+void XonoticServerList_focusEnter(entity me)
{
if(time < me.nextRefreshTime)
{
me.nextRefreshTime = time + 10;
me.refreshServerList(me, 1);
}
-void drawXonoticServerList(entity me)
+void XonoticServerList_draw(entity me)
{
float i, found, owned;
me.ipAddressBoxFocused = me.ipAddressBox.focused;
}
- drawListBox(me);
+ SUPER(XonoticServerList).draw(me);
}
void ServerList_PingSort_Click(entity btn, 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;
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);
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));
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)
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;
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;
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;
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;
}
}
-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;
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)));
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;
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");
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)
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
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;
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;
me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
return me;
}
-void loadCvarsXonoticDecibelsSlider(entity me)
+void XonoticDecibelsSlider_loadCvars(entity me)
{
float v;
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;
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
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;
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)
{
#endif
#ifdef IMPLEMENTATION
-void showNotifyXonoticTab(entity me)
+void XonoticTab_showNotify(entity me)
{
loadAllCvars(me);
- showNotifyContainer(me);
+ SUPER(XonoticTab).showNotify(me);
}
#endif
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)
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
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)
// 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;
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;
}
}
}
-void configureXonoticTextSliderValuesXonoticTextSlider(entity me)
+void XonoticTextSlider_configureXonoticTextSliderValues(entity me)
{
me.configureTextSliderValues(me, string_null);
me.loadCvars(me);
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;
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)
{
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;
}
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)
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) // +
{
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;
}