me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
e.onEnter = ServerList_Connect_Click;
e.onEnterEntity = slist;
+ e.onChange = ServerList_Update_favoriteButton;
+ e.onChangeEntity = slist;
slist.ipAddressBox = e;
me.TD(me, 1, 1.5, e = makeXonoticButton("", '0 0 0'));
e.onClick = ServerList_Favorite_Click;
void ServerList_Filter_Change(entity box, entity me);
void ServerList_Favorite_Click(entity btn, entity me);
void ServerList_Info_Click(entity btn, entity me);
+void ServerList_Update_favoriteButton(entity btn, entity me);
#endif
#ifdef IMPLEMENTATION
resorthostcache();
}
+void ServerList_Update_favoriteButton(entity btn, entity me)
+{
+ if(IsFavorite(me.ipAddressBox.text))
+ me.favoriteButton.setText(me.favoriteButton, _("Remove"));
+ else
+ me.favoriteButton.setText(me.favoriteButton, _("Bookmark"));
+}
+
entity makeXonoticServerList()
{
entity me;
if(me.ipAddressBoxFocused != me.ipAddressBox.focused)
{
if(me.ipAddressBox.focused || me.ipAddressBoxFocused < 0)
- {
- if(IsFavorite(me.ipAddressBox.text))
- me.favoriteButton.setText(me.favoriteButton, _("Remove"));
- else
- me.favoriteButton.setText(me.favoriteButton, _("Bookmark"));
- }
+ ServerList_Update_favoriteButton(NULL, me);
me.ipAddressBoxFocused = me.ipAddressBox.focused;
}