From: Rudolf Polzer Date: Sun, 16 Oct 2011 12:21:42 +0000 (+0200) Subject: factor out menu_cmd sync X-Git-Tag: xonotic-v0.6.0~40^2~35 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=37e2b6899c0d7d80fa9389de0ccd1babddf2bbf7;p=xonotic%2Fxonotic-data.pk3dir.git factor out menu_cmd sync --- diff --git a/qcsrc/menu/gamecommand.qc b/qcsrc/menu/gamecommand.qc index 7b8425c5b..83ef53762 100644 --- a/qcsrc/menu/gamecommand.qc +++ b/qcsrc/menu/gamecommand.qc @@ -74,9 +74,7 @@ void GameCommand(string theCommand) if(argv(0) == "sync") { - updateCompression(); - updateConwidths(); - loadAllCvars(main); + m_sync(); return; } diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index c8c3b62f4..f5c0f6da5 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -18,6 +18,14 @@ float menuMouseMode; void SUB_Null() { } +void m_sync() +{ + updateCompression(); + updateConwidths(); + + loadAllCvars(main); +} + void m_init() { cvar_set("_menu_alpha", "0"); @@ -169,6 +177,8 @@ void m_init_delayed() menuShiftState = 0; menuMousePos = '0.5 0.5 0'; + m_sync(); + if(Menu_Active) m_display(); // delayed menu display } diff --git a/qcsrc/menu/menu.qh b/qcsrc/menu/menu.qh index e42595e58..ab812437a 100644 --- a/qcsrc/menu/menu.qh +++ b/qcsrc/menu/menu.qh @@ -41,3 +41,5 @@ void SUB_Null(); float preMenuInit(); // you have to define this for pre-menu initialization. Return 0 if initialization needs to be retried a frame later, 1 if it succeeded. void preMenuDraw(); // this is run before the menu is drawn. You may put some stuff there that has to be done every frame. void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else. + +void m_sync();