From cf1adef1a2e10819cec287f3a945bd9e42acbeaa Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Fri, 11 Nov 2022 20:12:20 +0100 Subject: [PATCH] Add FCVAR_RELEASE unknown and extended flag textures If FCVAR_RELEASE but not restricted by context, then display this texture in the console suggestion window. --- r5dev/core/resource.h | 2 + r5dev/gameui/IConsole.cpp | 59 +++++++++++--------- r5dev/resource/png/vf_release_unknown.png | Bin 0 -> 1845 bytes r5dev/resource/png/vf_release_unknown_e.png | Bin 0 -> 1954 bytes r5dev/resource/r5dev.rc | 42 +++++++------- 5 files changed, 56 insertions(+), 47 deletions(-) create mode 100644 r5dev/resource/png/vf_release_unknown.png create mode 100644 r5dev/resource/png/vf_release_unknown_e.png diff --git a/r5dev/core/resource.h b/r5dev/core/resource.h index 7636f872..4b904e59 100644 --- a/r5dev/core/resource.h +++ b/r5dev/core/resource.h @@ -31,6 +31,8 @@ #define IDB_PNG27 127 #define IDB_PNG28 128 #define IDB_PNG29 129 +#define IDB_PNG30 130 +#define IDB_PNG31 131 #define DEV 256 #define PNG 256 diff --git a/r5dev/gameui/IConsole.cpp b/r5dev/gameui/IConsole.cpp index d41da269..535c80d2 100644 --- a/r5dev/gameui/IConsole.cpp +++ b/r5dev/gameui/IConsole.cpp @@ -668,8 +668,8 @@ bool CConsole::LoadFlagIcons(void) { bool ret = false; - // Get all image resources for displaying flags. - for (int i = IDB_PNG3, k = NULL; i <= IDB_PNG29; i++, k++) + // Get all flag image resources for displaying flags. + for (int i = IDB_PNG3, k = NULL; i <= IDB_PNG31; i++, k++) { m_vFlagIcons.push_back(MODULERESOURCE(GetModuleResource(i))); MODULERESOURCE& rFlagIcon = m_vFlagIcons[k]; @@ -692,47 +692,47 @@ int CConsole::GetFlagTextureIndex(int nFlags) const switch (nFlags) // All indices for single/dual flag textures. { case FCVAR_DEVELOPMENTONLY: - return 7; - case FCVAR_GAMEDLL: - return 8; - case FCVAR_CLIENTDLL: return 9; - case FCVAR_REPLICATED: + case FCVAR_GAMEDLL: return 10; - case FCVAR_CHEAT: + case FCVAR_CLIENTDLL: return 11; - case FCVAR_RELEASE: + case FCVAR_REPLICATED: return 12; - case FCVAR_MATERIAL_SYSTEM_THREAD: + case FCVAR_CHEAT: return 13; - case FCVAR_DEVELOPMENTONLY | FCVAR_GAMEDLL: + case FCVAR_RELEASE: return 14; - case FCVAR_DEVELOPMENTONLY | FCVAR_CLIENTDLL: + case FCVAR_MATERIAL_SYSTEM_THREAD: return 15; - case FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED: + case FCVAR_DEVELOPMENTONLY | FCVAR_GAMEDLL: return 16; - case FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT: + case FCVAR_DEVELOPMENTONLY | FCVAR_CLIENTDLL: return 17; - case FCVAR_DEVELOPMENTONLY | FCVAR_MATERIAL_SYSTEM_THREAD: + case FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED: return 18; - case FCVAR_REPLICATED | FCVAR_CHEAT: + case FCVAR_DEVELOPMENTONLY | FCVAR_CHEAT: return 19; - case FCVAR_REPLICATED | FCVAR_RELEASE: + case FCVAR_DEVELOPMENTONLY | FCVAR_MATERIAL_SYSTEM_THREAD: return 20; - case FCVAR_GAMEDLL | FCVAR_CHEAT: + case FCVAR_REPLICATED | FCVAR_CHEAT: return 21; - case FCVAR_GAMEDLL | FCVAR_RELEASE: + case FCVAR_REPLICATED | FCVAR_RELEASE: return 22; - case FCVAR_CLIENTDLL | FCVAR_CHEAT: + case FCVAR_GAMEDLL | FCVAR_CHEAT: return 23; - case FCVAR_CLIENTDLL | FCVAR_RELEASE: + case FCVAR_GAMEDLL | FCVAR_RELEASE: return 24; - case FCVAR_MATERIAL_SYSTEM_THREAD | FCVAR_CHEAT: + case FCVAR_CLIENTDLL | FCVAR_CHEAT: return 25; - case FCVAR_MATERIAL_SYSTEM_THREAD | FCVAR_RELEASE: + case FCVAR_CLIENTDLL | FCVAR_RELEASE: return 26; + case FCVAR_MATERIAL_SYSTEM_THREAD | FCVAR_CHEAT: + return 27; + case FCVAR_MATERIAL_SYSTEM_THREAD | FCVAR_RELEASE: + return 28; - default: // Hit when flag is non-indexed or 3+ bits are set. + default: // Hit when flag is zero/non-indexed or 3+ bits are set. int v = __popcnt(nFlags); switch (v) @@ -746,15 +746,20 @@ int CConsole::GetFlagTextureIndex(int nFlags) const // If 3 or more bits are set, we test the flags // and display the appropriate checker texture. bool mul = v > 2; - int ret = NULL; if (nFlags & FCVAR_DEVELOPMENTONLY) { - return ret = mul ? 4 : 3; + return mul ? 4 : 3; } else if (nFlags & FCVAR_CHEAT) { - return ret = mul ? 6 : 5; + return mul ? 6 : 5; + } + else if (nFlags & FCVAR_RELEASE && // RELEASE command but no context restriction. + !(nFlags & FCVAR_SERVER_CAN_EXECUTE) && + !(nFlags & FCVAR_CLIENTCMD_CAN_EXECUTE)) + { + return mul ? 8 : 7; } // Rainbow checker texture (user needs to manually check flags). diff --git a/r5dev/resource/png/vf_release_unknown.png b/r5dev/resource/png/vf_release_unknown.png new file mode 100644 index 0000000000000000000000000000000000000000..ea9bc5a97df490b03f6cc51848486a52a0574ea4 GIT binary patch literal 1845 zcmb_dO>f*p7&aU#S}6!2J_JI-axR53w#OdZJEJU7*bO8S4k1~o$&K;Mc-P9>V{9k8 z$$>);kq{CfRDs~efeR{Jk;s8wxKxO*13!Q(haR~y-VZmTX&X^i@_KAP^Stl-ywA+M zzq#?o!lmagX_~gMzSiAR_s8q&u}9Va$1i_>tZo#fGU@G9 zJK>vz$<(A=M#3DYxk78&((*W`Y)@2rB>G9#Hg2E%VCV^N8&|#14)cx}Bx^^7*go3m zv7rVkiI zo*rNm`Yyuw72UC6%d%S*bOH1UvWes9v!9`&6+9+e-PdQa)Kl9SR8>waYcv{}BiEEg z-+~xp%XTcs0SW=i!>poXkd=#bhOQ`Ck>ph(GreY{k=(D^hRSqWLYgUGmJehl%YnQ{9nI&anw)eBK`UAGq#Vv0wK-?eJDs{QSigKV$+#Sq zFV%r&b3~U`qHQ>~lG{eW@q4yIJVadgiW=DV6dEcka9Yt*U|nv0dB(B0@F@5DGvP z#~j$gY56T51p>MA`CZBO>n7Ior+(&=DUL=uq69&{%Ol`2$^h~Z1UQI&5JdrG$O#Zb zc+U1#k*Fm_ho@QVthi$IV~<8S2mp2k1(>52z%jOgOM@2TJZiC)F!VcdJ8~$CP;#ZY zTN`>}EV7oAs(XjCC9*BvosEWxKJgNvthRgGV0E7bH)gMsGjuv%MpN3+Kq%7tG=B;! zWn7JDAy)cI)ARVtx>x=sJ-C1NC`N&e1q6-@Iba-NrL1ZWbZid?juSB0RDXB&F7Z6# zIdkj&$Lwd~vH{KdLhYcI@euW#%e8lP*Ps4eGXFY$=GqJI{ruGN z^^bo4`nj8=^ZD*)+n?SzdHciN@3ud=@xk@}9}BnsCO-!8h2Oq-u|5a2_0^5;x39f( F?H}t9Kso>b literal 0 HcmV?d00001 diff --git a/r5dev/resource/png/vf_release_unknown_e.png b/r5dev/resource/png/vf_release_unknown_e.png new file mode 100644 index 0000000000000000000000000000000000000000..4414dbcc20b031b5c196306552496d56ed6509ac GIT binary patch literal 1954 zcmb_dO>f*p75K-Q-v# zq#ls?52#nf8ITbF0>ObRH?ACc?e#hlO+#9-lGkJVndkj_-g%!K?0>_jrw}+75M+={U5%9+w1w>XQig~HtOrv^6A#8roD=j@lkaYeN4GZdrYW_>@CwA z(3-ZnwaghmmX$t{(bP%g*9P^Y=s+K+Lh4@6M;yDJ9*`dP9hZ;~blbwA zX@w?s5ca8SQQOwrp8?hi5!1urhpjDm>Kn7F%Bg8C7K`4(>8WCBVnT>%*`{qHK%nw0 ztJo4{<;I#}C`(=>d6lS4uNm1yom71TJY9v5<{fQTwrPTdnM;kTaxPPuRV83?hlMOfQ3t=0HcdNpS?!*JM{R6ZqRa7FF3m$(s*{4t-BYl*v34w< zsY;bI^_)1m&s{V*9TbvPsu(LZUl;0N&7uzmbzz8p?@^KowJ6`K4YhmZkX5p8*cPPQ za*^$iEt`5Sb)5UKu&fm{0x1Yqu}ff#5yoRo07Jd-zJ)KqN+j{we?kSPu_{sqiAqv7 zm1dqz8*5QSM_F01jLXrmZ-A@4BoQ>=f$(MMBY)yx6bd&)gas26N;?R{aAI-7*ZYTx zpVURH_pkIU6bFtjb=1K;4&6W^i?bL_d^bj+O)Mm2Z28P}ypVWnwoi%#T8hmtv({b- zVDw{;O-K+R;z))_<5dhi4huq8h)KvpY3LVr2Wqa0ND0WfQwzEg7TrrqsNPxIA`j&k z?P{Lrjg~0mwcPs#uj?#@(Y{Wu$kWX{TG1|M5=gHp{t8yAxLUA6ZcibnH_?~*JpW5} zdcF5<>;@K*7}*XMhzplMW?j&lZFwZH?SSJh`e(g&sOM47UQ72Sy>FAtXDpjaI6+P0 z<>R@TYM-gb)!p^K#$(oJ=Sphkzg2jl*R|%ip&M(BmThHs*tDzhgBNLr&BpFLf!)n& zMPy!Yu|Zxs_t%?YnAFQ|ioruS2W1AOD`3jqdgt!fFd^@bhTG$NZ}NlR{`~UETi-wa g^y#<1?EG}7z59Fm$Lw$XYdu9ryZgiMc0Pan4?TupegFUf literal 0 HcmV?d00001 diff --git a/r5dev/resource/r5dev.rc b/r5dev/resource/r5dev.rc index be5eaad0..50759fcc 100644 --- a/r5dev/resource/r5dev.rc +++ b/r5dev/resource/r5dev.rc @@ -62,26 +62,28 @@ IDB_PNG6 PNG "png\\vf_developmentonly_unknown IDB_PNG7 PNG "png\\vf_developmentonly_unknown_e.png" IDB_PNG8 PNG "png\\vf_cheat_unknown.png" IDB_PNG9 PNG "png\\vf_cheat_unknown_e.png" -IDB_PNG10 PNG "png\\vf_developmentonly.png" -IDB_PNG11 PNG "png\\vf_gamedll.png" -IDB_PNG12 PNG "png\\vf_clientdll.png" -IDB_PNG13 PNG "png\\vf_replicated.png" -IDB_PNG14 PNG "png\\vf_cheat.png" -IDB_PNG15 PNG "png\\vf_release.png" -IDB_PNG16 PNG "png\\vf_msthread.png" -IDB_PNG17 PNG "png\\vf_developmentonly_gamedll.png" -IDB_PNG18 PNG "png\\vf_developmentonly_clientdll.png" -IDB_PNG19 PNG "png\\vf_developmentonly_replicated.png" -IDB_PNG20 PNG "png\\vf_developmentonly_cheat.png" -IDB_PNG21 PNG "png\\vf_developmentonly_msthread.png" -IDB_PNG22 PNG "png\\vf_replicated_cheat.png" -IDB_PNG23 PNG "png\\vf_replicated_release.png" -IDB_PNG24 PNG "png\\vf_gamedll_cheat.png" -IDB_PNG25 PNG "png\\vf_gamedll_release.png" -IDB_PNG26 PNG "png\\vf_clientdll_cheat.png" -IDB_PNG27 PNG "png\\vf_clientdll_release.png" -IDB_PNG28 PNG "png\\vf_msthread_cheat.png" -IDB_PNG29 PNG "png\\vf_msthread_release.png" +IDB_PNG10 PNG "png\\vf_release_unknown.png" +IDB_PNG11 PNG "png\\vf_release_unknown_e.png" +IDB_PNG12 PNG "png\\vf_developmentonly.png" +IDB_PNG13 PNG "png\\vf_gamedll.png" +IDB_PNG14 PNG "png\\vf_clientdll.png" +IDB_PNG15 PNG "png\\vf_replicated.png" +IDB_PNG16 PNG "png\\vf_cheat.png" +IDB_PNG17 PNG "png\\vf_release.png" +IDB_PNG18 PNG "png\\vf_msthread.png" +IDB_PNG19 PNG "png\\vf_developmentonly_gamedll.png" +IDB_PNG20 PNG "png\\vf_developmentonly_clientdll.png" +IDB_PNG21 PNG "png\\vf_developmentonly_replicated.png" +IDB_PNG22 PNG "png\\vf_developmentonly_cheat.png" +IDB_PNG23 PNG "png\\vf_developmentonly_msthread.png" +IDB_PNG24 PNG "png\\vf_replicated_cheat.png" +IDB_PNG25 PNG "png\\vf_replicated_release.png" +IDB_PNG26 PNG "png\\vf_gamedll_cheat.png" +IDB_PNG27 PNG "png\\vf_gamedll_release.png" +IDB_PNG28 PNG "png\\vf_clientdll_cheat.png" +IDB_PNG29 PNG "png\\vf_clientdll_release.png" +IDB_PNG30 PNG "png\\vf_msthread_cheat.png" +IDB_PNG31 PNG "png\\vf_msthread_release.png" #endif // English (United States) resources /////////////////////////////////////////////////////////////////////////////