X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdatasource.qc;h=d51a1f74893682130152f79b07a742747165fcc2;hb=c72d8802ab6a8df4072e8342a5fe8750619c5855;hp=809f79682712c39a51719fd843e76ef691c08e1d;hpb=826222f84e886d85179a032b07edc71d99982040;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/datasource.qc b/qcsrc/menu/xonotic/datasource.qc index 809f79682..d51a1f748 100644 --- a/qcsrc/menu/xonotic/datasource.qc +++ b/qcsrc/menu/xonotic/datasource.qc @@ -1,31 +1,5 @@ #include "datasource.qh" -#ifndef DATASOURCE_H -#define DATASOURCE_H -CLASS(DataSource, Object) - entity DataSource_true; - entity DataSource_false; - INIT_STATIC(DataSource) { - DataSource_true = NEW(Object); - DataSource_false = NULL; - } - /** - * get entry `i` passing `name` and `icon` through `returns` if it is not null - * returns `DataSource_false` if out of bounds - * otherwise returns an entity or `DataSource_true` - */ - METHOD(DataSource, getEntry, entity(entity this, int i, void(string name, string icon) returns)) { return DataSource_false; } - /** return the index of the first match for `find`. optional */ - METHOD(DataSource, indexOf, int(entity this, string find)) { return -1; } - /** reload all entries matching `filter` returning how many matches were found */ - METHOD(DataSource, reload, int(entity this, string filter)) { return 0; } - /** cleanup on shutdown. optional */ - METHOD(DataSource, destroy, void(entity this)) { } -ENDCLASS(DataSource) - -CLASS(StringSource, DataSource) - ATTRIB(StringSource, StringSource_str, string, string_null) - ATTRIB(StringSource, StringSource_sep, string, string_null) CONSTRUCTOR(StringSource, string str, string sep) { CONSTRUCT(StringSource); @@ -44,10 +18,7 @@ CLASS(StringSource, DataSource) { return tokenizebyseparator(this.StringSource_str, this.StringSource_sep); } -ENDCLASS(StringSource) -CLASS(CvarStringSource, StringSource) - ATTRIB(CvarStringSource, CvarStringSource_cvar, string, string_null) CONSTRUCTOR(CvarStringSource, string cv, string sep) { CONSTRUCT(CvarStringSource); @@ -66,5 +37,3 @@ CLASS(CvarStringSource, StringSource) this.StringSource_str = s ? cvar_string(s) : string_null; return SUPER(CvarStringSource).reload(this, filter); } -ENDCLASS(CvarStringSource) -#endif