]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into terencehill/listbox_item_highlight
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 10 May 2015 03:56:21 +0000 (13:56 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 10 May 2015 03:58:03 +0000 (13:58 +1000)
24 files changed:
1  2 
qcsrc/menu/classes.inc
qcsrc/menu/item/listbox.qc
qcsrc/menu/xonotic/campaign.qc
qcsrc/menu/xonotic/charmap.qc
qcsrc/menu/xonotic/credits.qc
qcsrc/menu/xonotic/crosshairpicker.qc
qcsrc/menu/xonotic/crosshairpreview.qc
qcsrc/menu/xonotic/cvarlist.qc
qcsrc/menu/xonotic/demolist.qc
qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc
qcsrc/menu/xonotic/gametypelist.qc
qcsrc/menu/xonotic/keybinder.qc
qcsrc/menu/xonotic/languagelist.qc
qcsrc/menu/xonotic/maplist.qc
qcsrc/menu/xonotic/picker.qc
qcsrc/menu/xonotic/playerlist.qc
qcsrc/menu/xonotic/playlist.qc
qcsrc/menu/xonotic/screenshotlist.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/skinlist.qc
qcsrc/menu/xonotic/soundlist.qc
qcsrc/menu/xonotic/statslist.qc
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/weaponslist.qc

index 0000000000000000000000000000000000000000,68b90d586394939a459e81345903a605f7be2e75..5b0e417f94965c5c1f4899b49a904575c3366c4c
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,132 +1,134 @@@
 -#include "xonotic/crosshairbutton.qc"
+ #include "anim/animation.qc"
+ #include "anim/animhost.qc"
+ #include "anim/easing.qc"
+ #include "anim/keyframe.qc"
+ #include "item.qc"
+ #include "item/borderimage.qc"
+ #include "item/button.qc"
+ #include "item/checkbox.qc"
+ #include "item/container.qc"
+ #include "item/dialog.qc"
+ #include "item/image.qc"
+ #include "item/inputbox.qc"
+ #include "item/inputcontainer.qc"
+ #include "item/label.qc"
+ #include "item/listbox.qc"
+ #include "item/modalcontroller.qc"
+ #include "item/nexposee.qc"
+ #include "item/radiobutton.qc"
+ #include "item/slider.qc"
+ #include "item/tab.qc"
+ #include "item/textslider.qc"
+ #include "xonotic/bigbutton.qc"
+ #include "xonotic/bigcommandbutton.qc"
+ #include "xonotic/button.qc"
+ #include "xonotic/campaign.qc"
+ #include "xonotic/charmap.qc"
+ #include "xonotic/checkbox.qc"
+ #include "xonotic/checkbox_slider_invalid.qc"
+ #include "xonotic/checkbox_string.qc"
+ #include "xonotic/colorbutton.qc"
+ #include "xonotic/colorpicker.qc"
+ #include "xonotic/colorpicker_string.qc"
+ #include "xonotic/commandbutton.qc"
+ #include "xonotic/credits.qc"
++#include "xonotic/crosshairpicker.qc"
++#include "xonotic/crosshairpreview.qc"
+ #include "xonotic/cvarlist.qc"
+ #include "xonotic/demolist.qc"
+ #include "xonotic/dialog.qc"
+ #include "xonotic/dialog_credits.qc"
+ #include "xonotic/dialog_firstrun.qc"
+ #include "xonotic/dialog_hudpanel_ammo.qc"
+ #include "xonotic/dialog_hudpanel_buffs.qc"
+ #include "xonotic/dialog_hudpanel_centerprint.qc"
+ #include "xonotic/dialog_hudpanel_chat.qc"
+ #include "xonotic/dialog_hudpanel_engineinfo.qc"
+ #include "xonotic/dialog_hudpanel_healtharmor.qc"
+ #include "xonotic/dialog_hudpanel_infomessages.qc"
+ #include "xonotic/dialog_hudpanel_modicons.qc"
+ #include "xonotic/dialog_hudpanel_notification.qc"
+ #include "xonotic/dialog_hudpanel_physics.qc"
+ #include "xonotic/dialog_hudpanel_powerups.qc"
+ #include "xonotic/dialog_hudpanel_pressedkeys.qc"
+ #include "xonotic/dialog_hudpanel_racetimer.qc"
+ #include "xonotic/dialog_hudpanel_radar.qc"
+ #include "xonotic/dialog_hudpanel_score.qc"
+ #include "xonotic/dialog_hudpanel_timer.qc"
+ #include "xonotic/dialog_hudpanel_vote.qc"
+ #include "xonotic/dialog_hudpanel_weapons.qc"
+ #include "xonotic/dialog_hudsetup_exit.qc"
+ #include "xonotic/dialog_monstertools.qc"
+ #include "xonotic/dialog_multiplayer.qc"
+ #include "xonotic/dialog_multiplayer_create.qc"
+ #include "xonotic/dialog_multiplayer_create_mapinfo.qc"
+ #include "xonotic/dialog_multiplayer_create_mutators.qc"
+ #include "xonotic/dialog_multiplayer_join.qc"
+ #include "xonotic/dialog_multiplayer_join_serverinfo.qc"
+ #include "xonotic/dialog_multiplayer_media.qc"
+ #include "xonotic/dialog_multiplayer_media_demo.qc"
+ #include "xonotic/dialog_multiplayer_media_demo_startconfirm.qc"
+ #include "xonotic/dialog_multiplayer_media_demo_timeconfirm.qc"
+ #include "xonotic/dialog_multiplayer_media_musicplayer.qc"
+ #include "xonotic/dialog_multiplayer_media_screenshot.qc"
+ #include "xonotic/dialog_multiplayer_media_screenshot_viewer.qc"
+ #include "xonotic/dialog_multiplayer_profile.qc"
+ #include "xonotic/dialog_quit.qc"
+ #include "xonotic/dialog_sandboxtools.qc"
+ #include "xonotic/dialog_settings.qc"
+ #include "xonotic/dialog_settings_audio.qc"
+ #include "xonotic/dialog_settings_effects.qc"
+ #include "xonotic/dialog_settings_game.qc"
+ #include "xonotic/dialog_settings_game_crosshair.qc"
+ #include "xonotic/dialog_settings_game_hudconfirm.qc"
+ #include "xonotic/dialog_settings_game_hud.qc"
+ #include "xonotic/dialog_settings_game_messages.qc"
+ #include "xonotic/dialog_settings_game_model.qc"
+ #include "xonotic/dialog_settings_game_view.qc"
+ #include "xonotic/dialog_settings_game_weapons.qc"
+ #include "xonotic/dialog_settings_input.qc"
+ #include "xonotic/dialog_settings_input_userbind.qc"
+ #include "xonotic/dialog_settings_misc.qc"
+ #include "xonotic/dialog_settings_misc_cvars.qc"
+ #include "xonotic/dialog_settings_misc_reset.qc"
+ #include "xonotic/dialog_settings_user.qc"
+ #include "xonotic/dialog_settings_user_languagewarning.qc"
+ #include "xonotic/dialog_settings_video.qc"
+ #include "xonotic/dialog_singleplayer.qc"
+ #include "xonotic/dialog_singleplayer_winner.qc"
+ #include "xonotic/dialog_teamselect.qc"
+ #include "xonotic/gametypelist.qc"
+ #include "xonotic/image.qc"
+ #include "xonotic/inputbox.qc"
+ #include "xonotic/keybinder.qc"
+ #include "xonotic/languagelist.qc"
+ #include "xonotic/listbox.qc"
+ #include "xonotic/mainwindow.qc"
+ #include "xonotic/maplist.qc"
+ #include "xonotic/nexposee.qc"
++#include "xonotic/picker.qc"
+ #include "xonotic/playerlist.qc"
+ #include "xonotic/playermodel.qc"
+ #include "xonotic/playlist.qc"
+ #include "xonotic/radiobutton.qc"
+ #include "xonotic/rootdialog.qc"
+ #include "xonotic/screenshotimage.qc"
+ #include "xonotic/screenshotlist.qc"
+ #include "xonotic/serverlist.qc"
+ #include "xonotic/skinlist.qc"
+ #include "xonotic/slider.qc"
+ #include "xonotic/slider_decibels.qc"
+ #include "xonotic/slider_particles.qc"
+ #include "xonotic/slider_picmip.qc"
+ #include "xonotic/slider_resolution.qc"
+ #include "xonotic/slider_sbfadetime.qc"
+ #include "xonotic/soundlist.qc"
+ #include "xonotic/statslist.qc"
+ #include "xonotic/tabcontroller.qc"
+ #include "xonotic/tab.qc"
+ #include "xonotic/textlabel.qc"
+ #include "xonotic/textslider.qc"
+ #include "xonotic/weaponarenacheckbox.qc"
+ #include "xonotic/weaponslist.qc"
Simple merge
Simple merge
index 68c0e566fa449bd43030e437750b282280cdf671,d6bc52461846995ad7f0d09f0e4f3a871a4bd3ac..747d1f03b4568a4a820bdc35cedb170b67570a19
@@@ -1,19 -1,25 +1,21 @@@
- #ifdef INTERFACE
- CLASS(XonoticCharmap) EXTENDS(XonoticPicker)
+ #ifndef CHARMAP_H
+ #define CHARMAP_H
 -#include "../item.qc"
 -CLASS(XonoticCharmap, Item)
++#include "picker.qc"
++CLASS(XonoticCharmap, XonoticPicker)
        METHOD(XonoticCharmap, configureXonoticCharmap, void(entity, entity))
 -      METHOD(XonoticCharmap, mousePress, float(entity, vector))
 -      METHOD(XonoticCharmap, mouseRelease, float(entity, vector))
 -      METHOD(XonoticCharmap, mouseMove, float(entity, vector))
 -      METHOD(XonoticCharmap, mouseDrag, float(entity, vector))
 -      METHOD(XonoticCharmap, keyDown, float(entity, float, float, float))
        METHOD(XonoticCharmap, focusLeave, void(entity))
        METHOD(XonoticCharmap, resizeNotify, void(entity, vector, vector, vector, vector))
 -      METHOD(XonoticCharmap, draw, void(entity))
 -      ATTRIB(XonoticCharmap, focusable, float, 1)
 -
 -      METHOD(XonoticCharmap, moveFocus, void(entity, vector, vector))
 -      METHOD(XonoticCharmap, enterChar, void(entity))
 +      METHOD(XonoticCharmap, keyDown, float(entity, float, float, float))
        ATTRIB(XonoticCharmap, inputBox, entity, NULL)
        ATTRIB(XonoticCharmap, realFontSize, vector, '0 0 0')
 -      ATTRIB(XonoticCharmap, realCellSize, vector, '0 0 0')
 -      ATTRIB(XonoticCharmap, focusedCell, vector, '-1 -1 0')
 -      ATTRIB(XonoticCharmap, previouslyFocusedCell, vector, '-1 -1 0')
 +
 +      ATTRIB(XonoticCharmap, rows, float, 10)
 +      ATTRIB(XonoticCharmap, columns, float, 14)
 +
 +      METHOD(XonoticCharmap, cellSelect, void(entity, vector))
 +      METHOD(XonoticCharmap, cellIsValid, bool(entity, vector))
 +      METHOD(XonoticCharmap, cellDraw, void(entity, vector, vector))
 +      METHOD(XonoticCharmap, charOffset, vector)
  ENDCLASS(XonoticCharmap)
  entity makeXonoticCharmap(entity controlledInputBox);
  #endif
Simple merge
index 2f2c35507823fe090c1ec014fe3056376b494c40,0000000000000000000000000000000000000000..8922e7fbf4d3c4fbf5fa367ee64b4adb2ee82ac4
mode 100644,000000..100644
--- /dev/null
@@@ -1,77 -1,0 +1,79 @@@
- #ifdef INTERFACE
- CLASS(XonoticCrosshairPicker) EXTENDS(XonoticPicker)
++#ifndef CROSSHAIRPICKER_H
++#define CROSSHAIRPICKER_H
++#include "picker.qc"
++CLASS(XonoticCrosshairPicker, XonoticPicker)
 +      METHOD(XonoticCrosshairPicker, configureXonoticCrosshairPicker, void(entity))
 +
 +      ATTRIB(XonoticCrosshairPicker, rows, float, 3)
 +      ATTRIB(XonoticCrosshairPicker, columns, float, 12)
 +
 +      METHOD(XonoticCrosshairPicker, cellSelect, void(entity, vector))
 +      METHOD(XonoticCrosshairPicker, cellIsValid, bool(entity, vector))
 +      METHOD(XonoticCrosshairPicker, cellDraw, void(entity, vector, vector))
 +ENDCLASS(XonoticCrosshairPicker)
 +entity makeXonoticCrosshairPicker();
 +#endif
 +
 +#ifdef IMPLEMENTATION
 +
 +string crosshairpicker_cellToCrosshair(entity me, vector cell)
 +{
 +      if(cell.x < 0 || cell.x >= me.columns || cell.y < 0 || cell.y >= me.rows)
 +              return "";
 +      return ftos(31 + cell.y * me.columns + cell.x);
 +}
 +
 +vector crosshairpicker_crosshairToCell(entity me, string crosshair_str)
 +{
 +      float crosshair = stof(crosshair_str) - 31;
 +      if(crosshair - floor(crosshair) > 0)
 +              return '-1 -1 0';
 +      return mod(crosshair, me.columns) * eX + floor(crosshair / me.columns) * eY;
 +}
 +
 +entity makeXonoticCrosshairPicker()
 +{
 +      entity me;
-       me = spawnXonoticCrosshairPicker();
++      me = NEW(XonoticCrosshairPicker);
 +      me.configureXonoticCrosshairPicker(me);
 +      return me;
 +}
 +
 +void XonoticCrosshairPicker_configureXonoticCrosshairPicker(entity me)
 +{
 +      me.configureXonoticPicker(me);
 +      SUPER(XonoticCrosshairPicker).cellSelect(me, crosshairpicker_crosshairToCell(me, cvar_string("crosshair")));
 +}
 +
 +void XonoticCrosshairPicker_cellSelect(entity me, vector cell)
 +{
 +      cvar_set("crosshair", crosshairpicker_cellToCrosshair(me, me.focusedCell));
 +      SUPER(XonoticCrosshairPicker).cellSelect(me, me.focusedCell);
 +}
 +
 +bool XonoticCrosshairPicker_cellIsValid(entity me, vector cell)
 +{
 +      if(crosshairpicker_cellToCrosshair(me, cell) == "")
 +              return false;
 +      return true;
 +}
 +
 +void XonoticCrosshairPicker_cellDraw(entity me, vector cell, vector cellPos)
 +{
 +      vector sz;
 +      string cross = strcat("/gfx/crosshair", crosshairpicker_cellToCrosshair(me, cell));
 +      sz = draw_PictureSize(cross);
 +      sz = globalToBoxSize(sz, me.size);
 +
 +      float ar = sz.x / sz.y;
 +      sz.x = me.realCellSize.x;
 +      sz.y = sz.x / ar;
 +      sz = sz * 0.95;
 +
 +      vector crosshairPos = cellPos + 0.5 * me.realCellSize;
 +      draw_Picture(crosshairPos - 0.5 * sz, cross, sz, SKINCOLOR_CROSSHAIRPICKER_CROSSHAIR, SKINALPHA_CROSSHAIRPICKER_CROSSHAIR);
 +
 +      if(cvar("crosshair_dot"))
 +              draw_Picture(crosshairPos - 0.5 * sz * cvar("crosshair_dot_size"), "/gfx/crosshairdot", sz * cvar("crosshair_dot_size"), SKINCOLOR_CROSSHAIRPICKER_CROSSHAIR, SKINALPHA_CROSSHAIRPICKER_CROSSHAIR);
 +}
 +#endif
index b271f4dab39093703e36737d7e544646beb3fbd2,0000000000000000000000000000000000000000..f8de85798258502c058575e14f7afc05a120161d
mode 100644,000000..100644
--- /dev/null
@@@ -1,60 -1,0 +1,62 @@@
- #ifdef INTERFACE
- CLASS(XonoticCrosshairPreview) EXTENDS(Item)
++#ifndef CROSSHAIRPREVIEW_H
++#define CROSSHAIRPREVIEW_H
++#include "../item.qc"
++CLASS(XonoticCrosshairPreview, Item)
 +      METHOD(XonoticCrosshairPreview, configureXonoticCrosshairPreview, void(entity))
 +      METHOD(XonoticCrosshairPreview, draw, void(entity))
 +      ATTRIB(XonoticCrosshairPreview, src, string, string_null)
 +      ATTRIB(XonoticCrosshairPreview, src2, string, string_null)
 +      ATTRIB(XonoticCrosshairPreview, disabled, float, 0)
 +      ATTRIB(XonoticCrosshairPreview, disabledAlpha, float, SKINALPHA_DISABLED)
 +ENDCLASS(XonoticCrosshairPreview)
 +entity makeXonoticCrosshairPreview();
 +#endif
 +
 +#ifdef IMPLEMENTATION
 +entity makeXonoticCrosshairPreview()
 +{
 +      entity me;
-       me = spawnXonoticCrosshairPreview();
++      me = NEW(XonoticCrosshairPreview);
 +      me.configureXonoticCrosshairPreview(me);
 +      return me;
 +}
 +
 +void XonoticCrosshairPreview_configureXonoticCrosshairPreview(entity me)
 +{
 +      me.src = strzone(strcat("/gfx/crosshair", cvar_string("crosshair")));
 +      me.src2 = "/gfx/crosshairdot";
 +}
 +
 +void XonoticCrosshairPreview_draw(entity me)
 +{
 +      float save;
 +      save = draw_alpha;
 +      if(me.disabled)
 +              draw_alpha *= me.disabledAlpha;
 +
 +      vector sz, rgb;
 +      float a;
 +      rgb = stov(cvar_string("crosshair_color"));
 +      a = cvar("crosshair_alpha");
 +      if(me.src)
 +              strunzone(me.src);
 +      me.src = strzone(strcat("/gfx/crosshair", cvar_string("crosshair")));
 +
 +      sz = draw_PictureSize(me.src);
 +      sz = globalToBoxSize(sz, me.size);
 +      sz = sz * cvar("crosshair_size");
 +
 +      draw_Picture('0.5 0.5 0' - 0.5 * sz, me.src, sz, rgb, a);
 +      if(cvar("crosshair_dot"))
 +      {
 +              if(cvar("crosshair_dot_color_custom") && (cvar_string("crosshair_dot_color") != "0"))
 +                      rgb = stov(cvar_string("crosshair_dot_color"));
 +
 +              draw_Picture('0.5 0.5 0' - 0.5 * sz * cvar("crosshair_dot_size"), me.src2, sz * cvar("crosshair_dot_size"), rgb, a * cvar("crosshair_dot_alpha"));
 +      }
 +
 +      draw_alpha = save;
 +
 +      SUPER(XonoticCrosshairPreview).draw(me);
 +}
 +#endif
index 172eb58a68c8e5e9a3dc98d5eefaee1af1ead164,44520c1f22f58857b72d43d71e63ae97e9556843..9a95ed163963c58607afd2a0709bd408e6d5cad6
@@@ -1,8 -1,10 +1,10 @@@
- #ifdef INTERFACE
- CLASS(XonoticCvarList) EXTENDS(XonoticListBox)
+ #ifndef CVARLIST_H
+ #define CVARLIST_H
+ #include "listbox.qc"
+ CLASS(XonoticCvarList, XonoticListBox)
        METHOD(XonoticCvarList, configureXonoticCvarList, void(entity))
        ATTRIB(XonoticCvarList, rowsPerItem, float, 1)
 -      METHOD(XonoticCvarList, drawListBoxItem, void(entity, float, vector, float))
 +      METHOD(XonoticCvarList, drawListBoxItem, void(entity, int, vector, bool, bool))
        METHOD(XonoticCvarList, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(XonoticCvarList, keyDown, float(entity, float, float, float))
  
Simple merge
index c0a351b31982f1dd5d436ea02a7615534b809aff,d8dbc8838ea5bdb709931008cf7f3207a614ad9a..26845f0946430469120b374d59bfc0f0d785f7a3
@@@ -1,8 -1,10 +1,10 @@@
- #ifdef INTERFACE
- CLASS(XonoticGametypeList) EXTENDS(XonoticListBox)
+ #ifndef GAMETYPELIST_H
+ #define GAMETYPELIST_H
+ #include "listbox.qc"
+ CLASS(XonoticGametypeList, XonoticListBox)
        METHOD(XonoticGametypeList, configureXonoticGametypeList, void(entity))
        ATTRIB(XonoticGametypeList, rowsPerItem, float, 2)
 -      METHOD(XonoticGametypeList, drawListBoxItem, void(entity, float, vector, float))
 +      METHOD(XonoticGametypeList, drawListBoxItem, void(entity, int, vector, bool, bool))
        METHOD(XonoticGametypeList, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(XonoticGametypeList, setSelected, void(entity, float))
        METHOD(XonoticGametypeList, loadCvars, void(entity))
index 02f41efd2c727bbb6c70f564a818372293d57578,82d3db4e5d7d5489cae3c1d9fb414a7fa1132cc7..8953b1db9b3f716e11dd0d49eb83a2566c8cf859
@@@ -1,8 -1,10 +1,10 @@@
- #ifdef INTERFACE
- CLASS(XonoticKeyBinder) EXTENDS(XonoticListBox)
+ #ifndef KEYBINDER_H
+ #define KEYBINDER_H
+ #include "listbox.qc"
+ CLASS(XonoticKeyBinder, XonoticListBox)
        METHOD(XonoticKeyBinder, configureXonoticKeyBinder, void(entity))
        ATTRIB(XonoticKeyBinder, rowsPerItem, int, 1)
 -      METHOD(XonoticKeyBinder, drawListBoxItem, void(entity, float, vector, float))
 +      METHOD(XonoticKeyBinder, drawListBoxItem, void(entity, int, vector, bool, bool))
        METHOD(XonoticKeyBinder, doubleClickListBoxItem, void(entity, float, vector))
        METHOD(XonoticKeyBinder, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(XonoticKeyBinder, setSelected, void(entity, float))
index 4f010134142e0577f899e9f74d92b24ada90d588,367da94dfb5df0ad26d6f001866c77896da4415b..af9d75211b3987809ec4bedb3eff1e85d3813990
@@@ -1,8 -1,10 +1,10 @@@
- #ifdef INTERFACE
- CLASS(XonoticLanguageList) EXTENDS(XonoticListBox)
+ #ifndef LANGUAGELIST_H
+ #define LANGUAGELIST_H
+ #include "listbox.qc"
+ CLASS(XonoticLanguageList, XonoticListBox)
        METHOD(XonoticLanguageList, configureXonoticLanguageList, void(entity))
        ATTRIB(XonoticLanguageList, rowsPerItem, float, 1)
 -      METHOD(XonoticLanguageList, drawListBoxItem, void(entity, float, vector, float))
 +      METHOD(XonoticLanguageList, drawListBoxItem, void(entity, int, vector, bool, bool))
        METHOD(XonoticLanguageList, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(XonoticLanguageList, setSelected, void(entity, float))
        METHOD(XonoticLanguageList, loadCvars, void(entity))
Simple merge
index 77b9348627fa28b33b729135fee314bba9a614ef,0000000000000000000000000000000000000000..9fe3f7f363cab77c2916aca315a0c6f637f8f720
mode 100644,000000..100644
--- /dev/null
@@@ -1,204 -1,0 +1,206 @@@
- #ifdef INTERFACE
- CLASS(XonoticPicker) EXTENDS(Item)
++#ifndef PICKER_H
++#define PICKER_H
++#include "../item.qc"
++CLASS(XonoticPicker, Item)
 +      METHOD(XonoticPicker, configureXonoticPicker, void(entity))
 +      METHOD(XonoticPicker, mousePress, float(entity, vector))
 +      METHOD(XonoticPicker, mouseRelease, float(entity, vector))
 +      METHOD(XonoticPicker, mouseMove, float(entity, vector))
 +      METHOD(XonoticPicker, mouseDrag, float(entity, vector))
 +      METHOD(XonoticPicker, keyDown, float(entity, float, float, float))
 +      METHOD(XonoticPicker, draw, void(entity))
 +      ATTRIB(XonoticPicker, focusable, float, 1)
 +      ATTRIB(XonoticPicker, disabled, float, 0)
 +      ATTRIB(XonoticPicker, alpha, float, 1)
 +      ATTRIB(XonoticPicker, disabledAlpha, float, SKINALPHA_DISABLED)
 +
 +      ATTRIB(XonoticPicker, rows, float, 3)
 +      ATTRIB(XonoticPicker, columns, float, 2)
 +
 +      METHOD(XonoticPicker, moveFocus, void(entity, vector, vector))
 +      METHOD(XonoticPicker, cellSelect, void(entity, vector))
 +      METHOD(XonoticPicker, cellDraw, void(entity, vector, vector))
 +      METHOD(XonoticPicker, cellIsValid, bool(entity, vector))
 +      ATTRIB(XonoticPicker, realCellSize, vector, '0 0 0')
 +      ATTRIB(XonoticPicker, selectedCell, vector, '-1 -1 0')
 +      ATTRIB(XonoticPicker, focusedCell, vector, '-1 -1 0')
 +      ATTRIB(XonoticPicker, focusedCellAlpha, float, 0)
 +      ATTRIB(XonoticPicker, focusedCellTime, float, 0)
 +      ATTRIB(XonoticPicker, pressedCell, vector, '-1 -1 0')
 +ENDCLASS(XonoticPicker)
 +entity makeXonoticPicker();
 +#endif
 +
 +#ifdef IMPLEMENTATION
 +
 +entity makeXonoticPicker()
 +{
 +      entity me;
-       me = spawnXonoticPicker();
++      me = NEW(XonoticPicker);
 +      me.configureXonoticPicker(me);
 +      return me;
 +}
 +
 +void XonoticPicker_configureXonoticPicker(entity me)
 +{
 +      me.realCellSize = eX / me.columns + eY / me.rows;
 +}
 +
 +float XonoticPicker_mouseMove(entity me, vector coords)
 +{
 +      vector prevFocusedCell = me.focusedCell;
 +      me.focusedCell_x = floor(coords.x * me.columns);
 +      me.focusedCell_y = floor(coords.y * me.rows);
 +
 +      if(me.focusedCell.x < 0 || me.focusedCell.y < 0 ||
 +         me.focusedCell.x >= me.columns || me.focusedCell.y >= me.rows)
 +      {
 +              me.focusedCell = '-1 -1 0';
 +              return 0;
 +      }
 +
 +      if(me.focusedCell != prevFocusedCell)
 +              me.focusedCellAlpha = SKINALPHA_LISTBOX_FOCUSED;
 +
 +      return 1;
 +}
 +
 +float XonoticPicker_mouseDrag(entity me, vector coords)
 +{
 +      return me.mouseMove(me, coords);
 +}
 +
 +float XonoticPicker_mousePress(entity me, vector coords)
 +{
 +      me.mouseMove(me, coords);
 +
 +      if(me.focusedCell.x >= 0)
 +      {
 +              me.pressed = 1;
 +              me.pressedCell = me.focusedCell;
 +      }
 +
 +      return 1;
 +}
 +
 +float XonoticPicker_mouseRelease(entity me, vector coords)
 +{
 +      if(!me.pressed)
 +              return 0;
 +
 +      me.mouseMove(me, coords);
 +
 +      if(me.focusedCell == me.pressedCell)
 +              me.cellSelect(me, me.focusedCell);
 +
 +      me.pressed = 0;
 +      return 1;
 +}
 +
 +float XonoticPicker_keyDown(entity me, float key, float ascii, float shift)
 +{
 +      switch(key)
 +      {
 +              case K_LEFTARROW:
 +              case K_KP_LEFTARROW:
 +                      me.moveFocus(me, me.focusedCell, '-1 0 0');
 +                      return 1;
 +              case K_RIGHTARROW:
 +              case K_KP_RIGHTARROW:
 +                      me.moveFocus(me, me.focusedCell, '1 0 0');
 +                      return 1;
 +              case K_UPARROW:
 +              case K_KP_UPARROW:
 +                      me.moveFocus(me, me.focusedCell, '0 -1 0');
 +                      return 1;
 +              case K_DOWNARROW:
 +              case K_KP_DOWNARROW:
 +                      me.moveFocus(me, me.focusedCell, '0 1 0');
 +                      return 1;
 +              case K_HOME:
 +              case K_KP_HOME:
 +                      me.focusedCell = '0 0 0';
 +                      return 1;
 +              case K_END:
 +              case K_KP_END:
 +                      me.focusedCell_x = me.columns - 1;
 +                      me.focusedCell_y = me.rows - 1;
 +                      return 1;
 +              case K_ENTER:
 +              case K_KP_ENTER:
 +              case K_INS:
 +              case K_KP_INS:
 +                      me.cellSelect(me, me.focusedCell);
 +                      return 1;
 +      }
 +      return 0;
 +}
 +
 +void XonoticPicker_moveFocus(entity me, vector initialCell, vector step)
 +{
 +      me.focusedCell_x = mod(me.focusedCell.x + step.x + me.columns, me.columns);
 +      me.focusedCell_y = mod(me.focusedCell.y + step.y + me.rows, me.rows);
 +
 +      if(me.focusedCell != initialCell) // Recursion break
 +              if(!me.cellIsValid(me, me.focusedCell))
 +                      me.moveFocus(me, initialCell, step);
 +}
 +
 +void XonoticPicker_cellSelect(entity me, vector cell)
 +{
 +      me.selectedCell = cell;
 +}
 +
 +bool XonoticPicker_cellIsValid(entity me, vector cell)
 +{
 +      return true;
 +}
 +
 +void XonoticPicker_cellDraw(entity me, vector cell, vector cellPos)
 +{
 +}
 +
 +void XonoticPicker_draw(entity me)
 +{
 +      float save;
 +
 +      me.focusable = !me.disabled;
 +
 +      save = draw_alpha;
 +      if(me.disabled)
 +              draw_alpha *= me.disabledAlpha;
 +
 +      vector cell, cellPos;
 +      cell = '0 0 0';
 +      cellPos = '0 0 0';
 +
 +      for(cell_y = 0; cell.y < me.rows; ++cell.y)
 +      {
 +              cellPos_y = mod(cell.y, me.rows) / me.rows;
 +              for(cell_x = 0; cell.x < me.columns; ++cell.x)
 +              {
 +                      if(!me.cellIsValid(me, cell))
 +                              continue;
 +
 +                      cellPos_x = mod(cell.x, me.columns) / me.columns;
 +
 +                      if(cell == me.selectedCell)
 +                              draw_Fill(cellPos, me.realCellSize, SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
 +                      else if(cell == me.focusedCell && me.focused)
 +                      {
 +                              if(!me.pressed || me.focusedCell == me.pressedCell)
 +                              {
 +                                      me.focusedCellAlpha = getFadedAlpha(me.focusedCellAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
 +                                      draw_Fill(cellPos, me.realCellSize, SKINCOLOR_LISTBOX_FOCUSED, me.focusedCellAlpha);
 +                              }
 +                      }
 +
 +                      me.cellDraw(me, cell, cellPos);
 +              }
 +      }
 +
 +      draw_alpha = save;
 +
 +      SUPER(XonoticPicker).draw(me);
 +}
 +#endif
index f6fba8bc8c5a14237d120731050f266a92a3d888,437206b881352bbd59cff5caade6eade963125a8..db3ac8a207aae1b99524a3cc11c1aa40adfed1f1
@@@ -1,8 -1,10 +1,10 @@@
- #ifdef INTERFACE
- CLASS(XonoticPlayerList) EXTENDS(XonoticListBox)
+ #ifndef PLAYERLIST_H
+ #define PLAYERLIST_H
+ #include "listbox.qc"
+ CLASS(XonoticPlayerList, XonoticListBox)
        ATTRIB(XonoticPlayerList, rowsPerItem, float, 1)
        METHOD(XonoticPlayerList, resizeNotify, void(entity, vector, vector, vector, vector))
 -      METHOD(XonoticPlayerList, drawListBoxItem, void(entity, float, vector, float))
 +      METHOD(XonoticPlayerList, drawListBoxItem, void(entity, int, vector, bool, bool))
        ATTRIB(XonoticPlayerList, allowFocusSound, float, 0)
        ATTRIB(XonoticPlayerList, realFontSize, vector, '0 0 0')
        ATTRIB(XonoticPlayerList, columnNameOrigin, float, 0)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge