Menu-FN: List packages in the updater that are listed in pkgname, not just

any data/addon package. Also commented some entry-points.
This commit is contained in:
Marco Cawthorne 2021-01-22 22:37:06 +01:00
parent 7a7b82cf42
commit c17515fe98
3 changed files with 50 additions and 4 deletions

View File

@ -35,12 +35,14 @@ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING\
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\
==============================================================================";
/* r_autoscale forces vid_conautoscale to be one of 4 integer values.
* this is due to vid_conautoscale 0 scaling with in floating point... which
* in turns results in skipped rows/columns and shimmering. */
var int autocvar_r_autoscale = TRUE;
void
Menu_AutoScale(void)
{
if (autocvar_r_autoscale) {
/* override for vid_conautoscales */
vector psize = getproperty(VF_SCREENPSIZE);
if (psize[1] >= (480 * 4)) {
cvar_set("vid_conautoscale", "4");
@ -54,7 +56,9 @@ Menu_AutoScale(void)
}
}
/* for old Half-Life configs */
/* old Half-Life configs that have a completely different gamma model would
* mess up visibility on initial launch - so we catch that and and force
* our default to fix it */
void
Menu_GammaHack(void)
{
@ -69,6 +73,7 @@ Menu_GammaHack(void)
}
}
/* called upon menu init/restart */
void
m_init(void)
{
@ -122,13 +127,16 @@ m_init(void)
Menu_GammaHack();
}
/* called upon vid_reload, vid_restart, but not menu init/restart */
void
Menu_RendererRestarted(string rendererdesc)
{
print("Menu_REndereresrsatr\n");
Menu_AutoScale();
Menu_GammaHack();
}
/* called, in theory, whenever the menu gets killed */
void
m_shutdown(void)
{
@ -147,6 +155,7 @@ m_shutdown(void)
memfree(games);
}
/* called every frame, influenced by cl_idlefps */
void
m_draw(vector screensize)
{

View File

@ -192,6 +192,7 @@ menu_updates_refresh(void)
memfree(updates);
}
#if 0
for (int i = 0; (getpackagemanagerinfo(i, GPMI_NAME)); i++) {
string cat = getpackagemanagerinfo(i, GPMI_CATEGORY);
if (cat == "Plugins/") {
@ -202,10 +203,22 @@ menu_updates_refresh(void)
}
update_count++;
}
#else
/* look for the valid packages in the gameinfo pkgname */
int pkgcount = tokenize(games[gameinfo_current].pkgname);
for (int i = 0i; i < pkgcount; i++) {
int id = game_getpackageid(argv(i));
if (id == -1)
continue;
update_count++;
}
#endif
c = 0;
updates = memalloc(sizeof(update_t) * update_count);
#if 0
for (int i = 0; (getpackagemanagerinfo(i, GPMI_NAME)); i++) {
string cat = getpackagemanagerinfo(i, GPMI_CATEGORY);
if (cat == "Plugins/") {
@ -230,6 +243,30 @@ menu_updates_refresh(void)
c++;
}
#else
for (int i = 0i; i < pkgcount; i++) {
int id = game_getpackageid(argv(i));
if (id == -1)
continue;
updates[c].name = getpackagemanagerinfo(id, GPMI_NAME);
updates[c].category = getpackagemanagerinfo(id, GPMI_CATEGORY);
updates[c].title = getpackagemanagerinfo(id, GPMI_TITLE);
updates[c].version = getpackagemanagerinfo(id, GPMI_VERSION);
updates[c].description = getpackagemanagerinfo(id, GPMI_DESCRIPTION);
updates[c].license = getpackagemanagerinfo(id, GPMI_LICENSE);
updates[c].author = getpackagemanagerinfo(id, GPMI_AUTHOR);
updates[c].website = getpackagemanagerinfo(id, GPMI_WEBSITE);
updates[c].installed = getpackagemanagerinfo(id, GPMI_INSTALLED);
updates[c].size = (int)stof(getpackagemanagerinfo(id, GPMI_FILESIZE));
updates[c].uid = id;
precache_pic(sprintf(FN_UPDATE_IMGURL, updates[c].name));
c++;
}
#endif
up_sbUpdates.SetMax(update_count);
up_lbUpdates.SetMax(update_count);
up_lbUpdates.SetSelected(0);

View File

@ -55,7 +55,7 @@ CModList::Draw(void)
[0,0,0], 1.0f);
visible = floor(m_size[1] / 29);
visible = bound(0, visible, gameinfo_count);
visible = bound(0, visible, gameinfo_count - 1);
pos = m_y;
for (int i = m_scroll; i <= (visible + m_scroll); i++) {
@ -127,7 +127,7 @@ CModList::Input(float type, float x, float y, float devid)
int pos[2];
visible = floor(m_size[1] / 29);
visible = bound(0, visible, gameinfo_count);
visible = bound(0, visible, gameinfo_count - 1);
pos[0] = m_x;
pos[1] = m_y;